hunk
dict
file
stringlengths
0
11.8M
file_path
stringlengths
2
234
label
int64
0
1
commit_url
stringlengths
74
103
dependency_score
sequencelengths
5
5
{ "id": 0, "code_window": [ " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"wbr\",\n", " \"description\": \"%html.format.unformatted.desc%\"\n", " },\n", " \"html.format.contentUnformatted\": {\n", " \"type\": [\n", " \"string\",\n" ], "labels": [ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.unformatted.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 53 }
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: [{ "name": "language-docker", "version": "0.0.0", "license": "Apache2", "repositoryURL": "https://github.com/moby/moby", "description": "The file syntaxes/docker.tmLanguage was included from https://github.com/moby/moby/blob/master/contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage." }]
extensions/docker/OSSREADME.json
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00016635302745271474, 0.00016635302745271474, 0.00016635302745271474, 0.00016635302745271474, 0 ]
{ "id": 0, "code_window": [ " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"wbr\",\n", " \"description\": \"%html.format.unformatted.desc%\"\n", " },\n", " \"html.format.contentUnformatted\": {\n", " \"type\": [\n", " \"string\",\n" ], "labels": [ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.unformatted.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 53 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { Event, Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import * as platform from 'vs/base/common/platform'; import * as browser from 'vs/base/browser/browser'; import { CommonEditorConfiguration, IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig'; import { IDimension } from 'vs/editor/common/editorCommon'; import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo'; import { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver'; import { FastDomNode } from 'vs/base/browser/fastDomNode'; import { CharWidthRequest, CharWidthRequestType, readCharWidths } from 'vs/editor/browser/config/charWidthReader'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; class CSSBasedConfigurationCache { private _keys: { [key: string]: BareFontInfo; }; private _values: { [key: string]: FontInfo; }; constructor() { this._keys = Object.create(null); this._values = Object.create(null); } public has(item: BareFontInfo): boolean { let itemId = item.getId(); return !!this._values[itemId]; } public get(item: BareFontInfo): FontInfo { let itemId = item.getId(); return this._values[itemId]; } public put(item: BareFontInfo, value: FontInfo): void { let itemId = item.getId(); this._keys[itemId] = item; this._values[itemId] = value; } public remove(item: BareFontInfo): void { let itemId = item.getId(); delete this._keys[itemId]; delete this._values[itemId]; } public getValues(): FontInfo[] { return Object.keys(this._keys).map(id => this._values[id]); } } export function readFontInfo(bareFontInfo: BareFontInfo): FontInfo { return CSSBasedConfiguration.INSTANCE.readConfiguration(bareFontInfo); } export function restoreFontInfo(storageService: IStorageService): void { let strStoredFontInfo = storageService.get('editorFontInfo', StorageScope.GLOBAL); if (typeof strStoredFontInfo !== 'string') { return; } let storedFontInfo: ISerializedFontInfo[] = null; try { storedFontInfo = JSON.parse(strStoredFontInfo); } catch (err) { return; } if (!Array.isArray(storedFontInfo)) { return; } CSSBasedConfiguration.INSTANCE.restoreFontInfo(storedFontInfo); } export function saveFontInfo(storageService: IStorageService): void { let knownFontInfo = CSSBasedConfiguration.INSTANCE.saveFontInfo(); storageService.store('editorFontInfo', JSON.stringify(knownFontInfo), StorageScope.GLOBAL); } export interface ISerializedFontInfo { readonly zoomLevel: number; readonly fontFamily: string; readonly fontWeight: string; readonly fontSize: number; readonly lineHeight: number; readonly letterSpacing: number; readonly isMonospace: boolean; readonly typicalHalfwidthCharacterWidth: number; readonly typicalFullwidthCharacterWidth: number; readonly canUseHalfwidthRightwardsArrow: boolean; readonly spaceWidth: number; readonly maxDigitWidth: number; } class CSSBasedConfiguration extends Disposable { public static readonly INSTANCE = new CSSBasedConfiguration(); private _cache: CSSBasedConfigurationCache; private _evictUntrustedReadingsTimeout: number; private _onDidChange = this._register(new Emitter<void>()); public readonly onDidChange: Event<void> = this._onDidChange.event; constructor() { super(); this._cache = new CSSBasedConfigurationCache(); this._evictUntrustedReadingsTimeout = -1; } public dispose(): void { if (this._evictUntrustedReadingsTimeout !== -1) { clearTimeout(this._evictUntrustedReadingsTimeout); this._evictUntrustedReadingsTimeout = -1; } super.dispose(); } private _writeToCache(item: BareFontInfo, value: FontInfo): void { this._cache.put(item, value); if (!value.isTrusted && this._evictUntrustedReadingsTimeout === -1) { // Try reading again after some time this._evictUntrustedReadingsTimeout = setTimeout(() => { this._evictUntrustedReadingsTimeout = -1; this._evictUntrustedReadings(); }, 5000); } } private _evictUntrustedReadings(): void { let values = this._cache.getValues(); let somethingRemoved = false; for (let i = 0, len = values.length; i < len; i++) { let item = values[i]; if (!item.isTrusted) { somethingRemoved = true; this._cache.remove(item); } } if (somethingRemoved) { this._onDidChange.fire(); } } public saveFontInfo(): ISerializedFontInfo[] { // Only save trusted font info (that has been measured in this running instance) return this._cache.getValues().filter(item => item.isTrusted); } public restoreFontInfo(savedFontInfo: ISerializedFontInfo[]): void { // Take all the saved font info and insert them in the cache without the trusted flag. // The reason for this is that a font might have been installed on the OS in the meantime. for (let i = 0, len = savedFontInfo.length; i < len; i++) { let fontInfo = new FontInfo(savedFontInfo[i], false); this._writeToCache(fontInfo, fontInfo); } } public readConfiguration(bareFontInfo: BareFontInfo): FontInfo { if (!this._cache.has(bareFontInfo)) { let readConfig = CSSBasedConfiguration._actualReadConfiguration(bareFontInfo); if (readConfig.typicalHalfwidthCharacterWidth <= 2 || readConfig.typicalFullwidthCharacterWidth <= 2 || readConfig.spaceWidth <= 2 || readConfig.maxDigitWidth <= 2) { // Hey, it's Bug 14341 ... we couldn't read readConfig = new FontInfo({ zoomLevel: browser.getZoomLevel(), fontFamily: readConfig.fontFamily, fontWeight: readConfig.fontWeight, fontSize: readConfig.fontSize, lineHeight: readConfig.lineHeight, letterSpacing: readConfig.letterSpacing, isMonospace: readConfig.isMonospace, typicalHalfwidthCharacterWidth: Math.max(readConfig.typicalHalfwidthCharacterWidth, 5), typicalFullwidthCharacterWidth: Math.max(readConfig.typicalFullwidthCharacterWidth, 5), canUseHalfwidthRightwardsArrow: readConfig.canUseHalfwidthRightwardsArrow, spaceWidth: Math.max(readConfig.spaceWidth, 5), maxDigitWidth: Math.max(readConfig.maxDigitWidth, 5), }, false); } this._writeToCache(bareFontInfo, readConfig); } return this._cache.get(bareFontInfo); } private static createRequest(chr: string, type: CharWidthRequestType, all: CharWidthRequest[], monospace: CharWidthRequest[]): CharWidthRequest { let result = new CharWidthRequest(chr, type); all.push(result); if (monospace) { monospace.push(result); } return result; } private static _actualReadConfiguration(bareFontInfo: BareFontInfo): FontInfo { let all: CharWidthRequest[] = []; let monospace: CharWidthRequest[] = []; const typicalHalfwidthCharacter = this.createRequest('n', CharWidthRequestType.Regular, all, monospace); const typicalFullwidthCharacter = this.createRequest('\uff4d', CharWidthRequestType.Regular, all, null); const space = this.createRequest(' ', CharWidthRequestType.Regular, all, monospace); const digit0 = this.createRequest('0', CharWidthRequestType.Regular, all, monospace); const digit1 = this.createRequest('1', CharWidthRequestType.Regular, all, monospace); const digit2 = this.createRequest('2', CharWidthRequestType.Regular, all, monospace); const digit3 = this.createRequest('3', CharWidthRequestType.Regular, all, monospace); const digit4 = this.createRequest('4', CharWidthRequestType.Regular, all, monospace); const digit5 = this.createRequest('5', CharWidthRequestType.Regular, all, monospace); const digit6 = this.createRequest('6', CharWidthRequestType.Regular, all, monospace); const digit7 = this.createRequest('7', CharWidthRequestType.Regular, all, monospace); const digit8 = this.createRequest('8', CharWidthRequestType.Regular, all, monospace); const digit9 = this.createRequest('9', CharWidthRequestType.Regular, all, monospace); // monospace test: used for whitespace rendering const rightwardsArrow = this.createRequest('→', CharWidthRequestType.Regular, all, monospace); const halfwidthRightwardsArrow = this.createRequest('→', CharWidthRequestType.Regular, all, null); this.createRequest('·', CharWidthRequestType.Regular, all, monospace); // monospace test: some characters this.createRequest('|', CharWidthRequestType.Regular, all, monospace); this.createRequest('/', CharWidthRequestType.Regular, all, monospace); this.createRequest('-', CharWidthRequestType.Regular, all, monospace); this.createRequest('_', CharWidthRequestType.Regular, all, monospace); this.createRequest('i', CharWidthRequestType.Regular, all, monospace); this.createRequest('l', CharWidthRequestType.Regular, all, monospace); this.createRequest('m', CharWidthRequestType.Regular, all, monospace); // monospace italic test this.createRequest('|', CharWidthRequestType.Italic, all, monospace); this.createRequest('_', CharWidthRequestType.Italic, all, monospace); this.createRequest('i', CharWidthRequestType.Italic, all, monospace); this.createRequest('l', CharWidthRequestType.Italic, all, monospace); this.createRequest('m', CharWidthRequestType.Italic, all, monospace); this.createRequest('n', CharWidthRequestType.Italic, all, monospace); // monospace bold test this.createRequest('|', CharWidthRequestType.Bold, all, monospace); this.createRequest('_', CharWidthRequestType.Bold, all, monospace); this.createRequest('i', CharWidthRequestType.Bold, all, monospace); this.createRequest('l', CharWidthRequestType.Bold, all, monospace); this.createRequest('m', CharWidthRequestType.Bold, all, monospace); this.createRequest('n', CharWidthRequestType.Bold, all, monospace); readCharWidths(bareFontInfo, all); const maxDigitWidth = Math.max(digit0.width, digit1.width, digit2.width, digit3.width, digit4.width, digit5.width, digit6.width, digit7.width, digit8.width, digit9.width); let isMonospace = true; let referenceWidth = monospace[0].width; for (let i = 1, len = monospace.length; i < len; i++) { const diff = referenceWidth - monospace[i].width; if (diff < -0.001 || diff > 0.001) { isMonospace = false; break; } } let canUseHalfwidthRightwardsArrow = true; if (isMonospace && halfwidthRightwardsArrow.width !== referenceWidth) { // using a halfwidth rightwards arrow would break monospace... canUseHalfwidthRightwardsArrow = false; } if (halfwidthRightwardsArrow.width > rightwardsArrow.width) { // using a halfwidth rightwards arrow would paint a larger arrow than a regular rightwards arrow canUseHalfwidthRightwardsArrow = false; } // let's trust the zoom level only 2s after it was changed. const canTrustBrowserZoomLevel = (browser.getTimeSinceLastZoomLevelChanged() > 2000); return new FontInfo({ zoomLevel: browser.getZoomLevel(), fontFamily: bareFontInfo.fontFamily, fontWeight: bareFontInfo.fontWeight, fontSize: bareFontInfo.fontSize, lineHeight: bareFontInfo.lineHeight, letterSpacing: bareFontInfo.letterSpacing, isMonospace: isMonospace, typicalHalfwidthCharacterWidth: typicalHalfwidthCharacter.width, typicalFullwidthCharacterWidth: typicalFullwidthCharacter.width, canUseHalfwidthRightwardsArrow: canUseHalfwidthRightwardsArrow, spaceWidth: space.width, maxDigitWidth: maxDigitWidth }, canTrustBrowserZoomLevel); } } export class Configuration extends CommonEditorConfiguration { private static _massageFontFamily(fontFamily: string): string { if (/[,"']/.test(fontFamily)) { // Looks like the font family might be already escaped return fontFamily; } if (/[+ ]/.test(fontFamily)) { // Wrap a font family using + or <space> with quotes return `"${fontFamily}"`; } return fontFamily; } public static applyFontInfoSlow(domNode: HTMLElement, fontInfo: BareFontInfo): void { domNode.style.fontFamily = Configuration._massageFontFamily(fontInfo.fontFamily); domNode.style.fontWeight = fontInfo.fontWeight; domNode.style.fontSize = fontInfo.fontSize + 'px'; domNode.style.lineHeight = fontInfo.lineHeight + 'px'; domNode.style.letterSpacing = fontInfo.letterSpacing + 'px'; } public static applyFontInfo(domNode: FastDomNode<HTMLElement>, fontInfo: BareFontInfo): void { domNode.setFontFamily(Configuration._massageFontFamily(fontInfo.fontFamily)); domNode.setFontWeight(fontInfo.fontWeight); domNode.setFontSize(fontInfo.fontSize); domNode.setLineHeight(fontInfo.lineHeight); domNode.setLetterSpacing(fontInfo.letterSpacing); } private readonly _elementSizeObserver: ElementSizeObserver; constructor(options: IEditorOptions, referenceDomElement: HTMLElement = null) { super(options); this._elementSizeObserver = this._register(new ElementSizeObserver(referenceDomElement, () => this._onReferenceDomElementSizeChanged())); this._register(CSSBasedConfiguration.INSTANCE.onDidChange(() => this._onCSSBasedConfigurationChanged())); if (this._validatedOptions.automaticLayout) { this._elementSizeObserver.startObserving(); } this._register(browser.onDidChangeZoomLevel(_ => this._recomputeOptions())); this._register(browser.onDidChangeAccessibilitySupport(() => this._recomputeOptions())); this._recomputeOptions(); } private _onReferenceDomElementSizeChanged(): void { this._recomputeOptions(); } private _onCSSBasedConfigurationChanged(): void { this._recomputeOptions(); } public observeReferenceElement(dimension?: IDimension): void { this._elementSizeObserver.observe(dimension); } public dispose(): void { super.dispose(); } private _getExtraEditorClassName(): string { let extra = ''; if (browser.isIE) { extra += 'ie '; } else if (browser.isFirefox) { extra += 'ff '; } else if (browser.isEdge) { extra += 'edge '; } else if (browser.isSafari) { extra += 'safari '; } if (platform.isMacintosh) { extra += 'mac '; } return extra; } protected _getEnvConfiguration(): IEnvConfiguration { return { extraEditorClassName: this._getExtraEditorClassName(), outerWidth: this._elementSizeObserver.getWidth(), outerHeight: this._elementSizeObserver.getHeight(), emptySelectionClipboard: browser.isWebKit || browser.isFirefox, pixelRatio: browser.getPixelRatio(), zoomLevel: browser.getZoomLevel(), accessibilitySupport: browser.getAccessibilitySupport() }; } protected readConfiguration(bareFontInfo: BareFontInfo): FontInfo { return CSSBasedConfiguration.INSTANCE.readConfiguration(bareFontInfo); } }
src/vs/editor/browser/config/configuration.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017523237329442054, 0.00016900683112908155, 0.00016101048095151782, 0.00016903510550037026, 0.0000029420064038276905 ]
{ "id": 1, "code_window": [ " \"string\",\n", " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"pre,code,textarea\",\n", " \"description\": \"%html.format.contentUnformatted.desc%\"\n", " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.contentUnformatted.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 62 }
{ "name": "html-language-features", "displayName": "%displayName%", "description": "%description%", "version": "1.0.0", "publisher": "vscode", "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", "engines": { "vscode": "0.10.x" }, "icon": "icons/html.png", "activationEvents": [ "onLanguage:html", "onLanguage:handlebars", "onLanguage:razor" ], "enableProposedApi": true, "main": "./client/out/htmlMain", "scripts": { "compile": "gulp compile-extension:html-language-features-client compile-extension:html-language-features-server", "watch": "gulp watch-extension:html-language-features-client watch-extension:html-language-features-server", "postinstall": "cd server && yarn install", "install-client-next": "yarn add vscode-languageclient@next" }, "categories": [ "Programming Languages" ], "contributes": { "configuration": { "id": "html", "order": 20, "type": "object", "title": "HTML", "properties": { "html.format.enable": { "type": "boolean", "scope": "window", "default": true, "description": "%html.format.enable.desc%" }, "html.format.wrapLineLength": { "type": "integer", "scope": "resource", "default": 120, "description": "%html.format.wrapLineLength.desc%" }, "html.format.unformatted": { "type": [ "string", "null" ], "scope": "resource", "default": "wbr", "description": "%html.format.unformatted.desc%" }, "html.format.contentUnformatted": { "type": [ "string", "null" ], "scope": "resource", "default": "pre,code,textarea", "description": "%html.format.contentUnformatted.desc%" }, "html.format.indentInnerHtml": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.indentInnerHtml.desc%" }, "html.format.preserveNewLines": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.format.preserveNewLines.desc%" }, "html.format.maxPreserveNewLines": { "type": [ "number", "null" ], "scope": "resource", "default": null, "description": "%html.format.maxPreserveNewLines.desc%" }, "html.format.indentHandlebars": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.indentHandlebars.desc%" }, "html.format.endWithNewline": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.endWithNewline.desc%" }, "html.format.extraLiners": { "type": [ "string", "null" ], "scope": "resource", "default": "head, body, /html", "description": "%html.format.extraLiners.desc%" }, "html.format.wrapAttributes": { "type": "string", "scope": "resource", "default": "auto", "enum": [ "auto", "force", "force-aligned", "force-expand-multiline", "aligned-multiple" ], "enumDescriptions": [ "%html.format.wrapAttributes.auto%", "%html.format.wrapAttributes.force%", "%html.format.wrapAttributes.forcealign%", "%html.format.wrapAttributes.forcemultiline%", "%html.format.wrapAttributes.alignedmultiple%" ], "description": "%html.format.wrapAttributes.desc%" }, "html.suggest.angular1": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.suggest.angular1.desc%" }, "html.suggest.ionic": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.suggest.ionic.desc%" }, "html.suggest.html5": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.suggest.html5.desc%" }, "html.validate.scripts": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.validate.scripts%" }, "html.validate.styles": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.validate.styles%" }, "html.autoClosingTags": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.autoClosingTags%" }, "html.trace.server": { "type": "string", "scope": "window", "enum": [ "off", "messages", "verbose" ], "default": "off", "description": "%html.trace.server.desc%" } } } }, "dependencies": { "vscode-extension-telemetry": "0.0.18", "vscode-languageclient": "^5.1.0-next.9", "vscode-nls": "^4.0.0" }, "devDependencies": { "@types/node": "^8.10.25" } }
extensions/html-language-features/package.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.9563423991203308, 0.05951739102602005, 0.000163483084179461, 0.0006038065766915679, 0.21344628930091858 ]
{ "id": 1, "code_window": [ " \"string\",\n", " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"pre,code,textarea\",\n", " \"description\": \"%html.format.contentUnformatted.desc%\"\n", " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.contentUnformatted.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 62 }
{ "comments": { "lineComment": "--", "blockComment": [ "--[[", "]]" ] }, "brackets": [ ["{", "}"], ["[", "]"], ["(", ")"] ], "autoClosingPairs": [ ["{", "}"], ["[", "]"], ["(", ")"], ["\"", "\""], ["'", "'"] ], "surroundingPairs": [ ["{", "}"], ["[", "]"], ["(", ")"], ["\"", "\""], ["'", "'"] ], "indentationRules": { "increaseIndentPattern": "((\\b(else|function|then|do|repeat)\\b((?!\\b(end|until)\\b).)*)|(\\{\\s*))$", "decreaseIndentPattern": "^\\s*((\\b(elseif|else|end|until)\\b)|(\\})|(\\)))" } }
extensions/lua/language-configuration.json
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0001679191191215068, 0.00016721368592698127, 0.00016659987159073353, 0.00016712205251678824, 5.424637379292108e-7 ]
{ "id": 1, "code_window": [ " \"string\",\n", " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"pre,code,textarea\",\n", " \"description\": \"%html.format.contentUnformatted.desc%\"\n", " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.contentUnformatted.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 62 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import * as assert from 'assert'; import { TextModel } from 'vs/editor/common/model/textModel'; import { computeRanges } from 'vs/editor/contrib/folding/indentRangeProvider'; import { FoldingMarkers } from 'vs/editor/common/modes/languageConfiguration'; interface ExpectedIndentRange { startLineNumber: number; endLineNumber: number; parentIndex: number; } function assertRanges(lines: string[], expected: ExpectedIndentRange[], offside: boolean, markers?: FoldingMarkers): void { let model = TextModel.createFromString(lines.join('\n')); let actual = computeRanges(model, offside, markers); let actualRanges = []; for (let i = 0; i < actual.length; i++) { actualRanges[i] = r(actual.getStartLineNumber(i), actual.getEndLineNumber(i), actual.getParentIndex(i)); } assert.deepEqual(actualRanges, expected); model.dispose(); } function r(startLineNumber: number, endLineNumber: number, parentIndex: number, marker = false): ExpectedIndentRange { return { startLineNumber, endLineNumber, parentIndex }; } suite('Indentation Folding', () => { test('Fold one level', () => { let range = [ 'A', ' A', ' A', ' A' ]; assertRanges(range, [r(1, 4, -1)], true); assertRanges(range, [r(1, 4, -1)], false); }); test('Fold two levels', () => { let range = [ 'A', ' A', ' A', ' A', ' A' ]; assertRanges(range, [r(1, 5, -1), r(3, 5, 0)], true); assertRanges(range, [r(1, 5, -1), r(3, 5, 0)], false); }); test('Fold three levels', () => { let range = [ 'A', ' A', ' A', ' A', 'A' ]; assertRanges(range, [r(1, 4, -1), r(2, 4, 0), r(3, 4, 1)], true); assertRanges(range, [r(1, 4, -1), r(2, 4, 0), r(3, 4, 1)], false); }); test('Fold decreasing indent', () => { let range = [ ' A', ' A', 'A' ]; assertRanges(range, [], true); assertRanges(range, [], false); }); test('Fold Java', () => { assertRanges([ /* 1*/ 'class A {', /* 2*/ ' void foo() {', /* 3*/ ' console.log();', /* 4*/ ' console.log();', /* 5*/ ' }', /* 6*/ '', /* 7*/ ' void bar() {', /* 8*/ ' console.log();', /* 9*/ ' }', /*10*/ '}', /*11*/ 'interface B {', /*12*/ ' void bar();', /*13*/ '}', ], [r(1, 9, -1), r(2, 4, 0), r(7, 8, 0), r(11, 12, -1)], false); }); test('Fold Javadoc', () => { assertRanges([ /* 1*/ '/**', /* 2*/ ' * Comment', /* 3*/ ' */', /* 4*/ 'class A {', /* 5*/ ' void foo() {', /* 6*/ ' }', /* 7*/ '}', ], [r(1, 3, -1), r(4, 6, -1)], false); }); test('Fold Whitespace Java', () => { assertRanges([ /* 1*/ 'class A {', /* 2*/ '', /* 3*/ ' void foo() {', /* 4*/ ' ', /* 5*/ ' return 0;', /* 6*/ ' }', /* 7*/ ' ', /* 8*/ '}', ], [r(1, 7, -1), r(3, 5, 0)], false); }); test('Fold Whitespace Python', () => { assertRanges([ /* 1*/ 'def a:', /* 2*/ ' pass', /* 3*/ ' ', /* 4*/ ' def b:', /* 5*/ ' pass', /* 6*/ ' ', /* 7*/ ' ', /* 8*/ 'def c: # since there was a deintent here' ], [r(1, 5, -1), r(4, 5, 0)], true); }); test('Fold Tabs', () => { assertRanges([ /* 1*/ 'class A {', /* 2*/ '\t\t', /* 3*/ '\tvoid foo() {', /* 4*/ '\t \t//hello', /* 5*/ '\t return 0;', /* 6*/ ' \t}', /* 7*/ ' ', /* 8*/ '}', ], [r(1, 7, -1), r(3, 5, 0)], false); }); }); let markers: FoldingMarkers = { start: /^\s*#region\b/, end: /^\s*#endregion\b/ }; suite('Folding with regions', () => { test('Inside region, indented', () => { assertRanges([ /* 1*/ 'class A {', /* 2*/ ' #region', /* 3*/ ' void foo() {', /* 4*/ ' ', /* 5*/ ' return 0;', /* 6*/ ' }', /* 7*/ ' #endregion', /* 8*/ '}', ], [r(1, 7, -1), r(2, 7, 0, true), r(3, 5, 1)], false, markers); }); test('Inside region, not indented', () => { assertRanges([ /* 1*/ 'var x;', /* 2*/ '#region', /* 3*/ 'void foo() {', /* 4*/ ' ', /* 5*/ ' return 0;', /* 6*/ ' }', /* 7*/ '#endregion', /* 8*/ '', ], [r(2, 7, -1, true), r(3, 6, 0)], false, markers); }); test('Empty Regions', () => { assertRanges([ /* 1*/ 'var x;', /* 2*/ '#region', /* 3*/ '#endregion', /* 4*/ '#region', /* 5*/ '', /* 6*/ '#endregion', /* 7*/ 'var y;', ], [r(2, 3, -1, true), r(4, 6, -1, true)], false, markers); }); test('Nested Regions', () => { assertRanges([ /* 1*/ 'var x;', /* 2*/ '#region', /* 3*/ '#region', /* 4*/ '', /* 5*/ '#endregion', /* 6*/ '#endregion', /* 7*/ 'var y;', ], [r(2, 6, -1, true), r(3, 5, 0, true)], false, markers); }); test('Nested Regions 2', () => { assertRanges([ /* 1*/ 'class A {', /* 2*/ ' #region', /* 3*/ '', /* 4*/ ' #region', /* 5*/ '', /* 6*/ ' #endregion', /* 7*/ ' // comment', /* 8*/ ' #endregion', /* 9*/ '}', ], [r(1, 8, -1), r(2, 8, 0, true), r(4, 6, 1, true)], false, markers); }); test('Incomplete Regions', () => { assertRanges([ /* 1*/ 'class A {', /* 2*/ '#region', /* 3*/ ' // comment', /* 4*/ '}', ], [r(2, 3, -1)], false, markers); }); test('Incomplete Regions 2', () => { assertRanges([ /* 1*/ '', /* 2*/ '#region', /* 3*/ '#region', /* 4*/ '#region', /* 5*/ ' // comment', /* 6*/ '#endregion', /* 7*/ '#endregion', /* 8*/ ' // hello', ], [r(3, 7, -1, true), r(4, 6, 0, true)], false, markers); }); test('Indented region before', () => { assertRanges([ /* 1*/ 'if (x)', /* 2*/ ' return;', /* 3*/ '', /* 4*/ '#region', /* 5*/ ' // comment', /* 6*/ '#endregion', ], [r(1, 3, -1), r(4, 6, -1, true)], false, markers); }); test('Indented region before 2', () => { assertRanges([ /* 1*/ 'if (x)', /* 2*/ ' log();', /* 3*/ '', /* 4*/ ' #region', /* 5*/ ' // comment', /* 6*/ ' #endregion', ], [r(1, 6, -1), r(2, 6, 0), r(4, 6, 1, true)], false, markers); }); test('Indented region in-between', () => { assertRanges([ /* 1*/ '#region', /* 2*/ ' // comment', /* 3*/ ' if (x)', /* 4*/ ' return;', /* 5*/ '', /* 6*/ '#endregion', ], [r(1, 6, -1, true), r(3, 5, 0)], false, markers); }); test('Indented region after', () => { assertRanges([ /* 1*/ '#region', /* 2*/ ' // comment', /* 3*/ '', /* 4*/ '#endregion', /* 5*/ ' if (x)', /* 6*/ ' return;', ], [r(1, 4, -1, true), r(5, 6, -1)], false, markers); }); test('With off-side', () => { assertRanges([ /* 1*/ '#region', /* 2*/ ' ', /* 3*/ '', /* 4*/ '#endregion', /* 5*/ '', ], [r(1, 4, -1, true)], true, markers); }); test('Nested with off-side', () => { assertRanges([ /* 1*/ '#region', /* 2*/ ' ', /* 3*/ '#region', /* 4*/ '', /* 5*/ '#endregion', /* 6*/ '', /* 7*/ '#endregion', /* 8*/ '', ], [r(1, 7, -1, true), r(3, 5, 0, true)], true, markers); }); test('Issue 35981', () => { assertRanges([ /* 1*/ 'function thisFoldsToEndOfPage() {', /* 2*/ ' const variable = []', /* 3*/ ' // #region', /* 4*/ ' .reduce((a, b) => a,[]);', /* 5*/ '}', /* 6*/ '', /* 7*/ 'function thisFoldsProperly() {', /* 8*/ ' const foo = "bar"', /* 9*/ '}', ], [r(1, 4, -1), r(2, 4, 0), r(7, 8, -1)], false, markers); }); test('Misspelled Markers', () => { assertRanges([ /* 1*/ '#Region', /* 2*/ '#endregion', /* 3*/ '#regionsandmore', /* 4*/ '#endregion', /* 5*/ '#region', /* 6*/ '#end region', /* 7*/ '#region', /* 8*/ '#endregionff', ], [], true, markers); }); });
src/vs/editor/contrib/folding/test/indentRangeProvider.test.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.001502706902101636, 0.0002098956028930843, 0.0001660706038819626, 0.00016946227697189897, 0.00022854309645481408 ]
{ "id": 1, "code_window": [ " \"string\",\n", " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"pre,code,textarea\",\n", " \"description\": \"%html.format.contentUnformatted.desc%\"\n", " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.contentUnformatted.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 62 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { readFileSync } from 'fs'; import { getPathFromAmdModule } from 'vs/base/common/amd'; suite('URI - perf', function () { let manyFileUris: URI[]; setup(function () { manyFileUris = []; let data = readFileSync(getPathFromAmdModule(require, './uri.test.data.txt')).toString(); let lines = data.split('\n'); for (let line of lines) { manyFileUris.push(URI.file(line)); } }); function perfTest(name: string, callback: Function) { test(name, _done => { let t1 = Date.now(); callback(); let d = Date.now() - t1; console.log(`${name} took ${d}ms (${(d / manyFileUris.length).toPrecision(3)} ms/uri)`); _done(); }); } perfTest('toString', function () { for (const uri of manyFileUris) { let data = uri.toString(); assert.ok(data); } }); perfTest('toString(skipEncoding)', function () { for (const uri of manyFileUris) { let data = uri.toString(true); assert.ok(data); } }); perfTest('fsPath', function () { for (const uri of manyFileUris) { let data = uri.fsPath; assert.ok(data); } }); perfTest('toJSON', function () { for (const uri of manyFileUris) { let data = uri.toJSON(); assert.ok(data); } }); });
src/vs/base/test/node/uri.test.perf.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017129267507698387, 0.00016923752264119685, 0.00016542358207516372, 0.00016938346379902214, 0.00000172916281826474 ]
{ "id": 2, "code_window": [ " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentInnerHtml.desc%\"\n", " },\n", " \"html.format.preserveNewLines\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentInnerHtml.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 68 }
{ "displayName": "HTML Language Features", "description": "Provides rich language support for HTML, Razor, and Handlebar files", "html.format.enable.desc": "Enable/disable default HTML formatter.", "html.format.wrapLineLength.desc": "Maximum amount of characters per line (0 = disable).", "html.format.unformatted.desc": "List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.", "html.format.contentUnformatted.desc": "List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.", "html.format.indentInnerHtml.desc": "Indent <head> and <body> sections.", "html.format.preserveNewLines.desc": "Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.", "html.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.", "html.format.indentHandlebars.desc": "Format and indent {{#foo}} and {{/foo}}.", "html.format.endWithNewline.desc": "End with a newline.", "html.format.extraLiners.desc": "List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \"head, body, /html\".", "html.format.wrapAttributes.desc": "Wrap attributes.", "html.format.wrapAttributes.auto": "Wrap attributes only when line length is exceeded.", "html.format.wrapAttributes.force": "Wrap each attribute except first.", "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", "html.format.wrapAttributesIndentSize.desc": "Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.", "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", "html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.", "html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.", "html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.", "html.autoClosingTags": "Enable/disable autoclosing of HTML tags." }
extensions/html-language-features/package.nls.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0122981620952487, 0.0042289686389267445, 0.00016394344856962562, 0.00022480096959043294, 0.005705834832042456 ]
{ "id": 2, "code_window": [ " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentInnerHtml.desc%\"\n", " },\n", " \"html.format.preserveNewLines\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentInnerHtml.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 68 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /// <reference path='../../../../src/vs/vscode.d.ts'/>
extensions/extension-editing/src/typings/ref.d.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017046088760253042, 0.00017046088760253042, 0.00017046088760253042, 0.00017046088760253042, 0 ]
{ "id": 2, "code_window": [ " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentInnerHtml.desc%\"\n", " },\n", " \"html.format.preserveNewLines\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentInnerHtml.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 68 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ .monaco-workbench .symbol-icon { display: inline-block; height: 14px; width: 16px; min-height: 14px; min-width: 16px; } /* default icons */ .monaco-workbench .symbol-icon { background-image: url('Field_16x.svg'); background-repeat: no-repeat; } .vs-dark .monaco-workbench .symbol-icon, .hc-black .monaco-workbench .symbol-icon { background-image: url('Field_16x_darkp.svg'); } /* constant */ .monaco-workbench .symbol-icon.constant { background-image: url('Constant_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.constant, .hc-black .monaco-workbench .symbol-icon.constant { background-image: url('Constant_16x_inverse.svg'); } /* enum */ .monaco-workbench .symbol-icon.enum { background-image: url('Enumerator_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.enum, .hc-black .monaco-workbench .symbol-icon.enum { background-image: url('Enumerator_inverse_16x.svg'); } /* enum-member */ .monaco-workbench .symbol-icon.enum-member { background-image: url('EnumItem_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.enum-member, .hc-black .monaco-workbench .symbol-icon.enum-member { background-image: url('EnumItem_inverse_16x.svg'); } /* struct */ .monaco-workbench .symbol-icon.struct { background-image: url('Structure_16x_vscode.svg'); } .vs-dark .monaco-workbench .symbol-icon.struct, .hc-black .monaco-workbench .symbol-icon.struct { background-image: url('Structure_16x_vscode_inverse.svg'); } /* event */ .monaco-workbench .symbol-icon.event { background-image: url('Event_16x_vscode.svg'); } .vs-dark .monaco-workbench .symbol-icon.event, .hc-black .monaco-workbench .symbol-icon.event { background-image: url('Event_16x_vscode_inverse.svg'); } /* operator */ .monaco-workbench .symbol-icon.operator { background-image: url('Operator_16x_vscode.svg'); } .vs-dark .monaco-workbench .symbol-icon.operator, .hc-black .monaco-workbench .symbol-icon.operator { background-image: url('Operator_16x_vscode_inverse.svg'); } /* type paramter */ .monaco-workbench .symbol-icon.type-parameter { background-image: url('Template_16x_vscode.svg'); } .vs-dark .monaco-workbench .symbol-icon.type-parameter, .hc-black .monaco-workbench .symbol-icon.type-parameter { background-image: url('Template_16x_vscode_inverse.svg'); } /* boolean, null */ .monaco-workbench .symbol-icon.boolean { background-image: url('BooleanData_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.boolean, .hc-black .monaco-workbench .symbol-icon.boolean { background-image: url('BooleanData_16x_darkp.svg'); } /* null */ .monaco-workbench .symbol-icon.null { background-image: url('BooleanData_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.null, .hc-black .monaco-workbench .symbol-icon.null { background-image: url('BooleanData_16x_darkp.svg'); } /* class */ .monaco-workbench .symbol-icon.class { background-image: url('Class_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.class, .hc-black .monaco-workbench .symbol-icon.class { background-image: url('Class_16x_darkp.svg'); } /* constructor */ .monaco-workbench .symbol-icon.constructor { background-image: url('Method_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.constructor, .hc-black .monaco-workbench .symbol-icon.constructor { background-image: url('Method_16x_darkp.svg'); } /* file */ .monaco-workbench .symbol-icon.file { background-image: url('Document_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.file, .hc-black .monaco-workbench .symbol-icon.file { background-image: url('Document_16x_darkp.svg'); } /* field */ .monaco-workbench .symbol-icon.field { background-image: url('Field_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.field, .hc-black .monaco-workbench .symbol-icon.field { background-image: url('Field_16x_darkp.svg'); } /* variable */ .monaco-workbench .symbol-icon.variable { background-image: url('LocalVariable_16x_vscode.svg'); } .vs-dark .monaco-workbench .symbol-icon.variable, .hc-black .monaco-workbench .symbol-icon.variable { background-image: url('LocalVariable_16x_vscode_inverse.svg'); } /* array */ .monaco-workbench .symbol-icon.array { background-image: url('Indexer_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.array, .hc-black .monaco-workbench .symbol-icon.array { background-image: url('Indexer_16x_darkp.svg'); } /* keyword */ /* todo@joh not used? */ .monaco-workbench .symbol-icon.keyword { background-image: url('IntelliSenseKeyword_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.keyword, .hc-black .monaco-workbench .symbol-icon.keyword { background-image: url('IntelliSenseKeyword_16x_darkp.svg'); } /* interface */ .monaco-workbench .symbol-icon.interface { background-image: url('Interface_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.interface, .hc-black .monaco-workbench .symbol-icon.interface { background-image: url('Interface_16x_darkp.svg'); } /* method */ .monaco-workbench .symbol-icon.method { background-image: url('Method_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.method, .hc-black .monaco-workbench .symbol-icon.method { background-image: url('Method_16x_darkp.svg'); } /* function */ .monaco-workbench .symbol-icon.function { background-image: url('Method_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.function, .hc-black .monaco-workbench .symbol-icon.function { background-image: url('Method_16x_darkp.svg'); } /* object */ .monaco-workbench .symbol-icon.object { background-image: url('Namespace_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.object, .hc-black .monaco-workbench .symbol-icon.object { background-image: url('Namespace_16x_darkp.svg'); } /* namespace */ .monaco-workbench .symbol-icon.namespace { background-image: url('Namespace_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.namespace, .hc-black .monaco-workbench .symbol-icon.namespace { background-image: url('Namespace_16x_darkp.svg'); } /* package */ .monaco-workbench .symbol-icon.package { background-image: url('Namespace_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.package, .hc-black .monaco-workbench .symbol-icon.package { background-image: url('Namespace_16x_darkp.svg'); } /* module */ .monaco-workbench .symbol-icon.module { background-image: url('Namespace_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.module, .hc-black .monaco-workbench .symbol-icon.module { background-image: url('Namespace_16x_darkp.svg'); } /* number */ .monaco-workbench .symbol-icon.number { background-image: url('Numeric_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.number, .hc-black .monaco-workbench .symbol-icon.number { background-image: url('Numeric_16x_darkp.svg'); } /* property */ .monaco-workbench .symbol-icon.property { background-image: url('Property_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.property, .hc-black .monaco-workbench .symbol-icon.property { background-image: url('Property_16x_darkp.svg'); } /* snippet */ /* todo@joh unused? */ .monaco-workbench .symbol-icon.snippet { background-image: url('Snippet_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.snippet, .hc-black .monaco-workbench .symbol-icon.snippet { background-image: url('Snippet_16x_darkp.svg'); } /* string */ .monaco-workbench .symbol-icon.string { background-image: url('String_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.string, .hc-black .monaco-workbench .symbol-icon.string { background-image: url('String_16x_darkp.svg'); } /* key */ .monaco-workbench .symbol-icon.key { background-image: url('String_16x.svg'); } .vs-dark .monaco-workbench .symbol-icon.key, .hc-black .monaco-workbench .symbol-icon.key { background-image: url('String_16x_darkp.svg'); }
src/vs/editor/contrib/documentSymbols/media/symbol-icons.css
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017241925525013357, 0.00016657161177136004, 0.00015961533063091338, 0.00016660644905641675, 0.0000030178341603459558 ]
{ "id": 2, "code_window": [ " },\n", " \"html.format.indentInnerHtml\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentInnerHtml.desc%\"\n", " },\n", " \"html.format.preserveNewLines\": {\n", " \"type\": \"boolean\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentInnerHtml.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 68 }
{ "name": "vs/base", "dependencies": [ { "name": "vs", "internal": false } ], "libs": [ "lib.core.d.ts" ], "sources": [ "**/*.ts" ], "declares": [ "vs/base/winjs.base.d.ts" ] }
src/vs/base/common/buildunit.json
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0001692562218522653, 0.00016899881302379072, 0.0001687413896434009, 0.00016899881302379072, 2.574161044321954e-7 ]
{ "id": 3, "code_window": [ " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": null,\n", " \"description\": \"%html.format.maxPreserveNewLines.desc%\"\n", " },\n", " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.maxPreserveNewLines.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 83 }
{ "displayName": "HTML Language Features", "description": "Provides rich language support for HTML, Razor, and Handlebar files", "html.format.enable.desc": "Enable/disable default HTML formatter.", "html.format.wrapLineLength.desc": "Maximum amount of characters per line (0 = disable).", "html.format.unformatted.desc": "List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.", "html.format.contentUnformatted.desc": "List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.", "html.format.indentInnerHtml.desc": "Indent <head> and <body> sections.", "html.format.preserveNewLines.desc": "Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.", "html.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.", "html.format.indentHandlebars.desc": "Format and indent {{#foo}} and {{/foo}}.", "html.format.endWithNewline.desc": "End with a newline.", "html.format.extraLiners.desc": "List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \"head, body, /html\".", "html.format.wrapAttributes.desc": "Wrap attributes.", "html.format.wrapAttributes.auto": "Wrap attributes only when line length is exceeded.", "html.format.wrapAttributes.force": "Wrap each attribute except first.", "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", "html.format.wrapAttributesIndentSize.desc": "Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.", "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", "html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.", "html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.", "html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.", "html.autoClosingTags": "Enable/disable autoclosing of HTML tags." }
extensions/html-language-features/package.nls.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.005302030127495527, 0.0031951649580150843, 0.00016396814316976815, 0.00411949772387743, 0.0021970756351947784 ]
{ "id": 3, "code_window": [ " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": null,\n", " \"description\": \"%html.format.maxPreserveNewLines.desc%\"\n", " },\n", " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.maxPreserveNewLines.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 83 }
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16"><style type="text/css">.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{fill:#F6F6F6;} .icon-vs-fg{fill:#F0EFF1;} .icon-vs-action-blue{fill:#00539C;}</style><path class="icon-canvas-transparent" d="M16 16h-16v-16h16v16z" id="canvas"/><path class="icon-vs-out" d="M11.5 12c-1.915 0-3.602-1.241-4.228-3h-1.41c-.536.985-1.572 1.625-2.737 1.625-1.723 0-3.125-1.402-3.125-3.125s1.402-3.125 3.125-3.125c1.165 0 2.201.639 2.737 1.625h1.41c.626-1.759 2.313-3 4.228-3 2.481 0 4.5 2.019 4.5 4.5s-2.019 4.5-4.5 4.5z" id="outline"/><path class="icon-vs-fg" d="M11.5 9c-.827 0-1.5-.674-1.5-1.5 0-.828.673-1.5 1.5-1.5s1.5.672 1.5 1.5c0 .826-.673 1.5-1.5 1.5z" id="iconFg"/><path class="icon-vs-action-blue" d="M11.5 4c-1.762 0-3.205 1.306-3.45 3h-2.865c-.226-.931-1.059-1.625-2.06-1.625-1.174 0-2.125.951-2.125 2.125s.951 2.125 2.125 2.125c1 0 1.834-.694 2.06-1.625h2.865c.245 1.694 1.688 3 3.45 3 1.933 0 3.5-1.567 3.5-3.5s-1.567-3.5-3.5-3.5zm0 5c-.827 0-1.5-.673-1.5-1.5s.673-1.5 1.5-1.5 1.5.673 1.5 1.5-.673 1.5-1.5 1.5z" id="iconBg"/></svg>
src/vs/editor/contrib/documentSymbols/media/Interface_16x.svg
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0001644079020479694, 0.0001644079020479694, 0.0001644079020479694, 0.0001644079020479694, 0 ]
{ "id": 3, "code_window": [ " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": null,\n", " \"description\": \"%html.format.maxPreserveNewLines.desc%\"\n", " },\n", " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.maxPreserveNewLines.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 83 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import * as nls from 'vs/nls'; import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/browser/editorExtensions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { WorkbenchKeybindingService } from 'vs/workbench/services/keybinding/electron-browser/keybindingService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IUntitledResourceInput } from 'vs/workbench/common/editor'; class InspectKeyMap extends EditorAction { constructor() { super({ id: 'workbench.action.inspectKeyMappings', label: nls.localize('workbench.action.inspectKeyMap', "Developer: Inspect Key Mappings"), alias: 'Developer: Inspect Key Mappings', precondition: null }); } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { const keybindingService = accessor.get(IKeybindingService); const editorService = accessor.get(IEditorService); if (keybindingService instanceof WorkbenchKeybindingService) { editorService.openEditor({ contents: keybindingService.dumpDebugInfo(), options: { pinned: true } } as IUntitledResourceInput); } } } registerEditorAction(InspectKeyMap);
src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017321002087555826, 0.00017076550284400582, 0.00016901835624594241, 0.00017041683895513415, 0.0000016477100643896847 ]
{ "id": 3, "code_window": [ " \"null\"\n", " ],\n", " \"scope\": \"resource\",\n", " \"default\": null,\n", " \"description\": \"%html.format.maxPreserveNewLines.desc%\"\n", " },\n", " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.maxPreserveNewLines.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 83 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; import * as Proto from '../protocol'; import { ITypeScriptServiceClient } from '../typescriptService'; import API from '../utils/api'; import { ConditionalRegistration, ConfigurationDependentRegistration, VersionDependentRegistration } from '../utils/dependentRegistration'; import { Disposable } from '../utils/dispose'; import * as typeConverters from '../utils/typeConverters'; class TagClosing extends Disposable { private _disposed = false; private _timeout: NodeJS.Timer | undefined = undefined; private _cancel: vscode.CancellationTokenSource | undefined = undefined; constructor( private readonly client: ITypeScriptServiceClient ) { super(); vscode.workspace.onDidChangeTextDocument( event => this.onDidChangeTextDocument(event.document, event.contentChanges), null, this._disposables); } public dispose() { super.dispose(); this._disposed = true; if (this._timeout) { clearTimeout(this._timeout); this._timeout = undefined; } if (this._cancel) { this._cancel.cancel(); this._cancel.dispose(); this._cancel = undefined; } } private onDidChangeTextDocument( document: vscode.TextDocument, changes: vscode.TextDocumentContentChangeEvent[] ) { const activeDocument = vscode.window.activeTextEditor && vscode.window.activeTextEditor.document; if (document !== activeDocument || changes.length === 0) { return; } const filepath = this.client.toPath(document.uri); if (!filepath) { return; } if (typeof this._timeout !== 'undefined') { clearTimeout(this._timeout); } if (this._cancel) { this._cancel.cancel(); this._cancel.dispose(); this._cancel = undefined; } const lastChange = changes[changes.length - 1]; const lastCharacter = lastChange.text[lastChange.text.length - 1]; if (lastChange.rangeLength > 0 || lastCharacter !== '>' && lastCharacter !== '/') { return; } const priorCharacter = lastChange.range.start.character > 0 ? document.getText(new vscode.Range(lastChange.range.start.translate({ characterDelta: -1 }), lastChange.range.start)) : ''; if (priorCharacter === '>') { return; } const rangeStart = lastChange.range.start; const version = document.version; this._timeout = setTimeout(async () => { this._timeout = undefined; if (this._disposed) { return; } let position = new vscode.Position(rangeStart.line, rangeStart.character + lastChange.text.length); let insertion: Proto.TextInsertion; const args: Proto.JsxClosingTagRequestArgs = typeConverters.Position.toFileLocationRequestArgs(filepath, position); this._cancel = new vscode.CancellationTokenSource(); try { const { body } = await this.client.execute('jsxClosingTag', args, this._cancel.token); if (!body) { return; } insertion = body; } catch { return; } if (this._disposed) { return; } const activeEditor = vscode.window.activeTextEditor; if (!activeEditor) { return; } const activeDocument = activeEditor.document; if (document === activeDocument && activeDocument.version === version) { activeEditor.insertSnippet( this.getTagSnippet(insertion), this.getInsertionPositions(activeEditor, position)); } }, 100); } private getTagSnippet(closingTag: Proto.TextInsertion): vscode.SnippetString { const snippet = new vscode.SnippetString(); snippet.appendPlaceholder('', 0); snippet.appendText(closingTag.newText); return snippet; } private getInsertionPositions(editor: vscode.TextEditor, position: vscode.Position) { const activeSelectionPositions = editor.selections.map(s => s.active); return activeSelectionPositions.some(p => p.isEqual(position)) ? activeSelectionPositions : position; } } export class ActiveDocumentDependentRegistration extends Disposable { private readonly _registration: ConditionalRegistration; constructor( private readonly selector: vscode.DocumentSelector, register: () => vscode.Disposable, ) { super(); this._registration = this._register(new ConditionalRegistration(register)); vscode.window.onDidChangeActiveTextEditor(this.update, this, this._disposables); this.update(); } private update() { const editor = vscode.window.activeTextEditor; const enabled = !!(editor && vscode.languages.match(this.selector, editor.document)); this._registration.update(enabled); } } export function register( selector: vscode.DocumentSelector, modeId: string, client: ITypeScriptServiceClient, ) { return new VersionDependentRegistration(client, API.v300, () => new ConfigurationDependentRegistration(modeId, 'autoClosingTags', () => new ActiveDocumentDependentRegistration(selector, () => new TagClosing(client)))); }
extensions/typescript-language-features/src/features/tagClosing.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017338864563498646, 0.0001710104988887906, 0.00016797739954199642, 0.00017098980606533587, 0.0000015578234524582513 ]
{ "id": 4, "code_window": [ " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentHandlebars.desc%\"\n", " },\n", " \"html.format.endWithNewline\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentHandlebars.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 89 }
{ "displayName": "HTML Language Features", "description": "Provides rich language support for HTML, Razor, and Handlebar files", "html.format.enable.desc": "Enable/disable default HTML formatter.", "html.format.wrapLineLength.desc": "Maximum amount of characters per line (0 = disable).", "html.format.unformatted.desc": "List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.", "html.format.contentUnformatted.desc": "List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.", "html.format.indentInnerHtml.desc": "Indent <head> and <body> sections.", "html.format.preserveNewLines.desc": "Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.", "html.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.", "html.format.indentHandlebars.desc": "Format and indent {{#foo}} and {{/foo}}.", "html.format.endWithNewline.desc": "End with a newline.", "html.format.extraLiners.desc": "List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \"head, body, /html\".", "html.format.wrapAttributes.desc": "Wrap attributes.", "html.format.wrapAttributes.auto": "Wrap attributes only when line length is exceeded.", "html.format.wrapAttributes.force": "Wrap each attribute except first.", "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", "html.format.wrapAttributesIndentSize.desc": "Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.", "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", "html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.", "html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.", "html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.", "html.autoClosingTags": "Enable/disable autoclosing of HTML tags." }
extensions/html-language-features/package.nls.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0022604987025260925, 0.000867208989802748, 0.00016347062774002552, 0.00017765769734978676, 0.000985221704468131 ]
{ "id": 4, "code_window": [ " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentHandlebars.desc%\"\n", " },\n", " \"html.format.endWithNewline\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentHandlebars.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 89 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { localize } from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; import { memoize } from 'vs/base/common/decorators'; import * as paths from 'vs/base/common/paths'; import * as resources from 'vs/base/common/resources'; import { URI } from 'vs/base/common/uri'; import { EncodingMode, ConfirmResult, EditorInput, IFileEditorInput, ITextEditorModel, Verbosity, IRevertOptions } from 'vs/workbench/common/editor'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; import { FileOperationError, FileOperationResult } from 'vs/platform/files/common/files'; import { ITextFileService, AutoSaveMode, ModelState, TextFileModelChangeEvent, LoadReason } from 'vs/workbench/services/textfile/common/textfiles'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IReference } from 'vs/base/common/lifecycle'; import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUtils'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IHashService } from 'vs/workbench/services/hash/common/hashService'; import { FILE_EDITOR_INPUT_ID, TEXT_FILE_EDITOR_ID, BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; import { ILabelService } from 'vs/platform/label/common/label'; /** * A file editor input is the input type for the file editor of file system resources. */ export class FileEditorInput extends EditorInput implements IFileEditorInput { private preferredEncoding: string; private forceOpenAsBinary: boolean; private forceOpenAsText: boolean; private textModelReference: TPromise<IReference<ITextEditorModel>>; private name: string; /** * An editor input who's contents are retrieved from file services. */ constructor( private resource: URI, preferredEncoding: string, @IInstantiationService private instantiationService: IInstantiationService, @ITextFileService private textFileService: ITextFileService, @ITextModelService private textModelResolverService: ITextModelService, @IHashService private hashService: IHashService, @ILabelService private labelService: ILabelService ) { super(); this.setPreferredEncoding(preferredEncoding); this.registerListeners(); } private registerListeners(): void { // Model changes this._register(this.textFileService.models.onModelDirty(e => this.onDirtyStateChange(e))); this._register(this.textFileService.models.onModelSaveError(e => this.onDirtyStateChange(e))); this._register(this.textFileService.models.onModelSaved(e => this.onDirtyStateChange(e))); this._register(this.textFileService.models.onModelReverted(e => this.onDirtyStateChange(e))); this._register(this.textFileService.models.onModelOrphanedChanged(e => this.onModelOrphanedChanged(e))); } private onDirtyStateChange(e: TextFileModelChangeEvent): void { if (e.resource.toString() === this.resource.toString()) { this._onDidChangeDirty.fire(); } } private onModelOrphanedChanged(e: TextFileModelChangeEvent): void { if (e.resource.toString() === this.resource.toString()) { this._onDidChangeLabel.fire(); } } getResource(): URI { return this.resource; } setPreferredEncoding(encoding: string): void { this.preferredEncoding = encoding; if (encoding) { this.forceOpenAsText = true; // encoding is a good hint to open the file as text } } getEncoding(): string { const textModel = this.textFileService.models.get(this.resource); if (textModel) { return textModel.getEncoding(); } return this.preferredEncoding; } getPreferredEncoding(): string { return this.preferredEncoding; } setEncoding(encoding: string, mode: EncodingMode): void { this.preferredEncoding = encoding; const textModel = this.textFileService.models.get(this.resource); if (textModel) { textModel.setEncoding(encoding, mode); } } setForceOpenAsText(): void { this.forceOpenAsText = true; this.forceOpenAsBinary = false; } setForceOpenAsBinary(): void { this.forceOpenAsBinary = true; this.forceOpenAsText = false; } getTypeId(): string { return FILE_EDITOR_INPUT_ID; } getName(): string { if (!this.name) { this.name = resources.basenameOrAuthority(this.resource); } return this.decorateLabel(this.name); } @memoize private get shortDescription(): string { return paths.basename(this.labelService.getUriLabel(resources.dirname(this.resource))); } @memoize private get mediumDescription(): string { return this.labelService.getUriLabel(resources.dirname(this.resource), true); } @memoize private get longDescription(): string { return this.labelService.getUriLabel(resources.dirname(this.resource), true); } getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string { let description: string; switch (verbosity) { case Verbosity.SHORT: description = this.shortDescription; break; case Verbosity.LONG: description = this.longDescription; break; case Verbosity.MEDIUM: default: description = this.mediumDescription; break; } return description; } @memoize private get shortTitle(): string { return this.getName(); } @memoize private get mediumTitle(): string { return this.labelService.getUriLabel(this.resource, true); } @memoize private get longTitle(): string { return this.labelService.getUriLabel(this.resource); } getTitle(verbosity: Verbosity): string { let title: string; switch (verbosity) { case Verbosity.SHORT: title = this.shortTitle; break; case Verbosity.MEDIUM: title = this.mediumTitle; break; case Verbosity.LONG: title = this.longTitle; break; } return this.decorateLabel(title); } private decorateLabel(label: string): string { const model = this.textFileService.models.get(this.resource); if (model && model.hasState(ModelState.ORPHAN)) { return localize('orphanedFile', "{0} (deleted from disk)", label); } if (model && model.isReadonly()) { return localize('readonlyFile', "{0} (read-only)", label); } return label; } isDirty(): boolean { const model = this.textFileService.models.get(this.resource); if (!model) { return false; } if (model.hasState(ModelState.CONFLICT) || model.hasState(ModelState.ERROR)) { return true; // always indicate dirty state if we are in conflict or error state } if (this.textFileService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY) { return false; // fast auto save enabled so we do not declare dirty } return model.isDirty(); } confirmSave(): TPromise<ConfirmResult> { return this.textFileService.confirmSave([this.resource]); } save(): TPromise<boolean> { return this.textFileService.save(this.resource); } revert(options?: IRevertOptions): TPromise<boolean> { return this.textFileService.revert(this.resource, options); } getPreferredEditorId(candidates: string[]): string { return this.forceOpenAsBinary ? BINARY_FILE_EDITOR_ID : TEXT_FILE_EDITOR_ID; } resolve(): TPromise<TextFileEditorModel | BinaryEditorModel> { // Resolve as binary if (this.forceOpenAsBinary) { return this.doResolveAsBinary(); } // Resolve as text return this.doResolveAsText(); } private doResolveAsText(): TPromise<TextFileEditorModel | BinaryEditorModel> { // Resolve as text return this.textFileService.models.loadOrCreate(this.resource, { encoding: this.preferredEncoding, reload: { async: true }, // trigger a reload of the model if it exists already but do not wait to show the model allowBinary: this.forceOpenAsText, reason: LoadReason.EDITOR }).then(model => { // This is a bit ugly, because we first resolve the model and then resolve a model reference. the reason being that binary // or very large files do not resolve to a text file model but should be opened as binary files without text. First calling into // loadOrCreate ensures we are not creating model references for these kind of resources. // In addition we have a bit of payload to take into account (encoding, reload) that the text resolver does not handle yet. if (!this.textModelReference) { this.textModelReference = this.textModelResolverService.createModelReference(this.resource); } return this.textModelReference.then(ref => ref.object as TextFileEditorModel); }, error => { // In case of an error that indicates that the file is binary or too large, just return with the binary editor model if ((<FileOperationError>error).fileOperationResult === FileOperationResult.FILE_IS_BINARY || (<FileOperationError>error).fileOperationResult === FileOperationResult.FILE_TOO_LARGE) { return this.doResolveAsBinary(); } // Bubble any other error up return TPromise.wrapError(error); }); } private doResolveAsBinary(): TPromise<BinaryEditorModel> { return this.instantiationService.createInstance(BinaryEditorModel, this.resource, this.getName()).load().then(m => m as BinaryEditorModel); } isResolved(): boolean { return !!this.textFileService.models.get(this.resource); } getTelemetryDescriptor(): object { const descriptor = super.getTelemetryDescriptor(); descriptor['resource'] = telemetryURIDescriptor(this.getResource(), path => this.hashService.createSHA1(path)); /* __GDPR__FRAGMENT__ "EditorTelemetryDescriptor" : { "resource": { "${inline}": [ "${URIDescriptor}" ] } } */ return descriptor; } dispose(): void { // Model reference if (this.textModelReference) { this.textModelReference.then(ref => ref.dispose()); this.textModelReference = null; } super.dispose(); } matches(otherInput: any): boolean { if (super.matches(otherInput) === true) { return true; } if (otherInput) { return otherInput instanceof FileEditorInput && otherInput.resource.toString() === this.resource.toString(); } return false; } }
src/vs/workbench/parts/files/common/editors/fileEditorInput.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017571474018041044, 0.00016882263298612088, 0.000161827148986049, 0.00016838264127727598, 0.0000035340729027666384 ]
{ "id": 4, "code_window": [ " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentHandlebars.desc%\"\n", " },\n", " \"html.format.endWithNewline\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentHandlebars.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 89 }
{ "type": "dark", "colors": { "dropdown.background": "#525252", "list.activeSelectionBackground": "#707070", "list.focusBackground": "#707070", "list.inactiveSelectionBackground": "#4e4e4e", "list.hoverBackground": "#444444", "list.highlightForeground": "#e58520", "button.background": "#565656", "editor.background": "#1e1e1e", "editor.foreground": "#c5c8c6", "editor.selectionBackground": "#676b7180", "editor.selectionHighlightBackground": "#575b6180", "editor.lineHighlightBackground": "#303030", "editorLineNumber.activeForeground": "#949494", "editor.wordHighlightBackground": "#4747a180", "editor.wordHighlightStrongBackground": "#6767ce80", "editorCursor.foreground": "#c07020", "editorWhitespace.foreground": "#505037", "editorIndentGuide.background": "#505037", "editorIndentGuide.activeBackground": "#707057", "editorGroupHeader.tabsBackground": "#282828", "tab.inactiveBackground": "#404040", "tab.border": "#303030", "tab.inactiveForeground": "#d8d8d8", "peekView.border": "#3655b5", "panelTitle.activeForeground": "#ffffff", "statusBar.background": "#505050", "statusBar.debuggingBackground": "#505050", "statusBar.noFolderBackground": "#505050", "titleBar.activeBackground": "#505050", "activityBar.background": "#353535", "activityBar.foreground": "#ffffff", "activityBarBadge.background": "#3655b5", "sideBar.background": "#272727", "sideBarSectionHeader.background": "#505050", "pickerGroup.foreground": "#b0b0b0", "terminal.ansiWhite": "#ffffff", "inputOption.activeBorder": "#3655b5", "focusBorder": "#3655b5" }, "tokenColors": [ { "settings": { "background": "#1e1e1e", "foreground": "#C5C8C6" } }, { "name": "By uonick", "settings": { "background": "#202025ff", "foreground": "#c5c8c6ff" } }, { "scope": [ "meta.embedded", "source.groovy.embedded" ], "settings": { "background": "#1e1e1e", "foreground": "#C5C8C6" } }, { "name": "Comment", "scope": "comment", "settings": { "fontStyle": "", "foreground": "#9A9B99" } }, { "name": "String", "scope": "string", "settings": { "fontStyle": "", "foreground": "#9AA83A" } }, { "name": "String Embedded Source", "scope": "string source", "settings": { "fontStyle": "", "foreground": "#D08442" } }, { "name": "Number", "scope": "constant.numeric", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "Built-in constant", "scope": "constant.language", "settings": { "fontStyle": "", "foreground": "#408080" } }, { "name": "User-defined constant", "scope": "constant.character, constant.other", "settings": { "fontStyle": "", "foreground": "#8080FF", "background": "#1e1e1e" } }, { "name": "Keyword", "scope": "keyword", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "Support", "scope": "support", "settings": { "fontStyle": "", "foreground": "#C7444A" } }, { "name": "Storage", "scope": "storage", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Class name", "scope": "entity.name.class, entity.name.type", "settings": { "fontStyle": "", "foreground": "#9B0000", "background": "#1E1E1E" } }, { "name": "Inherited class", "scope": "entity.other.inherited-class", "settings": { "fontStyle": "", "foreground": "#C7444A" } }, { "name": "Function name", "scope": "entity.name.function", "settings": { "fontStyle": "", "foreground": "#CE6700" } }, { "name": "Function argument", "scope": "variable.parameter", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "Tag name", "scope": "entity.name.tag", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Tag attribute", "scope": "entity.other.attribute-name", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Library function", "scope": "support.function", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Keyword", "scope": "keyword", "settings": { "fontStyle": "", "foreground": "#676867" } }, { "name": "Class Variable", "scope": "variable.other, variable.js, punctuation.separator.variable", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "Meta Brace", "scope": "punctuation.section.embedded -(source string source punctuation.section.embedded), meta.brace.erb.html", "settings": { "fontStyle": "", "foreground": "#008200" } }, { "name": "Invalid", "scope": "invalid", "settings": { "fontStyle": "", "foreground": "#FF0B00" } }, { "name": "Normal Variable", "scope": "variable.other.php, variable.other.normal", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "Function Object", "scope": "meta.function-call.object", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Function Call Variable", "scope": "variable.other.property", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Keyword Control", "scope": "keyword.control", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Tag", "scope": "meta.tag", "settings": { "fontStyle": "", "foreground": "#D0B344" } }, { "name": "Tag Name", "scope": "entity.name.tag", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "Doctype", "scope": "meta.doctype, meta.tag.sgml-declaration.doctype, meta.tag.sgml.doctype", "settings": { "fontStyle": "", "foreground": "#9AA83A" } }, { "name": "Tag Inline Source", "scope": "meta.tag.inline source, text.html.php.source", "settings": { "fontStyle": "", "foreground": "#9AA83A" } }, { "name": "Tag Other", "scope": "meta.tag.other, entity.name.tag.style, entity.name.tag.script, meta.tag.block.script, source.js.embedded punctuation.definition.tag.html, source.css.embedded punctuation.definition.tag.html", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "Tag Attribute", "scope": "entity.other.attribute-name, meta.tag punctuation.definition.string", "settings": { "fontStyle": "", "foreground": "#D0B344" } }, { "name": "Tag Value", "scope": "meta.tag string -source -punctuation, text source text meta.tag string -punctuation", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "Meta Brace", "scope": "punctuation.section.embedded -(source string source punctuation.section.embedded), meta.brace.erb.html", "settings": { "fontStyle": "", "foreground": "#D0B344" } }, { "name": "HTML ID", "scope": "meta.toc-list.id", "settings": { "foreground": "#9AA83A" } }, { "name": "HTML String", "scope": "string.quoted.double.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html", "settings": { "fontStyle": "", "foreground": "#9AA83A" } }, { "name": "HTML Tags", "scope": "punctuation.definition.tag.html, punctuation.definition.tag.begin, punctuation.definition.tag.end", "settings": { "fontStyle": "", "foreground": "#6089B4" } }, { "name": "CSS ID", "scope": "meta.selector.css entity.other.attribute-name.id", "settings": { "fontStyle": "", "foreground": "#9872A2" } }, { "name": "CSS Property Name", "scope": "support.type.property-name.css", "settings": { "fontStyle": "", "foreground": "#676867" } }, { "name": "CSS Property Value", "scope": "meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css", "settings": { "fontStyle": "", "foreground": "#C7444A" } }, { "name": "JavaScript Variable", "scope": "variable.language.js", "settings": { "foreground": "#CC555A" } }, { "name": "Template Definition", "scope": [ "punctuation.definition.template-expression", "punctuation.section.embedded.coffee" ], "settings": { "foreground": "#D08442" } }, { "name": "Reset JavaScript string interpolation expression", "scope": [ "meta.template.expression" ], "settings": { "foreground": "#C5C8C6" } }, { "name": "PHP Function Call", "scope": "meta.function-call.object.php", "settings": { "fontStyle": "", "foreground": "#D0B344" } }, { "name": "PHP Single Quote HMTL Fix", "scope": "punctuation.definition.string.end.php, punctuation.definition.string.begin.php", "settings": { "foreground": "#9AA83A" } }, { "name": "PHP Parenthesis HMTL Fix", "scope": "source.php.embedded.line.html", "settings": { "foreground": "#676867" } }, { "name": "PHP Punctuation Embedded", "scope": "punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php", "settings": { "fontStyle": "", "foreground": "#D08442" } }, { "name": "Ruby Symbol", "scope": "constant.other.symbol.ruby", "settings": { "fontStyle": "", "foreground": "#9AA83A" } }, { "name": "Ruby Variable", "scope": "variable.language.ruby", "settings": { "fontStyle": "", "foreground": "#D0B344" } }, { "name": "Ruby Special Method", "scope": "keyword.other.special-method.ruby", "settings": { "fontStyle": "", "foreground": "#D9B700" } }, { "name": "Ruby Embedded Source", "scope": [ "punctuation.section.embedded.begin.ruby", "punctuation.section.embedded.end.ruby" ], "settings": { "foreground": "#D08442" } }, { "name": "SQL", "scope": "keyword.other.DML.sql", "settings": { "fontStyle": "", "foreground": "#D0B344" } }, { "name": "diff: header", "scope": "meta.diff, meta.diff.header", "settings": { "background": "#b58900", "fontStyle": "italic", "foreground": "#E0EDDD" } }, { "name": "diff: deleted", "scope": "markup.deleted", "settings": { "background": "#eee8d5", "fontStyle": "", "foreground": "#dc322f" } }, { "name": "diff: changed", "scope": "markup.changed", "settings": { "background": "#eee8d5", "fontStyle": "", "foreground": "#cb4b16" } }, { "name": "diff: inserted", "scope": "markup.inserted", "settings": { "background": "#eee8d5", "foreground": "#219186" } }, { "name": "Markup Quote", "scope": "markup.quote", "settings": { "foreground": "#9872A2" } }, { "name": "Markup Lists", "scope": "markup.list", "settings": { "foreground": "#9AA83A" } }, { "name": "Markup Styling", "scope": "markup.bold, markup.italic", "settings": { "foreground": "#6089B4" } }, { "name": "Markup Inline", "scope": "markup.inline.raw", "settings": { "fontStyle": "", "foreground": "#FF0080" } }, { "name": "Markup Headings", "scope": "markup.heading", "settings": { "foreground": "#D0B344" } }, { "name": "Markup Setext Header", "scope": "markup.heading.setext", "settings": { "fontStyle": "", "foreground": "#D0B344" } }, { "scope": "token.info-token", "settings": { "foreground": "#6796e6" } }, { "scope": "token.warn-token", "settings": { "foreground": "#cd9731" } }, { "scope": "token.error-token", "settings": { "foreground": "#f44747" } }, { "scope": "token.debug-token", "settings": { "foreground": "#b267e6" } }, { "name": "this.self", "scope": "variable.language", "settings": { "foreground": "#c7444a" } } ] }
extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017236467101611197, 0.00016991712618619204, 0.00016694446094334126, 0.0001698832493275404, 0.0000011360560847606394 ]
{ "id": 4, "code_window": [ " \"html.format.indentHandlebars\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n", " \"description\": \"%html.format.indentHandlebars.desc%\"\n", " },\n", " \"html.format.endWithNewline\": {\n", " \"type\": \"boolean\",\n", " \"scope\": \"resource\",\n", " \"default\": false,\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.indentHandlebars.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 89 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; /** * Options to be passed to the external program or shell. */ export interface CommandOptions { /** * The current working directory of the executed program or shell. * If omitted VSCode's current workspace root is used. */ cwd?: string; /** * The environment of the executed program or shell. If omitted * the parent process' environment is used. */ env?: { [key: string]: string; }; } export interface Executable { /** * The command to be executed. Can be an external program or a shell * command. */ command: string; /** * Specifies whether the command is a shell command and therefore must * be executed in a shell interpreter (e.g. cmd.exe, bash, ...). */ isShellCommand: boolean; /** * The arguments passed to the command. */ args: string[]; /** * The command options used when the command is executed. Can be omitted. */ options?: CommandOptions; } export interface ForkOptions extends CommandOptions { execArgv?: string[]; } export const enum Source { stdout, stderr } /** * The data send via a success callback */ export interface SuccessData { error?: Error; cmdCode?: number; terminated?: boolean; } /** * The data send via a error callback */ export interface ErrorData { error?: Error; terminated?: boolean; stdout?: string; stderr?: string; } export interface TerminateResponse { success: boolean; code?: TerminateResponseCode; error?: any; } export const enum TerminateResponseCode { Success = 0, Unknown = 1, AccessDenied = 2, ProcessNotFound = 3, }
src/vs/base/common/processes.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0001723766908980906, 0.0001676809770287946, 0.00016385949857067317, 0.00016806744679342955, 0.0000027746648356696824 ]
{ "id": 5, "code_window": [ " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"head, body, /html\",\n", " \"description\": \"%html.format.extraLiners.desc%\"\n", " },\n", " \"html.format.wrapAttributes\": {\n", " \"type\": \"string\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.extraLiners.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 104 }
{ "displayName": "HTML Language Features", "description": "Provides rich language support for HTML, Razor, and Handlebar files", "html.format.enable.desc": "Enable/disable default HTML formatter.", "html.format.wrapLineLength.desc": "Maximum amount of characters per line (0 = disable).", "html.format.unformatted.desc": "List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.", "html.format.contentUnformatted.desc": "List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.", "html.format.indentInnerHtml.desc": "Indent <head> and <body> sections.", "html.format.preserveNewLines.desc": "Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.", "html.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.", "html.format.indentHandlebars.desc": "Format and indent {{#foo}} and {{/foo}}.", "html.format.endWithNewline.desc": "End with a newline.", "html.format.extraLiners.desc": "List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \"head, body, /html\".", "html.format.wrapAttributes.desc": "Wrap attributes.", "html.format.wrapAttributes.auto": "Wrap attributes only when line length is exceeded.", "html.format.wrapAttributes.force": "Wrap each attribute except first.", "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", "html.format.wrapAttributesIndentSize.desc": "Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.", "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", "html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.", "html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.", "html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.", "html.autoClosingTags": "Enable/disable autoclosing of HTML tags." }
extensions/html-language-features/package.nls.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0007808494847267866, 0.0004801573231816292, 0.00016504718223586679, 0.000494575418997556, 0.00025160689256154 ]
{ "id": 5, "code_window": [ " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"head, body, /html\",\n", " \"description\": \"%html.format.extraLiners.desc%\"\n", " },\n", " \"html.format.wrapAttributes\": {\n", " \"type\": \"string\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.extraLiners.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 104 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { fromNodeEventEmitter } from 'vs/base/common/event'; import { IPCClient } from 'vs/base/parts/ipc/node/ipc'; import { Protocol } from 'vs/base/parts/ipc/node/ipc.electron'; import { ipcRenderer } from 'electron'; export class Client extends IPCClient { private static createProtocol(): Protocol { const onMessage = fromNodeEventEmitter<string>(ipcRenderer, 'ipc:message', (_, message: string) => message); ipcRenderer.send('ipc:hello'); return new Protocol(ipcRenderer, onMessage); } constructor(id: string) { super(Client.createProtocol(), id); } }
src/vs/base/parts/ipc/electron-browser/ipc.electron-browser.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017123372526839375, 0.0001703423768049106, 0.00016951673023868352, 0.00017027667490765452, 7.024981982794998e-7 ]
{ "id": 5, "code_window": [ " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"head, body, /html\",\n", " \"description\": \"%html.format.extraLiners.desc%\"\n", " },\n", " \"html.format.wrapAttributes\": {\n", " \"type\": \"string\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.extraLiners.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 104 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { Location, getLocation, createScanner, SyntaxKind, ScanError } from 'jsonc-parser'; import { basename } from 'path'; import { BowerJSONContribution } from './bowerJSONContribution'; import { PackageJSONContribution } from './packageJSONContribution'; import { XHRRequest } from 'request-light'; import { CompletionItem, CompletionItemProvider, CompletionList, TextDocument, Position, Hover, HoverProvider, CancellationToken, Range, MarkedString, DocumentSelector, languages, Disposable } from 'vscode'; export interface ISuggestionsCollector { add(suggestion: CompletionItem): void; error(message: string): void; log(message: string): void; setAsIncomplete(): void; } export interface IJSONContribution { getDocumentSelector(): DocumentSelector; getInfoContribution(fileName: string, location: Location): Thenable<MarkedString[] | null> | null; collectPropertySuggestions(fileName: string, location: Location, currentWord: string, addValue: boolean, isLast: boolean, result: ISuggestionsCollector): Thenable<any> | null; collectValueSuggestions(fileName: string, location: Location, result: ISuggestionsCollector): Thenable<any> | null; collectDefaultSuggestions(fileName: string, result: ISuggestionsCollector): Thenable<any>; resolveSuggestion?(item: CompletionItem): Thenable<CompletionItem | null> | null; } export function addJSONProviders(xhr: XHRRequest): Disposable { const contributions = [new PackageJSONContribution(xhr), new BowerJSONContribution(xhr)]; const subscriptions: Disposable[] = []; contributions.forEach(contribution => { const selector = contribution.getDocumentSelector(); subscriptions.push(languages.registerCompletionItemProvider(selector, new JSONCompletionItemProvider(contribution), '"', ':')); subscriptions.push(languages.registerHoverProvider(selector, new JSONHoverProvider(contribution))); }); return Disposable.from(...subscriptions); } export class JSONHoverProvider implements HoverProvider { constructor(private jsonContribution: IJSONContribution) { } public provideHover(document: TextDocument, position: Position, _token: CancellationToken): Thenable<Hover> | null { const fileName = basename(document.fileName); const offset = document.offsetAt(position); const location = getLocation(document.getText(), offset); if (!location.previousNode) { return null; } const node = location.previousNode; if (node && node.offset <= offset && offset <= node.offset + node.length) { const promise = this.jsonContribution.getInfoContribution(fileName, location); if (promise) { return promise.then(htmlContent => { const range = new Range(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); const result: Hover = { contents: htmlContent || [], range: range }; return result; }); } } return null; } } export class JSONCompletionItemProvider implements CompletionItemProvider { constructor(private jsonContribution: IJSONContribution) { } public resolveCompletionItem(item: CompletionItem, _token: CancellationToken): Thenable<CompletionItem | null> { if (this.jsonContribution.resolveSuggestion) { const resolver = this.jsonContribution.resolveSuggestion(item); if (resolver) { return resolver; } } return Promise.resolve(item); } public provideCompletionItems(document: TextDocument, position: Position, _token: CancellationToken): Thenable<CompletionList | null> | null { const fileName = basename(document.fileName); const currentWord = this.getCurrentWord(document, position); let overwriteRange: Range; const items: CompletionItem[] = []; let isIncomplete = false; const offset = document.offsetAt(position); const location = getLocation(document.getText(), offset); const node = location.previousNode; if (node && node.offset <= offset && offset <= node.offset + node.length && (node.type === 'property' || node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { overwriteRange = new Range(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); } else { overwriteRange = new Range(document.positionAt(offset - currentWord.length), position); } const proposed: { [key: string]: boolean } = {}; const collector: ISuggestionsCollector = { add: (suggestion: CompletionItem) => { if (!proposed[suggestion.label]) { proposed[suggestion.label] = true; suggestion.range = overwriteRange; items.push(suggestion); } }, setAsIncomplete: () => isIncomplete = true, error: (message: string) => console.error(message), log: (message: string) => console.log(message) }; let collectPromise: Thenable<any> | null = null; if (location.isAtPropertyKey) { const addValue = !location.previousNode || !location.previousNode.columnOffset; const isLast = this.isLast(document, position); collectPromise = this.jsonContribution.collectPropertySuggestions(fileName, location, currentWord, addValue, isLast, collector); } else { if (location.path.length === 0) { collectPromise = this.jsonContribution.collectDefaultSuggestions(fileName, collector); } else { collectPromise = this.jsonContribution.collectValueSuggestions(fileName, location, collector); } } if (collectPromise) { return collectPromise.then(() => { if (items.length > 0) { return new CompletionList(items, isIncomplete); } return null; }); } return null; } private getCurrentWord(document: TextDocument, position: Position) { let i = position.character - 1; const text = document.lineAt(position.line).text; while (i >= 0 && ' \t\n\r\v":{[,'.indexOf(text.charAt(i)) === -1) { i--; } return text.substring(i + 1, position.character); } private isLast(document: TextDocument, position: Position): boolean { const scanner = createScanner(document.getText(), true); scanner.setPosition(document.offsetAt(position)); let nextToken = scanner.scan(); if (nextToken === SyntaxKind.StringLiteral && scanner.getTokenError() === ScanError.UnexpectedEndOfString) { nextToken = scanner.scan(); } return nextToken === SyntaxKind.CloseBraceToken || nextToken === SyntaxKind.EOF; } } export const xhrDisabled = () => Promise.reject({ responseText: 'Use of online resources is disabled.' });
extensions/npm/src/features/jsonContributions.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0001723301684251055, 0.0001700052962405607, 0.00016768342175055295, 0.00016996150952763855, 0.0000012149291706009535 ]
{ "id": 5, "code_window": [ " ],\n", " \"scope\": \"resource\",\n", " \"default\": \"head, body, /html\",\n", " \"description\": \"%html.format.extraLiners.desc%\"\n", " },\n", " \"html.format.wrapAttributes\": {\n", " \"type\": \"string\",\n", " \"scope\": \"resource\",\n" ], "labels": [ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " \"markdownDescription\": \"%html.format.extraLiners.desc%\"\n" ], "file_path": "extensions/html-language-features/package.json", "type": "replace", "edit_start_line_idx": 104 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable } from 'vs/base/common/lifecycle'; import { assign } from 'vs/base/common/objects'; import { IRequestOptions, IRequestContext, IRequestFunction, request } from 'vs/base/node/request'; import { getProxyAgent } from 'vs/base/node/proxy'; import { IRequestService, IHTTPConfiguration } from 'vs/platform/request/node/request'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService } from 'vs/platform/log/common/log'; import { CancellationToken } from 'vs/base/common/cancellation'; /** * This service exposes the `request` API, while using the global * or configured proxy settings. */ export class RequestService implements IRequestService { _serviceBrand: any; private proxyUrl: string; private strictSSL: boolean; private authorization: string; private disposables: IDisposable[] = []; constructor( @IConfigurationService configurationService: IConfigurationService, @ILogService private logService: ILogService ) { this.configure(configurationService.getValue<IHTTPConfiguration>()); configurationService.onDidChangeConfiguration(() => this.configure(configurationService.getValue()), this, this.disposables); } private configure(config: IHTTPConfiguration) { this.proxyUrl = config.http && config.http.proxy; this.strictSSL = config.http && config.http.proxyStrictSSL; this.authorization = config.http && config.http.proxyAuthorization; } request(options: IRequestOptions, token: CancellationToken, requestFn: IRequestFunction = request): TPromise<IRequestContext> { this.logService.trace('RequestService#request', options.url); const { proxyUrl, strictSSL } = this; const agentPromise = options.agent ? TPromise.wrap(options.agent) : TPromise.wrap(getProxyAgent(options.url, { proxyUrl, strictSSL })); return agentPromise.then(agent => { options.agent = agent; options.strictSSL = strictSSL; if (this.authorization) { options.headers = assign(options.headers || {}, { 'Proxy-Authorization': this.authorization }); } return requestFn(options, token); }); } }
src/vs/platform/request/node/requestService.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017113513604272157, 0.00016792122914921492, 0.00016366090858355165, 0.00016786708147265017, 0.0000023796487766958307 ]
{ "id": 6, "code_window": [ "\t\"displayName\": \"HTML Language Features\",\n", "\t\"description\": \"Provides rich language support for HTML, Razor, and Handlebar files\",\n", "\t\"html.format.enable.desc\": \"Enable/disable default HTML formatter.\",\n", "\t\"html.format.wrapLineLength.desc\": \"Maximum amount of characters per line (0 = disable).\",\n", "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent <head> and <body> sections.\",\n", "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. `null` defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. `null` defaults to the `pre` tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent `<head>` and `<body>` sections.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 5 }
{ "displayName": "HTML Language Features", "description": "Provides rich language support for HTML, Razor, and Handlebar files", "html.format.enable.desc": "Enable/disable default HTML formatter.", "html.format.wrapLineLength.desc": "Maximum amount of characters per line (0 = disable).", "html.format.unformatted.desc": "List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.", "html.format.contentUnformatted.desc": "List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.", "html.format.indentInnerHtml.desc": "Indent <head> and <body> sections.", "html.format.preserveNewLines.desc": "Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.", "html.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.", "html.format.indentHandlebars.desc": "Format and indent {{#foo}} and {{/foo}}.", "html.format.endWithNewline.desc": "End with a newline.", "html.format.extraLiners.desc": "List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \"head, body, /html\".", "html.format.wrapAttributes.desc": "Wrap attributes.", "html.format.wrapAttributes.auto": "Wrap attributes only when line length is exceeded.", "html.format.wrapAttributes.force": "Wrap each attribute except first.", "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", "html.format.wrapAttributesIndentSize.desc": "Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.", "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", "html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.", "html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.", "html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.", "html.autoClosingTags": "Enable/disable autoclosing of HTML tags." }
extensions/html-language-features/package.nls.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.9113317131996155, 0.3051193654537201, 0.0002783383533824235, 0.003748070914298296, 0.42865920066833496 ]
{ "id": 6, "code_window": [ "\t\"displayName\": \"HTML Language Features\",\n", "\t\"description\": \"Provides rich language support for HTML, Razor, and Handlebar files\",\n", "\t\"html.format.enable.desc\": \"Enable/disable default HTML formatter.\",\n", "\t\"html.format.wrapLineLength.desc\": \"Maximum amount of characters per line (0 = disable).\",\n", "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent <head> and <body> sections.\",\n", "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. `null` defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. `null` defaults to the `pre` tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent `<head>` and `<body>` sections.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 5 }
test/**
extensions/ruby/.vscodeignore
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0001657418761169538, 0.0001657418761169538, 0.0001657418761169538, 0.0001657418761169538, 0 ]
{ "id": 6, "code_window": [ "\t\"displayName\": \"HTML Language Features\",\n", "\t\"description\": \"Provides rich language support for HTML, Razor, and Handlebar files\",\n", "\t\"html.format.enable.desc\": \"Enable/disable default HTML formatter.\",\n", "\t\"html.format.wrapLineLength.desc\": \"Maximum amount of characters per line (0 = disable).\",\n", "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent <head> and <body> sections.\",\n", "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. `null` defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. `null` defaults to the `pre` tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent `<head>` and `<body>` sections.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 5 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import * as assert from 'assert'; import { strcmp, parseTokenTheme, TokenTheme, ParsedTokenThemeRule, ColorMap, ExternalThemeTrieElement, ThemeTrieElementRule } from 'vs/editor/common/modes/supports/tokenization'; import { FontStyle } from 'vs/editor/common/modes'; suite('Token theme matching', () => { test('gives higher priority to deeper matches', () => { let theme = TokenTheme.createFromRawTokenTheme([ { token: '', foreground: '100000', background: '200000' }, { token: 'punctuation.definition.string.begin.html', foreground: '300000' }, { token: 'punctuation.definition.string', foreground: '400000' }, ], []); let colorMap = new ColorMap(); colorMap.getId('100000'); const _B = colorMap.getId('200000'); colorMap.getId('400000'); const _D = colorMap.getId('300000'); let actual = theme._match('punctuation.definition.string.begin.html'); assert.deepEqual(actual, new ThemeTrieElementRule(FontStyle.None, _D, _B)); }); test('can match', () => { let theme = TokenTheme.createFromRawTokenTheme([ { token: '', foreground: 'F8F8F2', background: '272822' }, { token: 'source', background: '100000' }, { token: 'something', background: '100000' }, { token: 'bar', background: '200000' }, { token: 'baz', background: '200000' }, { token: 'bar', fontStyle: 'bold' }, { token: 'constant', fontStyle: 'italic', foreground: '300000' }, { token: 'constant.numeric', foreground: '400000' }, { token: 'constant.numeric.hex', fontStyle: 'bold' }, { token: 'constant.numeric.oct', fontStyle: 'bold italic underline' }, { token: 'constant.numeric.dec', fontStyle: '', foreground: '500000' }, { token: 'storage.object.bar', fontStyle: '', foreground: '600000' }, ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('F8F8F2'); const _B = colorMap.getId('272822'); const _C = colorMap.getId('200000'); const _D = colorMap.getId('300000'); const _E = colorMap.getId('400000'); const _F = colorMap.getId('500000'); const _G = colorMap.getId('100000'); const _H = colorMap.getId('600000'); function assertMatch(scopeName: string, expected: ThemeTrieElementRule): void { let actual = theme._match(scopeName); assert.deepEqual(actual, expected, 'when matching <<' + scopeName + '>>'); } function assertSimpleMatch(scopeName: string, fontStyle: FontStyle, foreground: number, background: number): void { assertMatch(scopeName, new ThemeTrieElementRule(fontStyle, foreground, background)); } function assertNoMatch(scopeName: string): void { assertMatch(scopeName, new ThemeTrieElementRule(FontStyle.None, _A, _B)); } // matches defaults assertNoMatch(''); assertNoMatch('bazz'); assertNoMatch('asdfg'); // matches source assertSimpleMatch('source', FontStyle.None, _A, _G); assertSimpleMatch('source.ts', FontStyle.None, _A, _G); assertSimpleMatch('source.tss', FontStyle.None, _A, _G); // matches something assertSimpleMatch('something', FontStyle.None, _A, _G); assertSimpleMatch('something.ts', FontStyle.None, _A, _G); assertSimpleMatch('something.tss', FontStyle.None, _A, _G); // matches baz assertSimpleMatch('baz', FontStyle.None, _A, _C); assertSimpleMatch('baz.ts', FontStyle.None, _A, _C); assertSimpleMatch('baz.tss', FontStyle.None, _A, _C); // matches constant assertSimpleMatch('constant', FontStyle.Italic, _D, _B); assertSimpleMatch('constant.string', FontStyle.Italic, _D, _B); assertSimpleMatch('constant.hex', FontStyle.Italic, _D, _B); // matches constant.numeric assertSimpleMatch('constant.numeric', FontStyle.Italic, _E, _B); assertSimpleMatch('constant.numeric.baz', FontStyle.Italic, _E, _B); // matches constant.numeric.hex assertSimpleMatch('constant.numeric.hex', FontStyle.Bold, _E, _B); assertSimpleMatch('constant.numeric.hex.baz', FontStyle.Bold, _E, _B); // matches constant.numeric.oct assertSimpleMatch('constant.numeric.oct', FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, _E, _B); assertSimpleMatch('constant.numeric.oct.baz', FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, _E, _B); // matches constant.numeric.dec assertSimpleMatch('constant.numeric.dec', FontStyle.None, _F, _B); assertSimpleMatch('constant.numeric.dec.baz', FontStyle.None, _F, _B); // matches storage.object.bar assertSimpleMatch('storage.object.bar', FontStyle.None, _H, _B); assertSimpleMatch('storage.object.bar.baz', FontStyle.None, _H, _B); // does not match storage.object.bar assertSimpleMatch('storage.object.bart', FontStyle.None, _A, _B); assertSimpleMatch('storage.object', FontStyle.None, _A, _B); assertSimpleMatch('storage', FontStyle.None, _A, _B); assertSimpleMatch('bar', FontStyle.Bold, _A, _C); }); }); suite('Token theme parsing', () => { test('can parse', () => { let actual = parseTokenTheme([ { token: '', foreground: 'F8F8F2', background: '272822' }, { token: 'source', background: '100000' }, { token: 'something', background: '100000' }, { token: 'bar', background: '010000' }, { token: 'baz', background: '010000' }, { token: 'bar', fontStyle: 'bold' }, { token: 'constant', fontStyle: 'italic', foreground: 'ff0000' }, { token: 'constant.numeric', foreground: '00ff00' }, { token: 'constant.numeric.hex', fontStyle: 'bold' }, { token: 'constant.numeric.oct', fontStyle: 'bold italic underline' }, { token: 'constant.numeric.dec', fontStyle: '', foreground: '0000ff' }, ]); let expected = [ new ParsedTokenThemeRule('', 0, FontStyle.NotSet, 'F8F8F2', '272822'), new ParsedTokenThemeRule('source', 1, FontStyle.NotSet, null, '100000'), new ParsedTokenThemeRule('something', 2, FontStyle.NotSet, null, '100000'), new ParsedTokenThemeRule('bar', 3, FontStyle.NotSet, null, '010000'), new ParsedTokenThemeRule('baz', 4, FontStyle.NotSet, null, '010000'), new ParsedTokenThemeRule('bar', 5, FontStyle.Bold, null, null), new ParsedTokenThemeRule('constant', 6, FontStyle.Italic, 'ff0000', null), new ParsedTokenThemeRule('constant.numeric', 7, FontStyle.NotSet, '00ff00', null), new ParsedTokenThemeRule('constant.numeric.hex', 8, FontStyle.Bold, null, null), new ParsedTokenThemeRule('constant.numeric.oct', 9, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, null, null), new ParsedTokenThemeRule('constant.numeric.dec', 10, FontStyle.None, '0000ff', null), ]; assert.deepEqual(actual, expected); }); }); suite('Token theme resolving', () => { test('strcmp works', () => { let actual = ['bar', 'z', 'zu', 'a', 'ab', ''].sort(strcmp); let expected = ['', 'a', 'ab', 'bar', 'z', 'zu']; assert.deepEqual(actual, expected); }); test('always has defaults', () => { let actual = TokenTheme.createFromParsedTokenTheme([], []); let colorMap = new ColorMap(); const _A = colorMap.getId('000000'); const _B = colorMap.getId('ffffff'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); assert.deepEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B))); }); test('respects incoming defaults 1', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, null, null) ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('000000'); const _B = colorMap.getId('ffffff'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); assert.deepEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B))); }); test('respects incoming defaults 2', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.None, null, null) ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('000000'); const _B = colorMap.getId('ffffff'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); assert.deepEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B))); }); test('respects incoming defaults 3', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.Bold, null, null) ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('000000'); const _B = colorMap.getId('ffffff'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); assert.deepEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _A, _B))); }); test('respects incoming defaults 4', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'ff0000', null) ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('ff0000'); const _B = colorMap.getId('ffffff'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); assert.deepEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B))); }); test('respects incoming defaults 5', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, null, 'ff0000') ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('000000'); const _B = colorMap.getId('ff0000'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); assert.deepEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B))); }); test('can merge incoming defaults', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, null, 'ff0000'), new ParsedTokenThemeRule('', -1, FontStyle.NotSet, '00ff00', null), new ParsedTokenThemeRule('', -1, FontStyle.Bold, null, null), ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('00ff00'); const _B = colorMap.getId('ff0000'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); assert.deepEqual(actual.getThemeTrieElement(), new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _A, _B))); }); test('defaults are inherited', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'), new ParsedTokenThemeRule('var', -1, FontStyle.NotSet, 'ff0000', null) ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('F8F8F2'); const _B = colorMap.getId('272822'); const _C = colorMap.getId('ff0000'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); let root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), { 'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _C, _B)) }); assert.deepEqual(actual.getThemeTrieElement(), root); }); test('same rules get merged', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'), new ParsedTokenThemeRule('var', 1, FontStyle.Bold, null, null), new ParsedTokenThemeRule('var', 0, FontStyle.NotSet, 'ff0000', null), ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('F8F8F2'); const _B = colorMap.getId('272822'); const _C = colorMap.getId('ff0000'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); let root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), { 'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _C, _B)) }); assert.deepEqual(actual.getThemeTrieElement(), root); }); test('rules are inherited 1', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'), new ParsedTokenThemeRule('var', -1, FontStyle.Bold, 'ff0000', null), new ParsedTokenThemeRule('var.identifier', -1, FontStyle.NotSet, '00ff00', null), ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('F8F8F2'); const _B = colorMap.getId('272822'); const _C = colorMap.getId('ff0000'); const _D = colorMap.getId('00ff00'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); let root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), { 'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _C, _B), { 'identifier': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _D, _B)) }) }); assert.deepEqual(actual.getThemeTrieElement(), root); }); test('rules are inherited 2', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('', -1, FontStyle.NotSet, 'F8F8F2', '272822'), new ParsedTokenThemeRule('var', -1, FontStyle.Bold, 'ff0000', null), new ParsedTokenThemeRule('var.identifier', -1, FontStyle.NotSet, '00ff00', null), new ParsedTokenThemeRule('constant', 4, FontStyle.Italic, '100000', null), new ParsedTokenThemeRule('constant.numeric', 5, FontStyle.NotSet, '200000', null), new ParsedTokenThemeRule('constant.numeric.hex', 6, FontStyle.Bold, null, null), new ParsedTokenThemeRule('constant.numeric.oct', 7, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, null, null), new ParsedTokenThemeRule('constant.numeric.dec', 8, FontStyle.None, '300000', null), ], []); let colorMap = new ColorMap(); const _A = colorMap.getId('F8F8F2'); const _B = colorMap.getId('272822'); const _C = colorMap.getId('100000'); const _D = colorMap.getId('200000'); const _E = colorMap.getId('300000'); const _F = colorMap.getId('ff0000'); const _G = colorMap.getId('00ff00'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); let root = new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _A, _B), { 'var': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _F, _B), { 'identifier': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _G, _B)) }), 'constant': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Italic, _C, _B), { 'numeric': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Italic, _D, _B), { 'hex': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold, _D, _B)), 'oct': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, _D, _B)), 'dec': new ExternalThemeTrieElement(new ThemeTrieElementRule(FontStyle.None, _E, _B)), }) }) }); assert.deepEqual(actual.getThemeTrieElement(), root); }); test('custom colors are first in color map', () => { let actual = TokenTheme.createFromParsedTokenTheme([ new ParsedTokenThemeRule('var', -1, FontStyle.NotSet, 'F8F8F2', null) ], [ '000000', 'FFFFFF', '0F0F0F' ]); let colorMap = new ColorMap(); colorMap.getId('000000'); colorMap.getId('FFFFFF'); colorMap.getId('0F0F0F'); colorMap.getId('F8F8F2'); assert.deepEqual(actual.getColorMap(), colorMap.getColorMap()); }); });
src/vs/editor/test/common/modes/supports/tokenization.test.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017256892169825733, 0.00017027929425239563, 0.00016759088612161577, 0.0001702409645076841, 0.000001156717871708679 ]
{ "id": 6, "code_window": [ "\t\"displayName\": \"HTML Language Features\",\n", "\t\"description\": \"Provides rich language support for HTML, Razor, and Handlebar files\",\n", "\t\"html.format.enable.desc\": \"Enable/disable default HTML formatter.\",\n", "\t\"html.format.wrapLineLength.desc\": \"Maximum amount of characters per line (0 = disable).\",\n", "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent <head> and <body> sections.\",\n", "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.unformatted.desc\": \"List of tags, comma separated, that shouldn't be reformatted. `null` defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.\",\n", "\t\"html.format.contentUnformatted.desc\": \"List of tags, comma separated, where the content shouldn't be reformatted. `null` defaults to the `pre` tag.\",\n", "\t\"html.format.indentInnerHtml.desc\": \"Indent `<head>` and `<body>` sections.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 5 }
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;"> <rect x="3" y="3" style="opacity:0.1;fill:#FFFFFF" width="9" height="9"/> <path style="fill:#5A5A5A" d="M11,4v7H4V4H11 M12,3H3v9h9V3L12,3z"/> <line style="fill:none;stroke:#C5C5C5;stroke-miterlimit:10" x1="10" y1="7.5" x2="5" y2="7.5"/> <line style="fill:none;stroke:#C5C5C5;stroke-miterlimit:10" x1="7.5" y1="5" x2="7.5" y2="10"/> </svg>
src/vs/editor/contrib/folding/arrow-collapse-dark.svg
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00016960615175776184, 0.00016960615175776184, 0.00016960615175776184, 0.00016960615175776184, 0 ]
{ "id": 7, "code_window": [ "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n", "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent {{#foo}} and {{/foo}}.\",\n", "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n" ], "labels": [ "keep", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use `null` for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent `{{#foo}}` and `{{/foo}}`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 9 }
{ "name": "html-language-features", "displayName": "%displayName%", "description": "%description%", "version": "1.0.0", "publisher": "vscode", "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", "engines": { "vscode": "0.10.x" }, "icon": "icons/html.png", "activationEvents": [ "onLanguage:html", "onLanguage:handlebars", "onLanguage:razor" ], "enableProposedApi": true, "main": "./client/out/htmlMain", "scripts": { "compile": "gulp compile-extension:html-language-features-client compile-extension:html-language-features-server", "watch": "gulp watch-extension:html-language-features-client watch-extension:html-language-features-server", "postinstall": "cd server && yarn install", "install-client-next": "yarn add vscode-languageclient@next" }, "categories": [ "Programming Languages" ], "contributes": { "configuration": { "id": "html", "order": 20, "type": "object", "title": "HTML", "properties": { "html.format.enable": { "type": "boolean", "scope": "window", "default": true, "description": "%html.format.enable.desc%" }, "html.format.wrapLineLength": { "type": "integer", "scope": "resource", "default": 120, "description": "%html.format.wrapLineLength.desc%" }, "html.format.unformatted": { "type": [ "string", "null" ], "scope": "resource", "default": "wbr", "description": "%html.format.unformatted.desc%" }, "html.format.contentUnformatted": { "type": [ "string", "null" ], "scope": "resource", "default": "pre,code,textarea", "description": "%html.format.contentUnformatted.desc%" }, "html.format.indentInnerHtml": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.indentInnerHtml.desc%" }, "html.format.preserveNewLines": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.format.preserveNewLines.desc%" }, "html.format.maxPreserveNewLines": { "type": [ "number", "null" ], "scope": "resource", "default": null, "description": "%html.format.maxPreserveNewLines.desc%" }, "html.format.indentHandlebars": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.indentHandlebars.desc%" }, "html.format.endWithNewline": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.endWithNewline.desc%" }, "html.format.extraLiners": { "type": [ "string", "null" ], "scope": "resource", "default": "head, body, /html", "description": "%html.format.extraLiners.desc%" }, "html.format.wrapAttributes": { "type": "string", "scope": "resource", "default": "auto", "enum": [ "auto", "force", "force-aligned", "force-expand-multiline", "aligned-multiple" ], "enumDescriptions": [ "%html.format.wrapAttributes.auto%", "%html.format.wrapAttributes.force%", "%html.format.wrapAttributes.forcealign%", "%html.format.wrapAttributes.forcemultiline%", "%html.format.wrapAttributes.alignedmultiple%" ], "description": "%html.format.wrapAttributes.desc%" }, "html.suggest.angular1": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.suggest.angular1.desc%" }, "html.suggest.ionic": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.suggest.ionic.desc%" }, "html.suggest.html5": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.suggest.html5.desc%" }, "html.validate.scripts": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.validate.scripts%" }, "html.validate.styles": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.validate.styles%" }, "html.autoClosingTags": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.autoClosingTags%" }, "html.trace.server": { "type": "string", "scope": "window", "enum": [ "off", "messages", "verbose" ], "default": "off", "description": "%html.trace.server.desc%" } } } }, "dependencies": { "vscode-extension-telemetry": "0.0.18", "vscode-languageclient": "^5.1.0-next.9", "vscode-nls": "^4.0.0" }, "devDependencies": { "@types/node": "^8.10.25" } }
extensions/html-language-features/package.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.05497908219695091, 0.003612210974097252, 0.0001654313236940652, 0.00016796827549114823, 0.012290682643651962 ]
{ "id": 7, "code_window": [ "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n", "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent {{#foo}} and {{/foo}}.\",\n", "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n" ], "labels": [ "keep", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use `null` for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent `{{#foo}}` and `{{/foo}}`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 9 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; export interface IMergeRegion { name: string; header: vscode.Range; content: vscode.Range; decoratorContent: vscode.Range; } export const enum CommitType { Current, Incoming, Both } export interface IExtensionConfiguration { enableCodeLens: boolean; enableDecorations: boolean; enableEditorOverview: boolean; } export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor { commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit): Thenable<boolean>; applyEdit(type: CommitType, editor: vscode.TextEditor, edit: vscode.TextEditorEdit): void; } export interface IDocumentMergeConflictDescriptor { range: vscode.Range; current: IMergeRegion; incoming: IMergeRegion; commonAncestors: IMergeRegion[]; splitter: vscode.Range; } export interface IDocumentMergeConflictTracker { getConflicts(document: vscode.TextDocument): PromiseLike<IDocumentMergeConflict[]>; isPending(document: vscode.TextDocument): boolean; forget(document: vscode.TextDocument): void; } export interface IDocumentMergeConflictTrackerService { createTracker(origin: string): IDocumentMergeConflictTracker; forget(document: vscode.TextDocument): void; }
extensions/merge-conflict/src/interfaces.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017689990636426955, 0.00017041889077518135, 0.00016744296590331942, 0.00016980890359263867, 0.000003376738504812238 ]
{ "id": 7, "code_window": [ "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n", "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent {{#foo}} and {{/foo}}.\",\n", "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n" ], "labels": [ "keep", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use `null` for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent `{{#foo}}` and `{{/foo}}`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 9 }
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: [ { "name": "atom/language-sass", "version": "0.52.0", "license": "MIT", "repositoryURL": "https://github.com/atom/language-sass", "description": "The file syntaxes/scss.json was derived from the Atom package https://github.com/atom/language-sass which was originally converted from the TextMate bundle https://github.com/alexsancho/SASS.tmbundle." } ]
extensions/scss/OSSREADME.json
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00016860355390235782, 0.0001681227149674669, 0.00016764187603257596, 0.0001681227149674669, 4.808389348909259e-7 ]
{ "id": 7, "code_window": [ "\t\"html.format.preserveNewLines.desc\": \"Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.\",\n", "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent {{#foo}} and {{/foo}}.\",\n", "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n" ], "labels": [ "keep", "replace", "replace", "keep" ], "after_edit": [ "\t\"html.format.maxPreserveNewLines.desc\": \"Maximum number of line breaks to be preserved in one chunk. Use `null` for unlimited.\",\n", "\t\"html.format.indentHandlebars.desc\": \"Format and indent `{{#foo}}` and `{{/foo}}`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 9 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { mergeSort } from 'vs/base/common/arrays'; import { dispose, IDisposable, IReference } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser'; import { IBulkEditOptions, IBulkEditResult, IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Range } from 'vs/editor/common/core/range'; import { EndOfLineSequence, IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model'; import { isResourceFileEdit, isResourceTextEdit, ResourceFileEdit, ResourceTextEdit, WorkspaceEdit } from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ITextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService'; import { localize } from 'vs/nls'; import { IFileService } from 'vs/platform/files/common/files'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; import { emptyProgressRunner, IProgress, IProgressRunner } from 'vs/platform/progress/common/progress'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { ILabelService } from 'vs/platform/label/common/label'; abstract class Recording { static start(fileService: IFileService): Recording { let _changes = new Set<string>(); let subscription = fileService.onAfterOperation(e => { _changes.add(e.resource.toString()); }); return { stop() { return subscription.dispose(); }, hasChanged(resource) { return _changes.has(resource.toString()); } }; } abstract stop(): void; abstract hasChanged(resource: URI): boolean; } type ValidationResult = { canApply: true } | { canApply: false, reason: URI }; class ModelEditTask implements IDisposable { private readonly _model: ITextModel; protected _edits: IIdentifiedSingleEditOperation[]; private _expectedModelVersionId: number | undefined; protected _newEol: EndOfLineSequence; constructor(private readonly _modelReference: IReference<ITextEditorModel>) { this._model = this._modelReference.object.textEditorModel; this._edits = []; } dispose() { dispose(this._modelReference); } addEdit(resourceEdit: ResourceTextEdit): void { this._expectedModelVersionId = resourceEdit.modelVersionId; for (const edit of resourceEdit.edits) { if (typeof edit.eol === 'number') { // honor eol-change this._newEol = edit.eol; } if (edit.range || edit.text) { // create edit operation let range: Range; if (!edit.range) { range = this._model.getFullModelRange(); } else { range = Range.lift(edit.range); } this._edits.push(EditOperation.replaceMove(range, edit.text)); } } } validate(): ValidationResult { if (typeof this._expectedModelVersionId === 'undefined' || this._model.getVersionId() === this._expectedModelVersionId) { return { canApply: true }; } return { canApply: false, reason: this._model.uri }; } apply(): void { if (this._edits.length > 0) { this._edits = mergeSort(this._edits, (a, b) => Range.compareRangesUsingStarts(a.range, b.range)); this._model.pushStackElement(); this._model.pushEditOperations([], this._edits, () => []); this._model.pushStackElement(); } if (this._newEol !== undefined) { this._model.pushStackElement(); this._model.pushEOL(this._newEol); this._model.pushStackElement(); } } } class EditorEditTask extends ModelEditTask { private _editor: ICodeEditor; constructor(modelReference: IReference<ITextEditorModel>, editor: ICodeEditor) { super(modelReference); this._editor = editor; } apply(): void { if (this._edits.length > 0) { this._edits = mergeSort(this._edits, (a, b) => Range.compareRangesUsingStarts(a.range, b.range)); this._editor.pushUndoStop(); this._editor.executeEdits('', this._edits); this._editor.pushUndoStop(); } if (this._newEol !== undefined) { this._editor.pushUndoStop(); this._editor.getModel().pushEOL(this._newEol); this._editor.pushUndoStop(); } } } class BulkEditModel implements IDisposable { private _textModelResolverService: ITextModelService; private _edits = new Map<string, ResourceTextEdit[]>(); private _editor: ICodeEditor; private _tasks: ModelEditTask[]; private _progress: IProgress<void>; constructor( textModelResolverService: ITextModelService, editor: ICodeEditor, edits: ResourceTextEdit[], progress: IProgress<void> ) { this._textModelResolverService = textModelResolverService; this._editor = editor; this._progress = progress; edits.forEach(this.addEdit, this); } dispose(): void { this._tasks = dispose(this._tasks); } addEdit(edit: ResourceTextEdit): void { let array = this._edits.get(edit.resource.toString()); if (!array) { array = []; this._edits.set(edit.resource.toString(), array); } array.push(edit); } async prepare(): Promise<BulkEditModel> { if (this._tasks) { throw new Error('illegal state - already prepared'); } this._tasks = []; const promises: TPromise<any>[] = []; this._edits.forEach((value, key) => { const promise = this._textModelResolverService.createModelReference(URI.parse(key)).then(ref => { const model = ref.object; if (!model || !model.textEditorModel) { throw new Error(`Cannot load file ${key}`); } let task: ModelEditTask; if (this._editor && this._editor.getModel().uri.toString() === model.textEditorModel.uri.toString()) { task = new EditorEditTask(ref, this._editor); } else { task = new ModelEditTask(ref); } value.forEach(edit => task.addEdit(edit)); this._tasks.push(task); this._progress.report(undefined); }); promises.push(promise); }); await TPromise.join(promises); return this; } validate(): ValidationResult { for (const task of this._tasks) { const result = task.validate(); if (!result.canApply) { return result; } } return { canApply: true }; } apply(): void { for (const task of this._tasks) { task.apply(); this._progress.report(undefined); } } } export type Edit = ResourceFileEdit | ResourceTextEdit; export class BulkEdit { private _edits: Edit[] = []; private _editor: ICodeEditor; private _progress: IProgressRunner; constructor( editor: ICodeEditor, progress: IProgressRunner, @ILogService private readonly _logService: ILogService, @ITextModelService private readonly _textModelService: ITextModelService, @IFileService private readonly _fileService: IFileService, @ITextFileService private readonly _textFileService: ITextFileService, @ILabelService private readonly _uriLabelServie: ILabelService ) { this._editor = editor; this._progress = progress || emptyProgressRunner; } add(edits: Edit[] | Edit): void { if (Array.isArray(edits)) { this._edits.push(...edits); } else { this._edits.push(edits); } } ariaMessage(): string { const editCount = this._edits.reduce((prev, cur) => isResourceFileEdit(cur) ? prev : prev + cur.edits.length, 0); const resourceCount = this._edits.length; if (editCount === 0) { return localize('summary.0', "Made no edits"); } else if (editCount > 1 && resourceCount > 1) { return localize('summary.nm', "Made {0} text edits in {1} files", editCount, resourceCount); } else { return localize('summary.n0', "Made {0} text edits in one file", editCount, resourceCount); } } async perform(): Promise<void> { let seen = new Set<string>(); let total = 0; const groups: Edit[][] = []; let group: Edit[]; for (const edit of this._edits) { if (!group || (isResourceFileEdit(group[0]) && !isResourceFileEdit(edit)) || (isResourceTextEdit(group[0]) && !isResourceTextEdit(edit)) ) { group = []; groups.push(group); } group.push(edit); if (isResourceFileEdit(edit)) { total += 1; } else if (!seen.has(edit.resource.toString())) { seen.add(edit.resource.toString()); total += 2; } } // define total work and progress callback // for child operations this._progress.total(total); let progress: IProgress<void> = { report: _ => this._progress.worked(1) }; // do it. for (const group of groups) { if (isResourceFileEdit(group[0])) { await this._performFileEdits(<ResourceFileEdit[]>group, progress); } else { await this._performTextEdits(<ResourceTextEdit[]>group, progress); } } } private async _performFileEdits(edits: ResourceFileEdit[], progress: IProgress<void>) { this._logService.debug('_performFileEdits', JSON.stringify(edits)); for (const edit of edits) { progress.report(undefined); let options = edit.options || {}; if (edit.newUri && edit.oldUri) { // rename if (options.overwrite === undefined && options.ignoreIfExists && await this._fileService.existsFile(edit.newUri)) { continue; // not overwriting, but ignoring, and the target file exists } await this._textFileService.move(edit.oldUri, edit.newUri, options.overwrite); } else if (!edit.newUri && edit.oldUri) { // delete file if (!options.ignoreIfNotExists || await this._fileService.existsFile(edit.oldUri)) { await this._textFileService.delete(edit.oldUri, { useTrash: true, recursive: options.recursive }); } } else if (edit.newUri && !edit.oldUri) { // create file if (options.overwrite === undefined && options.ignoreIfExists && await this._fileService.existsFile(edit.newUri)) { continue; // not overwriting, but ignoring, and the target file exists } await this._textFileService.create(edit.newUri, undefined, { overwrite: options.overwrite }); } } } private async _performTextEdits(edits: ResourceTextEdit[], progress: IProgress<void>): Promise<void> { this._logService.debug('_performTextEdits', JSON.stringify(edits)); const recording = Recording.start(this._fileService); const model = new BulkEditModel(this._textModelService, this._editor, edits, progress); await model.prepare(); const conflicts = edits .filter(edit => recording.hasChanged(edit.resource)) .map(edit => this._uriLabelServie.getUriLabel(edit.resource, true)); recording.stop(); if (conflicts.length > 0) { model.dispose(); throw new Error(localize('conflict', "These files have changed in the meantime: {0}", conflicts.join(', '))); } const validationResult = model.validate(); if (validationResult.canApply === false) { throw new Error(`${validationResult.reason.toString()} has changed in the meantime`); } await model.apply(); model.dispose(); } } export class BulkEditService implements IBulkEditService { _serviceBrand: any; constructor( @ILogService private readonly _logService: ILogService, @IModelService private readonly _modelService: IModelService, @IEditorService private readonly _editorService: IEditorService, @ITextModelService private readonly _textModelService: ITextModelService, @IFileService private readonly _fileService: IFileService, @ITextFileService private readonly _textFileService: ITextFileService, @ILabelService private readonly _labelService: ILabelService ) { } apply(edit: WorkspaceEdit, options: IBulkEditOptions = {}): TPromise<IBulkEditResult> { let { edits } = edit; let codeEditor = options.editor; // First check if loaded models were not changed in the meantime for (let i = 0, len = edits.length; i < len; i++) { const edit = edits[i]; if (!isResourceFileEdit(edit) && typeof edit.modelVersionId === 'number') { let model = this._modelService.getModel(edit.resource); if (model && model.getVersionId() !== edit.modelVersionId) { // model changed in the meantime return TPromise.wrapError(new Error(`${model.uri.toString()} has changed in the meantime`)); } } } // try to find code editor // todo@joh, prefer edit that gets edited if (!codeEditor) { let candidate = this._editorService.activeTextEditorWidget; if (isCodeEditor(candidate)) { codeEditor = candidate; } } const bulkEdit = new BulkEdit(options.editor, options.progress, this._logService, this._textModelService, this._fileService, this._textFileService, this._labelService); bulkEdit.add(edits); return TPromise.wrap(bulkEdit.perform().then(() => { return { ariaSummary: bulkEdit.ariaMessage() }; }, err => { // console.log('apply FAILED'); // console.log(err); this._logService.error(err); throw err; })); } } registerSingleton(IBulkEditService, BulkEditService);
src/vs/workbench/services/bulkEdit/electron-browser/bulkEditService.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017550811753608286, 0.00017089996254071593, 0.00016463160864077508, 0.00017095230577979237, 0.0000026500847525312565 ]
{ "id": 8, "code_window": [ "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n", "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \\\"head, body, /html\\\".\",\n", "\t\"html.format.wrapAttributes.desc\": \"Wrap attributes.\",\n", "\t\"html.format.wrapAttributes.auto\": \"Wrap attributes only when line length is exceeded.\",\n", "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n" ], "labels": [ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. `null` defaults to `\\\"head, body, /html\\\"`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 12 }
{ "name": "html-language-features", "displayName": "%displayName%", "description": "%description%", "version": "1.0.0", "publisher": "vscode", "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", "engines": { "vscode": "0.10.x" }, "icon": "icons/html.png", "activationEvents": [ "onLanguage:html", "onLanguage:handlebars", "onLanguage:razor" ], "enableProposedApi": true, "main": "./client/out/htmlMain", "scripts": { "compile": "gulp compile-extension:html-language-features-client compile-extension:html-language-features-server", "watch": "gulp watch-extension:html-language-features-client watch-extension:html-language-features-server", "postinstall": "cd server && yarn install", "install-client-next": "yarn add vscode-languageclient@next" }, "categories": [ "Programming Languages" ], "contributes": { "configuration": { "id": "html", "order": 20, "type": "object", "title": "HTML", "properties": { "html.format.enable": { "type": "boolean", "scope": "window", "default": true, "description": "%html.format.enable.desc%" }, "html.format.wrapLineLength": { "type": "integer", "scope": "resource", "default": 120, "description": "%html.format.wrapLineLength.desc%" }, "html.format.unformatted": { "type": [ "string", "null" ], "scope": "resource", "default": "wbr", "description": "%html.format.unformatted.desc%" }, "html.format.contentUnformatted": { "type": [ "string", "null" ], "scope": "resource", "default": "pre,code,textarea", "description": "%html.format.contentUnformatted.desc%" }, "html.format.indentInnerHtml": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.indentInnerHtml.desc%" }, "html.format.preserveNewLines": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.format.preserveNewLines.desc%" }, "html.format.maxPreserveNewLines": { "type": [ "number", "null" ], "scope": "resource", "default": null, "description": "%html.format.maxPreserveNewLines.desc%" }, "html.format.indentHandlebars": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.indentHandlebars.desc%" }, "html.format.endWithNewline": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.format.endWithNewline.desc%" }, "html.format.extraLiners": { "type": [ "string", "null" ], "scope": "resource", "default": "head, body, /html", "description": "%html.format.extraLiners.desc%" }, "html.format.wrapAttributes": { "type": "string", "scope": "resource", "default": "auto", "enum": [ "auto", "force", "force-aligned", "force-expand-multiline", "aligned-multiple" ], "enumDescriptions": [ "%html.format.wrapAttributes.auto%", "%html.format.wrapAttributes.force%", "%html.format.wrapAttributes.forcealign%", "%html.format.wrapAttributes.forcemultiline%", "%html.format.wrapAttributes.alignedmultiple%" ], "description": "%html.format.wrapAttributes.desc%" }, "html.suggest.angular1": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.suggest.angular1.desc%" }, "html.suggest.ionic": { "type": "boolean", "scope": "resource", "default": false, "description": "%html.suggest.ionic.desc%" }, "html.suggest.html5": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.suggest.html5.desc%" }, "html.validate.scripts": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.validate.scripts%" }, "html.validate.styles": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.validate.styles%" }, "html.autoClosingTags": { "type": "boolean", "scope": "resource", "default": true, "description": "%html.autoClosingTags%" }, "html.trace.server": { "type": "string", "scope": "window", "enum": [ "off", "messages", "verbose" ], "default": "off", "description": "%html.trace.server.desc%" } } } }, "dependencies": { "vscode-extension-telemetry": "0.0.18", "vscode-languageclient": "^5.1.0-next.9", "vscode-nls": "^4.0.0" }, "devDependencies": { "@types/node": "^8.10.25" } }
extensions/html-language-features/package.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0008048103773035109, 0.00021878806001041085, 0.00016413770208600909, 0.00016970725846476853, 0.00014273702981881797 ]
{ "id": 8, "code_window": [ "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n", "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \\\"head, body, /html\\\".\",\n", "\t\"html.format.wrapAttributes.desc\": \"Wrap attributes.\",\n", "\t\"html.format.wrapAttributes.auto\": \"Wrap attributes only when line length is exceeded.\",\n", "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n" ], "labels": [ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. `null` defaults to `\\\"head, body, /html\\\"`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 12 }
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.065 13H15v2H2.056v-2h5.009zm3.661-12H7.385L8.44 2.061 7.505 3H15V1h-4.274zM3.237 9H2.056v2H15V9H3.237zm4.208-4l.995 1-.995 1H15V5H7.445z" fill="#424242"/><path d="M5.072 4.03L7.032 6 5.978 7.061l-1.96-1.97-1.961 1.97L1 6l1.96-1.97L1 2.061 2.056 1l1.96 1.97L5.977 1l1.057 1.061L5.072 4.03z" fill="#A1260D"/></svg>
src/vs/workbench/parts/extensions/electron-browser/media/clear.svg
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.000170525920111686, 0.000170525920111686, 0.000170525920111686, 0.000170525920111686, 0 ]
{ "id": 8, "code_window": [ "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n", "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \\\"head, body, /html\\\".\",\n", "\t\"html.format.wrapAttributes.desc\": \"Wrap attributes.\",\n", "\t\"html.format.wrapAttributes.auto\": \"Wrap attributes only when line length is exceeded.\",\n", "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n" ], "labels": [ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. `null` defaults to `\\\"head, body, /html\\\"`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 12 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /* ---------- Find input ---------- */ .monaco-findInput { position: relative; } .monaco-findInput .monaco-inputbox { font-size: 13px; width: 100%; height: 25px; } .monaco-findInput > .controls { position: absolute; top: 3px; right: 2px; } .vs .monaco-findInput.disabled { background-color: #E1E1E1; } /* Theming */ .vs-dark .monaco-findInput.disabled { background-color: #333; } /* Highlighting */ .monaco-findInput.highlight-0 .controls { animation: monaco-findInput-highlight-0 100ms linear 0s; } .monaco-findInput.highlight-1 .controls { animation: monaco-findInput-highlight-1 100ms linear 0s; } .hc-black .monaco-findInput.highlight-0 .controls, .vs-dark .monaco-findInput.highlight-0 .controls { animation: monaco-findInput-highlight-dark-0 100ms linear 0s; } .hc-black .monaco-findInput.highlight-1 .controls, .vs-dark .monaco-findInput.highlight-1 .controls { animation: monaco-findInput-highlight-dark-1 100ms linear 0s; } @keyframes monaco-findInput-highlight-0 { 0% { background: rgba(253, 255, 0, 0.8); } 100% { background: transparent; } } @keyframes monaco-findInput-highlight-1 { 0% { background: rgba(253, 255, 0, 0.8); } /* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/ 99% { background: transparent; } } @keyframes monaco-findInput-highlight-dark-0 { 0% { background: rgba(255, 255, 255, 0.44); } 100% { background: transparent; } } @keyframes monaco-findInput-highlight-dark-1 { 0% { background: rgba(255, 255, 255, 0.44); } /* Made intentionally different such that the CSS minifier does not collapse the two animations into a single one*/ 99% { background: transparent; } }
src/vs/base/browser/ui/findinput/findInput.css
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017671060049906373, 0.00017396990733686835, 0.00017131979984696954, 0.00017406500410288572, 0.000001597007326381572 ]
{ "id": 8, "code_window": [ "\t\"html.format.endWithNewline.desc\": \"End with a newline.\",\n", "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \\\"head, body, /html\\\".\",\n", "\t\"html.format.wrapAttributes.desc\": \"Wrap attributes.\",\n", "\t\"html.format.wrapAttributes.auto\": \"Wrap attributes only when line length is exceeded.\",\n", "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n" ], "labels": [ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "\t\"html.format.extraLiners.desc\": \"List of tags, comma separated, that should have an extra newline before them. `null` defaults to `\\\"head, body, /html\\\"`.\",\n" ], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 12 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { isWindows, isMacintosh } from 'vs/base/common/platform'; import { systemPreferences } from 'electron'; import { IStateService } from 'vs/platform/state/common/state'; export const DEFAULT_BG_LIGHT = '#FFFFFF'; export const DEFAULT_BG_DARK = '#1E1E1E'; export const DEFAULT_BG_HC_BLACK = '#000000'; export const THEME_STORAGE_KEY = 'theme'; export const THEME_BG_STORAGE_KEY = 'themeBackground'; export function getBackgroundColor(stateService: IStateService): string { if (isWindows && systemPreferences.isInvertedColorScheme()) { return DEFAULT_BG_HC_BLACK; } let background = stateService.getItem<string>(THEME_BG_STORAGE_KEY, null); if (!background) { let baseTheme: string; if (isWindows && systemPreferences.isInvertedColorScheme()) { baseTheme = 'hc-black'; } else { baseTheme = stateService.getItem<string>(THEME_STORAGE_KEY, 'vs-dark').split(' ')[0]; } background = (baseTheme === 'hc-black') ? DEFAULT_BG_HC_BLACK : (baseTheme === 'vs' ? DEFAULT_BG_LIGHT : DEFAULT_BG_DARK); } if (isMacintosh && background.toUpperCase() === DEFAULT_BG_DARK) { background = '#171717'; // https://github.com/electron/electron/issues/5150 } return background; }
src/vs/code/electron-main/theme.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017229336663149297, 0.0001699179847491905, 0.00016686346498318017, 0.00016997997590806335, 0.0000021517732875508955 ]
{ "id": 9, "code_window": [ "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n", "\t\"html.format.wrapAttributes.alignedmultiple\": \"Wrap when line length is exceeded, align attributes vertically.\",\n", "\t\"html.format.wrapAttributesIndentSize.desc\": \"Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.\",\n", "\t\"html.suggest.angular1.desc\": \"Controls whether the built-in HTML language support suggests Angular V1 tags and properties.\",\n", "\t\"html.suggest.ionic.desc\": \"Controls whether the built-in HTML language support suggests Ionic tags, properties and values.\",\n", "\t\"html.suggest.html5.desc\": \"Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.\",\n", "\t\"html.trace.server.desc\": \"Traces the communication between VS Code and the HTML language server.\",\n", "\t\"html.validate.scripts\": \"Controls whether the built-in HTML language support validates embedded scripts.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 19 }
{ "displayName": "HTML Language Features", "description": "Provides rich language support for HTML, Razor, and Handlebar files", "html.format.enable.desc": "Enable/disable default HTML formatter.", "html.format.wrapLineLength.desc": "Maximum amount of characters per line (0 = disable).", "html.format.unformatted.desc": "List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.", "html.format.contentUnformatted.desc": "List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.", "html.format.indentInnerHtml.desc": "Indent <head> and <body> sections.", "html.format.preserveNewLines.desc": "Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.", "html.format.maxPreserveNewLines.desc": "Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.", "html.format.indentHandlebars.desc": "Format and indent {{#foo}} and {{/foo}}.", "html.format.endWithNewline.desc": "End with a newline.", "html.format.extraLiners.desc": "List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \"head, body, /html\".", "html.format.wrapAttributes.desc": "Wrap attributes.", "html.format.wrapAttributes.auto": "Wrap attributes only when line length is exceeded.", "html.format.wrapAttributes.force": "Wrap each attribute except first.", "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", "html.format.wrapAttributesIndentSize.desc": "Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.", "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", "html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.", "html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.", "html.validate.styles": "Controls whether the built-in HTML language support validates embedded styles.", "html.autoClosingTags": "Enable/disable autoclosing of HTML tags." }
extensions/html-language-features/package.nls.json
1
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.9925118684768677, 0.4111619293689728, 0.0006182324141263962, 0.2403557300567627, 0.4225670397281647 ]
{ "id": 9, "code_window": [ "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n", "\t\"html.format.wrapAttributes.alignedmultiple\": \"Wrap when line length is exceeded, align attributes vertically.\",\n", "\t\"html.format.wrapAttributesIndentSize.desc\": \"Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.\",\n", "\t\"html.suggest.angular1.desc\": \"Controls whether the built-in HTML language support suggests Angular V1 tags and properties.\",\n", "\t\"html.suggest.ionic.desc\": \"Controls whether the built-in HTML language support suggests Ionic tags, properties and values.\",\n", "\t\"html.suggest.html5.desc\": \"Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.\",\n", "\t\"html.trace.server.desc\": \"Traces the communication between VS Code and the HTML language server.\",\n", "\t\"html.validate.scripts\": \"Controls whether the built-in HTML language support validates embedded scripts.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 19 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { IMarkdownString } from 'vs/base/common/htmlContent'; import { URI } from 'vs/base/common/uri'; import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; import { LineTokens } from 'vs/editor/common/core/lineTokens'; import { IDisposable } from 'vs/base/common/lifecycle'; import { Position, IPosition } from 'vs/editor/common/core/position'; import { Range, IRange } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { ModelRawContentChangedEvent, IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelOptionsChangedEvent, IModelLanguageConfigurationChangedEvent, IModelTokensChangedEvent, IModelContentChange } from 'vs/editor/common/model/textModelEvents'; import { ThemeColor } from 'vs/platform/theme/common/themeService'; import { ITextSnapshot } from 'vs/platform/files/common/files'; import { SearchData } from 'vs/editor/common/model/textModelSearch'; /** * Vertical Lane in the overview ruler of the editor. */ export enum OverviewRulerLane { Left = 1, Center = 2, Right = 4, Full = 7 } /** * Options for rendering a model decoration in the overview ruler. */ export interface IModelDecorationOverviewRulerOptions { /** * CSS color to render in the overview ruler. * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ color: string | ThemeColor; /** * CSS color to render in the overview ruler. * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ darkColor: string | ThemeColor; /** * CSS color to render in the overview ruler. * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry */ hcColor?: string | ThemeColor; /** * The position in the overview ruler. */ position: OverviewRulerLane; } /** * Options for a model decoration. */ export interface IModelDecorationOptions { /** * Customize the growing behavior of the decoration when typing at the edges of the decoration. * Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */ stickiness?: TrackedRangeStickiness; /** * CSS class name describing the decoration. */ className?: string; /** * Message to be rendered when hovering over the glyph margin decoration. */ glyphMarginHoverMessage?: IMarkdownString | IMarkdownString[]; /** * Array of MarkdownString to render as the decoration message. */ hoverMessage?: IMarkdownString | IMarkdownString[]; /** * Should the decoration expand to encompass a whole line. */ isWholeLine?: boolean; /** * Always render the decoration (even when the range it encompasses is collapsed). * @internal */ showIfCollapsed?: boolean; /** * Specifies the stack order of a decoration. * A decoration with greater stack order is always in front of a decoration with a lower stack order. */ zIndex?: number; /** * If set, render this decoration in the overview ruler. */ overviewRuler?: IModelDecorationOverviewRulerOptions; /** * If set, the decoration will be rendered in the glyph margin with this CSS class name. */ glyphMarginClassName?: string; /** * If set, the decoration will be rendered in the lines decorations with this CSS class name. */ linesDecorationsClassName?: string; /** * If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name. */ marginClassName?: string; /** * If set, the decoration will be rendered inline with the text with this CSS class name. * Please use this only for CSS rules that must impact the text. For example, use `className` * to have a background color decoration. */ inlineClassName?: string; /** * If there is an `inlineClassName` which affects letter spacing. */ inlineClassNameAffectsLetterSpacing?: boolean; /** * If set, the decoration will be rendered before the text with this CSS class name. */ beforeContentClassName?: string; /** * If set, the decoration will be rendered after the text with this CSS class name. */ afterContentClassName?: string; } /** * New model decorations. */ export interface IModelDeltaDecoration { /** * Range that this decoration covers. */ range: IRange; /** * Options associated with this decoration. */ options: IModelDecorationOptions; } /** * A decoration in the model. */ export interface IModelDecoration { /** * Identifier for a decoration. */ readonly id: string; /** * Identifier for a decoration's owener. */ readonly ownerId: number; /** * Range that this decoration covers. */ readonly range: Range; /** * Options associated with this decoration. */ readonly options: IModelDecorationOptions; } /** * An accessor that can add, change or remove model decorations. * @internal */ export interface IModelDecorationsChangeAccessor { /** * Add a new decoration. * @param range Range that this decoration covers. * @param options Options associated with this decoration. * @return An unique identifier associated with this decoration. */ addDecoration(range: IRange, options: IModelDecorationOptions): string; /** * Change the range that an existing decoration covers. * @param id The unique identifier associated with the decoration. * @param newRange The new range that this decoration covers. */ changeDecoration(id: string, newRange: IRange): void; /** * Change the options associated with an existing decoration. * @param id The unique identifier associated with the decoration. * @param newOptions The new options associated with this decoration. */ changeDecorationOptions(id: string, newOptions: IModelDecorationOptions): void; /** * Remove an existing decoration. * @param id The unique identifier associated with the decoration. */ removeDecoration(id: string): void; /** * Perform a minimum ammount of operations, in order to transform the decorations * identified by `oldDecorations` to the decorations described by `newDecorations` * and returns the new identifiers associated with the resulting decorations. * * @param oldDecorations Array containing previous decorations identifiers. * @param newDecorations Array describing what decorations should result after the call. * @return An array containing the new decorations identifiers. */ deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[]; } /** * Word inside a model. */ export interface IWordAtPosition { /** * The word. */ readonly word: string; /** * The column where the word starts. */ readonly startColumn: number; /** * The column where the word ends. */ readonly endColumn: number; } /** * End of line character preference. */ export enum EndOfLinePreference { /** * Use the end of line character identified in the text buffer. */ TextDefined = 0, /** * Use line feed (\n) as the end of line character. */ LF = 1, /** * Use carriage return and line feed (\r\n) as the end of line character. */ CRLF = 2 } /** * The default end of line to use when instantiating models. */ export enum DefaultEndOfLine { /** * Use line feed (\n) as the end of line character. */ LF = 1, /** * Use carriage return and line feed (\r\n) as the end of line character. */ CRLF = 2 } /** * End of line character preference. */ export enum EndOfLineSequence { /** * Use line feed (\n) as the end of line character. */ LF = 0, /** * Use carriage return and line feed (\r\n) as the end of line character. */ CRLF = 1 } /** * An identifier for a single edit operation. */ export interface ISingleEditOperationIdentifier { /** * Identifier major */ major: number; /** * Identifier minor */ minor: number; } /** * A single edit operation, that acts as a simple replace. * i.e. Replace text at `range` with `text` in model. */ export interface ISingleEditOperation { /** * The range to replace. This can be empty to emulate a simple insert. */ range: IRange; /** * The text to replace with. This can be null to emulate a simple delete. */ text: string; /** * This indicates that this operation has "insert" semantics. * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved. */ forceMoveMarkers?: boolean; } /** * A single edit operation, that has an identifier. */ export interface IIdentifiedSingleEditOperation { /** * An identifier associated with this single edit operation. * @internal */ identifier?: ISingleEditOperationIdentifier; /** * The range to replace. This can be empty to emulate a simple insert. */ range: Range; /** * The text to replace with. This can be null to emulate a simple delete. */ text: string; /** * This indicates that this operation has "insert" semantics. * i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved. */ forceMoveMarkers?: boolean; /** * This indicates that this operation is inserting automatic whitespace * that can be removed on next model edit operation if `config.trimAutoWhitespace` is true. * @internal */ isAutoWhitespaceEdit?: boolean; /** * This indicates that this operation is in a set of operations that are tracked and should not be "simplified". * @internal */ _isTracked?: boolean; } /** * A callback that can compute the cursor state after applying a series of edit operations. */ export interface ICursorStateComputer { /** * A callback that can compute the resulting cursors state after some edit operations have been executed. */ (inverseEditOperations: IIdentifiedSingleEditOperation[]): Selection[]; } export class TextModelResolvedOptions { _textModelResolvedOptionsBrand: void; readonly tabSize: number; readonly insertSpaces: boolean; readonly defaultEOL: DefaultEndOfLine; readonly trimAutoWhitespace: boolean; /** * @internal */ constructor(src: { tabSize: number; insertSpaces: boolean; defaultEOL: DefaultEndOfLine; trimAutoWhitespace: boolean; }) { this.tabSize = src.tabSize | 0; this.insertSpaces = Boolean(src.insertSpaces); this.defaultEOL = src.defaultEOL | 0; this.trimAutoWhitespace = Boolean(src.trimAutoWhitespace); } /** * @internal */ public equals(other: TextModelResolvedOptions): boolean { return ( this.tabSize === other.tabSize && this.insertSpaces === other.insertSpaces && this.defaultEOL === other.defaultEOL && this.trimAutoWhitespace === other.trimAutoWhitespace ); } /** * @internal */ public createChangeEvent(newOpts: TextModelResolvedOptions): IModelOptionsChangedEvent { return { tabSize: this.tabSize !== newOpts.tabSize, insertSpaces: this.insertSpaces !== newOpts.insertSpaces, trimAutoWhitespace: this.trimAutoWhitespace !== newOpts.trimAutoWhitespace, }; } } /** * @internal */ export interface ITextModelCreationOptions { tabSize: number; insertSpaces: boolean; detectIndentation: boolean; trimAutoWhitespace: boolean; defaultEOL: DefaultEndOfLine; isForSimpleWidget: boolean; largeFileOptimizations: boolean; } export interface ITextModelUpdateOptions { tabSize?: number; insertSpaces?: boolean; trimAutoWhitespace?: boolean; } export class FindMatch { _findMatchBrand: void; public readonly range: Range; public readonly matches: string[]; /** * @internal */ constructor(range: Range, matches: string[]) { this.range = range; this.matches = matches; } } /** * @internal */ export interface IFoundBracket { range: Range; open: string; close: string; isOpen: boolean; } /** * Describes the behavior of decorations when typing/editing near their edges. * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior` */ export enum TrackedRangeStickiness { AlwaysGrowsWhenTypingAtEdges = 0, NeverGrowsWhenTypingAtEdges = 1, GrowsOnlyWhenTypingBefore = 2, GrowsOnlyWhenTypingAfter = 3, } /** * @internal */ export interface IActiveIndentGuideInfo { startLineNumber: number; endLineNumber: number; indent: number; } /** * A model. */ export interface ITextModel { /** * Gets the resource associated with this editor model. */ readonly uri: URI; /** * A unique identifier associated with this model. */ readonly id: string; /** * This model is constructed for a simple widget code editor. * @internal */ readonly isForSimpleWidget: boolean; /** * If true, the text model might contain RTL. * If false, the text model **contains only** contain LTR. * @internal */ mightContainRTL(): boolean; /** * If true, the text model might contain non basic ASCII. * If false, the text model **contains only** basic ASCII. * @internal */ mightContainNonBasicASCII(): boolean; /** * Get the resolved options for this model. */ getOptions(): TextModelResolvedOptions; /** * Get the current version id of the model. * Anytime a change happens to the model (even undo/redo), * the version id is incremented. */ getVersionId(): number; /** * Get the alternative version id of the model. * This alternative version id is not always incremented, * it will return the same values in the case of undo-redo. */ getAlternativeVersionId(): number; /** * Replace the entire text buffer value contained in this model. */ setValue(newValue: string): void; /** * Replace the entire text buffer value contained in this model. * @internal */ setValueFromTextBuffer(newValue: ITextBuffer): void; /** * Get the text stored in this model. * @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`. * @param preserverBOM Preserve a BOM character if it was detected when the model was constructed. * @return The text. */ getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string; /** * Get the text stored in this model. * @param preserverBOM Preserve a BOM character if it was detected when the model was constructed. * @return The text snapshot (it is safe to consume it asynchronously). * @internal */ createSnapshot(preserveBOM?: boolean): ITextSnapshot; /** * Get the length of the text stored in this model. */ getValueLength(eol?: EndOfLinePreference, preserveBOM?: boolean): number; /** * Check if the raw text stored in this model equals another raw text. * @internal */ equalsTextBuffer(other: ITextBuffer): boolean; /** * Get the text in a certain range. * @param range The range describing what text to get. * @param eol The end of line character preference. This will only be used for multiline ranges. Defaults to `EndOfLinePreference.TextDefined`. * @return The text. */ getValueInRange(range: IRange, eol?: EndOfLinePreference): string; /** * Get the length of text in a certain range. * @param range The range describing what text length to get. * @return The text length. */ getValueLengthInRange(range: IRange): number; /** * Splits characters in two buckets. First bucket (A) is of characters that * sit in lines with length < `LONG_LINE_BOUNDARY`. Second bucket (B) is of * characters that sit in lines with length >= `LONG_LINE_BOUNDARY`. * If count(B) > count(A) return true. Returns false otherwise. * @internal */ isDominatedByLongLines(): boolean; /** * Get the number of lines in the model. */ getLineCount(): number; /** * Get the text for a certain line. */ getLineContent(lineNumber: number): string; /** * Get the text length for a certain line. */ getLineLength(lineNumber: number): number; /** * Get the text for all lines. */ getLinesContent(): string[]; /** * Get the end of line sequence predominantly used in the text buffer. * @return EOL char sequence (e.g.: '\n' or '\r\n'). */ getEOL(): string; /** * Get the minimum legal column for line at `lineNumber` */ getLineMinColumn(lineNumber: number): number; /** * Get the maximum legal column for line at `lineNumber` */ getLineMaxColumn(lineNumber: number): number; /** * Returns the column before the first non whitespace character for line at `lineNumber`. * Returns 0 if line is empty or contains only whitespace. */ getLineFirstNonWhitespaceColumn(lineNumber: number): number; /** * Returns the column after the last non whitespace character for line at `lineNumber`. * Returns 0 if line is empty or contains only whitespace. */ getLineLastNonWhitespaceColumn(lineNumber: number): number; /** * Create a valid position, */ validatePosition(position: IPosition): Position; /** * Advances the given position by the given offest (negative offsets are also accepted) * and returns it as a new valid position. * * If the offset and position are such that their combination goes beyond the beginning or * end of the model, throws an exception. * * If the ofsset is such that the new position would be in the middle of a multi-byte * line terminator, throws an exception. */ modifyPosition(position: IPosition, offset: number): Position; /** * Create a valid range. */ validateRange(range: IRange): Range; /** * Converts the position to a zero-based offset. * * The position will be [adjusted](#TextDocument.validatePosition). * * @param position A position. * @return A valid zero-based offset. */ getOffsetAt(position: IPosition): number; /** * Converts a zero-based offset to a position. * * @param offset A zero-based offset. * @return A valid [position](#Position). */ getPositionAt(offset: number): Position; /** * Get a range covering the entire model */ getFullModelRange(): Range; /** * Returns if the model was disposed or not. */ isDisposed(): boolean; /** * @internal */ tokenizeViewport(startLineNumber: number, endLineNumber: number): void; /** * This model is so large that it would not be a good idea to sync it over * to web workers or other places. * @internal */ isTooLargeForSyncing(): boolean; /** * The file is so large, that even tokenization is disabled. * @internal */ isTooLargeForTokenization(): boolean; /** * Search the model. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchOnlyEditableRange Limit the searching to only search inside the editable range of the model. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if not matches have been found. */ findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchScope Limit the searching to only search inside this range. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @param limitResultCount Limit the number of results * @return The ranges where the matches are. It is empty if no matches have been found. */ findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[]; /** * Search the model for the next match. Loops to the beginning of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchStart Start the searching at the specified position. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @return The range where the next match is. It is null if no next match has been found. */ findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch; /** * Search the model for the previous match. Loops to the end of the model if needed. * @param searchString The string used to search. If it is a regular expression, set `isRegex` to true. * @param searchStart Start the searching at the specified position. * @param isRegex Used to indicate that `searchString` is a regular expression. * @param matchCase Force the matching to match lower/upper case exactly. * @param wordSeparators Force the matching to match entire words only. Pass null otherwise. * @param captureMatches The result will contain the captured groups. * @return The range where the previous match is. It is null if no previous match has been found. */ findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch; /** * Force tokenization information for `lineNumber` to be accurate. * @internal */ forceTokenization(lineNumber: number): void; /** * If it is cheap, force tokenization information for `lineNumber` to be accurate. * This is based on a heuristic. * @internal */ tokenizeIfCheap(lineNumber: number): void; /** * Check if calling `forceTokenization` for this `lineNumber` will be cheap (time-wise). * This is based on a heuristic. * @internal */ isCheapToTokenize(lineNumber: number): boolean; /** * Get the tokens for the line `lineNumber`. * The tokens might be inaccurate. Use `forceTokenization` to ensure accurate tokens. * @internal */ getLineTokens(lineNumber: number): LineTokens; /** * Get the language associated with this model. * @internal */ getLanguageIdentifier(): LanguageIdentifier; /** * Get the language associated with this model. */ getModeId(): string; /** * Set the current language mode associated with the model. * @internal */ setMode(languageIdentifier: LanguageIdentifier): void; /** * Returns the real (inner-most) language mode at a given position. * The result might be inaccurate. Use `forceTokenization` to ensure accurate tokens. * @internal */ getLanguageIdAtPosition(lineNumber: number, column: number): LanguageId; /** * Get the word under or besides `position`. * @param position The position to look for a word. * @return The word under or besides `position`. Might be null. */ getWordAtPosition(position: IPosition): IWordAtPosition; /** * Get the word under or besides `position` trimmed to `position`.column * @param position The position to look for a word. * @return The word under or besides `position`. Will never be null. */ getWordUntilPosition(position: IPosition): IWordAtPosition; /** * Find the matching bracket of `request` up, counting brackets. * @param request The bracket we're searching for * @param position The position at which to start the search. * @return The range of the matching bracket, or null if the bracket match was not found. * @internal */ findMatchingBracketUp(bracket: string, position: IPosition): Range; /** * Find the first bracket in the model before `position`. * @param position The position at which to start the search. * @return The info for the first bracket before `position`, or null if there are no more brackets before `positions`. * @internal */ findPrevBracket(position: IPosition): IFoundBracket; /** * Find the first bracket in the model after `position`. * @param position The position at which to start the search. * @return The info for the first bracket after `position`, or null if there are no more brackets after `positions`. * @internal */ findNextBracket(position: IPosition): IFoundBracket; /** * Given a `position`, if the position is on top or near a bracket, * find the matching bracket of that bracket and return the ranges of both brackets. * @param position The position at which to look for a bracket. * @internal */ matchBracket(position: IPosition): [Range, Range]; /** * @internal */ getActiveIndentGuide(lineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo; /** * @internal */ getLinesIndentGuides(startLineNumber: number, endLineNumber: number): number[]; /** * Change the decorations. The callback will be called with a change accessor * that becomes invalid as soon as the callback finishes executing. * This allows for all events to be queued up until the change * is completed. Returns whatever the callback returns. * @param ownerId Identifies the editor id in which these decorations should appear. If no `ownerId` is provided, the decorations will appear in all editors that attach this model. * @internal */ changeDecorations<T>(callback: (changeAccessor: IModelDecorationsChangeAccessor) => T, ownerId?: number): T; /** * Perform a minimum ammount of operations, in order to transform the decorations * identified by `oldDecorations` to the decorations described by `newDecorations` * and returns the new identifiers associated with the resulting decorations. * * @param oldDecorations Array containing previous decorations identifiers. * @param newDecorations Array describing what decorations should result after the call. * @param ownerId Identifies the editor id in which these decorations should appear. If no `ownerId` is provided, the decorations will appear in all editors that attach this model. * @return An array containing the new decorations identifiers. */ deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[], ownerId?: number): string[]; /** * Remove all decorations that have been added with this specific ownerId. * @param ownerId The owner id to search for. * @internal */ removeAllDecorationsWithOwnerId(ownerId: number): void; /** * Get the options associated with a decoration. * @param id The decoration id. * @return The decoration options or null if the decoration was not found. */ getDecorationOptions(id: string): IModelDecorationOptions; /** * Get the range associated with a decoration. * @param id The decoration id. * @return The decoration range or null if the decoration was not found. */ getDecorationRange(id: string): Range; /** * Gets all the decorations for the line `lineNumber` as an array. * @param lineNumber The line number * @param ownerId If set, it will ignore decorations belonging to other owners. * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). * @return An array with the decorations */ getLineDecorations(lineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; /** * Gets all the decorations for the lines between `startLineNumber` and `endLineNumber` as an array. * @param startLineNumber The start line number * @param endLineNumber The end line number * @param ownerId If set, it will ignore decorations belonging to other owners. * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). * @return An array with the decorations */ getLinesDecorations(startLineNumber: number, endLineNumber: number, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; /** * Gets all the deocorations in a range as an array. Only `startLineNumber` and `endLineNumber` from `range` are used for filtering. * So for now it returns all the decorations on the same line as `range`. * @param range The range to search in * @param ownerId If set, it will ignore decorations belonging to other owners. * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). * @return An array with the decorations */ getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; /** * Gets all the decorations as an array. * @param ownerId If set, it will ignore decorations belonging to other owners. * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). */ getAllDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; /** * Gets all the decorations that should be rendered in the overview ruler as an array. * @param ownerId If set, it will ignore decorations belonging to other owners. * @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors). */ getOverviewRulerDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[]; /** * @internal */ _getTrackedRange(id: string): Range; /** * @internal */ _setTrackedRange(id: string, newRange: Range, newStickiness: TrackedRangeStickiness): string; /** * Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs). */ normalizeIndentation(str: string): string; /** * Get what is considered to be one indent (e.g. a tab character or 4 spaces, etc.). */ getOneIndent(): string; /** * Change the options of this model. */ updateOptions(newOpts: ITextModelUpdateOptions): void; /** * Detect the indentation options for this model from its content. */ detectIndentation(defaultInsertSpaces: boolean, defaultTabSize: number): void; /** * Push a stack element onto the undo stack. This acts as an undo/redo point. * The idea is to use `pushEditOperations` to edit the model and then to * `pushStackElement` to create an undo/redo stop point. */ pushStackElement(): void; /** * Push edit operations, basically editing the model. This is the preferred way * of editing the model. The edit operations will land on the undo stack. * @param beforeCursorState The cursor state before the edit operaions. This cursor state will be returned when `undo` or `redo` are invoked. * @param editOperations The edit operations. * @param cursorStateComputer A callback that can compute the resulting cursors state after the edit operations have been executed. * @return The cursor state returned by the `cursorStateComputer`. */ pushEditOperations(beforeCursorState: Selection[], editOperations: IIdentifiedSingleEditOperation[], cursorStateComputer: ICursorStateComputer): Selection[]; /** * Change the end of line sequence. This is the preferred way of * changing the eol sequence. This will land on the undo stack. */ pushEOL(eol: EndOfLineSequence): void; /** * Edit the model without adding the edits to the undo stack. * This can have dire consequences on the undo stack! See @pushEditOperations for the preferred way. * @param operations The edit operations. * @return The inverse edit operations, that, when applied, will bring the model back to the previous state. */ applyEdits(operations: IIdentifiedSingleEditOperation[]): IIdentifiedSingleEditOperation[]; /** * Change the end of line sequence without recording in the undo stack. * This can have dire consequences on the undo stack! See @pushEOL for the preferred way. */ setEOL(eol: EndOfLineSequence): void; /** * Undo edit operations until the first previous stop point created by `pushStackElement`. * The inverse edit operations will be pushed on the redo stack. * @internal */ undo(): Selection[]; /** * Is there anything in the undo stack? * @internal */ canUndo(): boolean; /** * Redo edit operations until the next stop point created by `pushStackElement`. * The inverse edit operations will be pushed on the undo stack. * @internal */ redo(): Selection[]; /** * Is there anything in the redo stack? * @internal */ canRedo(): boolean; /** * @deprecated Please use `onDidChangeContent` instead. * An event emitted when the contents of the model have changed. * @internal * @event */ onDidChangeRawContentFast(listener: (e: ModelRawContentChangedEvent) => void): IDisposable; /** * @deprecated Please use `onDidChangeContent` instead. * An event emitted when the contents of the model have changed. * @internal * @event */ onDidChangeRawContent(listener: (e: ModelRawContentChangedEvent) => void): IDisposable; /** * An event emitted when the contents of the model have changed. * @event */ onDidChangeContent(listener: (e: IModelContentChangedEvent) => void): IDisposable; /** * An event emitted when decorations of the model have changed. * @event */ onDidChangeDecorations(listener: (e: IModelDecorationsChangedEvent) => void): IDisposable; /** * An event emitted when the model options have changed. * @event */ onDidChangeOptions(listener: (e: IModelOptionsChangedEvent) => void): IDisposable; /** * An event emitted when the language associated with the model has changed. * @event */ onDidChangeLanguage(listener: (e: IModelLanguageChangedEvent) => void): IDisposable; /** * An event emitted when the language configuration associated with the model has changed. * @event */ onDidChangeLanguageConfiguration(listener: (e: IModelLanguageConfigurationChangedEvent) => void): IDisposable; /** * An event emitted when the tokens associated with the model have changed. * @event * @internal */ onDidChangeTokens(listener: (e: IModelTokensChangedEvent) => void): IDisposable; /** * An event emitted right before disposing the model. * @event */ onWillDispose(listener: () => void): IDisposable; /** * Destroy this model. This will unbind the model from the mode * and make all necessary clean-up to release this object to the GC. */ dispose(): void; /** * @internal */ onBeforeAttached(): void; /** * @internal */ onBeforeDetached(): void; /** * Returns if this model is attached to an editor or not. * @internal */ isAttachedToEditor(): boolean; /** * Returns the count of editors this model is attached to. * @internal */ getAttachedEditorCount(): number; } /** * @internal */ export interface ITextBufferBuilder { acceptChunk(chunk: string): void; finish(): ITextBufferFactory; } /** * @internal */ export interface ITextBufferFactory { create(defaultEOL: DefaultEndOfLine): ITextBuffer; getFirstLineText(lengthLimit: number): string; } /** * @internal */ export interface ITextBuffer { equals(other: ITextBuffer): boolean; mightContainRTL(): boolean; mightContainNonBasicASCII(): boolean; getBOM(): string; getEOL(): string; getOffsetAt(lineNumber: number, column: number): number; getPositionAt(offset: number): Position; getRangeAt(offset: number, length: number): Range; getValueInRange(range: Range, eol: EndOfLinePreference): string; createSnapshot(preserveBOM: boolean): ITextSnapshot; getValueLengthInRange(range: Range, eol: EndOfLinePreference): number; getLength(): number; getLineCount(): number; getLinesContent(): string[]; getLineContent(lineNumber: number): string; getLineCharCode(lineNumber: number, index: number): number; getLineLength(lineNumber: number): number; getLineFirstNonWhitespaceColumn(lineNumber: number): number; getLineLastNonWhitespaceColumn(lineNumber: number): number; setEOL(newEOL: '\r\n' | '\n'): void; applyEdits(rawOperations: IIdentifiedSingleEditOperation[], recordTrimAutoWhitespace: boolean): ApplyEditsResult; findMatchesLineByLine?(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[]; } /** * @internal */ export class ApplyEditsResult { constructor( public readonly reverseEdits: IIdentifiedSingleEditOperation[], public readonly changes: IInternalModelContentChange[], public readonly trimAutoWhitespaceLineNumbers: number[] ) { } } /** * @internal */ export interface IInternalModelContentChange extends IModelContentChange { range: Range; forceMoveMarkers: boolean; }
src/vs/editor/common/model.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00018676367471925914, 0.0001685177267063409, 0.00016104579844977707, 0.00016867590602487326, 0.0000032576820103713544 ]
{ "id": 9, "code_window": [ "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n", "\t\"html.format.wrapAttributes.alignedmultiple\": \"Wrap when line length is exceeded, align attributes vertically.\",\n", "\t\"html.format.wrapAttributesIndentSize.desc\": \"Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.\",\n", "\t\"html.suggest.angular1.desc\": \"Controls whether the built-in HTML language support suggests Angular V1 tags and properties.\",\n", "\t\"html.suggest.ionic.desc\": \"Controls whether the built-in HTML language support suggests Ionic tags, properties and values.\",\n", "\t\"html.suggest.html5.desc\": \"Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.\",\n", "\t\"html.trace.server.desc\": \"Traces the communication between VS Code and the HTML language server.\",\n", "\t\"html.validate.scripts\": \"Controls whether the built-in HTML language support validates embedded scripts.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 19 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { TPromise } from 'vs/base/common/winjs.base'; import { IRequestOptions, IRequestContext, IRequestFunction } from 'vs/base/node/request'; import { Readable } from 'stream'; import { RequestService as NodeRequestService } from 'vs/platform/request/node/requestService'; import { CancellationToken } from 'vscode'; import { canceled } from 'vs/base/common/errors'; /** * This service exposes the `request` API, while using the global * or configured proxy settings. */ export class RequestService extends NodeRequestService { request(options: IRequestOptions, token: CancellationToken): TPromise<IRequestContext> { return super.request(options, token, xhrRequest); } } export const xhrRequest: IRequestFunction = (options: IRequestOptions, token: CancellationToken): TPromise<IRequestContext> => { const xhr = new XMLHttpRequest(); return new TPromise<IRequestContext>((resolve, reject) => { xhr.open(options.type || 'GET', options.url, true, options.user, options.password); setRequestHeaders(xhr, options); xhr.responseType = 'arraybuffer'; xhr.onerror = e => reject(new Error(xhr.statusText && ('XHR failed: ' + xhr.statusText))); xhr.onload = (e) => { resolve({ res: { statusCode: xhr.status, headers: getResponseHeaders(xhr) }, stream: new class ArrayBufferStream extends Readable { private _buffer: Buffer; private _offset: number; private _length: number; constructor(arraybuffer: ArrayBuffer) { super(); this._buffer = Buffer.from(new Uint8Array(arraybuffer)); this._offset = 0; this._length = this._buffer.length; } _read(size: number) { if (this._offset < this._length) { this.push(this._buffer.slice(this._offset, (this._offset + size))); this._offset += size; } else { this.push(null); } } }(xhr.response) }); }; xhr.ontimeout = e => reject(new Error(`XHR timeout: ${options.timeout}ms`)); if (options.timeout) { xhr.timeout = options.timeout; } // TODO: remove any xhr.send(options.data as any); // cancel token.onCancellationRequested(() => { xhr.abort(); reject(canceled()); }); }); }; function setRequestHeaders(xhr: XMLHttpRequest, options: IRequestOptions): void { if (options.headers) { outer: for (let k in options.headers) { switch (k) { case 'User-Agent': case 'Accept-Encoding': case 'Content-Length': // unsafe headers continue outer; } xhr.setRequestHeader(k, options.headers[k]); } } } function getResponseHeaders(xhr: XMLHttpRequest): { [name: string]: string } { const headers: { [name: string]: string } = Object.create(null); for (const line of xhr.getAllResponseHeaders().split(/\r\n|\n|\r/g)) { if (line) { const idx = line.indexOf(':'); headers[line.substr(0, idx).trim().toLowerCase()] = line.substr(idx + 1).trim(); } } return headers; }
src/vs/platform/request/electron-browser/requestService.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.0007747188792563975, 0.00022397033171728253, 0.00016441794286947697, 0.00016991663142107427, 0.00017417833441868424 ]
{ "id": 9, "code_window": [ "\t\"html.format.wrapAttributes.force\": \"Wrap each attribute except first.\",\n", "\t\"html.format.wrapAttributes.forcealign\": \"Wrap each attribute except first and keep aligned.\",\n", "\t\"html.format.wrapAttributes.forcemultiline\": \"Wrap each attribute.\",\n", "\t\"html.format.wrapAttributes.alignedmultiple\": \"Wrap when line length is exceeded, align attributes vertically.\",\n", "\t\"html.format.wrapAttributesIndentSize.desc\": \"Attribute alignment size when using 'force-aligned' or 'aligned-multiple'. Use 'null' to use the editor indent size.\",\n", "\t\"html.suggest.angular1.desc\": \"Controls whether the built-in HTML language support suggests Angular V1 tags and properties.\",\n", "\t\"html.suggest.ionic.desc\": \"Controls whether the built-in HTML language support suggests Ionic tags, properties and values.\",\n", "\t\"html.suggest.html5.desc\": \"Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.\",\n", "\t\"html.trace.server.desc\": \"Traces the communication between VS Code and the HTML language server.\",\n", "\t\"html.validate.scripts\": \"Controls whether the built-in HTML language support validates embedded scripts.\",\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [], "file_path": "extensions/html-language-features/package.nls.json", "type": "replace", "edit_start_line_idx": 19 }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import 'vs/css!./splitview'; import { IDisposable, combinedDisposable, toDisposable, Disposable } from 'vs/base/common/lifecycle'; import { Event, mapEvent, Emitter } from 'vs/base/common/event'; import * as types from 'vs/base/common/types'; import * as dom from 'vs/base/browser/dom'; import { clamp } from 'vs/base/common/numbers'; import { range, firstIndex, pushToStart, pushToEnd } from 'vs/base/common/arrays'; import { Sash, Orientation, ISashEvent as IBaseSashEvent, SashState } from 'vs/base/browser/ui/sash/sash'; import { Color } from 'vs/base/common/color'; import { domEvent } from 'vs/base/browser/event'; export { Orientation } from 'vs/base/browser/ui/sash/sash'; export interface ISplitViewStyles { separatorBorder: Color; } const defaultStyles: ISplitViewStyles = { separatorBorder: Color.transparent }; export interface ISplitViewOptions { orientation?: Orientation; // default Orientation.VERTICAL styles?: ISplitViewStyles; orthogonalStartSash?: Sash; orthogonalEndSash?: Sash; inverseAltBehavior?: boolean; } export interface IView { readonly element: HTMLElement; readonly minimumSize: number; readonly maximumSize: number; readonly onDidChange: Event<number | undefined>; layout(size: number, orientation: Orientation): void; } interface ISashEvent { sash: Sash; start: number; current: number; alt: boolean; } interface IViewItem { view: IView; size: number; container: HTMLElement; disposable: IDisposable; layout(): void; } interface ISashItem { sash: Sash; disposable: IDisposable; } interface ISashDragState { index: number; start: number; current: number; sizes: number[]; minDelta: number; maxDelta: number; alt: boolean; disposable: IDisposable; } enum State { Idle, Busy } export type DistributeSizing = { type: 'distribute' }; export type SplitSizing = { type: 'split', index: number }; export type Sizing = DistributeSizing | SplitSizing; export namespace Sizing { export const Distribute: DistributeSizing = { type: 'distribute' }; export function Split(index: number): SplitSizing { return { type: 'split', index }; } } export class SplitView extends Disposable { readonly orientation: Orientation; // TODO@Joao have the same pattern as grid here readonly el: HTMLElement; private sashContainer: HTMLElement; private viewContainer: HTMLElement; private size = 0; private contentSize = 0; private proportions: undefined | number[] = undefined; private viewItems: IViewItem[] = []; private sashItems: ISashItem[] = []; private sashDragState: ISashDragState; private state: State = State.Idle; private inverseAltBehavior: boolean; private _onDidSashChange = this._register(new Emitter<number>()); readonly onDidSashChange = this._onDidSashChange.event; private _onDidSashReset = this._register(new Emitter<number>()); readonly onDidSashReset = this._onDidSashReset.event; get length(): number { return this.viewItems.length; } get minimumSize(): number { return this.viewItems.reduce((r, item) => r + item.view.minimumSize, 0); } get maximumSize(): number { return this.length === 0 ? Number.POSITIVE_INFINITY : this.viewItems.reduce((r, item) => r + item.view.maximumSize, 0); } private _orthogonalStartSash: Sash | undefined; get orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; } set orthogonalStartSash(sash: Sash | undefined) { for (const sashItem of this.sashItems) { sashItem.sash.orthogonalStartSash = sash; } this._orthogonalStartSash = sash; } private _orthogonalEndSash: Sash | undefined; get orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; } set orthogonalEndSash(sash: Sash | undefined) { for (const sashItem of this.sashItems) { sashItem.sash.orthogonalEndSash = sash; } this._orthogonalEndSash = sash; } get sashes(): Sash[] { return this.sashItems.map(s => s.sash); } constructor(container: HTMLElement, options: ISplitViewOptions = {}) { super(); this.orientation = types.isUndefined(options.orientation) ? Orientation.VERTICAL : options.orientation; this.inverseAltBehavior = !!options.inverseAltBehavior; this.el = document.createElement('div'); dom.addClass(this.el, 'monaco-split-view2'); dom.addClass(this.el, this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal'); container.appendChild(this.el); this.sashContainer = dom.append(this.el, dom.$('.sash-container')); this.viewContainer = dom.append(this.el, dom.$('.split-view-container')); this.style(options.styles || defaultStyles); } style(styles: ISplitViewStyles): void { if (styles.separatorBorder.isTransparent()) { dom.removeClass(this.el, 'separator-border'); this.el.style.removeProperty('--separator-border'); } else { dom.addClass(this.el, 'separator-border'); this.el.style.setProperty('--separator-border', styles.separatorBorder.toString()); } } addView(view: IView, size: number | Sizing, index = this.viewItems.length): void { if (this.state !== State.Idle) { throw new Error('Cant modify splitview'); } this.state = State.Busy; // Add view const container = dom.$('.split-view-view'); if (index === this.viewItems.length) { this.viewContainer.appendChild(container); } else { this.viewContainer.insertBefore(container, this.viewContainer.children.item(index)); } const onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size)); const containerDisposable = toDisposable(() => this.viewContainer.removeChild(container)); const disposable = combinedDisposable([onChangeDisposable, containerDisposable]); const layoutContainer = this.orientation === Orientation.VERTICAL ? () => item.container.style.height = `${item.size}px` : () => item.container.style.width = `${item.size}px`; const layout = () => { layoutContainer(); item.view.layout(item.size, this.orientation); }; let viewSize: number; if (typeof size === 'number') { viewSize = size; } else if (size.type === 'split') { viewSize = this.getViewSize(size.index) / 2; } else { viewSize = view.minimumSize; } const item: IViewItem = { view, container, size: viewSize, layout, disposable }; this.viewItems.splice(index, 0, item); // Add sash if (this.viewItems.length > 1) { const orientation = this.orientation === Orientation.VERTICAL ? Orientation.HORIZONTAL : Orientation.VERTICAL; const layoutProvider = this.orientation === Orientation.VERTICAL ? { getHorizontalSashTop: sash => this.getSashPosition(sash) } : { getVerticalSashLeft: sash => this.getSashPosition(sash) }; const sash = new Sash(this.sashContainer, layoutProvider, { orientation, orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash }); const sashEventMapper = this.orientation === Orientation.VERTICAL ? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey } as ISashEvent) : (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey } as ISashEvent); const onStart = mapEvent(sash.onDidStart, sashEventMapper); const onStartDisposable = onStart(this.onSashStart, this); const onChange = mapEvent(sash.onDidChange, sashEventMapper); const onChangeDisposable = onChange(this.onSashChange, this); const onEnd = mapEvent(sash.onDidEnd, () => firstIndex(this.sashItems, item => item.sash === sash)); const onEndDisposable = onEnd(this.onSashEnd, this); const onDidResetDisposable = sash.onDidReset(() => this._onDidSashReset.fire(firstIndex(this.sashItems, item => item.sash === sash))); const disposable = combinedDisposable([onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash]); const sashItem: ISashItem = { sash, disposable }; this.sashItems.splice(index - 1, 0, sashItem); } container.appendChild(view.element); let highPriorityIndex: number | undefined; if (typeof size !== 'number' && size.type === 'split') { highPriorityIndex = size.index; } this.relayout(index, highPriorityIndex); this.state = State.Idle; if (typeof size !== 'number' && size.type === 'distribute') { this.distributeViewSizes(); } } removeView(index: number, sizing?: Sizing): IView { if (this.state !== State.Idle) { throw new Error('Cant modify splitview'); } this.state = State.Busy; if (index < 0 || index >= this.viewItems.length) { throw new Error('Index out of bounds'); } // Remove view const viewItem = this.viewItems.splice(index, 1)[0]; viewItem.disposable.dispose(); // Remove sash if (this.viewItems.length >= 1) { const sashIndex = Math.max(index - 1, 0); const sashItem = this.sashItems.splice(sashIndex, 1)[0]; sashItem.disposable.dispose(); } this.relayout(); this.state = State.Idle; if (sizing && sizing.type === 'distribute') { this.distributeViewSizes(); } return viewItem.view; } moveView(from: number, to: number): void { if (this.state !== State.Idle) { throw new Error('Cant modify splitview'); } const size = this.getViewSize(from); const view = this.removeView(from); this.addView(view, size, to); } swapViews(from: number, to: number): void { if (this.state !== State.Idle) { throw new Error('Cant modify splitview'); } if (from > to) { return this.swapViews(to, from); } const fromSize = this.getViewSize(from); const toSize = this.getViewSize(to); const toView = this.removeView(to); const fromView = this.removeView(from); this.addView(toView, fromSize, from); this.addView(fromView, toSize, to); } private relayout(lowPriorityIndex?: number, highPriorityIndex?: number): void { const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); this.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndex, highPriorityIndex); this.distributeEmptySpace(); this.layoutViews(); this.saveProportions(); } layout(size: number): void { const previousSize = Math.max(this.size, this.contentSize); this.size = size; if (!this.proportions) { this.resize(this.viewItems.length - 1, size - previousSize); } else { for (let i = 0; i < this.viewItems.length; i++) { const item = this.viewItems[i]; item.size = clamp(Math.round(this.proportions[i] * size), item.view.minimumSize, item.view.maximumSize); } } this.distributeEmptySpace(); this.layoutViews(); } private saveProportions(): void { if (this.contentSize > 0) { this.proportions = this.viewItems.map(i => i.size / this.contentSize); } } private onSashStart({ sash, start, alt }: ISashEvent): void { const index = firstIndex(this.sashItems, item => item.sash === sash); // This way, we can press Alt while we resize a sash, macOS style! const disposable = combinedDisposable([ domEvent(document.body, 'keydown')(e => resetSashDragState(this.sashDragState.current, e.altKey)), domEvent(document.body, 'keyup')(() => resetSashDragState(this.sashDragState.current, false)) ]); const resetSashDragState = (start: number, alt: boolean) => { const sizes = this.viewItems.map(i => i.size); let minDelta = Number.NEGATIVE_INFINITY; let maxDelta = Number.POSITIVE_INFINITY; if (this.inverseAltBehavior) { alt = !alt; } if (alt) { // When we're using the last sash with Alt, we're resizing // the view to the left/up, instead of right/down as usual // Thus, we must do the inverse of the usual const isLastSash = index === this.sashItems.length - 1; if (isLastSash) { const viewItem = this.viewItems[index]; minDelta = (viewItem.view.minimumSize - viewItem.size) / 2; maxDelta = (viewItem.view.maximumSize - viewItem.size) / 2; } else { const viewItem = this.viewItems[index + 1]; minDelta = (viewItem.size - viewItem.view.maximumSize) / 2; maxDelta = (viewItem.size - viewItem.view.minimumSize) / 2; } } this.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, disposable }; }; resetSashDragState(start, alt); } private onSashChange({ current }: ISashEvent): void { const { index, start, sizes, alt, minDelta, maxDelta } = this.sashDragState; this.sashDragState.current = current; const delta = current - start; const newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta); if (alt) { const isLastSash = index === this.sashItems.length - 1; const newSizes = this.viewItems.map(i => i.size); const viewItemIndex = isLastSash ? index : index + 1; const viewItem = this.viewItems[viewItemIndex]; const newMinDelta = viewItem.size - viewItem.view.maximumSize; const newMaxDelta = viewItem.size - viewItem.view.minimumSize; const resizeIndex = isLastSash ? index - 1 : index + 1; this.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta); } this.distributeEmptySpace(); this.layoutViews(); } private onSashEnd(index: number): void { this._onDidSashChange.fire(index); this.sashDragState.disposable.dispose(); this.saveProportions(); } private onViewChange(item: IViewItem, size: number | undefined): void { const index = this.viewItems.indexOf(item); if (index < 0 || index >= this.viewItems.length) { return; } size = typeof size === 'number' ? size : item.size; size = clamp(size, item.view.minimumSize, item.view.maximumSize); if (this.inverseAltBehavior && index > 0) { // In this case, we want the view to grow or shrink both sides equally // so we just resize the "left" side by half and let `resize` do the clamping magic this.resize(index - 1, Math.floor((item.size - size) / 2)); this.distributeEmptySpace(); this.layoutViews(); } else { item.size = size; this.relayout(index, undefined); } } resizeView(index: number, size: number): void { if (this.state !== State.Idle) { throw new Error('Cant modify splitview'); } this.state = State.Busy; if (index < 0 || index >= this.viewItems.length) { return; } const item = this.viewItems[index]; size = Math.round(size); size = clamp(size, item.view.minimumSize, item.view.maximumSize); let delta = size - item.size; if (delta !== 0 && index < this.viewItems.length - 1) { const downIndexes = range(index + 1, this.viewItems.length); const collapseDown = downIndexes.reduce((r, i) => r + (this.viewItems[i].size - this.viewItems[i].view.minimumSize), 0); const expandDown = downIndexes.reduce((r, i) => r + (this.viewItems[i].view.maximumSize - this.viewItems[i].size), 0); const deltaDown = clamp(delta, -expandDown, collapseDown); this.resize(index, deltaDown); delta -= deltaDown; } if (delta !== 0 && index > 0) { const upIndexes = range(index - 1, -1); const collapseUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].size - this.viewItems[i].view.minimumSize), 0); const expandUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].view.maximumSize - this.viewItems[i].size), 0); const deltaUp = clamp(-delta, -collapseUp, expandUp); this.resize(index - 1, deltaUp); } this.distributeEmptySpace(); this.layoutViews(); this.saveProportions(); this.state = State.Idle; } distributeViewSizes(): void { const size = Math.floor(this.size / this.viewItems.length); for (let i = 0; i < this.viewItems.length - 1; i++) { this.resizeView(i, size); } } getViewSize(index: number): number { if (index < 0 || index >= this.viewItems.length) { return -1; } return this.viewItems[index].size; } private resize( index: number, delta: number, sizes = this.viewItems.map(i => i.size), lowPriorityIndex?: number, highPriorityIndex?: number, overloadMinDelta: number = Number.NEGATIVE_INFINITY, overloadMaxDelta: number = Number.POSITIVE_INFINITY ): number { if (index < 0 || index >= this.viewItems.length) { return 0; } const upIndexes = range(index, -1); const downIndexes = range(index + 1, this.viewItems.length); if (typeof highPriorityIndex === 'number') { pushToStart(upIndexes, highPriorityIndex); pushToStart(downIndexes, highPriorityIndex); } if (typeof lowPriorityIndex === 'number') { pushToEnd(upIndexes, lowPriorityIndex); pushToEnd(downIndexes, lowPriorityIndex); } const upItems = upIndexes.map(i => this.viewItems[i]); const upSizes = upIndexes.map(i => sizes[i]); const downItems = downIndexes.map(i => this.viewItems[i]); const downSizes = downIndexes.map(i => sizes[i]); const minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].view.minimumSize - sizes[i]), 0); const maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].view.maximumSize - sizes[i]), 0); const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].view.minimumSize), 0); const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].view.maximumSize), 0); const minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta); const maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta); delta = clamp(delta, minDelta, maxDelta); for (let i = 0, deltaUp = delta; i < upItems.length; i++) { const item = upItems[i]; const size = clamp(upSizes[i] + deltaUp, item.view.minimumSize, item.view.maximumSize); const viewDelta = size - upSizes[i]; deltaUp -= viewDelta; item.size = size; } for (let i = 0, deltaDown = delta; i < downItems.length; i++) { const item = downItems[i]; const size = clamp(downSizes[i] - deltaDown, item.view.minimumSize, item.view.maximumSize); const viewDelta = size - downSizes[i]; deltaDown += viewDelta; item.size = size; } return delta; } private distributeEmptySpace(): void { let contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); let emptyDelta = this.size - contentSize; for (let i = this.viewItems.length - 1; emptyDelta !== 0 && i >= 0; i--) { const item = this.viewItems[i]; const size = clamp(item.size + emptyDelta, item.view.minimumSize, item.view.maximumSize); const viewDelta = size - item.size; emptyDelta -= viewDelta; item.size = size; } } private layoutViews(): void { // Save new content size this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); // Layout views this.viewItems.forEach(item => item.layout()); // Layout sashes this.sashItems.forEach(item => item.sash.layout()); // Update sashes enablement let previous = false; const collapsesDown = this.viewItems.map(i => previous = (i.size - i.view.minimumSize > 0) || previous); previous = false; const expandsDown = this.viewItems.map(i => previous = (i.view.maximumSize - i.size > 0) || previous); const reverseViews = [...this.viewItems].reverse(); previous = false; const collapsesUp = reverseViews.map(i => previous = (i.size - i.view.minimumSize > 0) || previous).reverse(); previous = false; const expandsUp = reverseViews.map(i => previous = (i.view.maximumSize - i.size > 0) || previous).reverse(); this.sashItems.forEach((s, i) => { const min = !(collapsesDown[i] && expandsUp[i + 1]); const max = !(expandsDown[i] && collapsesUp[i + 1]); if (min && max) { s.sash.state = SashState.Disabled; } else if (min && !max) { s.sash.state = SashState.Minimum; } else if (!min && max) { s.sash.state = SashState.Maximum; } else { s.sash.state = SashState.Enabled; } }); } private getSashPosition(sash: Sash): number { let position = 0; for (let i = 0; i < this.sashItems.length; i++) { position += this.viewItems[i].size; if (this.sashItems[i].sash === sash) { return position; } } return 0; } dispose(): void { super.dispose(); this.viewItems.forEach(i => i.disposable.dispose()); this.viewItems = []; this.sashItems.forEach(i => i.disposable.dispose()); this.sashItems = []; } }
src/vs/base/browser/ui/splitview/splitview.ts
0
https://github.com/microsoft/vscode/commit/60b4b9939e5460ca3b9dc63340b6a42340207427
[ 0.00017317949095740914, 0.00017031621246133, 0.0001663747534621507, 0.0001706957700662315, 0.0000016144012988661416 ]
{ "id": 0, "code_window": [ " }\n", "})\n", "\n", "// Sync logic between headers and working/bulk headers\n", "watch(\n", " request.value.headers,\n", " (newHeadersList) => {\n", " // Sync should overwrite working headers\n", " const filteredWorkingHeaders = pipe(\n", " workingHeaders.value,\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " () => request.value.headers,\n" ], "file_path": "packages/hoppscotch-common/src/components/http/Headers.vue", "type": "replace", "edit_start_line_idx": 340 }
import parser from "yargs-parser" import { pipe } from "fp-ts/function" import * as O from "fp-ts/Option" import * as A from "fp-ts/Array" import { getDefaultRESTRequest } from "~/helpers/rest/default" import { stringArrayJoin } from "~/helpers/functional/array" const defaultRESTReq = getDefaultRESTRequest() const getProtocolFromURL = (url: string) => pipe( // get the base URL /^([^\s:@]+:[^\s:@]+@)?([^:/\s]+)([:]*)/.exec(url), O.fromNullable, O.filter((burl) => burl.length > 1), O.map((burl) => burl[2]), // set protocol to http for local URLs O.map((burl) => burl === "localhost" || burl === "2130706433" || /127(\.0){0,2}\.1/.test(burl) || /0177(\.0){0,2}\.1/.test(burl) || /0x7f(\.0){0,2}\.1/.test(burl) || /192\.168(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}/.test(burl) || /10(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/.test(burl) ? "http://" + url : "https://" + url ) ) /** * Checks if the URL is valid using the URL constructor * @param urlString URL string (with protocol) * @returns boolean whether the URL is valid using the inbuilt URL class */ const isURLValid = (urlString: string) => pipe( O.tryCatch(() => new URL(urlString)), O.isSome ) /** * Checks and returns URL object for the valid URL * @param urlText Raw URL string provided by argument parser * @returns Option of URL object */ const parseURL = (urlText: string | number) => pipe( urlText, O.fromNullable, // preprocess url string O.map((u) => u.toString().replaceAll(/[^a-zA-Z0-9_\-./?&=:@%+#,;\s]/g, "")), O.filter((u) => u.length > 0), O.chain((u) => pipe( u, // check if protocol is available O.fromPredicate( (url: string) => /^[^:\s]+(?=:\/\/)/.exec(url) !== null ), O.alt(() => getProtocolFromURL(u)) ) ), O.filter(isURLValid), O.map((u) => new URL(u)) ) /** * Processes URL string and returns the URL object * @param parsedArguments Parsed Arguments object * @returns URL object */ export function getURLObject(parsedArguments: parser.Arguments) { return pipe( // contains raw url strings parsedArguments._.slice(1), A.findFirstMap(parseURL), // no url found O.getOrElse(() => new URL(defaultRESTReq.endpoint)) ) } /** * Joins dangling params to origin * @param urlObject URL object containing origin and pathname * @param danglingParams Keys of params with empty values * @returns origin string concatenated with dangling paramas */ export function concatParams(urlObject: URL, danglingParams: string[]) { return pipe( O.Do, O.bind("originString", () => pipe( urlObject.origin, O.fromPredicate((h) => h !== "") ) ), O.map(({ originString }) => pipe( danglingParams, O.fromPredicate((dp) => dp.length > 0), O.map(stringArrayJoin("&")), O.map((h) => originString + (urlObject.pathname || "") + "?" + h), O.getOrElse(() => originString + (urlObject.pathname || "")) ) ), O.getOrElse(() => defaultRESTReq.endpoint) ) }
packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts
1
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.001429291325621307, 0.00028584658866748214, 0.0001659071131143719, 0.00017238929285667837, 0.00034531441633589566 ]
{ "id": 0, "code_window": [ " }\n", "})\n", "\n", "// Sync logic between headers and working/bulk headers\n", "watch(\n", " request.value.headers,\n", " (newHeadersList) => {\n", " // Sync should overwrite working headers\n", " const filteredWorkingHeaders = pipe(\n", " workingHeaders.value,\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " () => request.value.headers,\n" ], "file_path": "packages/hoppscotch-common/src/components/http/Headers.vue", "type": "replace", "edit_start_line_idx": 340 }
<template> <div class="flex flex-col items-center justify-between min-h-screen"> <div v-if="invalidLink" class="flex flex-col items-center justify-center flex-1" > <icon-lucide-alert-triangle class="mb-2 opacity-75 svg-icons" /> <h1 class="text-center heading"> {{ t("team.invalid_invite_link") }} </h1> <p class="mt-2 text-center"> {{ t("team.invalid_invite_link_description") }} </p> </div> <div v-else-if="loadingCurrentUser" class="flex flex-col items-center justify-center flex-1 p-4" > <HoppSmartSpinner /> </div> <div v-else-if="currentUser === null" class="flex flex-col items-center justify-center flex-1 p-4" > <h1 class="heading">{{ t("team.login_to_continue") }}</h1> <p class="mt-2">{{ t("team.login_to_continue_description") }}</p> <HoppButtonPrimary :label="t('auth.login_to_hoppscotch')" class="mt-8" @click="invokeAction('modals.login.toggle')" /> </div> <div v-else class="flex flex-col items-center justify-center flex-1 p-4"> <div v-if="inviteDetails.loading" class="flex flex-col items-center justify-center flex-1 p-4" > <HoppSmartSpinner /> </div> <div v-else> <div v-if="!inviteDetails.loading && E.isLeft(inviteDetails.data)" class="flex flex-col items-center p-4" > <icon-lucide-alert-triangle class="mb-4 svg-icons" /> <p> {{ getErrorMessage(inviteDetails.data.left) }} </p> <p class="flex flex-col items-center p-4 mt-8 border rounded border-dividerLight" > <span class="mb-4"> {{ t("team.logout_and_try_again") }} </span> <span class="flex"> <FirebaseLogout v-if="inviteDetails.data.left.type === 'gql_error'" outline /> </span> </p> </div> <div v-if=" !inviteDetails.loading && E.isRight(inviteDetails.data) && !joinTeamSuccess " class="flex flex-col items-center justify-center flex-1 p-4" > <h1 class="heading"> {{ t("team.join_team", { team: inviteDetails.data.right.teamInvitation.team.name, }) }} </h1> <p class="mt-2 text-secondaryLight"> {{ t("team.invited_to_team", { owner: inviteDetails.data.right.teamInvitation.creator.displayName ?? inviteDetails.data.right.teamInvitation.creator.email, team: inviteDetails.data.right.teamInvitation.team.name, }) }} </p> <div class="mt-8"> <HoppButtonPrimary :label=" t('team.join_team', { team: inviteDetails.data.right.teamInvitation.team.name, }) " :loading="loading" :disabled="revokedLink" @click="joinTeam" /> </div> </div> <div v-if=" !inviteDetails.loading && E.isRight(inviteDetails.data) && joinTeamSuccess " class="flex flex-col items-center justify-center flex-1 p-4" > <h1 class="heading"> {{ t("team.joined_team", { team: inviteDetails.data.right.teamInvitation.team.name, }) }} </h1> <p class="mt-2 text-secondaryLight"> {{ t("team.joined_team_description", { team: inviteDetails.data.right.teamInvitation.team.name, }) }} </p> <div class="mt-8"> <HoppButtonSecondary to="/" :icon="IconHome" filled :label="t('app.home')" /> </div> </div> </div> </div> <div class="p-4"> <HoppButtonSecondary class="tracking-wide !font-bold !text-secondaryDark" label="HOPPSCOTCH" to="/" /> </div> </div> </template> <script lang="ts"> import { computed, defineComponent } from "vue" import { useRoute } from "vue-router" import * as E from "fp-ts/Either" import * as TE from "fp-ts/TaskEither" import { pipe } from "fp-ts/function" import { GQLError } from "~/helpers/backend/GQLClient" import { useGQLQuery } from "@composables/graphql" import { GetInviteDetailsDocument, GetInviteDetailsQuery, GetInviteDetailsQueryVariables, } from "~/helpers/backend/graphql" import { acceptTeamInvitation } from "~/helpers/backend/mutations/TeamInvitation" import { initializeApp } from "~/helpers/app" import { platform } from "~/platform" import { onLoggedIn } from "@composables/auth" import { useReadonlyStream } from "@composables/stream" import { useToast } from "@composables/toast" import { useI18n } from "~/composables/i18n" import IconHome from "~icons/lucide/home" import { invokeAction } from "~/helpers/actions" type GetInviteDetailsError = | "team_invite/not_valid_viewer" | "team_invite/not_found" | "team_invite/no_invite_found" | "team_invite/email_do_not_match" | "team_invite/already_member" export default defineComponent({ layout: "empty", setup() { const route = useRoute() const inviteDetails = useGQLQuery< GetInviteDetailsQuery, GetInviteDetailsQueryVariables, GetInviteDetailsError >({ query: GetInviteDetailsDocument, variables: { inviteID: route.query.id as string, }, defer: true, }) onLoggedIn(() => { if (typeof route.query.id === "string") { inviteDetails.execute({ inviteID: route.query.id, }) } }) const probableUser = useReadonlyStream( platform.auth.getProbableUserStream(), platform.auth.getProbableUser() ) const currentUser = useReadonlyStream( platform.auth.getCurrentUserStream(), platform.auth.getCurrentUser() ) const loadingCurrentUser = computed(() => { if (!probableUser.value) return false else if (!currentUser.value) return true else return false }) return { E, inviteDetails, loadingCurrentUser, currentUser, toast: useToast(), t: useI18n(), IconHome, invokeAction, } }, data() { return { invalidLink: false, loading: false, revokedLink: false, inviteID: "", joinTeamSuccess: false, } }, beforeMount() { initializeApp() }, mounted() { if (typeof this.$route.query.id === "string") { this.inviteID = this.$route.query.id } this.invalidLink = !this.inviteID // TODO: check revokeTeamInvitation // TODO: check login user already a member }, methods: { joinTeam() { this.loading = true pipe( acceptTeamInvitation(this.inviteID), TE.matchW( () => { this.loading = false this.toast.error(`${this.t("error.something_went_wrong")}`) }, () => { this.joinTeamSuccess = true this.loading = false } ) )() }, getErrorMessage(error: GQLError<GetInviteDetailsError>) { if (error.type === "network_error") { return this.t("error.network_error") } else { switch (error.error) { case "team_invite/not_valid_viewer": return this.t("team.not_valid_viewer") case "team_invite/not_found": return this.t("team.not_found") case "team_invite/no_invite_found": return this.t("team.no_invite_found") case "team_invite/already_member": return this.t("team.already_member") case "team_invite/email_do_not_match": return this.t("team.email_do_not_match") default: return this.t("error.something_went_wrong") } } }, }, }) </script>
packages/hoppscotch-common/src/pages/join-team.vue
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0001803434279281646, 0.00016993196913972497, 0.00016612587205599993, 0.00016984566173050553, 0.0000023275622424989706 ]
{ "id": 0, "code_window": [ " }\n", "})\n", "\n", "// Sync logic between headers and working/bulk headers\n", "watch(\n", " request.value.headers,\n", " (newHeadersList) => {\n", " // Sync should overwrite working headers\n", " const filteredWorkingHeaders = pipe(\n", " workingHeaders.value,\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " () => request.value.headers,\n" ], "file_path": "packages/hoppscotch-common/src/components/http/Headers.vue", "type": "replace", "edit_start_line_idx": 340 }
<template> <div :class="{ 'rounded border border-divider': saveRequest }"> <div class="sticky z-10 flex flex-col flex-shrink-0 overflow-x-auto rounded-t bg-primary" :style=" saveRequest ? 'top: calc(-1 * var(--line-height-body))' : 'top: 0' " > <input v-model="filterText" type="search" autocomplete="off" :placeholder="t('action.search')" class="py-2 pl-4 pr-2 bg-transparent" /> <div class="flex justify-between flex-1 flex-shrink-0 border-y bg-primary border-dividerLight" > <HoppButtonSecondary :icon="IconPlus" :label="t('action.new')" class="!rounded-none" @click="displayModalAdd(true)" /> <div class="flex"> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" to="https://docs.hoppscotch.io/documentation/features/collections" blank :title="t('app.wiki')" :icon="IconHelpCircle" /> <HoppButtonSecondary v-if="!saveRequest" v-tippy="{ theme: 'tooltip' }" :title="t('modal.import_export')" :icon="IconArchive" @click="displayModalImportExport(true)" /> </div> </div> </div> <div class="flex flex-col"> <CollectionsGraphqlCollection v-for="(collection, index) in filteredCollections" :key="`collection-${index}`" :picked="picked" :name="collection.name" :collection-index="index" :collection="collection" :is-filtered="filterText.length > 0" :save-request="saveRequest" @edit-collection="editCollection(collection, index)" @add-request="addRequest($event)" @add-folder="addFolder($event)" @edit-folder="editFolder($event)" @edit-request="editRequest($event)" @duplicate-request="duplicateRequest($event)" @select-collection="$emit('use-collection', collection)" @select="$emit('select', $event)" /> </div> <div v-if="collections.length === 0" class="flex flex-col items-center justify-center p-4 text-secondaryLight" > <img :src="`/images/states/${colorMode.value}/pack.svg`" loading="lazy" class="inline-flex flex-col object-contain object-center w-16 h-16 my-4" :alt="t('empty.collections')" /> <span class="pb-4 text-center"> {{ t("empty.collections") }} </span> <HoppButtonSecondary :label="t('add.new')" filled outline @click="displayModalAdd(true)" /> </div> <div v-if="!(filteredCollections.length !== 0 || collections.length === 0)" class="flex flex-col items-center justify-center p-4 text-secondaryLight" > <icon-lucide-search class="pb-2 opacity-75 svg-icons" /> <span class="my-2 text-center"> {{ t("state.nothing_found") }} "{{ filterText }}" </span> </div> <CollectionsGraphqlAdd :show="showModalAdd" @hide-modal="displayModalAdd(false)" /> <CollectionsGraphqlEdit :show="showModalEdit" :editing-collection="editingCollection" :editing-collection-index="editingCollectionIndex" :editing-collection-name="editingCollection ? editingCollection.name : ''" @hide-modal="displayModalEdit(false)" /> <CollectionsGraphqlAddRequest :show="showModalAddRequest" :folder-path="editingFolderPath" @add-request="onAddRequest($event)" @hide-modal="displayModalAddRequest(false)" /> <CollectionsGraphqlAddFolder :show="showModalAddFolder" :folder-path="editingFolderPath" @add-folder="onAddFolder($event)" @hide-modal="displayModalAddFolder(false)" /> <CollectionsGraphqlEditFolder :show="showModalEditFolder" :collection-index="editingCollectionIndex" :folder="editingFolder" :folder-index="editingFolderIndex" :folder-path="editingFolderPath" :editing-folder-name="editingFolder ? editingFolder.name : ''" @hide-modal="displayModalEditFolder(false)" /> <CollectionsGraphqlEditRequest :show="showModalEditRequest" :folder-path="editingFolderPath" :request="editingRequest" :request-index="editingRequestIndex" :editing-request-name="editingRequest ? editingRequest.name : ''" @hide-modal="displayModalEditRequest(false)" /> <CollectionsGraphqlImportExport :show="showModalImportExport" @hide-modal="displayModalImportExport(false)" /> </div> </template> <script lang="ts"> // TODO: TypeScript + Script Setup this :) import { defineComponent } from "vue" import { cloneDeep, clone } from "lodash-es" import { graphqlCollections$, addGraphqlFolder, saveGraphqlRequestAs, } from "~/newstore/collections" import { getGQLSession, setGQLSession } from "~/newstore/GQLSession" import IconPlus from "~icons/lucide/plus" import IconHelpCircle from "~icons/lucide/help-circle" import IconArchive from "~icons/lucide/archive" import { useI18n } from "@composables/i18n" import { useReadonlyStream } from "@composables/stream" import { useColorMode } from "@composables/theming" export default defineComponent({ props: { // Whether to activate the ability to pick items (activates 'select' events) saveRequest: { type: Boolean, default: false }, picked: { type: Object, default: null }, }, emits: ["select", "use-collection"], setup() { const collections = useReadonlyStream(graphqlCollections$, [], "deep") const colorMode = useColorMode() const t = useI18n() return { collections, colorMode, t, IconPlus, IconHelpCircle, IconArchive, } }, data() { return { showModalAdd: false, showModalEdit: false, showModalImportExport: false, showModalAddRequest: false, showModalAddFolder: false, showModalEditFolder: false, showModalEditRequest: false, editingCollection: undefined, editingCollectionIndex: undefined, editingFolder: undefined, editingFolderName: undefined, editingFolderIndex: undefined, editingFolderPath: undefined, editingRequest: undefined, editingRequestIndex: undefined, filterText: "", } }, computed: { filteredCollections() { const collections = clone(this.collections) if (!this.filterText) return collections const filterText = this.filterText.toLowerCase() const filteredCollections = [] for (const collection of collections) { const filteredRequests = [] const filteredFolders = [] for (const request of collection.requests) { if (request.name.toLowerCase().includes(filterText)) filteredRequests.push(request) } for (const folder of collection.folders) { const filteredFolderRequests = [] for (const request of folder.requests) { if (request.name.toLowerCase().includes(filterText)) filteredFolderRequests.push(request) } if (filteredFolderRequests.length > 0) { const filteredFolder = Object.assign({}, folder) filteredFolder.requests = filteredFolderRequests filteredFolders.push(filteredFolder) } } if (filteredRequests.length + filteredFolders.length > 0) { const filteredCollection = Object.assign({}, collection) filteredCollection.requests = filteredRequests filteredCollection.folders = filteredFolders filteredCollections.push(filteredCollection) } } return filteredCollections }, }, methods: { displayModalAdd(shouldDisplay) { this.showModalAdd = shouldDisplay }, displayModalEdit(shouldDisplay) { this.showModalEdit = shouldDisplay if (!shouldDisplay) this.resetSelectedData() }, displayModalImportExport(shouldDisplay) { this.showModalImportExport = shouldDisplay }, displayModalAddRequest(shouldDisplay) { this.showModalAddRequest = shouldDisplay if (!shouldDisplay) this.resetSelectedData() }, displayModalAddFolder(shouldDisplay) { this.showModalAddFolder = shouldDisplay if (!shouldDisplay) this.resetSelectedData() }, displayModalEditFolder(shouldDisplay) { this.showModalEditFolder = shouldDisplay if (!shouldDisplay) this.resetSelectedData() }, displayModalEditRequest(shouldDisplay) { this.showModalEditRequest = shouldDisplay if (!shouldDisplay) this.resetSelectedData() }, editCollection(collection, collectionIndex) { this.$data.editingCollection = collection this.$data.editingCollectionIndex = collectionIndex this.displayModalEdit(true) }, onAddRequest({ name, path }) { const newRequest = { ...getGQLSession().request, name, } saveGraphqlRequestAs(path, newRequest) setGQLSession({ request: newRequest, schema: "", response: "", }) this.displayModalAddRequest(false) }, addRequest(payload) { const { path } = payload this.$data.editingFolderPath = path this.displayModalAddRequest(true) }, onAddFolder({ name, path }) { addGraphqlFolder(name, path) this.displayModalAddFolder(false) }, addFolder(payload) { const { path } = payload this.$data.editingFolderPath = path this.displayModalAddFolder(true) }, editFolder(payload) { const { folder, folderPath } = payload this.editingFolder = folder this.editingFolderPath = folderPath this.displayModalEditFolder(true) }, editRequest(payload) { const { collectionIndex, folderIndex, folderName, request, requestIndex, folderPath, } = payload this.$data.editingFolderPath = folderPath this.$data.editingCollectionIndex = collectionIndex this.$data.editingFolderIndex = folderIndex this.$data.editingFolderName = folderName this.$data.editingRequest = request this.$data.editingRequestIndex = requestIndex this.displayModalEditRequest(true) }, resetSelectedData() { this.$data.editingCollection = undefined this.$data.editingCollectionIndex = undefined this.$data.editingFolder = undefined this.$data.editingFolderIndex = undefined this.$data.editingRequest = undefined this.$data.editingRequestIndex = undefined }, duplicateRequest({ folderPath, request }) { saveGraphqlRequestAs(folderPath, { ...cloneDeep(request), name: `${request.name} - ${this.t("action.duplicate")}`, }) }, }, }) </script>
packages/hoppscotch-common/src/components/collections/graphql/index.vue
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.028590794652700424, 0.001769696013070643, 0.0001674183877184987, 0.000170792467542924, 0.005622725933790207 ]
{ "id": 0, "code_window": [ " }\n", "})\n", "\n", "// Sync logic between headers and working/bulk headers\n", "watch(\n", " request.value.headers,\n", " (newHeadersList) => {\n", " // Sync should overwrite working headers\n", " const filteredWorkingHeaders = pipe(\n", " workingHeaders.value,\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ " () => request.value.headers,\n" ], "file_path": "packages/hoppscotch-common/src/components/http/Headers.vue", "type": "replace", "edit_start_line_idx": 340 }
mutation DeleteUserCollection($userCollectionID: ID!) { deleteUserCollection(userCollectionID: $userCollectionID) }
packages/hoppscotch-selfhost-web/src/api/mutations/DeleteUserCollection.graphql
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0001692405785433948, 0.0001692405785433948, 0.0001692405785433948, 0.0001692405785433948, 0 ]
{ "id": 1, "code_window": [ "\n", "<script setup lang=\"ts\">\n", "import { useI18n } from \"@composables/i18n\"\n", "import { HoppRESTRequest } from \"@hoppscotch/data\"\n", "import { computed, ref, watch } from \"vue\"\n", "\n", "export type RequestOptionTabs =\n", " | \"params\"\n", " | \"bodyParams\"\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { useVModel } from \"@vueuse/core\"\n", "import { computed, ref } from \"vue\"\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 56 }
<template> <HoppSmartTabs v-model="selectedRealtimeTab" styles="sticky overflow-x-auto flex-shrink-0 bg-primary top-upperMobilePrimaryStickyFold sm:top-upperPrimaryStickyFold z-10" render-inactive-tabs > <HoppSmartTab :id="'params'" :label="`${t('tab.parameters')}`" :info="`${newActiveParamsCount$}`" > <HttpParameters v-model="request.params" /> </HoppSmartTab> <HoppSmartTab :id="'bodyParams'" :label="`${t('tab.body')}`"> <HttpBody v-model:headers="request.headers" v-model:body="request.body" @change-tab="changeTab" /> </HoppSmartTab> <HoppSmartTab :id="'headers'" :label="`${t('tab.headers')}`" :info="`${newActiveHeadersCount$}`" > <HttpHeaders v-model="request" @change-tab="changeTab" /> </HoppSmartTab> <HoppSmartTab :id="'authorization'" :label="`${t('tab.authorization')}`"> <HttpAuthorization v-model="request.auth" /> </HoppSmartTab> <HoppSmartTab :id="'preRequestScript'" :label="`${t('tab.pre_request_script')}`" :indicator=" request.preRequestScript && request.preRequestScript.length > 0 ? true : false " > <HttpPreRequestScript v-model="request.preRequestScript" /> </HoppSmartTab> <HoppSmartTab :id="'tests'" :label="`${t('tab.tests')}`" :indicator=" request.testScript && request.testScript.length > 0 ? true : false " > <HttpTests v-model="request.testScript" /> </HoppSmartTab> </HoppSmartTabs> </template> <script setup lang="ts"> import { useI18n } from "@composables/i18n" import { HoppRESTRequest } from "@hoppscotch/data" import { computed, ref, watch } from "vue" export type RequestOptionTabs = | "params" | "bodyParams" | "headers" | "authorization" const t = useI18n() // v-model integration with props and emit const props = defineProps<{ modelValue: HoppRESTRequest }>() const emit = defineEmits<{ (e: "update:modelValue", value: HoppRESTRequest): void }>() const request = ref(props.modelValue) watch( () => request.value, (newVal) => { emit("update:modelValue", newVal) }, { deep: true } ) const selectedRealtimeTab = ref<RequestOptionTabs>("params") const changeTab = (e: RequestOptionTabs) => { selectedRealtimeTab.value = e } const newActiveParamsCount$ = computed(() => { const e = request.value.params.filter( (x) => x.active && (x.key !== "" || x.value !== "") ).length if (e === 0) return null return `${e}` }) const newActiveHeadersCount$ = computed(() => { const e = request.value.headers.filter( (x) => x.active && (x.key !== "" || x.value !== "") ).length if (e === 0) return null return `${e}` }) </script>
packages/hoppscotch-common/src/components/http/RequestOptions.vue
1
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.9986271858215332, 0.18131834268569946, 0.00016509472334291786, 0.0001750027877278626, 0.383928120136261 ]
{ "id": 1, "code_window": [ "\n", "<script setup lang=\"ts\">\n", "import { useI18n } from \"@composables/i18n\"\n", "import { HoppRESTRequest } from \"@hoppscotch/data\"\n", "import { computed, ref, watch } from \"vue\"\n", "\n", "export type RequestOptionTabs =\n", " | \"params\"\n", " | \"bodyParams\"\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { useVModel } from \"@vueuse/core\"\n", "import { computed, ref } from \"vue\"\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 56 }
/** * the direct import from yargs-parser uses fs which is a built in node module, * just adding the /browser import as a fix for now, which does not have type info on DefinitelyTyped. * remove/update this comment before merging the vue3 port. */ import parser from "yargs-parser/browser" import * as O from "fp-ts/Option" import * as A from "fp-ts/Array" import { pipe, flow } from "fp-ts/function" import { FormDataKeyValue, HoppRESTReqBody, makeRESTRequest, } from "@hoppscotch/data" import { getAuthObject } from "./sub_helpers/auth" import { getHeaders, recordToHoppHeaders } from "./sub_helpers/headers" // import { getCookies } from "./sub_helpers/cookies" import { getQueries } from "./sub_helpers/queries" import { getMethod } from "./sub_helpers/method" import { concatParams, getURLObject } from "./sub_helpers/url" import { preProcessCurlCommand } from "./sub_helpers/preproc" import { getBody, getFArgumentMultipartData } from "./sub_helpers/body" import { getDefaultRESTRequest } from "../rest/default" import { objHasProperty, objHasArrayProperty, } from "~/helpers/functional/object" const defaultRESTReq = getDefaultRESTRequest() export const parseCurlCommand = (curlCommand: string) => { // const isDataBinary = curlCommand.includes(" --data-binary") // const compressed = !!parsedArguments.compressed curlCommand = preProcessCurlCommand(curlCommand) const parsedArguments = parser(curlCommand) const headerObject = getHeaders(parsedArguments) const { headers } = headerObject let { rawContentType } = headerObject const hoppHeaders = pipe( headers, O.fromPredicate(() => Object.keys(headers).length > 0), O.map(recordToHoppHeaders), O.getOrElse(() => defaultRESTReq.headers) ) const method = getMethod(parsedArguments) // const cookies = getCookies(parsedArguments) const urlObject = getURLObject(parsedArguments) const auth = getAuthObject(parsedArguments, headers, urlObject) let rawData: string | string[] = pipe( parsedArguments, O.fromPredicate(objHasArrayProperty("d", "string")), O.map((args) => args.d), O.altW(() => pipe( parsedArguments, O.fromPredicate(objHasProperty("d", "string")), O.map((args) => args.d) ) ), O.getOrElseW(() => "") ) let body: HoppRESTReqBody["body"] = "" let contentType: HoppRESTReqBody["contentType"] = defaultRESTReq.body.contentType let hasBodyBeenParsed = false let { queries, danglingParams } = getQueries( Array.from(urlObject.searchParams.entries()) ) const stringToPair = flow( decodeURIComponent, (pair) => <[string, string]>pair.split("=", 2) ) const pairs = pipe( rawData, O.fromPredicate(Array.isArray), O.map(A.map(stringToPair)), O.alt(() => pipe( rawData, O.fromPredicate((s) => s.length > 0), O.map(() => [stringToPair(rawData as string)]) ) ), O.getOrElseW(() => undefined) ) if (objHasProperty("G", "boolean")(parsedArguments) && !!pairs) { const newQueries = getQueries(pairs) queries = [...queries, ...newQueries.queries] danglingParams = [...danglingParams, ...newQueries.danglingParams] hasBodyBeenParsed = true } else if ( rawContentType.includes("application/x-www-form-urlencoded") && !!pairs && Array.isArray(rawData) ) { body = pairs.map((p) => p.join(": ")).join("\n") || null contentType = "application/x-www-form-urlencoded" hasBodyBeenParsed = true } const urlString = concatParams(urlObject, danglingParams) let multipartUploads: Record<string, string> = pipe( O.of(parsedArguments), O.chain(getFArgumentMultipartData), O.match( () => ({}), (args) => { hasBodyBeenParsed = true rawContentType = "multipart/form-data" return args } ) ) if (!hasBodyBeenParsed) { if (typeof rawData !== "string") { rawData = rawData.join("") } const bodyObject = getBody(rawData, rawContentType, contentType) if (O.isSome(bodyObject)) { const bodyObjectValue = bodyObject.value if (bodyObjectValue.type === "FORMDATA") { multipartUploads = bodyObjectValue.body } else { body = bodyObjectValue.body.body contentType = bodyObjectValue.body .contentType as HoppRESTReqBody["contentType"] } } } const finalBody: HoppRESTReqBody = pipe( body, O.fromNullable, O.filter((b) => b.length > 0), O.map((b) => <HoppRESTReqBody>{ body: b, contentType }), O.alt(() => pipe( multipartUploads, O.of, O.map((m) => Object.entries(m)), O.filter((m) => m.length > 0), O.map( flow( A.map( ([key, value]) => <FormDataKeyValue>{ active: true, isFile: false, key, value, } ), (b) => <HoppRESTReqBody>{ body: b, contentType: "multipart/form-data" } ) ) ) ), O.getOrElse(() => defaultRESTReq.body) ) return makeRESTRequest({ name: defaultRESTReq.name, endpoint: urlString, method: (method || defaultRESTReq.method).toUpperCase(), params: queries ?? defaultRESTReq.params, headers: hoppHeaders, preRequestScript: defaultRESTReq.preRequestScript, testScript: defaultRESTReq.testScript, auth, body: finalBody, }) }
packages/hoppscotch-common/src/helpers/curl/curlparser.ts
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0006918957806192338, 0.00023870670702308416, 0.00016522906662430614, 0.00018365388677921146, 0.00012444646563380957 ]
{ "id": 1, "code_window": [ "\n", "<script setup lang=\"ts\">\n", "import { useI18n } from \"@composables/i18n\"\n", "import { HoppRESTRequest } from \"@hoppscotch/data\"\n", "import { computed, ref, watch } from \"vue\"\n", "\n", "export type RequestOptionTabs =\n", " | \"params\"\n", " | \"bodyParams\"\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { useVModel } from \"@vueuse/core\"\n", "import { computed, ref } from \"vue\"\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 56 }
import { distinctUntilChanged, pluck } from "rxjs" import DispatchingStore, { defineDispatchers } from "./DispatchingStore" export type ExtensionStatus = "available" | "unknown-origin" | "waiting" type InitialState = { extensionStatus: ExtensionStatus } const initialState: InitialState = { extensionStatus: "waiting", } const dispatchers = defineDispatchers({ changeExtensionStatus( _, { extensionStatus }: { extensionStatus: ExtensionStatus } ) { return { extensionStatus, } }, }) export const hoppExtensionStore = new DispatchingStore( initialState, dispatchers ) export const extensionStatus$ = hoppExtensionStore.subject$.pipe( pluck("extensionStatus"), distinctUntilChanged() ) export function changeExtensionStatus(extensionStatus: ExtensionStatus) { hoppExtensionStore.dispatch({ dispatcher: "changeExtensionStatus", payload: { extensionStatus }, }) }
packages/hoppscotch-common/src/newstore/HoppExtension.ts
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.00017721662879921496, 0.00017180191935040057, 0.00016478096949867904, 0.00017341776401735842, 0.000004332192474976182 ]
{ "id": 1, "code_window": [ "\n", "<script setup lang=\"ts\">\n", "import { useI18n } from \"@composables/i18n\"\n", "import { HoppRESTRequest } from \"@hoppscotch/data\"\n", "import { computed, ref, watch } from \"vue\"\n", "\n", "export type RequestOptionTabs =\n", " | \"params\"\n", " | \"bodyParams\"\n" ], "labels": [ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { useVModel } from \"@vueuse/core\"\n", "import { computed, ref } from \"vue\"\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 56 }
subscription TeamEnvironmentUpdated ($teamID: ID!) { teamEnvironmentUpdated(teamID: $teamID) { id teamID name variables } }
packages/hoppscotch-common/src/helpers/backend/gql/subscriptions/TeamEnvironmentUpdated.graphql
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0001720018481137231, 0.0001720018481137231, 0.0001720018481137231, 0.0001720018481137231, 0 ]
{ "id": 2, "code_window": [ " (e: \"update:modelValue\", value: HoppRESTRequest): void\n", "}>()\n", "\n", "const request = ref(props.modelValue)\n", "\n", "watch(\n", " () => request.value,\n", " (newVal) => {\n", " emit(\"update:modelValue\", newVal)\n", " },\n", " { deep: true }\n", ")\n", "\n", "const selectedRealtimeTab = ref<RequestOptionTabs>(\"params\")\n", "\n", "const changeTab = (e: RequestOptionTabs) => {\n", " selectedRealtimeTab.value = e\n" ], "labels": [ "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "const request = useVModel(props, \"modelValue\", emit)\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 72 }
<template> <HoppSmartTabs v-model="selectedRealtimeTab" styles="sticky overflow-x-auto flex-shrink-0 bg-primary top-upperMobilePrimaryStickyFold sm:top-upperPrimaryStickyFold z-10" render-inactive-tabs > <HoppSmartTab :id="'params'" :label="`${t('tab.parameters')}`" :info="`${newActiveParamsCount$}`" > <HttpParameters v-model="request.params" /> </HoppSmartTab> <HoppSmartTab :id="'bodyParams'" :label="`${t('tab.body')}`"> <HttpBody v-model:headers="request.headers" v-model:body="request.body" @change-tab="changeTab" /> </HoppSmartTab> <HoppSmartTab :id="'headers'" :label="`${t('tab.headers')}`" :info="`${newActiveHeadersCount$}`" > <HttpHeaders v-model="request" @change-tab="changeTab" /> </HoppSmartTab> <HoppSmartTab :id="'authorization'" :label="`${t('tab.authorization')}`"> <HttpAuthorization v-model="request.auth" /> </HoppSmartTab> <HoppSmartTab :id="'preRequestScript'" :label="`${t('tab.pre_request_script')}`" :indicator=" request.preRequestScript && request.preRequestScript.length > 0 ? true : false " > <HttpPreRequestScript v-model="request.preRequestScript" /> </HoppSmartTab> <HoppSmartTab :id="'tests'" :label="`${t('tab.tests')}`" :indicator=" request.testScript && request.testScript.length > 0 ? true : false " > <HttpTests v-model="request.testScript" /> </HoppSmartTab> </HoppSmartTabs> </template> <script setup lang="ts"> import { useI18n } from "@composables/i18n" import { HoppRESTRequest } from "@hoppscotch/data" import { computed, ref, watch } from "vue" export type RequestOptionTabs = | "params" | "bodyParams" | "headers" | "authorization" const t = useI18n() // v-model integration with props and emit const props = defineProps<{ modelValue: HoppRESTRequest }>() const emit = defineEmits<{ (e: "update:modelValue", value: HoppRESTRequest): void }>() const request = ref(props.modelValue) watch( () => request.value, (newVal) => { emit("update:modelValue", newVal) }, { deep: true } ) const selectedRealtimeTab = ref<RequestOptionTabs>("params") const changeTab = (e: RequestOptionTabs) => { selectedRealtimeTab.value = e } const newActiveParamsCount$ = computed(() => { const e = request.value.params.filter( (x) => x.active && (x.key !== "" || x.value !== "") ).length if (e === 0) return null return `${e}` }) const newActiveHeadersCount$ = computed(() => { const e = request.value.headers.filter( (x) => x.active && (x.key !== "" || x.value !== "") ).length if (e === 0) return null return `${e}` }) </script>
packages/hoppscotch-common/src/components/http/RequestOptions.vue
1
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.9977509379386902, 0.18282769620418549, 0.00016544329992029816, 0.0013213955098763108, 0.3840703070163727 ]
{ "id": 2, "code_window": [ " (e: \"update:modelValue\", value: HoppRESTRequest): void\n", "}>()\n", "\n", "const request = ref(props.modelValue)\n", "\n", "watch(\n", " () => request.value,\n", " (newVal) => {\n", " emit(\"update:modelValue\", newVal)\n", " },\n", " { deep: true }\n", ")\n", "\n", "const selectedRealtimeTab = ref<RequestOptionTabs>(\"params\")\n", "\n", "const changeTab = (e: RequestOptionTabs) => {\n", " selectedRealtimeTab.value = e\n" ], "labels": [ "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "const request = useVModel(props, \"modelValue\", emit)\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 72 }
<template> <div class="flex flex-col flex-1"> <div class="sticky z-10 flex items-center justify-between flex-shrink-0 pl-4 overflow-x-auto border-b bg-primary border-dividerLight top-upperMobileSecondaryStickyFold sm:top-upperSecondaryStickyFold" > <label class="font-semibold truncate text-secondaryLight"> {{ t("preRequest.javascript_code") }} </label> <div class="flex"> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" to="https://docs.hoppscotch.io/documentation/getting-started/rest/pre-request-scripts" blank :title="t('app.wiki')" :icon="IconHelpCircle" /> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="t('action.clear')" :icon="IconTrash2" @click="clearContent" /> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="t('state.linewrap')" :class="{ '!text-accent': linewrapEnabled }" :icon="IconWrapText" @click.prevent="linewrapEnabled = !linewrapEnabled" /> </div> </div> <div class="flex flex-1 border-b border-dividerLight"> <div class="w-2/3 border-r border-dividerLight"> <div ref="preRequestEditor" class="h-full"></div> </div> <div class="sticky flex-shrink-0 h-full p-4 overflow-auto overflow-x-auto bg-primary top-upperTertiaryStickyFold min-w-46 max-w-1/3 z-9" > <div class="pb-2 text-secondaryLight"> {{ t("helpers.pre_request_script") }} </div> <HoppSmartAnchor :label="`${t('preRequest.learn')}`" to="https://docs.hoppscotch.io/documentation/getting-started/rest/pre-request-scripts" blank /> <h4 class="pt-6 font-bold text-secondaryLight"> {{ t("preRequest.snippets") }} </h4> <div class="flex flex-col pt-4"> <TabSecondary v-for="(snippet, index) in snippets" :key="`snippet-${index}`" :label="snippet.name" active @click="useSnippet(snippet.script)" /> </div> </div> </div> </div> </template> <script setup lang="ts"> import IconHelpCircle from "~icons/lucide/help-circle" import IconWrapText from "~icons/lucide/wrap-text" import IconTrash2 from "~icons/lucide/trash-2" import { reactive, ref } from "vue" import snippets from "@helpers/preRequestScriptSnippets" import { useCodemirror } from "@composables/codemirror" import linter from "~/helpers/editor/linting/preRequest" import completer from "~/helpers/editor/completion/preRequest" import { useI18n } from "@composables/i18n" import { useVModel } from "@vueuse/core" const t = useI18n() const props = defineProps<{ modelValue: string }>() const emit = defineEmits<{ (e: "update:modelValue", value: string): void }>() const preRequestScript = useVModel(props, "modelValue", emit) const preRequestEditor = ref<any | null>(null) const linewrapEnabled = ref(true) useCodemirror( preRequestEditor, preRequestScript, reactive({ extendedEditorConfig: { mode: "application/javascript", lineWrapping: linewrapEnabled, placeholder: `${t("preRequest.javascript_code")}`, }, linter, completer, environmentHighlights: false, }) ) const useSnippet = (script: string) => { preRequestScript.value += script } const clearContent = () => { preRequestScript.value = "" } </script>
packages/hoppscotch-common/src/components/http/PreRequestScript.vue
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0023141736164689064, 0.0005241430480964482, 0.000168193771969527, 0.00017132138600572944, 0.0007888206746429205 ]
{ "id": 2, "code_window": [ " (e: \"update:modelValue\", value: HoppRESTRequest): void\n", "}>()\n", "\n", "const request = ref(props.modelValue)\n", "\n", "watch(\n", " () => request.value,\n", " (newVal) => {\n", " emit(\"update:modelValue\", newVal)\n", " },\n", " { deep: true }\n", ")\n", "\n", "const selectedRealtimeTab = ref<RequestOptionTabs>(\"params\")\n", "\n", "const changeTab = (e: RequestOptionTabs) => {\n", " selectedRealtimeTab.value = e\n" ], "labels": [ "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "const request = useVModel(props, \"modelValue\", emit)\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 72 }
import { BehaviorSubject, Subject } from "rxjs" import { SIOClientV2, SIOClientV3, SIOClientV4, SIOClient } from "./SIOClients" import { SIOClientVersion } from "~/newstore/SocketIOSession" import { platform } from "~/platform" export const SOCKET_CLIENTS = { v2: SIOClientV2, v3: SIOClientV3, v4: SIOClientV4, } as const type SIOAuth = { type: "None" } | { type: "Bearer"; token: string } export type ConnectionOption = { url: string path: string clientVersion: SIOClientVersion auth: SIOAuth | undefined } export type SIOMessage = { eventName: string value: unknown } type SIOErrorType = "CONNECTION" | "RECONNECT_ERROR" | "UNKNOWN" export type SIOError = { type: SIOErrorType value: unknown } export type SIOEvent = { time: number } & ( | { type: "CONNECTING" } | { type: "CONNECTED" } | { type: "MESSAGE_SENT"; message: SIOMessage } | { type: "MESSAGE_RECEIVED"; message: SIOMessage } | { type: "DISCONNECTED"; manual: boolean } | { type: "ERROR"; error: SIOError } ) export type ConnectionState = "CONNECTING" | "CONNECTED" | "DISCONNECTED" export class SIOConnection { connectionState$: BehaviorSubject<ConnectionState> event$: Subject<SIOEvent> = new Subject() socket: SIOClient | undefined constructor() { this.connectionState$ = new BehaviorSubject<ConnectionState>("DISCONNECTED") } private addEvent(event: SIOEvent) { this.event$.next(event) } connect({ url, path, clientVersion, auth }: ConnectionOption) { this.connectionState$.next("CONNECTING") this.addEvent({ time: Date.now(), type: "CONNECTING", }) try { this.socket = new SOCKET_CLIENTS[clientVersion]() if (auth?.type === "Bearer") { this.socket.connect(url, { path, auth: { token: auth.token, }, }) } else { this.socket.connect(url) } this.socket.on("connect", () => { this.connectionState$.next("CONNECTED") this.addEvent({ type: "CONNECTED", time: Date.now(), }) }) this.socket.on("*", ({ data }: { data: string[] }) => { const [eventName, message] = data this.addEvent({ message: { eventName, value: message }, type: "MESSAGE_RECEIVED", time: Date.now(), }) }) this.socket.on("connect_error", (error: unknown) => { this.handleError(error, "CONNECTION") }) this.socket.on("reconnect_error", (error: unknown) => { this.handleError(error, "RECONNECT_ERROR") }) this.socket.on("error", (error: unknown) => { this.handleError(error, "UNKNOWN") }) this.socket.on("disconnect", () => { this.connectionState$.next("DISCONNECTED") this.addEvent({ type: "DISCONNECTED", time: Date.now(), manual: true, }) }) } catch (error) { this.handleError(error, "CONNECTION") } platform.analytics?.logHoppRequestRunToAnalytics({ platform: "socketio", }) } private handleError(error: unknown, type: SIOErrorType) { this.disconnect() this.addEvent({ time: Date.now(), type: "ERROR", error: { type, value: error, }, }) } sendMessage(event: { message: string; eventName: string }) { if (this.connectionState$.value === "DISCONNECTED") return const { message, eventName } = event this.socket?.emit(eventName, message, (data) => { // receive response from server this.addEvent({ time: Date.now(), type: "MESSAGE_RECEIVED", message: { eventName, value: data, }, }) }) this.addEvent({ time: Date.now(), type: "MESSAGE_SENT", message: { eventName, value: message, }, }) } disconnect() { this.socket?.close() this.connectionState$.next("DISCONNECTED") } }
packages/hoppscotch-common/src/helpers/realtime/SIOConnection.ts
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.00017611109069548547, 0.00017216372361872345, 0.00016934130690060556, 0.00017206728807650506, 0.0000018775820080918493 ]
{ "id": 2, "code_window": [ " (e: \"update:modelValue\", value: HoppRESTRequest): void\n", "}>()\n", "\n", "const request = ref(props.modelValue)\n", "\n", "watch(\n", " () => request.value,\n", " (newVal) => {\n", " emit(\"update:modelValue\", newVal)\n", " },\n", " { deep: true }\n", ")\n", "\n", "const selectedRealtimeTab = ref<RequestOptionTabs>(\"params\")\n", "\n", "const changeTab = (e: RequestOptionTabs) => {\n", " selectedRealtimeTab.value = e\n" ], "labels": [ "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "const request = useVModel(props, \"modelValue\", emit)\n" ], "file_path": "packages/hoppscotch-common/src/components/http/RequestOptions.vue", "type": "replace", "edit_start_line_idx": 72 }
<template> <HoppSmartModal v-if="show" dialog :title="t('collection.new')" @close="hideModal" > <template #body> <div class="flex flex-col"> <input id="selectLabelAdd" v-model="name" v-focus class="input floating-input" placeholder=" " type="text" autocomplete="off" @keyup.enter="addNewCollection" /> <label for="selectLabelAdd"> {{ t("action.label") }} </label> </div> </template> <template #footer> <span class="flex space-x-2"> <HoppButtonPrimary :label="t('action.save')" :loading="loadingState" outline @click="addNewCollection" /> <HoppButtonSecondary :label="t('action.cancel')" outline filled @click="hideModal" /> </span> </template> </HoppSmartModal> </template> <script setup lang="ts"> import { watch, ref } from "vue" import { useToast } from "@composables/toast" import { useI18n } from "@composables/i18n" const toast = useToast() const t = useI18n() const props = withDefaults( defineProps<{ show: boolean loadingState: boolean }>(), { show: false, loadingState: false, } ) const emit = defineEmits<{ (e: "submit", name: string): void (e: "hide-modal"): void }>() const name = ref("") watch( () => props.show, (show) => { if (!show) { name.value = "" } } ) const addNewCollection = () => { if (!name.value) { toast.error(t("collection.invalid_name")) return } emit("submit", name.value) } const hideModal = () => { name.value = "" emit("hide-modal") } </script>
packages/hoppscotch-common/src/components/collections/Add.vue
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0024589006789028645, 0.0007618360104970634, 0.000168193771969527, 0.00017370174464304, 0.0008674828568473458 ]
{ "id": 3, "code_window": [ " * Processes URL string and returns the URL object\n", " * @param parsedArguments Parsed Arguments object\n", " * @returns URL object\n", " */\n", "export function getURLObject(parsedArguments: parser.Arguments) {\n", " return pipe(\n", " // contains raw url strings\n" ], "labels": [ "keep", "keep", "keep", "keep", "add", "keep", "keep" ], "after_edit": [ " const location = parsedArguments.location ?? undefined\n", "\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "add", "edit_start_line_idx": 73 }
<template> <HoppSmartTabs v-model="selectedRealtimeTab" styles="sticky overflow-x-auto flex-shrink-0 bg-primary top-upperMobilePrimaryStickyFold sm:top-upperPrimaryStickyFold z-10" render-inactive-tabs > <HoppSmartTab :id="'params'" :label="`${t('tab.parameters')}`" :info="`${newActiveParamsCount$}`" > <HttpParameters v-model="request.params" /> </HoppSmartTab> <HoppSmartTab :id="'bodyParams'" :label="`${t('tab.body')}`"> <HttpBody v-model:headers="request.headers" v-model:body="request.body" @change-tab="changeTab" /> </HoppSmartTab> <HoppSmartTab :id="'headers'" :label="`${t('tab.headers')}`" :info="`${newActiveHeadersCount$}`" > <HttpHeaders v-model="request" @change-tab="changeTab" /> </HoppSmartTab> <HoppSmartTab :id="'authorization'" :label="`${t('tab.authorization')}`"> <HttpAuthorization v-model="request.auth" /> </HoppSmartTab> <HoppSmartTab :id="'preRequestScript'" :label="`${t('tab.pre_request_script')}`" :indicator=" request.preRequestScript && request.preRequestScript.length > 0 ? true : false " > <HttpPreRequestScript v-model="request.preRequestScript" /> </HoppSmartTab> <HoppSmartTab :id="'tests'" :label="`${t('tab.tests')}`" :indicator=" request.testScript && request.testScript.length > 0 ? true : false " > <HttpTests v-model="request.testScript" /> </HoppSmartTab> </HoppSmartTabs> </template> <script setup lang="ts"> import { useI18n } from "@composables/i18n" import { HoppRESTRequest } from "@hoppscotch/data" import { computed, ref, watch } from "vue" export type RequestOptionTabs = | "params" | "bodyParams" | "headers" | "authorization" const t = useI18n() // v-model integration with props and emit const props = defineProps<{ modelValue: HoppRESTRequest }>() const emit = defineEmits<{ (e: "update:modelValue", value: HoppRESTRequest): void }>() const request = ref(props.modelValue) watch( () => request.value, (newVal) => { emit("update:modelValue", newVal) }, { deep: true } ) const selectedRealtimeTab = ref<RequestOptionTabs>("params") const changeTab = (e: RequestOptionTabs) => { selectedRealtimeTab.value = e } const newActiveParamsCount$ = computed(() => { const e = request.value.params.filter( (x) => x.active && (x.key !== "" || x.value !== "") ).length if (e === 0) return null return `${e}` }) const newActiveHeadersCount$ = computed(() => { const e = request.value.headers.filter( (x) => x.active && (x.key !== "" || x.value !== "") ).length if (e === 0) return null return `${e}` }) </script>
packages/hoppscotch-common/src/components/http/RequestOptions.vue
1
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0001757326681399718, 0.0001714461832307279, 0.0001663385919528082, 0.00017232654499821365, 0.000003017698418261716 ]
{ "id": 3, "code_window": [ " * Processes URL string and returns the URL object\n", " * @param parsedArguments Parsed Arguments object\n", " * @returns URL object\n", " */\n", "export function getURLObject(parsedArguments: parser.Arguments) {\n", " return pipe(\n", " // contains raw url strings\n" ], "labels": [ "keep", "keep", "keep", "keep", "add", "keep", "keep" ], "after_edit": [ " const location = parsedArguments.location ?? undefined\n", "\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "add", "edit_start_line_idx": 73 }
export function defineGQLLanguageMode(ace) { // Highlighting ace.define( "ace/mode/gql-query-highlight", ["require", "exports", "ace/lib/oop", "ace/mode/text_highlight_rules"], (aceRequire, exports) => { const oop = aceRequire("ace/lib/oop") const TextHighlightRules = aceRequire( "ace/mode/text_highlight_rules" ).TextHighlightRules const GQLQueryTextHighlightRules = function () { const keywords = "type|interface|union|enum|schema|input|implements|extends|scalar|fragment|query|mutation|subscription" const dataTypes = "Int|Float|String|ID|Boolean" const literalValues = "true|false|null" const escapeRe = /\\(?:u[\da-fA-f]{4}|.)/ const keywordMapper = this.createKeywordMapper( { keyword: keywords, "storage.type": dataTypes, "constant.language": literalValues, }, "identifier" ) this.$rules = { start: [ { token: "comment", regex: "#.*$", }, { token: "paren.lparen", regex: /[[({]/, next: "start", }, { token: "paren.rparen", regex: /[\])}]/, }, { token: keywordMapper, regex: "[a-zA-Z_][a-zA-Z0-9_$]*\\b", }, { token: "string", // character regex: `'(?:${escapeRe}|.)?'`, }, { token: "string.start", regex: '"', stateName: "qqstring", next: [ { token: "string", regex: /\\\s*$/, next: "qqstring" }, { token: "constant.language.escape", regex: escapeRe }, { token: "string.end", regex: '"|$', next: "start" }, { defaultToken: "string" }, ], }, { token: "string.start", regex: "'", stateName: "singleQuoteString", next: [ { token: "string", regex: /\\\s*$/, next: "singleQuoteString" }, { token: "constant.language.escape", regex: escapeRe }, { token: "string.end", regex: "'|$", next: "start" }, { defaultToken: "string" }, ], }, { token: "constant.numeric", regex: /\d+\.?\d*[eE]?[+-]?\d*/, }, { token: "variable", regex: /\$[_A-Za-z][_0-9A-Za-z]*/, }, ], } this.normalizeRules() } oop.inherits(GQLQueryTextHighlightRules, TextHighlightRules) exports.GQLQueryTextHighlightRules = GQLQueryTextHighlightRules } ) // Language Mode Definition ace.define( "ace/mode/gql-query", ["require", "exports", "ace/mode/text", "ace/mode/gql-query-highlight"], (aceRequire, exports) => { const oop = aceRequire("ace/lib/oop") const TextMode = aceRequire("ace/mode/text").Mode const GQLQueryTextHighlightRules = aceRequire( "ace/mode/gql-query-highlight" ).GQLQueryTextHighlightRules const FoldMode = aceRequire("ace/mode/folding/cstyle").FoldMode const Mode = function () { this.HighlightRules = GQLQueryTextHighlightRules this.foldingRules = new FoldMode() } oop.inherits(Mode, TextMode) exports.Mode = Mode } ) }
packages/hoppscotch-common/src/helpers/syntax/gqlQueryLangMode.js
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0001725011388771236, 0.00016873444837983698, 0.0001654729712754488, 0.00016862920892890543, 0.0000019971730580436997 ]
{ "id": 3, "code_window": [ " * Processes URL string and returns the URL object\n", " * @param parsedArguments Parsed Arguments object\n", " * @returns URL object\n", " */\n", "export function getURLObject(parsedArguments: parser.Arguments) {\n", " return pipe(\n", " // contains raw url strings\n" ], "labels": [ "keep", "keep", "keep", "keep", "add", "keep", "keep" ], "after_edit": [ " const location = parsedArguments.location ?? undefined\n", "\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "add", "edit_start_line_idx": 73 }
<template> <HoppSmartModal v-if="show" dialog :title="t('app.options')" styles="sm:max-w-md" @close="emit('hide-modal')" > <template #body> <div class="flex flex-col space-y-2"> <h2 class="p-4 font-semibold font-bold text-secondaryDark"> {{ t("layout.name") }} </h2> <HoppSmartItem :icon="IconSidebar" :label="EXPAND_NAVIGATION ? t('hide.sidebar') : t('show.sidebar')" :description="t('layout.collapse_sidebar')" :info-icon="IconChevronRight" active @click="expandNavigation" /> <HoppSmartItem :icon="IconSidebarOpen" :label="SIDEBAR ? t('hide.collection') : t('show.collection')" :description="t('layout.collapse_collection')" :info-icon="IconChevronRight" active @click="expandCollection" /> <h2 class="p-4 font-semibold font-bold text-secondaryDark"> {{ t("support.title") }} </h2> <HoppSmartItem :icon="IconBook" :label="t('app.documentation')" to="https://docs.hoppscotch.io" :description="t('support.documentation')" :info-icon="IconChevronRight" active blank @click="hideModal()" /> <HoppSmartItem :icon="IconGift" :label="t('app.whats_new')" to="https://docs.hoppscotch.io/documentation/changelog" :description="t('support.changelog')" :info-icon="IconChevronRight" active blank @click="hideModal()" /> <HoppSmartItem :icon="IconActivity" :label="t('app.status')" to="https://status.hoppscotch.io" blank :description="t('app.status_description')" :info-icon="IconChevronRight" active @click="hideModal()" /> <HoppSmartItem :icon="IconLock" :label="`${t('app.terms_and_privacy')}`" to="https://docs.hoppscotch.io/support/privacy" blank :description="t('app.terms_and_privacy')" :info-icon="IconChevronRight" active @click="hideModal()" /> <h2 class="p-4 font-semibold font-bold text-secondaryDark"> {{ t("settings.follow") }} </h2> <HoppSmartItem :icon="IconDiscord" :label="t('app.discord')" to="https://hoppscotch.io/discord" blank :description="t('app.join_discord_community')" :info-icon="IconChevronRight" active @click="hideModal()" /> <HoppSmartItem :icon="IconTwitter" :label="t('app.twitter')" to="https://hoppscotch.io/twitter" blank :description="t('support.twitter')" :info-icon="IconChevronRight" active @click="hideModal()" /> <HoppSmartItem :icon="IconGithub" :label="`${t('app.github')}`" to="https://github.com/hoppscotch/hoppscotch" blank :description="t('support.github')" :info-icon="IconChevronRight" active @click="hideModal()" /> <HoppSmartItem :icon="IconMessageCircle" :label="t('app.chat_with_us')" :description="t('support.chat')" :info-icon="IconChevronRight" active @click="chatWithUs()" /> <HoppSmartItem :icon="IconUserPlus" :label="`${t('app.invite')}`" :description="t('shortcut.miscellaneous.invite')" :info-icon="IconChevronRight" active @click="expandInvite()" /> <HoppSmartItem v-if="navigatorShare" v-tippy="{ theme: 'tooltip' }" :icon="IconShare2" :label="`${t('request.share')}`" :description="t('request.share_description')" :info-icon="IconChevronRight" active @click="nativeShare()" /> </div> <AppShare :show="showShare" @hide-modal="showShare = false" /> </template> </HoppSmartModal> </template> <script setup lang="ts"> import { ref, watch } from "vue" import IconSidebar from "~icons/lucide/sidebar" import IconSidebarOpen from "~icons/lucide/sidebar-open" import IconBook from "~icons/lucide/book" import IconGift from "~icons/lucide/gift" import IconActivity from "~icons/lucide/activity" import IconLock from "~icons/lucide/lock" import IconDiscord from "~icons/brands/discord" import IconTwitter from "~icons/brands/twitter" import IconGithub from "~icons/lucide/github" import IconMessageCircle from "~icons/lucide/message-circle" import IconUserPlus from "~icons/lucide/user-plus" import IconShare2 from "~icons/lucide/share-2" import IconChevronRight from "~icons/lucide/chevron-right" import { useSetting } from "@composables/settings" import { defineActionHandler } from "~/helpers/actions" import { showChat } from "@modules/crisp" import { useI18n } from "@composables/i18n" const t = useI18n() const navigatorShare = !!navigator.share const showShare = ref(false) const ZEN_MODE = useSetting("ZEN_MODE") const EXPAND_NAVIGATION = useSetting("EXPAND_NAVIGATION") const SIDEBAR = useSetting("SIDEBAR") watch( () => ZEN_MODE.value, () => { EXPAND_NAVIGATION.value = !ZEN_MODE.value } ) defineProps<{ show: boolean }>() defineActionHandler("modals.share.toggle", () => { showShare.value = !showShare.value }) const emit = defineEmits<{ (e: "hide-modal"): void }>() const chatWithUs = () => { showChat() hideModal() } const expandNavigation = () => { EXPAND_NAVIGATION.value = !EXPAND_NAVIGATION.value hideModal() } const expandCollection = () => { SIDEBAR.value = !SIDEBAR.value hideModal() } const expandInvite = () => { showShare.value = true } const nativeShare = () => { if (navigator.share) { navigator .share({ title: "Hoppscotch", text: "Hoppscotch • Open source API development ecosystem - Helps you create requests faster, saving precious time on development.", url: "https://hoppscotch.io", }) .catch(console.error) } else { // fallback } } const hideModal = () => { emit("hide-modal") } </script>
packages/hoppscotch-common/src/components/app/Options.vue
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.00017655579722486436, 0.00017319992184638977, 0.00016761981532908976, 0.0001741252635838464, 0.0000023739430616842583 ]
{ "id": 3, "code_window": [ " * Processes URL string and returns the URL object\n", " * @param parsedArguments Parsed Arguments object\n", " * @returns URL object\n", " */\n", "export function getURLObject(parsedArguments: parser.Arguments) {\n", " return pipe(\n", " // contains raw url strings\n" ], "labels": [ "keep", "keep", "keep", "keep", "add", "keep", "keep" ], "after_edit": [ " const location = parsedArguments.location ?? undefined\n", "\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "add", "edit_start_line_idx": 73 }
{ "action": { "autoscroll": "Autoscroll", "cancel": "Cancel", "choose_file": "Choose a file", "clear": "Clear", "clear_all": "Clear all", "close": "Close", "connect": "Connect", "connecting": "Connecting", "copy": "Copy", "delete": "Delete", "disconnect": "Disconnect", "dismiss": "Dismiss", "dont_save": "Don't save", "download_file": "Download file", "drag_to_reorder": "Drag to reorder", "duplicate": "Duplicate", "edit": "Edit", "filter": "Filter", "go_back": "Go back", "go_forward": "Go forward", "group_by": "Group by", "label": "Label", "learn_more": "Learn more", "less": "Less", "more": "More", "new": "New", "no": "No", "open_workspace": "Open workspace", "paste": "Paste", "prettify": "Prettify", "remove": "Remove", "restore": "Restore", "save": "Save", "scroll_to_bottom": "Scroll to bottom", "scroll_to_top": "Scroll to top", "search": "Search", "send": "Send", "start": "Start", "starting": "Starting", "stop": "Stop", "to_close": "to close", "to_navigate": "to navigate", "to_select": "to select", "turn_off": "Turn off", "turn_on": "Turn on", "undo": "Undo", "yes": "Yes" }, "add": { "new": "Add new", "star": "Add star" }, "app": { "chat_with_us": "Chat with us", "contact_us": "Contact us", "copy": "Copy", "copy_user_id": "Copy User Auth Token", "developer_option": "Developer options", "developer_option_description": "Developer tools which helps in development and maintenance of Hoppscotch.", "discord": "Discord", "documentation": "Documentation", "github": "GitHub", "help": "Help & feedback", "home": "Home", "invite": "Invite", "invite_description": "Hoppscotch is an open source API development ecosystem. We designed a simple and intuitive interface for creating and managing your APIs. Hoppscotch is a tool that helps you build, test, document and share your APIs.", "invite_your_friends": "Invite your friends", "join_discord_community": "Join our Discord community", "keyboard_shortcuts": "Keyboard shortcuts", "name": "Hoppscotch", "new_version_found": "New version found. Refresh to update.", "options": "Options", "proxy_privacy_policy": "Proxy privacy policy", "reload": "Reload", "search": "Search", "share": "Share", "shortcuts": "Shortcuts", "spotlight": "Spotlight", "status": "Status", "status_description": "Check the status of the website", "terms_and_privacy": "Terms and privacy", "twitter": "Twitter", "type_a_command_search": "Type a command or search…", "we_use_cookies": "We use cookies", "whats_new": "What's new?", "wiki": "Wiki" }, "auth": { "account_exists": "Account exists with different credential - Login to link both accounts", "all_sign_in_options": "All sign in options", "continue_with_email": "Continue with Email", "continue_with_github": "Continue with GitHub", "continue_with_google": "Continue with Google", "continue_with_microsoft": "Continue with Microsoft", "email": "Email", "logged_out": "Logged out", "login": "Login", "login_success": "Successfully logged in", "login_to_hoppscotch": "Login to Hoppscotch", "logout": "Logout", "re_enter_email": "Re-enter email", "send_magic_link": "Send a magic link", "sync": "Sync", "we_sent_magic_link": "We sent you a magic link!", "we_sent_magic_link_description": "Check your inbox - we sent an email to {email}. It contains a magic link that will log you in." }, "authorization": { "generate_token": "Generate Token", "include_in_url": "Include in URL", "learn": "Learn how", "pass_key_by": "Pass by", "password": "Password", "token": "Token", "type": "Authorization Type", "username": "Username" }, "collection": { "created": "Collection created", "different_parent": "Cannot reorder collection with different parent", "edit": "Edit Collection", "invalid_name": "Please provide a name for the collection", "invalid_root_move": "Collection already in the root", "moved": "Moved Successfully", "my_collections": "My Collections", "name": "My New Collection", "name_length_insufficient": "Collection name should be at least 3 characters long", "new": "New Collection", "order_changed": "Collection Order Updated", "renamed": "Collection renamed", "request_in_use": "Request in use", "save_as": "Save as", "select": "Select a Collection", "select_location": "Select location", "select_team": "Select a team", "team_collections": "Team Collections" }, "confirm": { "exit_team": "Are you sure you want to leave this team?", "logout": "Are you sure you want to logout?", "remove_collection": "Are you sure you want to permanently delete this collection?", "remove_environment": "Are you sure you want to permanently delete this environment?", "remove_folder": "Are you sure you want to permanently delete this folder?", "remove_history": "Are you sure you want to permanently delete all history?", "remove_request": "Are you sure you want to permanently delete this request?", "remove_team": "Are you sure you want to delete this team?", "remove_telemetry": "Are you sure you want to opt-out of Telemetry?", "request_change": "Are you sure you want to discard current request, unsaved changes will be lost.", "save_unsaved_tab": "Do you want to save changes made in this tab?", "sync": "Would you like to restore your workspace from cloud? This will discard your local progress." }, "count": { "header": "Header {count}", "message": "Message {count}", "parameter": "Parameter {count}", "protocol": "Protocol {count}", "value": "Value {count}", "variable": "Variable {count}" }, "documentation": { "generate": "Generate documentation", "generate_message": "Import any Hoppscotch collection to generate API documentation on-the-go." }, "empty": { "authorization": "This request does not use any authorization", "body": "This request does not have a body", "collection": "Collection is empty", "collections": "Collections are empty", "documentation": "Connect to a GraphQL endpoint to view documentation", "endpoint": "Endpoint cannot be empty", "environments": "Environments are empty", "folder": "Folder is empty", "headers": "This request does not have any headers", "history": "History is empty", "invites": "Invite list is empty", "members": "Team is empty", "parameters": "This request does not have any parameters", "pending_invites": "There are no pending invites for this team", "profile": "Login to view your profile", "protocols": "Protocols are empty", "schema": "Connect to a GraphQL endpoint to view schema", "shortcodes": "Shortcodes are empty", "subscription": "Subscriptions are empty", "team_name": "Team name empty", "teams": "You don't belong to any teams", "tests": "There are no tests for this request" }, "environment": { "add_to_global": "Add to Global", "added": "Environment addition", "create_new": "Create new environment", "created": "Environment created", "deleted": "Environment deletion", "edit": "Edit Environment", "invalid_name": "Please provide a name for the environment", "my_environments": "My Environments", "nested_overflow": "nested environment variables are limited to 10 levels", "new": "New Environment", "no_environment": "No environment", "no_environment_description": "No environments were selected. Choose what to do with the following variables.", "select": "Select environment", "team_environments": "Team Environments", "title": "Environments", "updated": "Environment updated", "variable_list": "Variable List" }, "error": { "browser_support_sse": "This browser doesn't seems to have Server Sent Events support.", "check_console_details": "Check console log for details.", "curl_invalid_format": "cURL is not formatted properly", "danger_zone": "Danger zone", "delete_account": "Your account is currently an owner in these teams:", "delete_account_description": "You must either remove yourself, transfer ownership, or delete these teams before you can delete your account.", "empty_req_name": "Empty Request Name", "f12_details": "(F12 for details)", "gql_prettify_invalid_query": "Couldn't prettify an invalid query, solve query syntax errors and try again", "incomplete_config_urls": "Incomplete configuration URLs", "incorrect_email": "Incorrect email", "invalid_link": "Invalid link", "invalid_link_description": "The link you clicked is invalid or expired.", "json_parsing_failed": "Invalid JSON", "json_prettify_invalid_body": "Couldn't prettify an invalid body, solve json syntax errors and try again", "network_error": "There seems to be a network error. Please try again.", "network_fail": "Could not send request", "no_duration": "No duration", "no_results_found": "No matches found", "page_not_found": "This page could not be found", "script_fail": "Could not execute pre-request script", "something_went_wrong": "Something went wrong", "test_script_fail": "Could not execute post-request script" }, "export": { "as_json": "Export as JSON", "create_secret_gist": "Create secret Gist", "gist_created": "Gist created", "require_github": "Login with GitHub to create secret gist", "title": "Export" }, "filter": { "all": "All", "none": "None", "starred": "Starred" }, "folder": { "created": "Folder created", "edit": "Edit Folder", "invalid_name": "Please provide a name for the folder", "name_length_insufficient": "Folder name should be at least 3 characters long", "new": "New Folder", "renamed": "Folder renamed" }, "graphql": { "mutations": "Mutations", "schema": "Schema", "subscriptions": "Subscriptions" }, "group": { "time": "Time", "url": "URL" }, "header": { "install_pwa": "Install app", "login": "Login", "save_workspace": "Save My Workspace" }, "helpers": { "authorization": "The authorization header will be automatically generated when you send the request.", "generate_documentation_first": "Generate documentation first", "network_fail": "Unable to reach the API endpoint. Check your network connection or select a different Interceptor and try again.", "offline": "You seem to be offline. Data in this workspace might not be up to date.", "offline_short": "You seem to be offline.", "post_request_tests": "Test scripts are written in JavaScript, and are run after the response is received.", "pre_request_script": "Pre-request scripts are written in JavaScript, and are run before the request is sent.", "script_fail": "It seems there is a glitch in the pre-request script. Check the error below and fix the script accordingly.", "test_script_fail": "There seems to be an error with test script. Please fix the errors and run tests again", "tests": "Write a test script to automate debugging." }, "hide": { "collection": "Collapse Collection Panel", "more": "Hide more", "preview": "Hide Preview", "sidebar": "Collapse sidebar" }, "import": { "collections": "Import collections", "curl": "Import cURL", "failed": "Error while importing: format not recognized", "from_gist": "Import from Gist", "from_gist_description": "Import from Gist URL", "from_insomnia": "Import from Insomnia", "from_insomnia_description": "Import from Insomnia collection", "from_json": "Import from Hoppscotch", "from_json_description": "Import from Hoppscotch collection file", "from_my_collections": "Import from My Collections", "from_my_collections_description": "Import from My Collections file", "from_openapi": "Import from OpenAPI", "from_openapi_description": "Import from OpenAPI specification file (YML/JSON)", "from_postman": "Import from Postman", "from_postman_description": "Import from Postman collection", "from_url": "Import from URL", "gist_url": "Enter Gist URL", "import_from_url_invalid_fetch": "Couldn't get data from the url", "import_from_url_invalid_file_format": "Error while importing collections", "import_from_url_invalid_type": "Unsupported type. accepted values are 'hoppscotch', 'openapi', 'postman', 'insomnia'", "import_from_url_success": "Collections Imported", "json_description": "Import collections from a Hoppscotch Collections JSON file", "title": "Import" }, "layout": { "collapse_collection": "Collapse or Expand Collections", "collapse_sidebar": "Collapse or Expand the sidebar", "column": "Vertical layout", "name": "Layout", "row": "Horizontal layout", "zen_mode": "Zen mode" }, "modal": { "close_unsaved_tab": "You have unsaved changes", "collections": "Collections", "confirm": "Confirm", "edit_request": "Edit Request", "import_export": "Import / Export" }, "mqtt": { "already_subscribed": "You are already subscribed to this topic.", "clean_session": "Clean Session", "clear_input": "Clear input", "clear_input_on_send": "Clear input on send", "client_id": "Client ID", "color": "Pick a color", "communication": "Communication", "connection_config": "Connection Config", "connection_not_authorized": "This MQTT connection does not use any authentication.", "invalid_topic": "Please provide a topic for the subscription", "keep_alive": "Keep Alive", "log": "Log", "lw_message": "Last-Will Message", "lw_qos": "Last-Will QoS", "lw_retain": "Last-Will Retain", "lw_topic": "Last-Will Topic", "message": "Message", "new": "New Subscription", "not_connected": "Please start a MQTT connection first.", "publish": "Publish", "qos": "QoS", "ssl": "SSL", "subscribe": "Subscribe", "topic": "Topic", "topic_name": "Topic Name", "topic_title": "Publish / Subscribe topic", "unsubscribe": "Unsubscribe", "url": "URL" }, "navigation": { "doc": "Docs", "graphql": "GraphQL", "profile": "Profile", "realtime": "Realtime", "rest": "REST", "settings": "Settings" }, "preRequest": { "javascript_code": "JavaScript Code", "learn": "Read documentation", "script": "Pre-Request Script", "snippets": "Snippets" }, "profile": { "app_settings": "App Settings", "default_hopp_displayname": "Unnamed User", "editor": "Editor", "editor_description": "Editors can add, edit, and delete requests.", "email_verification_mail": "A verification email has been sent to your email address. Please click on the link to verify your email address.", "no_permission": "You do not have permission to perform this action.", "owner": "Owner", "owner_description": "Owners can add, edit, and delete requests, collections and team members.", "roles": "Roles", "roles_description": "Roles are used to control access to the shared collections.", "updated": "Profile updated", "viewer": "Viewer", "viewer_description": "Viewers can only view and use requests." }, "remove": { "star": "Remove star" }, "request": { "added": "Request added", "authorization": "Authorization", "body": "Request Body", "choose_language": "Choose language", "content_type": "Content Type", "content_type_titles": { "others": "Others", "structured": "Structured", "text": "Text" }, "copy_link": "Copy link", "different_collection": "Cannot reorder requests from different collections", "duplicated": "Request duplicated", "duration": "Duration", "enter_curl": "Enter cURL command", "generate_code": "Generate code", "generated_code": "Generated code", "header_list": "Header List", "invalid_name": "Please provide a name for the request", "method": "Method", "moved": "Request moved", "name": "Request name", "new": "New Request", "order_changed": "Request Order Updated", "override": "Override", "override_help": "Set <kbd>Content-Type</kbd> in Headers", "overriden": "Overridden", "parameter_list": "Query Parameters", "parameters": "Parameters", "path": "Path", "payload": "Payload", "query": "Query", "raw_body": "Raw Request Body", "renamed": "Request renamed", "run": "Run", "save": "Save", "save_as": "Save as", "saved": "Request saved", "share": "Share", "share_description": "Share Hoppscotch with your friends", "title": "Request", "type": "Request type", "url": "URL", "variables": "Variables", "view_my_links": "View my links" }, "response": { "audio": "Audio", "body": "Response Body", "filter_response_body": "Filter JSON response body (uses JSONPath syntax)", "headers": "Headers", "html": "HTML", "image": "Image", "json": "JSON", "pdf": "PDF", "preview_html": "Preview HTML", "raw": "Raw", "size": "Size", "status": "Status", "time": "Time", "title": "Response", "video": "Video", "waiting_for_connection": "waiting for connection", "xml": "XML" }, "settings": { "accent_color": "Accent color", "account": "Account", "account_deleted": "Your account has been deleted", "account_description": "Customize your account settings.", "account_email_description": "Your primary email address.", "account_name_description": "This is your display name.", "background": "Background", "black_mode": "Black", "change_font_size": "Change font size", "choose_language": "Choose language", "dark_mode": "Dark", "delete_account": "Delete account", "delete_account_description": "Once you delete your account, all your data will be permanently deleted. This action cannot be undone.", "expand_navigation": "Expand navigation", "experiments": "Experiments", "experiments_notice": "This is a collection of experiments we're working on that might turn out to be useful, fun, both, or neither. They're not final and may not be stable, so if something overly weird happens, don't panic. Just turn the dang thing off. Jokes aside, ", "extension_ver_not_reported": "Not Reported", "extension_version": "Extension Version", "extensions": "Browser extension", "extensions_use_toggle": "Use the browser extension to send requests (if present)", "follow": "Follow us", "font_size": "Font size", "font_size_large": "Large", "font_size_medium": "Medium", "font_size_small": "Small", "interceptor": "Interceptor", "interceptor_description": "Middleware between application and APIs.", "language": "Language", "light_mode": "Light", "official_proxy_hosting": "Official Proxy is hosted by Hoppscotch.", "profile": "Profile", "profile_description": "Update your profile details", "profile_email": "Email address", "profile_name": "Profile name", "proxy": "Proxy", "proxy_url": "Proxy URL", "proxy_use_toggle": "Use the proxy middleware to send requests", "read_the": "Read the", "reset_default": "Reset to default", "short_codes": "Short codes", "short_codes_description": "Short codes which were created by you.", "sidebar_on_left": "Sidebar on left", "sync": "Synchronise", "sync_collections": "Collections", "sync_description": "These settings are synced to cloud.", "sync_environments": "Environments", "sync_history": "History", "system_mode": "System", "telemetry": "Telemetry", "telemetry_helps_us": "Telemetry helps us to personalize our operations and deliver the best experience to you.", "theme": "Theme", "theme_description": "Customize your application theme.", "use_experimental_url_bar": "Use experimental URL bar with environment highlighting", "user": "User", "verified_email": "Verified email", "verify_email": "Verify email" }, "shortcodes": { "actions": "Actions", "created_on": "Created on", "deleted": "Shortcode deleted", "method": "Method", "not_found": "Shortcode not found", "short_code": "Short code", "url": "URL" }, "shortcut": { "general": { "close_current_menu": "Close current menu", "command_menu": "Search & command menu", "help_menu": "Help menu", "show_all": "Keyboard shortcuts", "title": "General" }, "miscellaneous": { "invite": "Invite people to Hoppscotch", "title": "Miscellaneous" }, "navigation": { "back": "Go back to previous page", "documentation": "Go to Documentation page", "forward": "Go forward to next page", "graphql": "Go to GraphQL page", "profile": "Go to Profile page", "realtime": "Go to Realtime page", "rest": "Go to REST page", "settings": "Go to Settings page", "title": "Navigation" }, "request": { "copy_request_link": "Copy Request Link", "delete_method": "Select DELETE method", "get_method": "Select GET method", "head_method": "Select HEAD method", "method": "Method", "next_method": "Select Next method", "post_method": "Select POST method", "previous_method": "Select Previous method", "put_method": "Select PUT method", "reset_request": "Reset Request", "save_to_collections": "Save to Collections", "send_request": "Send Request", "title": "Request" }, "response": { "copy": "Copy response to clipboard", "download": "Download response as file", "title": "Response" }, "theme": { "black": "Switch theme to black mode", "dark": "Switch theme to dark mode", "light": "Switch theme to light mode", "system": "Switch theme to system mode", "title": "Theme" } }, "show": { "code": "Show code", "collection": "Expand Collection Panel", "more": "Show more", "sidebar": "Expand sidebar" }, "socketio": { "communication": "Communication", "connection_not_authorized": "This SocketIO connection does not use any authentication.", "event_name": "Event/Topic Name", "events": "Events", "log": "Log", "url": "URL" }, "sse": { "event_type": "Event type", "log": "Log", "url": "URL" }, "state": { "bulk_mode": "Bulk edit", "bulk_mode_placeholder": "Entries are separated by newline\nKeys and values are separated by :\nPrepend # to any row you want to add but keep disabled", "cleared": "Cleared", "connected": "Connected", "connected_to": "Connected to {name}", "connecting_to": "Connecting to {name}...", "connection_error": "Failed to connect", "connection_failed": "Connection failed", "connection_lost": "Connection lost", "copied_to_clipboard": "Copied to clipboard", "deleted": "Deleted", "deprecated": "DEPRECATED", "disabled": "Disabled", "disconnected": "Disconnected", "disconnected_from": "Disconnected from {name}", "docs_generated": "Documentation generated", "download_started": "Download started", "enabled": "Enabled", "file_imported": "File imported", "finished_in": "Finished in {duration} ms", "history_deleted": "History deleted", "linewrap": "Wrap lines", "loading": "Loading...", "message_received": "Message: {message} arrived on topic: {topic}", "mqtt_subscription_failed": "Something went wrong while subscribing to topic: {topic}", "none": "None", "nothing_found": "Nothing found for", "published_error": "Something went wrong while publishing msg: {topic} to topic: {message}", "published_message": "Published message: {message} to topic: {topic}", "reconnection_error": "Failed to reconnect", "subscribed_failed": "Failed to subscribe to topic: {topic}", "subscribed_success": "Successfully subscribed to topic: {topic}", "unsubscribed_failed": "Failed to unsubscribe from topic: {topic}", "unsubscribed_success": "Successfully unsubscribed from topic: {topic}", "waiting_send_request": "Waiting to send request" }, "support": { "changelog": "Read more about latest releases", "chat": "Questions? Chat with us!", "community": "Ask questions and help others", "documentation": "Read more about Hoppscotch", "forum": "Ask questions and get answers", "github": "Follow us on Github", "shortcuts": "Browse app faster", "team": "Get in touch with the team", "title": "Support", "twitter": "Follow us on Twitter" }, "tab": { "authorization": "Authorization", "body": "Body", "collections": "Collections", "documentation": "Documentation", "environments": "Environments", "headers": "Headers", "history": "History", "mqtt": "MQTT", "parameters": "Parameters", "pre_request_script": "Pre-request Script", "queries": "Queries", "query": "Query", "schema": "Schema", "socketio": "Socket.IO", "sse": "SSE", "tests": "Tests", "types": "Types", "variables": "Variables", "websocket": "WebSocket" }, "team": { "already_member": "You are already a member of this team. Contact your team owner.", "create_new": "Create new team", "deleted": "Team deleted", "edit": "Edit Team", "email": "E-mail", "email_do_not_match": "Email doesn't match with your account details. Contact your team owner.", "exit": "Exit Team", "exit_disabled": "Only owner cannot exit the team", "invalid_coll_id": "Invalid collection ID", "invalid_email_format": "Email format is invalid", "invalid_id": "Invalid team ID. Contact your team owner.", "invalid_invite_link": "Invalid invite link", "invalid_invite_link_description": "The link you followed is invalid. Contact your team owner.", "invalid_member_permission": "Please provide a valid permission to the team member", "invite": "Invite", "invite_more": "Invite more", "invite_tooltip": "Invite people to this workspace", "invited_to_team": "{owner} invited you to join {team}", "join": "Invitation accepted", "join_beta": "Join the beta program to access teams.", "join_team": "Join {team}", "joined_team": "You have joined {team}", "joined_team_description": "You are now a member of this team", "left": "You left the team", "login_to_continue": "Login to continue", "login_to_continue_description": "You need to be logged in to join a team.", "logout_and_try_again": "Logout and sign in with another account", "member_has_invite": "This email ID already has an invite. Contact your team owner.", "member_not_found": "Member not found. Contact your team owner.", "member_removed": "User removed", "member_role_updated": "User roles updated", "members": "Members", "more_members": "+{count} more", "name_length_insufficient": "Team name should be at least 6 characters long", "name_updated": "Team name updated", "new": "New Team", "new_created": "New team created", "new_name": "My New Team", "no_access": "You do not have edit access to these collections", "no_invite_found": "Invitation not found. Contact your team owner.", "no_request_found": "Request not found.", "not_found": "Team not found. Contact your team owner.", "not_valid_viewer": "You are not a valid viewer. Contact your team owner.", "parent_coll_move": "Cannot move collection to a child collection", "pending_invites": "Pending invites", "permissions": "Permissions", "same_target_destination": "Same target and destination", "saved": "Team saved", "select_a_team": "Select a team", "title": "Teams", "we_sent_invite_link": "We sent an invite link to all invitees!", "we_sent_invite_link_description": "Ask all invitees to check their inbox. Click on the link to join the team." }, "team_environment": { "deleted": "Environment Deleted", "duplicate": "Environment Duplicated", "not_found": "Environment not found." }, "test": { "failed": "test failed", "javascript_code": "JavaScript Code", "learn": "Read documentation", "passed": "test passed", "report": "Test Report", "results": "Test Results", "script": "Script", "snippets": "Snippets" }, "websocket": { "communication": "Communication", "log": "Log", "message": "Message", "protocols": "Protocols", "url": "URL" }, "workspace": { "change": "Change workspace", "personal": "My Workspace", "team": "Team Workspace", "title": "Workspaces" } }
packages/hoppscotch-common/locales/en.json
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0001756899437168613, 0.0001710407668724656, 0.0001649337646085769, 0.0001709343632683158, 0.000001924760454130592 ]
{ "id": 4, "code_window": [ " return pipe(\n", " // contains raw url strings\n", " parsedArguments._.slice(1),\n", " A.findFirstMap(parseURL),\n", " // no url found\n", " O.getOrElse(() => new URL(defaultRESTReq.endpoint))\n" ], "labels": [ "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " [...parsedArguments._.slice(1), location],\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "replace", "edit_start_line_idx": 75 }
<template> <div class="flex flex-col flex-1"> <div class="sticky z-10 flex items-center justify-between flex-shrink-0 pl-4 overflow-x-auto border-b bg-primary border-dividerLight top-upperMobileSecondaryStickyFold sm:top-upperSecondaryStickyFold" > <label class="font-semibold truncate text-secondaryLight"> {{ t("request.header_list") }} </label> <div class="flex"> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" to="https://docs.hoppscotch.io/documentation/features/rest-api-testing" blank :title="t('app.wiki')" :icon="IconHelpCircle" /> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="t('action.clear_all')" :icon="IconTrash2" @click="clearContent()" /> <HoppButtonSecondary v-if="bulkMode" v-tippy="{ theme: 'tooltip' }" :title="t('state.linewrap')" :class="{ '!text-accent': linewrapEnabled }" :icon="IconWrapText" @click.prevent="linewrapEnabled = !linewrapEnabled" /> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="t('state.bulk_mode')" :icon="IconEdit" :class="{ '!text-accent': bulkMode }" @click="bulkMode = !bulkMode" /> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="t('add.new')" :icon="IconPlus" :disabled="bulkMode" @click="addHeader" /> </div> </div> <div v-if="bulkMode" ref="bulkEditor" class="flex flex-col flex-1"></div> <div v-else> <draggable v-model="workingHeaders" :item-key="(header: WorkingHeader) => `header-${header.id}`" animation="250" handle=".draggable-handle" draggable=".draggable-content" ghost-class="cursor-move" chosen-class="bg-primaryLight" drag-class="cursor-grabbing" > <template #item="{ element: header, index }"> <div class="flex border-b divide-x divide-dividerLight border-dividerLight draggable-content group" > <span> <HoppButtonSecondary v-tippy="{ theme: 'tooltip', delay: [500, 20], content: index !== workingHeaders?.length - 1 ? t('action.drag_to_reorder') : null, }" :icon="IconGripVertical" class="cursor-auto text-primary hover:text-primary" :class="{ 'draggable-handle group-hover:text-secondaryLight !cursor-grab': index !== workingHeaders?.length - 1, }" tabindex="-1" /> </span> <HoppSmartAutoComplete :placeholder="`${t('count.header', { count: index + 1 })}`" :source="commonHeaders" :spellcheck="false" :value="header.key" autofocus styles=" bg-transparent flex flex-1 py-1 px-4 truncate " class="flex-1 !flex" @input=" updateHeader(index, { id: header.id, key: $event, value: header.value, active: header.active, }) " /> <SmartEnvInput v-model="header.value" :placeholder="`${t('count.value', { count: index + 1 })}`" @change=" updateHeader(index, { id: header.id, key: header.key, value: $event, active: header.active, }) " /> <span> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" :title=" header.hasOwnProperty('active') ? header.active ? t('action.turn_off') : t('action.turn_on') : t('action.turn_off') " :icon=" header.hasOwnProperty('active') ? header.active ? IconCheckCircle : IconCircle : IconCheckCircle " color="green" @click=" updateHeader(index, { id: header.id, key: header.key, value: header.value, active: !header.active, }) " /> </span> <span> <HoppButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="t('action.remove')" :icon="IconTrash" color="red" @click="deleteHeader(index)" /> </span> </div> </template> </draggable> <draggable v-model="computedHeaders" item-key="id" animation="250" handle=".draggable-handle" draggable=".draggable-content" ghost-class="cursor-move" chosen-class="bg-primaryLight" drag-class="cursor-grabbing" > <template #item="{ element: header, index }"> <div class="flex border-b divide-x divide-dividerLight border-dividerLight draggable-content group" > <span> <HoppButtonSecondary :icon="IconLock" class="opacity-25 cursor-auto text-secondaryLight bg-divider" tabindex="-1" /> </span> <SmartEnvInput v-model="header.header.key" :placeholder="`${t('count.value', { count: index + 1 })}`" readonly /> <SmartEnvInput :model-value="mask(header)" :placeholder="`${t('count.value', { count: index + 1 })}`" readonly /> <span> <HoppButtonSecondary v-if="header.source === 'auth'" :icon="masking ? IconEye : IconEyeOff" @click="toggleMask()" /> <HoppButtonSecondary v-else :icon="IconArrowUpRight" class="cursor-auto text-primary hover:text-primary" /> </span> <span> <HoppButtonSecondary :icon="IconArrowUpRight" @click="changeTab(header.source)" /> </span> </div> </template> </draggable> <div v-if="workingHeaders.length === 0" class="flex flex-col items-center justify-center p-4 text-secondaryLight" > <img :src="`/images/states/${colorMode.value}/add_category.svg`" loading="lazy" class="inline-flex flex-col object-contain object-center w-16 h-16 my-4" :alt="`${t('empty.headers')}`" /> <span class="pb-4 text-center">{{ t("empty.headers") }}</span> <HoppButtonSecondary filled :label="`${t('add.new')}`" :icon="IconPlus" class="mb-4" @click="addHeader" /> </div> </div> </div> </template> <script setup lang="ts"> import IconHelpCircle from "~icons/lucide/help-circle" import IconTrash2 from "~icons/lucide/trash-2" import IconEdit from "~icons/lucide/edit" import IconPlus from "~icons/lucide/plus" import IconGripVertical from "~icons/lucide/grip-vertical" import IconCheckCircle from "~icons/lucide/check-circle" import IconCircle from "~icons/lucide/circle" import IconTrash from "~icons/lucide/trash" import IconLock from "~icons/lucide/lock" import IconEye from "~icons/lucide/eye" import IconEyeOff from "~icons/lucide/eye-off" import IconArrowUpRight from "~icons/lucide/arrow-up-right" import IconWrapText from "~icons/lucide/wrap-text" import { useColorMode } from "@composables/theming" import { computed, reactive, ref, watch } from "vue" import { isEqual, cloneDeep } from "lodash-es" import { HoppRESTHeader, HoppRESTRequest, parseRawKeyValueEntriesE, rawKeyValueEntriesToString, RawKeyValueEntry, } from "@hoppscotch/data" import { flow, pipe } from "fp-ts/function" import * as RA from "fp-ts/ReadonlyArray" import * as E from "fp-ts/Either" import * as O from "fp-ts/Option" import * as A from "fp-ts/Array" import draggable from "vuedraggable-es" import { RequestOptionTabs } from "./RequestOptions.vue" import { useCodemirror } from "@composables/codemirror" import { commonHeaders } from "~/helpers/headers" import { useI18n } from "@composables/i18n" import { useReadonlyStream } from "@composables/stream" import { useToast } from "@composables/toast" import linter from "~/helpers/editor/linting/rawKeyValue" import { throwError } from "~/helpers/functional/error" import { objRemoveKey } from "~/helpers/functional/object" import { ComputedHeader, getComputedHeaders, } from "~/helpers/utils/EffectiveURL" import { aggregateEnvs$, getAggregateEnvs } from "~/newstore/environments" import { useVModel } from "@vueuse/core" const t = useI18n() const toast = useToast() const colorMode = useColorMode() const idTicker = ref(0) const bulkMode = ref(false) const bulkHeaders = ref("") const bulkEditor = ref<any | null>(null) const linewrapEnabled = ref(true) const deletionToast = ref<{ goAway: (delay: number) => void } | null>(null) // v-model integration with props and emit const props = defineProps<{ modelValue: HoppRESTRequest }>() const emit = defineEmits<{ (e: "change-tab", value: RequestOptionTabs): void (e: "update:modelValue", value: HoppRESTRequest): void }>() const request = useVModel(props, "modelValue", emit) useCodemirror( bulkEditor, bulkHeaders, reactive({ extendedEditorConfig: { mode: "text/x-yaml", placeholder: `${t("state.bulk_mode_placeholder")}`, lineWrapping: linewrapEnabled, }, linter, completer: null, environmentHighlights: true, }) ) type WorkingHeader = HoppRESTHeader & { id: number } // The UI representation of the headers list (has the empty end headers) const workingHeaders = ref<Array<WorkingHeader>>([ { id: idTicker.value++, key: "", value: "", active: true, }, ]) // Rule: Working Headers always have last element is always an empty header watch(workingHeaders, (headersList) => { if ( headersList.length > 0 && headersList[headersList.length - 1].key !== "" ) { workingHeaders.value.push({ id: idTicker.value++, key: "", value: "", active: true, }) } }) // Sync logic between headers and working/bulk headers watch( request.value.headers, (newHeadersList) => { // Sync should overwrite working headers const filteredWorkingHeaders = pipe( workingHeaders.value, A.filterMap( flow( O.fromPredicate((e) => e.key !== ""), O.map(objRemoveKey("id")) ) ) ) const filteredBulkHeaders = pipe( parseRawKeyValueEntriesE(bulkHeaders.value), E.map( flow( RA.filter((e) => e.key !== ""), RA.toArray ) ), E.getOrElse(() => [] as RawKeyValueEntry[]) ) if (!isEqual(newHeadersList, filteredWorkingHeaders)) { workingHeaders.value = pipe( newHeadersList, A.map((x) => ({ id: idTicker.value++, ...x })) ) } if (!isEqual(newHeadersList, filteredBulkHeaders)) { bulkHeaders.value = rawKeyValueEntriesToString(newHeadersList) } }, { immediate: true } ) watch(workingHeaders, (newWorkingHeaders) => { const fixedHeaders = pipe( newWorkingHeaders, A.filterMap( flow( O.fromPredicate((e) => e.key !== ""), O.map(objRemoveKey("id")) ) ) ) if (!isEqual(request.value.headers, fixedHeaders)) { request.value.headers = cloneDeep(fixedHeaders) } }) watch(bulkHeaders, (newBulkHeaders) => { const filteredBulkHeaders = pipe( parseRawKeyValueEntriesE(newBulkHeaders), E.map( flow( RA.filter((e) => e.key !== ""), RA.toArray ) ), E.getOrElse(() => [] as RawKeyValueEntry[]) ) if (!isEqual(props.modelValue, filteredBulkHeaders)) { request.value.headers = filteredBulkHeaders } }) const addHeader = () => { workingHeaders.value.push({ id: idTicker.value++, key: "", value: "", active: true, }) } const updateHeader = ( index: number, header: HoppRESTHeader & { id: number } ) => { workingHeaders.value = workingHeaders.value.map((h, i) => i === index ? header : h ) } const deleteHeader = (index: number) => { const headersBeforeDeletion = cloneDeep(workingHeaders.value) if ( !( headersBeforeDeletion.length > 0 && index === headersBeforeDeletion.length - 1 ) ) { if (deletionToast.value) { deletionToast.value.goAway(0) deletionToast.value = null } deletionToast.value = toast.success(`${t("state.deleted")}`, { action: [ { text: `${t("action.undo")}`, onClick: (_, toastObject) => { workingHeaders.value = headersBeforeDeletion toastObject.goAway(0) deletionToast.value = null }, }, ], onComplete: () => { deletionToast.value = null }, }) } workingHeaders.value = pipe( workingHeaders.value, A.deleteAt(index), O.getOrElseW(() => throwError("Working Headers Deletion Out of Bounds")) ) } const clearContent = () => { // set params list to the initial state workingHeaders.value = [ { id: idTicker.value++, key: "", value: "", active: true, }, ] bulkHeaders.value = "" } const aggregateEnvs = useReadonlyStream(aggregateEnvs$, getAggregateEnvs()) const computedHeaders = computed(() => getComputedHeaders(request.value, aggregateEnvs.value).map( (header, index) => ({ id: `header-${index}`, ...header, }) ) ) const masking = ref(true) const toggleMask = () => { masking.value = !masking.value } const mask = (header: ComputedHeader) => { if (header.source === "auth" && masking.value) return header.header.value.replace(/\S/gi, "*") return header.header.value } const changeTab = (tab: ComputedHeader["source"]) => { if (tab === "auth") emit("change-tab", "authorization") else emit("change-tab", "bodyParams") } </script>
packages/hoppscotch-common/src/components/http/Headers.vue
1
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0006267903954721987, 0.0001861761265899986, 0.00016462281928397715, 0.000171920022694394, 0.00007028422987787053 ]
{ "id": 4, "code_window": [ " return pipe(\n", " // contains raw url strings\n", " parsedArguments._.slice(1),\n", " A.findFirstMap(parseURL),\n", " // no url found\n", " O.getOrElse(() => new URL(defaultRESTReq.endpoint))\n" ], "labels": [ "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " [...parsedArguments._.slice(1), location],\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "replace", "edit_start_line_idx": 75 }
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" fill="none"><path fill="#10B981" d="M0 0h512v512H0z"/><circle cx="197.76" cy="157.84" r="10" fill="#fff" fill-opacity=".75"/><circle cx="259.76" cy="161.84" r="12" fill="#fff" fill-opacity=".75"/><circle cx="319.76" cy="177.84" r="10" fill="#fff" fill-opacity=".75"/><path d="M344.963 235.676c2.075-12.698-38.872-29.804-90.967-38.094-52.09-8.296-96.404-4.665-98.48 8.033-.257 1.035 0 1.812.263 2.853-1.298-.521-76.714 211.212-76.714 211.212H364.14s-17.621-181.414-20.211-181.414c.515-.772 1.035-1.549 1.035-2.59Z" fill="url(#a)"/><path d="M314.902 227.386c-1.298 8.033-30.839 9.845-66.343 4.402-35.247-5.7-62.982-16.843-61.684-24.618.521-2.59 3.888-4.665 9.331-5.7-18.141.777-30.062 4.145-31.096 9.845-1.555 10.628 34.726 25.139 81.373 32.657 46.647 7.512 85.782 4.665 87.594-5.7 1.041-6.226-9.33-12.961-26.431-19.439 4.923 2.847 7.513 5.957 7.256 8.553Z" fill="#A7F3D0" fill-opacity=".5"/><path d="M333.557 157.413c-3.104-32.137-27.729-59.351-60.9-64.53-33.172-5.186-64.531 12.954-77.749 42.238 21.251 1.298 44.057 3.631 67.904 7.518 25.396 3.888 49.237 9.074 70.745 14.774Z" fill="url(#b)"/><path d="M74.142 158.002c-2.59 15.808 30.319 35.247 81.894 51.055-.257-1.04-.257-1.818-.257-2.853 2.07-12.698 46.127-16.328 98.48-8.032 52.347 8.29 93.037 25.396 90.961 38.094-.257 1.04-.514 1.818-1.035 2.589 53.645.778 90.968-7.512 93.557-23.32 3.625-24.104-74.638-56.498-174.93-72.306-100.555-15.808-185.045-9.331-188.67 14.773Zm115.586-1.298c.778-4.145 4.665-7.255 8.81-6.477 4.145.777 7.256 4.665 6.478 8.81-.52 4.145-4.665 6.998-8.81 6.478-4.145-.778-7.255-4.666-6.478-8.811Zm59.866 4.145c.777-5.7 6.22-9.587 11.92-8.547 5.7.778 9.588 6.215 8.553 11.921-1.041 5.442-6.478 9.33-11.92 8.553-5.706-.778-9.594-6.221-8.553-11.927Zm62.975 15.294c.778-4.145 4.665-7.255 8.81-6.478 4.145.778 7.255 4.666 6.478 8.811-.515 4.145-4.665 7.255-8.81 6.477-4.145-.777-7.256-4.665-6.478-8.81Z" fill="url(#c)"/><defs><radialGradient id="b" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 32.7063 -69.3245 0 264.232 124.706)"><stop stop-color="#047857"/><stop offset="1" stop-color="#064E3B"/></radialGradient><radialGradient id="c" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(255.837 186.754) scale(1389.61)"><stop stop-color="#047857"/><stop offset=".115" stop-color="#064E3B"/></radialGradient><linearGradient id="a" x1="224.998" y1="157.606" x2="224.998" y2="403.696" gradientUnits="userSpaceOnUse"><stop stop-color="#86EFAC" stop-opacity=".75"/><stop offset=".635" stop-color="#fff" stop-opacity=".2"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient></defs></svg>
packages/hoppscotch-common/public/logo.svg
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.0018741104286164045, 0.0018741104286164045, 0.0018741104286164045, 0.0018741104286164045, 0 ]
{ "id": 4, "code_window": [ " return pipe(\n", " // contains raw url strings\n", " parsedArguments._.slice(1),\n", " A.findFirstMap(parseURL),\n", " // no url found\n", " O.getOrElse(() => new URL(defaultRESTReq.endpoint))\n" ], "labels": [ "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " [...parsedArguments._.slice(1), location],\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "replace", "edit_start_line_idx": 75 }
import extensionStrategy, { hasExtensionInstalled, hasChromeExtensionInstalled, hasFirefoxExtensionInstalled, cancelRunningExtensionRequest, } from "../ExtensionStrategy" jest.mock("../../utils/b64", () => ({ __esModule: true, decodeB64StringToArrayBuffer: jest.fn((data) => `${data}-converted`), })) jest.mock("~/newstore/settings", () => { return { __esModule: true, settingsStore: { value: { EXTENSIONS_ENABLED: true, PROXY_ENABLED: false, }, }, } }) describe("hasExtensionInstalled", () => { test("returns true if extension is present and hooked", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = {} expect(hasExtensionInstalled()).toEqual(true) }) test("returns false if extension not present or not hooked", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = undefined expect(hasExtensionInstalled()).toEqual(false) }) }) describe("hasChromeExtensionInstalled", () => { test("returns true if extension is hooked and browser is chrome", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = {} jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Chrome") jest.spyOn(navigator, "vendor", "get").mockReturnValue("Google") expect(hasChromeExtensionInstalled()).toEqual(true) }) test("returns false if extension is hooked and browser is not chrome", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = {} jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Firefox") jest.spyOn(navigator, "vendor", "get").mockReturnValue("Google") expect(hasChromeExtensionInstalled()).toEqual(false) }) test("returns false if extension not installed and browser is chrome", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = undefined jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Chrome") jest.spyOn(navigator, "vendor", "get").mockReturnValue("Google") expect(hasChromeExtensionInstalled()).toEqual(false) }) test("returns false if extension not installed and browser is not chrome", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = undefined jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Firefox") jest.spyOn(navigator, "vendor", "get").mockReturnValue("Google") expect(hasChromeExtensionInstalled()).toEqual(false) }) }) describe("hasFirefoxExtensionInstalled", () => { test("returns true if extension is hooked and browser is firefox", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = {} jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Firefox") expect(hasFirefoxExtensionInstalled()).toEqual(true) }) test("returns false if extension is hooked and browser is not firefox", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = {} jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Chrome") expect(hasFirefoxExtensionInstalled()).toEqual(false) }) test("returns false if extension not installed and browser is firefox", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = undefined jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Firefox") expect(hasFirefoxExtensionInstalled()).toEqual(false) }) test("returns false if extension not installed and browser is not firefox", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = undefined jest.spyOn(navigator, "userAgent", "get").mockReturnValue("Chrome") expect(hasFirefoxExtensionInstalled()).toEqual(false) }) }) describe("cancelRunningExtensionRequest", () => { const cancelFunc = jest.fn() beforeEach(() => { cancelFunc.mockClear() }) test("cancels request if extension installed and function present in hook", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = { cancelRunningRequest: cancelFunc, } cancelRunningExtensionRequest() expect(cancelFunc).toHaveBeenCalledTimes(1) }) test("does not cancel request if extension not installed", () => { global.__POSTWOMAN_EXTENSION_HOOK__ = undefined cancelRunningExtensionRequest() expect(cancelFunc).not.toHaveBeenCalled() }) }) describe("extensionStrategy", () => { const sendReqFunc = jest.fn() beforeEach(() => { sendReqFunc.mockClear() }) describe("Non-Proxy Requests", () => { test("ask extension to send request", async () => { global.__POSTWOMAN_EXTENSION_HOOK__ = { sendRequest: sendReqFunc, } sendReqFunc.mockResolvedValue({ data: '{"success":true,"data":""}', }) await extensionStrategy({})() expect(sendReqFunc).toHaveBeenCalledTimes(1) }) test("sends request to the actual sender if proxy disabled", async () => { let passedUrl global.__POSTWOMAN_EXTENSION_HOOK__ = { sendRequest: sendReqFunc, } sendReqFunc.mockImplementation(({ url }) => { passedUrl = url return Promise.resolve({ data: '{"success":true,"data":""}', }) }) await extensionStrategy({ url: "test" })() expect(passedUrl).toEqual("test") }) test("asks extension to get binary data", async () => { let passedFields global.__POSTWOMAN_EXTENSION_HOOK__ = { sendRequest: sendReqFunc, } sendReqFunc.mockImplementation((fields) => { passedFields = fields return Promise.resolve({ data: '{"success":true,"data":""}', }) }) await extensionStrategy({})() expect(passedFields).toHaveProperty("wantsBinary") }) test("rights successful requests", async () => { global.__POSTWOMAN_EXTENSION_HOOK__ = { sendRequest: sendReqFunc, } sendReqFunc.mockResolvedValue({ data: '{"success":true,"data":""}', }) expect(await extensionStrategy({})()).toBeRight() }) test("rejects errors as-is", async () => { global.__POSTWOMAN_EXTENSION_HOOK__ = { sendRequest: sendReqFunc, } sendReqFunc.mockRejectedValue("err") expect(await extensionStrategy({})()).toEqualLeft("err") }) }) })
packages/hoppscotch-common/src/helpers/strategies/__tests__/ExtensionStrategy-NoProxy.spec.js
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.00017722525808494538, 0.0001714871177682653, 0.0001663385919528082, 0.0001717975246720016, 0.00000290682783088414 ]
{ "id": 4, "code_window": [ " return pipe(\n", " // contains raw url strings\n", " parsedArguments._.slice(1),\n", " A.findFirstMap(parseURL),\n", " // no url found\n", " O.getOrElse(() => new URL(defaultRESTReq.endpoint))\n" ], "labels": [ "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " [...parsedArguments._.slice(1), location],\n" ], "file_path": "packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts", "type": "replace", "edit_start_line_idx": 75 }
<template> <div class="flex flex-col"> <h1 class="text-lg font-bold text-secondaryDark">Dashboard</h1> <div v-if="fetching" class="flex justify-center py-6"> <HoppSmartSpinner /> </div> <div v-else-if="error || !metrics"> <p class="text-xl">No Metrics Found..</p> </div> <div v-else> <div class="py-10 grid lg:grid-cols-2 gap-6"> <DashboardMetricsCard :count="metrics.usersCount" label="Total Users" :icon="UserIcon" color="text-green-400" /> <DashboardMetricsCard :count="metrics.teamsCount" label="Total Teams" :icon="UsersIcon" color="text-pink-400" /> <DashboardMetricsCard :count="metrics.teamRequestsCount" label="Total Requests" :icon="LineChartIcon" color="text-cyan-400" /> <DashboardMetricsCard :count="metrics.teamCollectionsCount" label="Total Collections" :icon="FolderTreeIcon" color="text-orange-400" /> </div> </div> </div> </template> <script setup lang="ts"> import { computed } from 'vue'; import { useQuery } from '@urql/vue'; import { MetricsDocument } from '../helpers/backend/graphql'; import UserIcon from '~icons/lucide/user'; import UsersIcon from '~icons/lucide/users'; import LineChartIcon from '~icons/lucide/line-chart'; import FolderTreeIcon from '~icons/lucide/folder-tree'; // Get Metrics Data const { fetching, error, data } = useQuery({ query: MetricsDocument }); const metrics = computed(() => data?.value?.admin); </script>
packages/hoppscotch-sh-admin/src/pages/dashboard.vue
0
https://github.com/hoppscotch/hoppscotch/commit/2afc87847d75c2990f69135f83da6ea01b28e7d1
[ 0.00017759807815309614, 0.0001752328098518774, 0.0001732491800794378, 0.00017498670786153525, 0.0000015359660210378934 ]
{ "id": 0, "code_window": [ " :label=\"$t('response.headers')\"\n", " :info=\"`${headerLength}`\"\n", " >\n", " <LensesHeadersRenderer :headers=\"response.headers\" />\n", " </SmartTab>\n", " <SmartTab id=\"results\" :label=\"$t('test.results')\">\n", " <HttpTestResult />\n", " </SmartTab>\n", " </SmartTabs>\n", "</template>\n", "\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <SmartTab\n", " id=\"results\"\n", " :label=\"$t('test.results')\"\n", " :indicator=\"\n", " testResults &&\n", " (testResults.expectResults.length || testResults.tests.length)\n", " ? true\n", " : false\n", " \"\n", " >\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "replace", "edit_start_line_idx": 19 }
<template> <SmartTabs styles="sticky z-10 bg-primary top-lowerPrimaryStickyFold"> <SmartTab v-for="(lens, index) in validLenses" :id="lens.renderer" :key="`lens-${index}`" :label="$t(lens.lensName)" :selected="index === 0" > <component :is="lens.renderer" :response="response" /> </SmartTab> <SmartTab v-if="headerLength" id="headers" :label="$t('response.headers')" :info="`${headerLength}`" > <LensesHeadersRenderer :headers="response.headers" /> </SmartTab> <SmartTab id="results" :label="$t('test.results')"> <HttpTestResult /> </SmartTab> </SmartTabs> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" import { getSuitableLenses, getLensRenderers } from "~/helpers/lenses/lenses" export default defineComponent({ components: { // Lens Renderers ...getLensRenderers(), }, props: { response: { type: Object, default: () => {} }, }, computed: { headerLength() { if (!this.response || !this.response.headers) return 0 return Object.keys(this.response.headers).length }, validLenses() { if (!this.response) return [] return getSuitableLenses(this.response) }, }, }) </script>
packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue
1
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.995062530040741, 0.1665668934583664, 0.00017132778884842992, 0.0005095736123621464, 0.3705156147480011 ]
{ "id": 0, "code_window": [ " :label=\"$t('response.headers')\"\n", " :info=\"`${headerLength}`\"\n", " >\n", " <LensesHeadersRenderer :headers=\"response.headers\" />\n", " </SmartTab>\n", " <SmartTab id=\"results\" :label=\"$t('test.results')\">\n", " <HttpTestResult />\n", " </SmartTab>\n", " </SmartTabs>\n", "</template>\n", "\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <SmartTab\n", " id=\"results\"\n", " :label=\"$t('test.results')\"\n", " :indicator=\"\n", " testResults &&\n", " (testResults.expectResults.length || testResults.tests.length)\n", " ? true\n", " : false\n", " \"\n", " >\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "replace", "edit_start_line_idx": 19 }
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
packages/hoppscotch-app/assets/icons/chevron-down.svg
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00017497876251582056, 0.00017497876251582056, 0.00017497876251582056, 0.00017497876251582056, 0 ]
{ "id": 0, "code_window": [ " :label=\"$t('response.headers')\"\n", " :info=\"`${headerLength}`\"\n", " >\n", " <LensesHeadersRenderer :headers=\"response.headers\" />\n", " </SmartTab>\n", " <SmartTab id=\"results\" :label=\"$t('test.results')\">\n", " <HttpTestResult />\n", " </SmartTab>\n", " </SmartTabs>\n", "</template>\n", "\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <SmartTab\n", " id=\"results\"\n", " :label=\"$t('test.results')\"\n", " :indicator=\"\n", " testResults &&\n", " (testResults.expectResults.length || testResults.tests.length)\n", " ? true\n", " : false\n", " \"\n", " >\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "replace", "edit_start_line_idx": 19 }
<template> <svg :height="radius * 2" :width="radius * 2"> <circle :stroke-width="stroke" class="stroke-green-500" fill="transparent" :r="normalizedRadius" :cx="radius" :cy="radius" /> <circle :stroke-width="stroke" stroke="currentColor" fill="transparent" :r="normalizedRadius" :cx="radius" :cy="radius" :style="{ strokeDashoffset: strokeDashoffset }" :stroke-dasharray="circumference + ' ' + circumference" /> </svg> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" export default defineComponent({ props: { radius: { type: Number, default: 12, }, progress: { type: Number, default: 50, }, stroke: { type: Number, default: 4, }, }, data() { const normalizedRadius = this.radius - this.stroke * 2 const circumference = normalizedRadius * 2 * Math.PI return { normalizedRadius, circumference, } }, computed: { strokeDashoffset() { return this.circumference - (this.progress / 100) * this.circumference }, }, }) </script>
packages/hoppscotch-app/components/smart/ProgressRing.vue
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00017790384299587458, 0.00017630094953346997, 0.00017314282013103366, 0.0001769430673448369, 0.0000017301404113823082 ]
{ "id": 0, "code_window": [ " :label=\"$t('response.headers')\"\n", " :info=\"`${headerLength}`\"\n", " >\n", " <LensesHeadersRenderer :headers=\"response.headers\" />\n", " </SmartTab>\n", " <SmartTab id=\"results\" :label=\"$t('test.results')\">\n", " <HttpTestResult />\n", " </SmartTab>\n", " </SmartTabs>\n", "</template>\n", "\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <SmartTab\n", " id=\"results\"\n", " :label=\"$t('test.results')\"\n", " :indicator=\"\n", " testResults &&\n", " (testResults.expectResults.length || testResults.tests.length)\n", " ? true\n", " : false\n", " \"\n", " >\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "replace", "edit_start_line_idx": 19 }
{ "action": { "cancel": "Cancelar", "choose_file": "Escolha um arquivo", "clear": "Claro", "clear_all": "Limpar tudo", "connect": "Conectar", "copy": "cópia de", "delete": "Excluir", "disconnect": "desconectar", "dismiss": "Dispensar", "download_file": "⇬ Fazer download do arquivo", "edit": "Editar", "go_back": "Volte", "label": "Etiqueta", "learn_more": "Saber mais", "more": "Mais", "new": "Novo", "no": "Não", "preserve_current": "Preservar corrente", "prettify": "Embelezar", "remove": "Remover", "replace_current": "Substitua a corrente", "replace_json": "Substitua por JSON", "restore": "Restaurar", "save": "Salvar", "search": "Procurar", "send": "Mandar", "start": "Começar", "stop": "Pare", "turn_off": "Desligar", "turn_on": "Ligar", "undo": "Desfazer", "yes": "sim" }, "add": { "new": "Adicionar novo", "star": "Adicionar estrela" }, "app": { "chat_with_us": "Converse conosco", "contact_us": "Contate-Nos", "copy": "cópia de", "documentation": "Documentação", "github": "GitHub", "help": "Ajuda, feedback e documentação", "home": "Lar", "invite": "Convidar", "invite_description": "No Hoppscotch, projetamos uma interface simples e intuitiva para criar e gerenciar suas APIs. Hoppscotch é uma ferramenta que o ajuda a construir, testar, documentar e compartilhar suas APIs.", "invite_your_friends": "Convide seus amigos", "join_discord_community": "Junte-se à nossa comunidade Discord", "keyboard_shortcuts": "Atalhos do teclado", "name": "Hoppscotch", "new_version_found": "Nova versão encontrada. Atualize para atualizar.", "proxy_privacy_policy": "Política de privacidade do proxy", "reload": "recarregar", "search": "Procurar", "share": "Compartilhado", "shortcuts": "Atalhos", "spotlight": "Holofote", "status": "Status", "terms_and_privacy": "Termos e privacidade", "twitter": "Twitter", "type_a_command_search": "Digite um comando ou pesquise ...", "version": "v2.0", "we_use_cookies": "Usamos cookies", "whats_new": "O que há de novo?", "wiki": "Wiki" }, "auth": { "account_exists": "A conta existe com credenciais diferentes - Faça login para vincular as duas contas", "all_sign_in_options": "Todas as opções de login", "continue_with_email": "Continue com Email", "continue_with_github": "Continue com GitHub", "continue_with_google": "Continue com o Google", "email": "E-mail", "logged_out": "Desconectado", "login": "Conecte-se", "login_success": "Conectado com sucesso", "login_to_hoppscotch": "Faça login no Hoppscotch", "logout": "Sair", "re_enter_email": "Digite o e-mail novamente", "send_magic_link": "Envie um link mágico", "sync": "Sincronizar", "we_sent_magic_link": "Enviamos a você um link mágico!", "we_sent_magic_link_description": "Verifique sua caixa de entrada - enviamos um e-mail para {email}. Ele contém um link mágico que fará o seu login." }, "authorization": { "generate_token": "Gerar token", "include_in_url": "Incluir no URL", "learn": "Aprenda como", "password": "Senha", "token": "Símbolo", "type": "Tipo de Autorização", "username": "Nome do usuário" }, "collection": { "created": "Coleção criada", "edit": "Editar coleção", "invalid_name": "Forneça um nome válido para a coleção", "my_collections": "Minhas coleções", "name": "Minha nova coleção", "new": "Nova coleção", "renamed": "Coleção renomeada", "save_as": "Salvar como", "select": "Selecione uma coleção", "select_location": "Selecione a localização", "select_team": "Selecione uma equipe", "team_collections": "Coleções da equipe" }, "confirm": { "logout": "Tem certeza que deseja sair?", "remove_collection": "Tem certeza de que deseja excluir esta coleção permanentemente?", "remove_environment": "Tem certeza de que deseja excluir este ambiente permanentemente?", "remove_folder": "Tem certeza de que deseja excluir esta pasta permanentemente?", "remove_history": "Tem certeza de que deseja excluir permanentemente todo o histórico?", "remove_request": "Tem certeza de que deseja excluir permanentemente esta solicitação?", "remove_team": "Tem certeza que deseja excluir esta equipe?", "remove_telemetry": "Tem certeza de que deseja cancelar a telemetria?", "sync": "Tem certeza de que deseja sincronizar este espaço de trabalho?" }, "count": { "header": "Cabeçalho {contagem}", "message": "Mensagem {contagem}", "parameter": "Parâmetro {contagem}", "protocol": "Protocolo {contagem}", "value": "Valor {contagem}", "variable": "Variável {contagem}" }, "documentation": { "generate": "Gerar documentação", "generate_message": "Importe qualquer coleção de Hoppscotch para gerar documentação de API em movimento." }, "empty": { "authorization": "Esta solicitação não usa nenhuma autorização", "body": "Este pedido não tem corpo", "collection": "Coleção está vazia", "collections": "Coleções estão vazias", "environments": "Ambientes estão vazios", "folder": "Pasta está vazia", "headers": "Esta solicitação não possui cabeçalhos", "history": "A história está vazia", "members": "Time está vazio", "parameters": "Esta solicitação não possui parâmetros", "protocols": "Os protocolos estão vazios", "schema": "Conecte-se a um endpoint GraphQL", "team_name": "Nome do time vazio", "teams": "Times estão vazios", "tests": "Não há testes para esta solicitação" }, "environment": { "create_new": "Crie um novo ambiente", "edit": "Editar Ambiente", "invalid_name": "Forneça um nome válido para o ambiente", "new": "Novo ambiente", "no_environment": "Sem ambiente", "select": "Selecione o ambiente", "title": "Ambientes", "variable_list": "Lista de Variáveis" }, "error": { "browser_support_sse": "Este navegador não parece ter suporte para eventos enviados pelo servidor.", "check_console_details": "Verifique o log do console para obter detalhes.", "curl_invalid_format": "cURL não está formatado corretamente", "empty_req_name": "Nome do pedido vazio", "f12_details": "(F12 para detalhes)", "gql_prettify_invalid_query": "Não foi possível justificar uma consulta inválida, resolva os erros de sintaxe da consulta e tente novamente", "json_prettify_invalid_body": "Não foi possível embelezar um corpo inválido, resolver erros de sintaxe json e tentar novamente", "network_fail": "Não foi possível enviar pedido", "no_duration": "Sem duração", "something_went_wrong": "Algo deu errado" }, "export": { "as_json": "Exportar como JSON", "create_secret_gist": "Crie uma essência secreta", "gist_created": "Gist criado", "require_github": "Faça login com GitHub para criar uma essência secreta" }, "folder": { "created": "Pasta criada", "edit": "Editar pasta", "invalid_name": "Forneça um nome para a pasta", "new": "Nova pasta", "renamed": "Pasta renomeada" }, "graphql": { "mutations": "Mutações", "schema": "Esquema", "subscriptions": "Assinaturas" }, "header": { "account": "Conta", "install_pwa": "Instalar aplicativo", "login": "Conecte-se", "save_workspace": "Salvar meu espaço de trabalho" }, "helpers": { "authorization": "O cabeçalho da autorização será gerado automaticamente quando você enviar a solicitação.", "generate_documentation_first": "Gere a documentação primeiro", "network_fail": "Incapaz de alcançar o endpoint da API. Verifique sua conexão de rede e tente novamente.", "offline": "Você parece estar offline. Os dados neste espaço de trabalho podem não estar atualizados.", "offline_short": "Você parece estar offline.", "post_request_tests": "Os scripts de teste são gravados em JavaScript e executados após o recebimento da resposta.", "pre_request_script": "Os scripts de pré-solicitação são gravados em JavaScript e executados antes do envio da solicitação.", "tests": "Escreva um script de teste para automatizar a depuração." }, "hide": { "more": "Esconda mais", "preview": "Esconder a Antevisão", "sidebar": "Ocultar barra lateral" }, "import": { "collections": "Importar coleções", "curl": "Importar cURL", "failed": "A importação falhou", "from_gist": "Importar do Gist", "from_my_collections": "Importar de minhas coleções", "gist_url": "Insira o URL da essência", "json": "Importar de JSON", "title": "Importar" }, "layout": { "column": "Vertical layout", "row": "Horizontal layout", "zen_mode": "Modo zen" }, "modal": { "collections": "Coleções", "confirm": "confirme", "edit_request": "Editar pedido", "import_export": "Importar / Exportar" }, "mqtt": { "communication": "Comunicação", "log": "Registro", "message": "Mensagem", "publish": "Publicar", "subscribe": "Se inscrever", "topic": "Tema", "topic_name": "Nome do tópico", "topic_title": "Publicar / Assinar tópico", "unsubscribe": "Cancelar subscrição", "url": "URL" }, "navigation": { "doc": "Docs", "graphql": "GraphQL", "realtime": "Tempo real", "rest": "REST", "settings": "Configurações" }, "preRequest": { "javascript_code": "Código JavaScript", "learn": "Leia a documentação", "script": "Script de pré-solicitação", "snippets": "Trechos" }, "remove": { "star": "Remover estrela" }, "request": { "added": "Pedido adicionado", "authorization": "Autorização", "body": "Corpo de Solicitação", "choose_language": "Escolha o seu idioma", "content_type": "Tipo de conteúdo", "copy_link": "Link de cópia", "duration": "Duração", "enter_curl": "Digite cURL", "generate_code": "Gerar código", "generated_code": "Código gerado", "header_list": "Lista de Cabeçalhos", "invalid_name": "Forneça um nome para o pedido", "method": "Método", "name": "Nome do pedido", "parameter_list": "Parâmetros de consulta", "parameters": "Parâmetros", "payload": "Carga útil", "query": "Consulta", "raw_body": "Corpo de Solicitação Bruta", "renamed": "Pedido renomeado", "run": "Corre", "save": "Salvar", "save_as": "Salvar como", "saved": "Pedido salvo", "share": "Compartilhado", "title": "Solicitar", "type": "Tipo de solicitação", "url": "URL", "variables": "Variáveis" }, "response": { "body": "Corpo de Resposta", "headers": "Cabeçalhos", "html": "HTML", "image": "Imagem", "json": "JSON", "preview_html": "Pré-visualizar HTML", "raw": "Cru", "size": "Tamanho", "status": "Status", "time": "Tempo", "title": "Resposta", "waiting_for_connection": "aguardando conexão", "xml": "XML" }, "settings": { "accent_color": "Cor de destaque", "account": "Conta", "account_description": "Personalize as configurações da sua conta.", "account_email_description": "Seu endereço de e-mail principal.", "account_name_description": "Este é o seu nome de exibição.", "background": "Fundo", "black_mode": "Preto", "change_font_size": "Mudar TAMANHO DA FONTE", "choose_language": "Escolha o seu idioma", "dark_mode": "Escuro", "experiments": "Experimentos", "experiments_notice": "Esta é uma coleção de experimentos em que estamos trabalhando que podem ser úteis, divertidos, ambos ou nenhum dos dois. Eles não são finais e podem não ser estáveis, portanto, se algo muito estranho acontecer, não entre em pânico. Apenas desligue essa maldita coisa. Piadas à parte,", "extension_ver_not_reported": "Não reportado", "extension_version": "Versão da extensão", "extensions": "Extensões", "extensions_use_toggle": "Use a extensão do navegador para enviar solicitações (se houver)", "font_size": "Tamanho da fonte", "font_size_large": "Grande", "font_size_medium": "Médio", "font_size_small": "Pequeno", "interceptor": "Interceptor", "interceptor_description": "Middleware entre aplicativo e APIs.", "language": "Língua", "light_mode": "Luz", "navigation_sidebar": "Barra lateral de navegação", "official_proxy_hosting": "Official Proxy é hospedado por Hoppscotch.", "proxy": "Proxy", "proxy_url": "URL proxy", "proxy_use_toggle": "Use o middleware de proxy para enviar solicitações", "read_the": "Leia o", "reset_default": "Restaurar ao padrão", "sync": "Sincronizar", "sync_collections": "Coleções", "sync_description": "Essas configurações são sincronizadas com a nuvem.", "sync_environments": "Ambientes", "sync_history": "História", "system_mode": "Sistema", "telemetry": "Telemetria", "telemetry_helps_us": "A telemetria nos ajuda a personalizar nossas operações e oferecer a melhor experiência para você.", "theme": "Tema", "theme_description": "Personalize o tema do seu aplicativo.", "use_experimental_url_bar": "Use a barra de URL experimental com destaque do ambiente", "user": "Do utilizador" }, "shortcut": { "general": { "close_current_menu": "Fechar menu atual", "command_menu": "Menu de pesquisa e comando", "help_menu": "Menu de ajuda", "show_all": "Atalhos do teclado", "title": "Em geral" }, "miscellaneous": { "invite": "Convide pessoas para Hoppscotch", "title": "Diversos" }, "navigation": { "back": "Voltar para a página anterior", "documentation": "Vá para a página de documentação", "forward": "Avance para a próxima página", "graphql": "Vá para a página GraphQL", "realtime": "Vá para a página em tempo real", "rest": "Vá para a página REST", "settings": "Vá para a página de configurações", "title": "Navegação" }, "request": { "copy_request_link": "Copiar link de solicitação", "delete_method": "Selecione o método DELETE", "get_method": "Selecione o método GET", "head_method": "Selecione o método HEAD", "method": "Método", "next_method": "Selecione o próximo método", "path": "Caminho", "post_method": "Selecione o método POST", "previous_method": "Selecione o método anterior", "put_method": "Selecione o método PUT", "reset_request": "Pedido de reinicialização", "save_to_collections": "Salvar em coleções", "send_request": "Enviar pedido", "title": "Solicitar" } }, "show": { "code": "Exibir código", "more": "Mostre mais", "sidebar": "Mostrar barra lateral" }, "socketio": { "communication": "Comunicação", "event_name": "Nome do evento", "events": "Eventos", "log": "Registro", "url": "URL" }, "sse": { "event_type": "Tipo de evento", "log": "Registro", "url": "URL" }, "state": { "bulk_mode": "Edição em massa", "bulk_mode_placeholder": "As entradas são separadas por nova linha\nChaves e valores são separados por:\nAnexar // a qualquer linha que você deseja adicionar, mas manter desativado", "cleared": "Liberado", "connected": "Conectado", "connected_to": "Conectado a {name}", "connecting_to": "Conectando-se a {name} ...", "copied_to_clipboard": "Copiado para a área de transferência", "deleted": "Excluído", "deprecated": "DESCONTINUADA", "disabled": "Desabilitado", "disconnected": "Desconectado", "disconnected_from": "Desconectado de {name}", "docs_generated": "Documentação gerada", "download_started": "Download iniciado", "enabled": "Habilitado", "file_imported": "Arquivo importado", "finished_in": "Terminado em {duração} ms", "history_deleted": "Histórico excluído", "linewrap": "Quebrar linhas", "loading": "Carregando...", "none": "Nenhum", "nothing_found": "Nada encontrado para", "waiting_send_request": "Esperando para enviar pedido" }, "support": { "changelog": "Leia mais sobre os últimos lançamentos", "chat": "Questões? Converse conosco!", "community": "Faça perguntas e ajude os outros", "documentation": "Leia mais sobre Hoppscotch", "forum": "Faça perguntas e obtenha respostas", "shortcuts": "Navegue pelo aplicativo mais rápido", "team": "Entre em contato com a equipe", "title": "Apoio, suporte", "twitter": "Siga-nos no Twitter" }, "tab": { "authorization": "Autorização", "body": "Corpo", "collections": "Coleções", "documentation": "Documentação", "headers": "Cabeçalhos", "history": "História", "mqtt": "MQTT", "parameters": "Parâmetros", "pre_request_script": "Script de pré-solicitação", "queries": "Consultas", "query": "Consulta", "socketio": "Socket.IO", "sse": "SSE", "tests": "Testes", "types": "Tipos", "variables": "Variáveis", "websocket": "WebSocket" }, "team": { "create_new": "Criar nova equipe", "deleted": "Equipe excluída", "edit": "Editar equipe", "email": "E-mail", "exit": "Sair da equipe", "exit_disabled": "Apenas o dono não pode sair da equipe", "invalid_email_format": "O formato do email é inválido", "invalid_member_permission": "Forneça uma permissão válida para o membro da equipe", "join_beta": "Junte-se ao programa beta para acessar as equipes.", "left": "Você saiu do time", "member_removed": "Usuário removido", "member_role_updated": "Funções de usuário atualizadas", "members": "Membros", "name_length_insufficient": "O nome da equipe deve ter pelo menos 6 caracteres", "new": "Novo time", "new_created": "Nova equipe criada", "new_name": "Minha Nova Equipe", "no_access": "Você não tem acesso de edição a essas coleções", "permissions": "Permissões", "saved": "Equipe salva", "title": "Times" }, "test": { "javascript_code": "Código JavaScript", "learn": "Leia a documentação", "report": "Relatório de teste", "results": "Resultado dos testes", "script": "Roteiro", "snippets": "Trechos" }, "websocket": { "communication": "Comunicação", "log": "Registro", "message": "Mensagem", "protocols": "Protocolos", "url": "URL" } }
packages/hoppscotch-app/locales/pt-br.json
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00017930248577613384, 0.00017630905495025218, 0.00016666247393004596, 0.00017684003978502005, 0.0000021271875993988942 ]
{ "id": 1, "code_window": [ "\n", "<script>\n", "import { defineComponent } from \"@nuxtjs/composition-api\"\n", "import { getSuitableLenses, getLensRenderers } from \"~/helpers/lenses/lenses\"\n", "\n", "export default defineComponent({\n", " components: {\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ "import { useReadonlyStream } from \"~/helpers/utils/composables\"\n", "import { restTestResults$ } from \"~/newstore/RESTSession\"\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 28 }
<template> <div v-show="active"> <slot></slot> </div> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" export default defineComponent({ name: "SmartTab", props: { label: { type: String, default: null }, info: { type: String, default: null }, icon: { type: String, default: null }, id: { type: String, default: null, required: true }, selected: { type: Boolean, default: false, }, }, data() { return { active: false, } }, mounted() { this.active = this.selected }, }) </script>
packages/hoppscotch-app/components/smart/Tab.vue
1
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.07892037183046341, 0.0198618583381176, 0.00017284360365010798, 0.0001771074312273413, 0.03409745171666145 ]
{ "id": 1, "code_window": [ "\n", "<script>\n", "import { defineComponent } from \"@nuxtjs/composition-api\"\n", "import { getSuitableLenses, getLensRenderers } from \"~/helpers/lenses/lenses\"\n", "\n", "export default defineComponent({\n", " components: {\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ "import { useReadonlyStream } from \"~/helpers/utils/composables\"\n", "import { restTestResults$ } from \"~/newstore/RESTSession\"\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 28 }
<template> <Splitpanes class="smart-splitter" :dbl-click-splitter="false" :horizontal="!(windowInnerWidth.x.value >= 768)" > <Pane class="hide-scrollbar !overflow-auto"> <Splitpanes class="smart-splitter" :dbl-click-splitter="false" :horizontal="COLUMN_LAYOUT" > <Pane class="hide-scrollbar !overflow-auto"> <AppSection label="request"> <div class="bg-primary flex p-4 top-0 z-10 sticky"> <div class="space-x-2 flex-1 inline-flex"> <div class="flex flex-1"> <label for="client-version"> <tippy ref="versionOptions" interactive trigger="click" theme="popover" arrow > <template #trigger> <span class="select-wrapper"> <input id="client-version" v-tippy="{ theme: 'tooltip' }" title="socket.io-client version" class=" bg-primaryLight border border-divider rounded-l cursor-pointer flex font-semibold text-secondaryDark py-2 px-4 w-26 hover:border-dividerDark focus-visible:bg-transparent focus-visible:border-dividerDark " :value="`Client ${clientVersion}`" readonly :disabled="connectionState" /> </span> </template> <SmartItem v-for="(_, version) in socketIoClients" :key="`client-${version}`" :label="`Client ${version}`" @click.native="onSelectVersion(version)" /> </tippy> </label> <input id="socketio-url" v-model="url" v-focus type="url" autocomplete="off" spellcheck="false" :class="{ error: !urlValid }" class=" bg-primaryLight border border-divider flex flex-1 text-secondaryDark w-full py-2 px-4 hover:border-dividerDark focus-visible:bg-transparent focus-visible:border-dividerDark " :placeholder="$t('socketio.url')" :disabled="connectionState" @keyup.enter="urlValid ? toggleConnection() : null" /> <input id="socketio-path" v-model="path" class=" bg-primaryLight border border-divider rounded-r flex flex-1 text-secondaryDark w-full py-2 px-4 hover:border-dividerDark focus-visible:bg-transparent focus-visible:border-dividerDark " spellcheck="false" :disabled="connectionState" /> </div> <ButtonPrimary id="connect" :disabled="!urlValid" name="connect" class="w-32" :label=" !connectionState ? $t('action.connect') : $t('action.disconnect') " :loading="connectingState" @click.native="toggleConnection" /> </div> </div> </AppSection> </Pane> <Pane class="hide-scrollbar !overflow-auto"> <AppSection label="response"> <RealtimeLog :title="$t('socketio.log')" :log="communication.log" /> </AppSection> </Pane> </Splitpanes> </Pane> <Pane v-if="RIGHT_SIDEBAR" max-size="35" size="25" min-size="20" class="hide-scrollbar !overflow-auto" > <AppSection label="messages"> <div class="flex flex-col flex-1 p-4 inline-flex"> <label for="events" class="font-semibold text-secondaryLight"> {{ $t("socketio.events") }} </label> </div> <div class="flex px-4"> <input id="event_name" v-model="communication.eventName" class="input" name="event_name" :placeholder="$t('socketio.event_name')" type="text" autocomplete="off" :disabled="!connectionState" /> </div> <div class="flex flex-1 p-4 items-center justify-between"> <label class="font-semibold text-secondaryLight"> {{ $t("socketio.communication") }} </label> <div class="flex"> <ButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="$t('add.new')" svg="plus" class="rounded" @click.native="addCommunicationInput" /> </div> </div> <div class="flex flex-col space-y-2 px-4 pb-4"> <div v-for="(input, index) of communication.inputs" :key="`input-${index}`" > <div class="flex space-x-2"> <input v-model="communication.inputs[index]" class="input" name="message" :placeholder="$t('count.message', { count: index + 1 })" type="text" autocomplete="off" :disabled="!connectionState" @keyup.enter="connectionState ? sendMessage() : null" /> <ButtonSecondary v-if="index + 1 !== communication.inputs.length" v-tippy="{ theme: 'tooltip' }" :title="$t('action.remove')" svg="trash" class="rounded" color="red" outline @click.native="removeCommunicationInput({ index })" /> <ButtonPrimary v-if="index + 1 === communication.inputs.length" id="send" name="send" :disabled="!connectionState" :label="$t('action.send')" @click.native="sendMessage" /> </div> </div> </div> </AppSection> </Pane> </Splitpanes> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" import { Splitpanes, Pane } from "splitpanes" import "splitpanes/dist/splitpanes.css" // All Socket.IO client version imports import ClientV2 from "socket.io-client-v2" import { io as ClientV3 } from "socket.io-client-v3" import { io as ClientV4 } from "socket.io-client-v4" import wildcard from "socketio-wildcard" import debounce from "lodash/debounce" import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics" import { useSetting } from "~/newstore/settings" import useWindowSize from "~/helpers/utils/useWindowSize" const socketIoClients = { v4: ClientV4, v3: ClientV3, v2: ClientV2, } export default defineComponent({ components: { Splitpanes, Pane }, setup() { return { windowInnerWidth: useWindowSize(), RIGHT_SIDEBAR: useSetting("RIGHT_SIDEBAR"), COLUMN_LAYOUT: useSetting("COLUMN_LAYOUT"), socketIoClients, } }, data() { return { // default version is set to v4 clientVersion: "v4", url: "wss://main-daxrc78qyb411dls-gtw.qovery.io", path: "/socket.io", isUrlValid: true, connectingState: false, connectionState: false, io: null, communication: { log: null, eventName: "", inputs: [""], }, } }, computed: { urlValid() { return this.isUrlValid }, }, watch: { url() { this.debouncer() }, connectionState(connected) { if (connected) this.$refs.versionOptions.tippy().disable() else this.$refs.versionOptions.tippy().enable() }, }, mounted() { if (process.browser) { this.worker = this.$worker.createRejexWorker() this.worker.addEventListener("message", this.workerResponseHandler) } }, destroyed() { this.worker.terminate() }, methods: { debouncer: debounce(function () { this.worker.postMessage({ type: "socketio", url: this.url }) }, 1000), workerResponseHandler({ data }) { if (data.url === this.url) this.isUrlValid = data.result }, removeCommunicationInput({ index }) { this.$delete(this.communication.inputs, index) }, addCommunicationInput() { this.communication.inputs.push("") }, toggleConnection() { // If it is connecting: if (!this.connectionState) return this.connect() // Otherwise, it's disconnecting. else return this.disconnect() }, connect() { this.connectingState = true this.communication.log = [ { payload: this.$t("state.connecting_to", { name: this.url }), source: "info", color: "var(--accent-color)", }, ] try { if (!this.path) { this.path = "/socket.io" } const Client = socketIoClients[this.clientVersion] this.io = new Client(this.url, { path: this.path }) // Add ability to listen to all events wildcard(Client.Manager)(this.io) this.io.on("connect", () => { this.connectingState = false this.connectionState = true this.communication.log = [ { payload: this.$t("state.connected_to", { name: this.url }), source: "info", color: "var(--accent-color)", ts: new Date().toLocaleTimeString(), }, ] this.$toast.success(this.$t("state.connected"), { icon: "sync", }) }) this.io.on("*", ({ data }) => { const [eventName, message] = data this.communication.log.push({ payload: `[${eventName}] ${message ? JSON.stringify(message) : ""}`, source: "server", ts: new Date().toLocaleTimeString(), }) }) this.io.on("connect_error", (error) => { this.handleError(error) }) this.io.on("reconnect_error", (error) => { this.handleError(error) }) this.io.on("error", () => { this.handleError() }) this.io.on("disconnect", () => { this.connectingState = false this.connectionState = false this.communication.log.push({ payload: this.$t("state.disconnected_from", { name: this.url }), source: "info", color: "#ff5555", ts: new Date().toLocaleTimeString(), }) this.$toast.error(this.$t("state.disconnected"), { icon: "sync_disabled", }) }) } catch (e) { this.handleError(e) this.$toast.error(this.$t("error.something_went_wrong"), { icon: "error_outline", }) } logHoppRequestRunToAnalytics({ platform: "socketio", }) }, disconnect() { this.io.close() }, handleError(error) { this.disconnect() this.connectingState = false this.connectionState = false this.communication.log.push({ payload: this.$t("error.something_went_wrong"), source: "info", color: "#ff5555", ts: new Date().toLocaleTimeString(), }) if (error !== null) this.communication.log.push({ payload: error, source: "info", color: "#ff5555", ts: new Date().toLocaleTimeString(), }) }, sendMessage() { const eventName = this.communication.eventName const messages = (this.communication.inputs || []) .map((input) => { try { return JSON.parse(input) } catch (e) { return input } }) .filter((message) => !!message) if (this.io) { this.io.emit(eventName, ...messages, (data) => { // receive response from server this.communication.log.push({ payload: `[${eventName}] ${JSON.stringify(data)}`, source: "server", ts: new Date().toLocaleTimeString(), }) }) this.communication.log.push({ payload: `[${eventName}] ${JSON.stringify(messages)}`, source: "client", ts: new Date().toLocaleTimeString(), }) this.communication.inputs = [""] } }, onSelectVersion(version) { this.clientVersion = version this.$refs.versionOptions.tippy().hide() }, }, }) </script>
packages/hoppscotch-app/components/realtime/Socketio.vue
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.004430670291185379, 0.0002832731406670064, 0.0001666327443672344, 0.00017342140199616551, 0.0006355750956572592 ]
{ "id": 1, "code_window": [ "\n", "<script>\n", "import { defineComponent } from \"@nuxtjs/composition-api\"\n", "import { getSuitableLenses, getLensRenderers } from \"~/helpers/lenses/lenses\"\n", "\n", "export default defineComponent({\n", " components: {\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ "import { useReadonlyStream } from \"~/helpers/utils/composables\"\n", "import { restTestResults$ } from \"~/newstore/RESTSession\"\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 28 }
<template> <div class="flex flex-col" :class="[{ 'bg-primaryLight': dragging }]"> <div class="flex items-center group" @dragover.prevent @drop.prevent="dropEvent" @dragover="dragging = true" @drop="dragging = false" @dragleave="dragging = false" @dragend="dragging = false" > <span class="cursor-pointer flex px-4 justify-center items-center" @click="toggleShowChildren()" > <SmartIcon class="svg-icons" :class="{ 'text-green-500': isSelected }" :name="getCollectionIcon" /> </span> <span class=" cursor-pointer flex flex-1 min-w-0 py-2 pr-2 transition group-hover:text-secondaryDark " @click="toggleShowChildren()" > <span class="truncate"> {{ folder.name ? folder.name : folder.title }} </span> </span> <div class="flex"> <ButtonSecondary v-tippy="{ theme: 'tooltip' }" svg="folder-plus" :title="$t('folder.new')" class="hidden group-hover:inline-flex" @click.native="$emit('add-folder', { folder, path: folderPath })" /> <span> <tippy ref="options" interactive trigger="click" theme="popover" arrow > <template #trigger> <ButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="$t('action.more')" svg="more-vertical" /> </template> <SmartItem svg="folder-plus" :label="$t('folder.new')" @click.native=" () => { $emit('add-folder', { folder, path: folderPath }) $refs.options.tippy().hide() } " /> <SmartItem svg="edit" :label="$t('action.edit')" @click.native=" () => { $emit('edit-folder', { folder, folderIndex, collectionIndex, folderPath, }) $refs.options.tippy().hide() } " /> <SmartItem svg="trash-2" color="red" :label="$t('action.delete')" @click.native=" () => { confirmRemove = true $refs.options.tippy().hide() } " /> </tippy> </span> </div> </div> <div v-if="showChildren || isFiltered" class="flex"> <div class=" flex w-1 transform transition cursor-nsResize ml-5.5 bg-dividerLight hover:scale-x-125 hover:bg-dividerDark " @click="toggleShowChildren()" ></div> <div class="flex flex-col flex-1 truncate"> <CollectionsMyFolder v-for="(subFolder, subFolderIndex) in folder.folders" :key="`subFolder-${subFolderIndex}`" :folder="subFolder" :folder-index="subFolderIndex" :collection-index="collectionIndex" :doc="doc" :save-request="saveRequest" :collections-type="collectionsType" :folder-path="`${folderPath}/${subFolderIndex}`" :picked="picked" @add-folder="$emit('add-folder', $event)" @edit-folder="$emit('edit-folder', $event)" @edit-request="$emit('edit-request', $event)" @update-team-collections="$emit('update-team-collections')" @select="$emit('select', $event)" @remove-request="removeRequest" /> <CollectionsMyRequest v-for="(request, index) in folder.requests" :key="`request-${index}`" :request="request" :collection-index="collectionIndex" :folder-index="folderIndex" :folder-name="folder.name" :folder-path="folderPath" :request-index="index" :doc="doc" :picked="picked" :save-request="saveRequest" :collections-type="collectionsType" @edit-request="$emit('edit-request', $event)" @select="$emit('select', $event)" @remove-request="removeRequest" /> <div v-if=" folder.folders && folder.folders.length === 0 && folder.requests && folder.requests.length === 0 " class=" flex flex-col text-secondaryLight p-4 items-center justify-center " > <i class="opacity-75 pb-2 material-icons">folder_open</i> <span class="text-center"> {{ $t("empty.folder") }} </span> </div> </div> </div> <SmartConfirmModal :show="confirmRemove" :title="$t('confirm.remove_folder')" @hide-modal="confirmRemove = false" @resolve="removeFolder" /> </div> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" import { removeRESTFolder, removeRESTRequest, moveRESTRequest, } from "~/newstore/collections" export default defineComponent({ name: "Folder", props: { folder: { type: Object, default: () => {} }, folderIndex: { type: Number, default: null }, collectionIndex: { type: Number, default: null }, folderPath: { type: String, default: null }, doc: Boolean, saveRequest: Boolean, isFiltered: Boolean, collectionsType: { type: Object, default: () => {} }, picked: { type: Object, default: () => {} }, }, data() { return { showChildren: false, dragging: false, confirmRemove: false, prevCursor: "", cursor: "", } }, computed: { isSelected() { return ( this.picked && this.picked.pickedType === "my-folder" && this.picked.folderPath === this.folderPath ) }, getCollectionIcon() { if (this.isSelected) return "check-circle" else if (!this.showChildren && !this.isFiltered) return "folder" else if (this.showChildren || this.isFiltered) return "folder-minus" else return "folder" }, }, methods: { toggleShowChildren() { if (this.$props.saveRequest) this.$emit("select", { picked: { pickedType: "my-folder", collectionIndex: this.collectionIndex, folderName: this.folder.name, folderPath: this.folderPath, }, }) this.showChildren = !this.showChildren }, removeFolder() { // TODO: Bubble it up ? // Cancel pick if picked folder was deleted if ( this.picked && this.picked.pickedType === "my-folder" && this.picked.folderPath === this.folderPath ) { this.$emit("select", { picked: null }) } removeRESTFolder(this.folderPath) this.$toast.success(this.$t("state.deleted"), { icon: "delete", }) }, dropEvent({ dataTransfer }) { this.dragging = !this.dragging const folderPath = dataTransfer.getData("folderPath") const requestIndex = dataTransfer.getData("requestIndex") moveRESTRequest(folderPath, requestIndex, this.folderPath) }, removeRequest({ requestIndex }) { // TODO: Bubble it up to root ? // Cancel pick if the picked item is being deleted if ( this.picked && this.picked.pickedType === "my-request" && this.picked.folderPath === this.folderPath && this.picked.requestIndex === requestIndex ) { this.$emit("select", { picked: null }) } removeRESTRequest(this.folderPath, requestIndex) }, }, }) </script>
packages/hoppscotch-app/components/collections/my/Folder.vue
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.12900735437870026, 0.00477604242041707, 0.0001663782459218055, 0.00017516498337499797, 0.023908324539661407 ]
{ "id": 1, "code_window": [ "\n", "<script>\n", "import { defineComponent } from \"@nuxtjs/composition-api\"\n", "import { getSuitableLenses, getLensRenderers } from \"~/helpers/lenses/lenses\"\n", "\n", "export default defineComponent({\n", " components: {\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ "import { useReadonlyStream } from \"~/helpers/utils/composables\"\n", "import { restTestResults$ } from \"~/newstore/RESTSession\"\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 28 }
import jsonParse from "../jsonParse" describe("jsonParse", () => { test("parses without errors for valid JSON", () => { const testJSON = JSON.stringify({ name: "hoppscotch", url: "https://hoppscotch.io", awesome: true, when: 2019, }) expect(() => jsonParse(testJSON)).not.toThrow() }) test("throws error for invalid JSON", () => { const testJSON = '{ "name": hopp "url": true }' expect(() => jsonParse(testJSON)).toThrow() }) test("thrown error has proper info fields", () => { expect.assertions(3) const testJSON = '{ "name": hopp "url": true }' try { jsonParse(testJSON) } catch (e) { expect(e).toHaveProperty("start") expect(e).toHaveProperty("end") expect(e).toHaveProperty("message") } }) })
packages/hoppscotch-app/helpers/__tests__/jsonParse.spec.js
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.0001791242539184168, 0.00017713886336423457, 0.000174951390363276, 0.0001772398827597499, 0.0000015444325072166976 ]
{ "id": 2, "code_window": [ " },\n", " props: {\n", " response: { type: Object, default: () => {} },\n", " },\n", " computed: {\n", " headerLength() {\n", " if (!this.response || !this.response.headers) return 0\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " setup() {\n", " const testResults = useReadonlyStream(restTestResults$, null)\n", " return {\n", " testResults,\n", " }\n", " },\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 37 }
<template> <SmartTabs styles="sticky z-10 bg-primary top-lowerPrimaryStickyFold"> <SmartTab v-for="(lens, index) in validLenses" :id="lens.renderer" :key="`lens-${index}`" :label="$t(lens.lensName)" :selected="index === 0" > <component :is="lens.renderer" :response="response" /> </SmartTab> <SmartTab v-if="headerLength" id="headers" :label="$t('response.headers')" :info="`${headerLength}`" > <LensesHeadersRenderer :headers="response.headers" /> </SmartTab> <SmartTab id="results" :label="$t('test.results')"> <HttpTestResult /> </SmartTab> </SmartTabs> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" import { getSuitableLenses, getLensRenderers } from "~/helpers/lenses/lenses" export default defineComponent({ components: { // Lens Renderers ...getLensRenderers(), }, props: { response: { type: Object, default: () => {} }, }, computed: { headerLength() { if (!this.response || !this.response.headers) return 0 return Object.keys(this.response.headers).length }, validLenses() { if (!this.response) return [] return getSuitableLenses(this.response) }, }, }) </script>
packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue
1
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.9918118715286255, 0.17333769798278809, 0.0001683391456026584, 0.003434906480833888, 0.3663199245929718 ]
{ "id": 2, "code_window": [ " },\n", " props: {\n", " response: { type: Object, default: () => {} },\n", " },\n", " computed: {\n", " headerLength() {\n", " if (!this.response || !this.response.headers) return 0\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " setup() {\n", " const testResults = useReadonlyStream(restTestResults$, null)\n", " return {\n", " testResults,\n", " }\n", " },\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 37 }
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
packages/hoppscotch-app/assets/icons/help-circle.svg
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00016814230184536427, 0.00016814230184536427, 0.00016814230184536427, 0.00016814230184536427, 0 ]
{ "id": 2, "code_window": [ " },\n", " props: {\n", " response: { type: Object, default: () => {} },\n", " },\n", " computed: {\n", " headerLength() {\n", " if (!this.response || !this.response.headers) return 0\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " setup() {\n", " const testResults = useReadonlyStream(restTestResults$, null)\n", " return {\n", " testResults,\n", " }\n", " },\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 37 }
<?xml version="1.0" encoding="UTF-8"?> <svg width="256px" height="256px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"> <g> <path d="M218.123122,218.127392 L180.191928,218.127392 L180.191928,158.724263 C180.191928,144.559023 179.939053,126.323993 160.463756,126.323993 C140.707926,126.323993 137.685284,141.757585 137.685284,157.692986 L137.685284,218.123441 L99.7540894,218.123441 L99.7540894,95.9665207 L136.168036,95.9665207 L136.168036,112.660562 L136.677736,112.660562 C144.102746,99.9650027 157.908637,92.3824528 172.605689,92.9280076 C211.050535,92.9280076 218.138927,118.216023 218.138927,151.114151 L218.123122,218.127392 Z M56.9550587,79.2685282 C44.7981969,79.2707099 34.9413443,69.4171797 34.9391618,57.260052 C34.93698,45.1029244 44.7902948,35.2458562 56.9471566,35.2436736 C69.1040185,35.2414916 78.9608713,45.0950217 78.963054,57.2521493 C78.9641017,63.090208 76.6459976,68.6895714 72.5186979,72.8184433 C68.3913982,76.9473153 62.7929898,79.26748 56.9550587,79.2685282 M75.9206558,218.127392 L37.94995,218.127392 L37.94995,95.9665207 L75.9206558,95.9665207 L75.9206558,218.127392 Z M237.033403,0.0182577091 L18.8895249,0.0182577091 C8.57959469,-0.0980923971 0.124827038,8.16056231 -0.001,18.4706066 L-0.001,237.524091 C0.120519052,247.839103 8.57460631,256.105934 18.8895249,255.9977 L237.033403,255.9977 C247.368728,256.125818 255.855922,247.859464 255.999,237.524091 L255.999,18.4548016 C255.851624,8.12438979 247.363742,-0.133792868 237.033403,0.000790807055" fill="#0077b5"></path> </g> </svg>
packages/hoppscotch-app/assets/icons/brands/linkedin.svg
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00019857424194924533, 0.00019857424194924533, 0.00019857424194924533, 0.00019857424194924533, 0 ]
{ "id": 2, "code_window": [ " },\n", " props: {\n", " response: { type: Object, default: () => {} },\n", " },\n", " computed: {\n", " headerLength() {\n", " if (!this.response || !this.response.headers) return 0\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " setup() {\n", " const testResults = useReadonlyStream(restTestResults$, null)\n", " return {\n", " testResults,\n", " }\n", " },\n" ], "file_path": "packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue", "type": "add", "edit_start_line_idx": 37 }
import { Ref } from "@nuxtjs/composition-api" import { GraphQLError, GraphQLSchema, parse as gqlParse, validate as gqlValidate, } from "graphql" import { LinterDefinition, LinterResult } from "./linter" /** * Creates a Linter function that can lint a GQL query against a given * schema */ export const createGQLQueryLinter: ( schema: Ref<GraphQLSchema | null> ) => LinterDefinition = (schema: Ref<GraphQLSchema | null>) => (text) => { if (text === "") return Promise.resolve([]) if (!schema.value) return Promise.resolve([]) try { const doc = gqlParse(text) const results = gqlValidate(schema.value, doc).map( ({ locations, message }) => <LinterResult>{ from: { line: locations![0].line - 1, ch: locations![0].column - 1, }, to: { line: locations![0].line - 1, ch: locations![0].column, }, message, severity: "error", } ) return Promise.resolve(results) } catch (e) { const err = e as GraphQLError return Promise.resolve([ <LinterResult>{ from: { line: err.locations![0].line - 1, ch: err.locations![0].column - 1, }, to: { line: err.locations![0].line - 1, ch: err.locations![0].column, }, message: err.message, severity: "error", }, ]) } }
packages/hoppscotch-app/helpers/editor/linting/gqlQuery.ts
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00036571809323504567, 0.00020411757577676326, 0.00016850214160513133, 0.00017350734560750425, 0.00007230465416796505 ]
{ "id": 3, "code_window": [ " props: {\n", " label: { type: String, default: null },\n", " info: { type: String, default: null },\n", " icon: { type: String, default: null },\n", " id: { type: String, default: null, required: true },\n", " selected: {\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " indicator: { type: Boolean, default: false },\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tab.vue", "type": "add", "edit_start_line_idx": 14 }
<template> <SmartTabs styles="sticky z-10 bg-primary top-lowerPrimaryStickyFold"> <SmartTab v-for="(lens, index) in validLenses" :id="lens.renderer" :key="`lens-${index}`" :label="$t(lens.lensName)" :selected="index === 0" > <component :is="lens.renderer" :response="response" /> </SmartTab> <SmartTab v-if="headerLength" id="headers" :label="$t('response.headers')" :info="`${headerLength}`" > <LensesHeadersRenderer :headers="response.headers" /> </SmartTab> <SmartTab id="results" :label="$t('test.results')"> <HttpTestResult /> </SmartTab> </SmartTabs> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" import { getSuitableLenses, getLensRenderers } from "~/helpers/lenses/lenses" export default defineComponent({ components: { // Lens Renderers ...getLensRenderers(), }, props: { response: { type: Object, default: () => {} }, }, computed: { headerLength() { if (!this.response || !this.response.headers) return 0 return Object.keys(this.response.headers).length }, validLenses() { if (!this.response) return [] return getSuitableLenses(this.response) }, }, }) </script>
packages/hoppscotch-app/components/lenses/ResponseBodyRenderer.vue
1
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.0002600958978291601, 0.00018560094758868217, 0.00016765801410656422, 0.0001714606914902106, 0.00003337128509883769 ]
{ "id": 3, "code_window": [ " props: {\n", " label: { type: String, default: null },\n", " info: { type: String, default: null },\n", " icon: { type: String, default: null },\n", " id: { type: String, default: null, required: true },\n", " selected: {\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " indicator: { type: Boolean, default: false },\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tab.vue", "type": "add", "edit_start_line_idx": 14 }
const mimeToMode = { "text/plain": "text/x-yaml", "text/html": "htmlmixed", "application/xml": "application/xml", "application/hal+json": "application/ld+json", "application/vnd.api+json": "application/ld+json", "application/json": "application/ld+json", } export function getEditorLangForMimeType(mimeType) { return mimeToMode[mimeType] || "text/x-yaml" }
packages/hoppscotch-app/helpers/editorutils.js
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00016973963647615165, 0.00016968275303952396, 0.0001696258841548115, 0.00016968275303952396, 5.687616067007184e-8 ]
{ "id": 3, "code_window": [ " props: {\n", " label: { type: String, default: null },\n", " info: { type: String, default: null },\n", " icon: { type: String, default: null },\n", " id: { type: String, default: null, required: true },\n", " selected: {\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " indicator: { type: Boolean, default: false },\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tab.vue", "type": "add", "edit_start_line_idx": 14 }
import { pluck, distinctUntilChanged, map, filter } from "rxjs/operators" import { Ref } from "@nuxtjs/composition-api" import DispatchingStore, { defineDispatchers } from "./DispatchingStore" import { FormDataKeyValue, HoppRESTHeader, HoppRESTParam, HoppRESTReqBody, HoppRESTRequest, RESTReqSchemaVersion, } from "~/helpers/types/HoppRESTRequest" import { HoppRESTResponse } from "~/helpers/types/HoppRESTResponse" import { useStream } from "~/helpers/utils/composables" import { HoppTestResult } from "~/helpers/types/HoppTestResult" import { HoppRESTAuth } from "~/helpers/types/HoppRESTAuth" import { ValidContentTypes } from "~/helpers/utils/contenttypes" import { HoppRequestSaveContext } from "~/helpers/types/HoppRequestSaveContext" type RESTSession = { request: HoppRESTRequest response: HoppRESTResponse | null testResults: HoppTestResult | null saveContext: HoppRequestSaveContext | null } export const defaultRESTRequest: HoppRESTRequest = { v: RESTReqSchemaVersion, endpoint: "https://echo.hoppscotch.io", name: "Untitled request", params: [{ key: "", value: "", active: true }], headers: [{ key: "", value: "", active: true }], method: "GET", auth: { authType: "none", authActive: true, }, preRequestScript: "", testScript: "", body: { contentType: null, body: null, }, } const defaultRESTSession: RESTSession = { request: defaultRESTRequest, response: null, testResults: null, saveContext: null, } const dispatchers = defineDispatchers({ setRequest(_: RESTSession, { req }: { req: HoppRESTRequest }) { return { request: req, } }, setRequestName(curr: RESTSession, { newName }: { newName: string }) { return { request: { ...curr.request, name: newName, }, } }, setEndpoint(curr: RESTSession, { newEndpoint }: { newEndpoint: string }) { return { request: { ...curr.request, endpoint: newEndpoint, }, } }, setParams(curr: RESTSession, { entries }: { entries: HoppRESTParam[] }) { return { request: { ...curr.request, params: entries, }, } }, addParam(curr: RESTSession, { newParam }: { newParam: HoppRESTParam }) { return { request: { ...curr.request, params: [...curr.request.params, newParam], }, } }, updateParam( curr: RESTSession, { index, updatedParam }: { index: number; updatedParam: HoppRESTParam } ) { const newParams = curr.request.params.map((param, i) => { if (i === index) return updatedParam else return param }) return { request: { ...curr.request, params: newParams, }, } }, deleteParam(curr: RESTSession, { index }: { index: number }) { const newParams = curr.request.params.filter((_x, i) => i !== index) return { request: { ...curr.request, params: newParams, }, } }, deleteAllParams(curr: RESTSession) { return { request: { ...curr.request, params: [], }, } }, updateMethod(curr: RESTSession, { newMethod }: { newMethod: string }) { return { request: { ...curr.request, method: newMethod, }, } }, setHeaders(curr: RESTSession, { entries }: { entries: HoppRESTHeader[] }) { return { request: { ...curr.request, headers: entries, }, } }, addHeader(curr: RESTSession, { entry }: { entry: HoppRESTHeader }) { return { request: { ...curr.request, headers: [...curr.request.headers, entry], }, } }, updateHeader( curr: RESTSession, { index, updatedEntry }: { index: number; updatedEntry: HoppRESTHeader } ) { return { request: { ...curr.request, headers: curr.request.headers.map((header, i) => { if (i === index) return updatedEntry else return header }), }, } }, deleteHeader(curr: RESTSession, { index }: { index: number }) { return { request: { ...curr.request, headers: curr.request.headers.filter((_, i) => i !== index), }, } }, deleteAllHeaders(curr: RESTSession) { return { request: { ...curr.request, headers: [], }, } }, setAuth(curr: RESTSession, { newAuth }: { newAuth: HoppRESTAuth }) { return { request: { ...curr.request, auth: newAuth, }, } }, setPreRequestScript(curr: RESTSession, { newScript }: { newScript: string }) { return { request: { ...curr.request, preRequestScript: newScript, }, } }, setTestScript(curr: RESTSession, { newScript }: { newScript: string }) { return { request: { ...curr.request, testScript: newScript, }, } }, setContentType( curr: RESTSession, { newContentType }: { newContentType: ValidContentTypes | null } ) { // TODO: persist body evenafter switching content typees if (curr.request.body.contentType !== "multipart/form-data") { if (newContentType === "multipart/form-data") { // Going from non-formdata to form-data, discard contents and set empty array as body return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: "multipart/form-data", body: [], }, }, } } else { // non-formdata to non-formdata, keep body and set content type return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: newContentType, body: newContentType === null ? null : (curr.request.body as any)?.body ?? "", }, }, } } } else if (newContentType !== "multipart/form-data") { // Going from formdata to non-formdata, discard contents and set empty string return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: newContentType, body: "", }, }, } } else { // form-data to form-data ? just set the content type ¯\_(ツ)_/¯ return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: newContentType, body: curr.request.body.body, }, }, } } }, addFormDataEntry(curr: RESTSession, { entry }: { entry: FormDataKeyValue }) { // Only perform update if the current content-type is formdata if (curr.request.body.contentType !== "multipart/form-data") return {} return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: "multipart/form-data", body: [...curr.request.body.body, entry], }, }, } }, deleteFormDataEntry(curr: RESTSession, { index }: { index: number }) { // Only perform update if the current content-type is formdata if (curr.request.body.contentType !== "multipart/form-data") return {} return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: "multipart/form-data", body: curr.request.body.body.filter((_, i) => i !== index), }, }, } }, updateFormDataEntry( curr: RESTSession, { index, entry }: { index: number; entry: FormDataKeyValue } ) { // Only perform update if the current content-type is formdata if (curr.request.body.contentType !== "multipart/form-data") return {} return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: "multipart/form-data", body: curr.request.body.body.map((x, i) => (i !== index ? x : entry)), }, }, } }, deleteAllFormDataEntries(curr: RESTSession) { // Only perform update if the current content-type is formdata if (curr.request.body.contentType !== "multipart/form-data") return {} return { request: { ...curr.request, body: <HoppRESTReqBody>{ contentType: "multipart/form-data", body: [], }, }, } }, setRequestBody(curr: RESTSession, { newBody }: { newBody: HoppRESTReqBody }) { return { request: { ...curr.request, body: newBody, }, } }, updateResponse( _curr: RESTSession, { updatedRes }: { updatedRes: HoppRESTResponse | null } ) { return { response: updatedRes, } }, clearResponse(_curr: RESTSession) { return { response: null, } }, setTestResults( _curr: RESTSession, { newResults }: { newResults: HoppTestResult | null } ) { return { testResults: newResults, } }, setSaveContext( _, { newContext }: { newContext: HoppRequestSaveContext | null } ) { return { saveContext: newContext, } }, }) const restSessionStore = new DispatchingStore(defaultRESTSession, dispatchers) export function getRESTRequest() { return restSessionStore.subject$.value.request } export function setRESTRequest( req: HoppRESTRequest, saveContext?: HoppRequestSaveContext | null ) { restSessionStore.dispatch({ dispatcher: "setRequest", payload: { req, }, }) if (saveContext) setRESTSaveContext(saveContext) } export function setRESTSaveContext(saveContext: HoppRequestSaveContext | null) { restSessionStore.dispatch({ dispatcher: "setSaveContext", payload: { newContext: saveContext, }, }) } export function getRESTSaveContext() { return restSessionStore.value.saveContext } export function resetRESTRequest() { setRESTRequest(defaultRESTRequest) } export function setRESTEndpoint(newEndpoint: string) { restSessionStore.dispatch({ dispatcher: "setEndpoint", payload: { newEndpoint, }, }) } export function setRESTRequestName(newName: string) { restSessionStore.dispatch({ dispatcher: "setRequestName", payload: { newName, }, }) } export function setRESTParams(entries: HoppRESTParam[]) { restSessionStore.dispatch({ dispatcher: "setParams", payload: { entries, }, }) } export function addRESTParam(newParam: HoppRESTParam) { restSessionStore.dispatch({ dispatcher: "addParam", payload: { newParam, }, }) } export function updateRESTParam(index: number, updatedParam: HoppRESTParam) { restSessionStore.dispatch({ dispatcher: "updateParam", payload: { updatedParam, index, }, }) } export function deleteRESTParam(index: number) { restSessionStore.dispatch({ dispatcher: "deleteParam", payload: { index, }, }) } export function deleteAllRESTParams() { restSessionStore.dispatch({ dispatcher: "deleteAllParams", payload: {}, }) } export function updateRESTMethod(newMethod: string) { restSessionStore.dispatch({ dispatcher: "updateMethod", payload: { newMethod, }, }) } export function setRESTHeaders(entries: HoppRESTHeader[]) { restSessionStore.dispatch({ dispatcher: "setHeaders", payload: { entries, }, }) } export function addRESTHeader(entry: HoppRESTHeader) { restSessionStore.dispatch({ dispatcher: "addHeader", payload: { entry, }, }) } export function updateRESTHeader(index: number, updatedEntry: HoppRESTHeader) { restSessionStore.dispatch({ dispatcher: "updateHeader", payload: { index, updatedEntry, }, }) } export function deleteRESTHeader(index: number) { restSessionStore.dispatch({ dispatcher: "deleteHeader", payload: { index, }, }) } export function deleteAllRESTHeaders() { restSessionStore.dispatch({ dispatcher: "deleteAllHeaders", payload: {}, }) } export function setRESTAuth(newAuth: HoppRESTAuth) { restSessionStore.dispatch({ dispatcher: "setAuth", payload: { newAuth, }, }) } export function setRESTPreRequestScript(newScript: string) { restSessionStore.dispatch({ dispatcher: "setPreRequestScript", payload: { newScript, }, }) } export function setRESTTestScript(newScript: string) { restSessionStore.dispatch({ dispatcher: "setTestScript", payload: { newScript, }, }) } export function setRESTReqBody(newBody: HoppRESTReqBody | null) { restSessionStore.dispatch({ dispatcher: "setRequestBody", payload: { newBody, }, }) } export function updateRESTResponse(updatedRes: HoppRESTResponse | null) { restSessionStore.dispatch({ dispatcher: "updateResponse", payload: { updatedRes, }, }) } export function clearRESTResponse() { restSessionStore.dispatch({ dispatcher: "clearResponse", payload: {}, }) } export function setRESTTestResults(newResults: HoppTestResult | null) { restSessionStore.dispatch({ dispatcher: "setTestResults", payload: { newResults, }, }) } export function addFormDataEntry(entry: FormDataKeyValue) { restSessionStore.dispatch({ dispatcher: "addFormDataEntry", payload: { entry, }, }) } export function deleteFormDataEntry(index: number) { restSessionStore.dispatch({ dispatcher: "deleteFormDataEntry", payload: { index, }, }) } export function updateFormDataEntry(index: number, entry: FormDataKeyValue) { restSessionStore.dispatch({ dispatcher: "updateFormDataEntry", payload: { index, entry, }, }) } export function setRESTContentType(newContentType: ValidContentTypes | null) { restSessionStore.dispatch({ dispatcher: "setContentType", payload: { newContentType, }, }) } export function deleteAllFormDataEntries() { restSessionStore.dispatch({ dispatcher: "deleteAllFormDataEntries", payload: {}, }) } export const restSaveContext$ = restSessionStore.subject$.pipe( pluck("saveContext"), distinctUntilChanged() ) export const restRequest$ = restSessionStore.subject$.pipe( pluck("request"), distinctUntilChanged() ) export const restRequestName$ = restRequest$.pipe( pluck("name"), distinctUntilChanged() ) export const restEndpoint$ = restSessionStore.subject$.pipe( pluck("request", "endpoint"), distinctUntilChanged() ) export const restParams$ = restSessionStore.subject$.pipe( pluck("request", "params"), distinctUntilChanged() ) export const restActiveParamsCount$ = restParams$.pipe( map( (params) => params.filter((x) => x.active && (x.key !== "" || x.value !== "")).length ) ) export const restMethod$ = restSessionStore.subject$.pipe( pluck("request", "method"), distinctUntilChanged() ) export const restHeaders$ = restSessionStore.subject$.pipe( pluck("request", "headers"), distinctUntilChanged() ) export const restActiveHeadersCount$ = restHeaders$.pipe( map( (params) => params.filter((x) => x.active && (x.key !== "" || x.value !== "")).length ) ) export const restAuth$ = restRequest$.pipe(pluck("auth")) export const restPreRequestScript$ = restSessionStore.subject$.pipe( pluck("request", "preRequestScript"), distinctUntilChanged() ) export const restContentType$ = restRequest$.pipe( pluck("body", "contentType"), distinctUntilChanged() ) export const restTestScript$ = restSessionStore.subject$.pipe( pluck("request", "testScript"), distinctUntilChanged() ) export const restReqBody$ = restSessionStore.subject$.pipe( pluck("request", "body"), distinctUntilChanged() ) export const restResponse$ = restSessionStore.subject$.pipe( pluck("response"), distinctUntilChanged() ) export const completedRESTResponse$ = restResponse$.pipe( filter( (res) => res !== null && res.type !== "loading" && res.type !== "network_fail" ) ) export const restTestResults$ = restSessionStore.subject$.pipe( pluck("testResults"), distinctUntilChanged() ) /** * A Vue 3 composable function that gives access to a ref * which is updated to the preRequestScript value in the store. * The ref value is kept in sync with the store and all writes * to the ref are dispatched to the store as `setPreRequestScript` * dispatches. */ export function usePreRequestScript(): Ref<string> { return useStream( restPreRequestScript$, restSessionStore.value.request.preRequestScript, (value) => { setRESTPreRequestScript(value) } ) } /** * A Vue 3 composable function that gives access to a ref * which is updated to the testScript value in the store. * The ref value is kept in sync with the store and all writes * to the ref are dispatched to the store as `setTestScript` * dispatches. */ export function useTestScript(): Ref<string> { return useStream( restTestScript$, restSessionStore.value.request.testScript, (value) => { setRESTTestScript(value) } ) } export function useRESTRequestBody(): Ref<HoppRESTReqBody> { return useStream( restReqBody$, restSessionStore.value.request.body, setRESTReqBody ) } export function useRESTRequestName(): Ref<string> { return useStream( restRequestName$, restSessionStore.value.request.name, setRESTRequestName ) }
packages/hoppscotch-app/newstore/RESTSession.ts
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00045061486889608204, 0.00018053979147225618, 0.00016376908752135932, 0.00016795274859759957, 0.00004711040674010292 ]
{ "id": 3, "code_window": [ " props: {\n", " label: { type: String, default: null },\n", " info: { type: String, default: null },\n", " icon: { type: String, default: null },\n", " id: { type: String, default: null, required: true },\n", " selected: {\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep" ], "after_edit": [ " indicator: { type: Boolean, default: false },\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tab.vue", "type": "add", "edit_start_line_idx": 14 }
# Changelog ## [v1.12.0](https://github.com/hoppscotch/hoppscotch/tree/v1.12.0) (2020-05-27) [Full Changelog](https://github.com/hoppscotch/hoppscotch/compare/v1.10.0...v1.12.0) ## [v1.10.0](https://github.com/hoppscotch/hoppscotch/tree/v1.10.0) (2020-04-10) [Full Changelog](https://github.com/hoppscotch/hoppscotch/compare/v1.9.9...v1.10.0) ## [v1.9.9](https://github.com/liyasthomas/postwoman/tree/v1.9.9) (2020-07-30) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/v1.9.7...v1.9.9) **Fixed bugs:** - TextDecoder.decode\(\) TypeError hangs the whole app [\#1032](https://github.com/liyasthomas/postwoman/issues/1032) - response content doesn't fit to the text area when resizing [\#970](https://github.com/liyasthomas/postwoman/issues/970) - typing into headers input fields [\#912](https://github.com/liyasthomas/postwoman/issues/912) - Environment variable template \(\<\<foo\>\>\) appears urlencoded \(%3C%3Cfoo%3E%3E\) [\#896](https://github.com/liyasthomas/postwoman/issues/896) - TypeError: Cannot read property 'startsWith' of undefined - after getting 401 response [\#894](https://github.com/liyasthomas/postwoman/issues/894) - When deleting the header, the key is not updated [\#886](https://github.com/liyasthomas/postwoman/issues/886) - Cannot introduce query parameters in URL for WebSocket [\#873](https://github.com/liyasthomas/postwoman/issues/873) - Response content-type as `text/html` with content in `json` cause content area display empty [\#869](https://github.com/liyasthomas/postwoman/issues/869) - Proxy privacy policy link [\#865](https://github.com/liyasthomas/postwoman/issues/865) **Closed issues:** - Collections | Request UI Issue [\#1028](https://github.com/liyasthomas/postwoman/issues/1028) - JSON not showing up in the correct format [\#1023](https://github.com/liyasthomas/postwoman/issues/1023) - ignore duplicates in history [\#1022](https://github.com/liyasthomas/postwoman/issues/1022) - change history menu [\#1021](https://github.com/liyasthomas/postwoman/issues/1021) - integrate parameters with history [\#1020](https://github.com/liyasthomas/postwoman/issues/1020) - Why some Chrome do not have the ability to install PWA? [\#1015](https://github.com/liyasthomas/postwoman/issues/1015) - Shall we have the team management ability and some public documents? [\#1014](https://github.com/liyasthomas/postwoman/issues/1014) - I have edit this config, but it is not available to login. [\#1013](https://github.com/liyasthomas/postwoman/issues/1013) - User login is disabled after i run it on our local server. [\#1012](https://github.com/liyasthomas/postwoman/issues/1012) - postwoman google login doesn't work behind ingress or reverse proxy [\#1009](https://github.com/liyasthomas/postwoman/issues/1009) - Compile error [\#1006](https://github.com/liyasthomas/postwoman/issues/1006) - Postman Web is now out. It might be great to find a USP for Postwoman [\#1000](https://github.com/liyasthomas/postwoman/issues/1000) - Saving response data in env variable [\#984](https://github.com/liyasthomas/postwoman/issues/984) - contentType 无法使用 form-date 上传文件 [\#983](https://github.com/liyasthomas/postwoman/issues/983) - Currently completely broken [\#980](https://github.com/liyasthomas/postwoman/issues/980) - localhost request error [\#979](https://github.com/liyasthomas/postwoman/issues/979) - Installing postwoman locally [\#969](https://github.com/liyasthomas/postwoman/issues/969) - Do I install NodeJS for my online environment [\#968](https://github.com/liyasthomas/postwoman/issues/968) - Collections and Environment Module [\#967](https://github.com/liyasthomas/postwoman/issues/967) - Textarea display problem in super hi-dpi [\#965](https://github.com/liyasthomas/postwoman/issues/965) - TypeError: Cannot read property 'value' of undefined - when logged in [\#961](https://github.com/liyasthomas/postwoman/issues/961) - Enable user-select on websocket and other realtime message logs [\#951](https://github.com/liyasthomas/postwoman/issues/951) - POST requet error [\#947](https://github.com/liyasthomas/postwoman/issues/947) - Unable to fetch schema from localhost GraphQL server. [\#940](https://github.com/liyasthomas/postwoman/issues/940) - Support downloading binary responses [\#929](https://github.com/liyasthomas/postwoman/issues/929) - Integrate PostWoman In our Webapp [\#918](https://github.com/liyasthomas/postwoman/issues/918) - proxy issue [\#911](https://github.com/liyasthomas/postwoman/issues/911) - Button to cancel requests [\#909](https://github.com/liyasthomas/postwoman/issues/909) - How to upload a file with a post request [\#908](https://github.com/liyasthomas/postwoman/issues/908) - Cant Import Postman Global Environment Variables [\#907](https://github.com/liyasthomas/postwoman/issues/907) - Postwoman Docker Container behind Reverse Proxy [\#906](https://github.com/liyasthomas/postwoman/issues/906) - `pw.response` seems not to work [\#905](https://github.com/liyasthomas/postwoman/issues/905) - Could postman add Sign in with LDAP server? [\#901](https://github.com/liyasthomas/postwoman/issues/901) - Collections & Environments not synced [\#900](https://github.com/liyasthomas/postwoman/issues/900) - Add authentication to MQTT [\#898](https://github.com/liyasthomas/postwoman/issues/898) - Labels are lost when using requests from collections [\#897](https://github.com/liyasthomas/postwoman/issues/897) - Handle JSON Parameter list validation [\#891](https://github.com/liyasthomas/postwoman/issues/891) - Nuxt fatal error [\#883](https://github.com/liyasthomas/postwoman/issues/883) - Cannot connect my local websocket server [\#880](https://github.com/liyasthomas/postwoman/issues/880) - Environments not synced after edit [\#877](https://github.com/liyasthomas/postwoman/issues/877) - Can't find Desktop app link anywhere [\#872](https://github.com/liyasthomas/postwoman/issues/872) - Show request completion time [\#871](https://github.com/liyasthomas/postwoman/issues/871) - Make docs on self-hosting Postwoman [\#868](https://github.com/liyasthomas/postwoman/issues/868) **Merged pull requests:** - Add trailing backslash to generated cURL code for easier paste-and-execute [\#1033](https://github.com/liyasthomas/postwoman/pull/1033) ([ushuz](https://github.com/ushuz)) - Update zh-CN.json [\#1031](https://github.com/liyasthomas/postwoman/pull/1031) ([hantianwei](https://github.com/hantianwei)) - Bump firebase from 7.17.0 to 7.17.1 [\#1026](https://github.com/liyasthomas/postwoman/pull/1026) ([dependabot[bot]](https://github.com/apps/dependabot)) - Update zh-CN.json [\#1024](https://github.com/liyasthomas/postwoman/pull/1024) ([hantianwei](https://github.com/hantianwei)) - Bump @nuxtjs/gtm from 2.3.0 to 2.3.2 [\#1019](https://github.com/liyasthomas/postwoman/pull/1019) ([dependabot[bot]](https://github.com/apps/dependabot)) - Bump firebase from 7.16.1 to 7.17.0 [\#1018](https://github.com/liyasthomas/postwoman/pull/1018) ([dependabot[bot]](https://github.com/apps/dependabot)) - Fix bugs with the renderer mixins [\#1008](https://github.com/liyasthomas/postwoman/pull/1008) ([AndrewBastin](https://github.com/AndrewBastin)) - Bump eslint from 7.4.0 to 7.5.0 [\#1005](https://github.com/liyasthomas/postwoman/pull/1005) ([dependabot[bot]](https://github.com/apps/dependabot)) - Add Collections section in Docs page [\#1004](https://github.com/liyasthomas/postwoman/pull/1004) ([liyasthomas](https://github.com/liyasthomas)) - Bump lodash from 4.17.15 to 4.17.19 in /functions [\#999](https://github.com/liyasthomas/postwoman/pull/999) ([dependabot[bot]](https://github.com/apps/dependabot)) - Bump @nuxtjs/google-analytics from 2.3.0 to 2.4.0 [\#998](https://github.com/liyasthomas/postwoman/pull/998) ([dependabot[bot]](https://github.com/apps/dependabot)) - Bump firebase from 7.16.0 to 7.16.1 [\#997](https://github.com/liyasthomas/postwoman/pull/997) ([dependabot[bot]](https://github.com/apps/dependabot)) - Fixed broken network requests in GraphQL [\#995](https://github.com/liyasthomas/postwoman/pull/995) ([AndrewBastin](https://github.com/AndrewBastin)) - fix: replaceWithJSON used wrong commit name [\#993](https://github.com/liyasthomas/postwoman/pull/993) ([perseveringman](https://github.com/perseveringman)) - ⬆️ Bump @nuxtjs/toast from 3.3.0 to 3.3.1 [\#992](https://github.com/liyasthomas/postwoman/pull/992) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump start-server-and-test from 1.11.1 to 1.11.2 [\#991](https://github.com/liyasthomas/postwoman/pull/991) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump @nuxtjs/axios from 5.11.0 to 5.12.0 [\#990](https://github.com/liyasthomas/postwoman/pull/990) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump firebase from 7.15.5 to 7.16.0 [\#989](https://github.com/liyasthomas/postwoman/pull/989) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump start-server-and-test from 1.11.0 to 1.11.1 [\#988](https://github.com/liyasthomas/postwoman/pull/988) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump sass-loader from 9.0.1 to 9.0.2 [\#986](https://github.com/liyasthomas/postwoman/pull/986) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump cypress from 4.9.0 to 4.10.0 [\#985](https://github.com/liyasthomas/postwoman/pull/985) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump ace-builds from 1.4.11 to 1.4.12 [\#982](https://github.com/liyasthomas/postwoman/pull/982) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump vuefire from 2.2.2 to 2.2.3 [\#981](https://github.com/liyasthomas/postwoman/pull/981) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump eslint from 7.3.1 to 7.4.0 [\#978](https://github.com/liyasthomas/postwoman/pull/978) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump sass-loader from 9.0.0 to 9.0.1 [\#977](https://github.com/liyasthomas/postwoman/pull/977) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump graphql from 15.2.0 to 15.3.0 [\#976](https://github.com/liyasthomas/postwoman/pull/976) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump nuxt-i18n from 6.13.0 to 6.13.1 [\#975](https://github.com/liyasthomas/postwoman/pull/975) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump sass-loader from 8.0.2 to 9.0.0 [\#973](https://github.com/liyasthomas/postwoman/pull/973) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump nuxt-i18n from 6.12.2 to 6.13.0 [\#972](https://github.com/liyasthomas/postwoman/pull/972) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump graphql from 15.1.0 to 15.2.0 [\#966](https://github.com/liyasthomas/postwoman/pull/966) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump @nuxtjs/sitemap from 2.3.2 to 2.4.0 [\#963](https://github.com/liyasthomas/postwoman/pull/963) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump firebase from 7.15.4 to 7.15.5 [\#962](https://github.com/liyasthomas/postwoman/pull/962) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump eslint from 7.3.0 to 7.3.1 [\#958](https://github.com/liyasthomas/postwoman/pull/958) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump cypress from 4.8.0 to 4.9.0 [\#957](https://github.com/liyasthomas/postwoman/pull/957) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump firebase from 7.15.3 to 7.15.4 [\#956](https://github.com/liyasthomas/postwoman/pull/956) ([dependabot[bot]](https://github.com/apps/dependabot)) - Binary Responses & Response Lenses [\#955](https://github.com/liyasthomas/postwoman/pull/955) ([AndrewBastin](https://github.com/AndrewBastin)) - Improving SEO [\#954](https://github.com/liyasthomas/postwoman/pull/954) ([liyasthomas](https://github.com/liyasthomas)) - Isolate Netlify, Firebase and Helper functions + Import from absolute… [\#953](https://github.com/liyasthomas/postwoman/pull/953) ([liyasthomas](https://github.com/liyasthomas)) - Added ability to select text in realtime log [\#952](https://github.com/liyasthomas/postwoman/pull/952) ([AndrewBastin](https://github.com/AndrewBastin)) - ⬆️ Bump firebase from 7.15.1 to 7.15.3 [\#950](https://github.com/liyasthomas/postwoman/pull/950) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump eslint from 7.2.0 to 7.3.0 [\#949](https://github.com/liyasthomas/postwoman/pull/949) ([dependabot[bot]](https://github.com/apps/dependabot)) - Revert "⬆️ Bump nuxt from 2.12.2 to 2.13.0" [\#946](https://github.com/liyasthomas/postwoman/pull/946) ([liyasthomas](https://github.com/liyasthomas)) - ⬆️ Bump nuxt from 2.12.2 to 2.13.0 [\#942](https://github.com/liyasthomas/postwoman/pull/942) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump @nuxtjs/sitemap from 2.3.1 to 2.3.2 [\#939](https://github.com/liyasthomas/postwoman/pull/939) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump graphql from 14.6.0 to 15.1.0 [\#938](https://github.com/liyasthomas/postwoman/pull/938) ([dependabot[bot]](https://github.com/apps/dependabot)) - Updated readme [\#937](https://github.com/liyasthomas/postwoman/pull/937) ([liyasthomas](https://github.com/liyasthomas)) - ⬆️ Bump graphql-language-service-interface from 2.3.3 to 2.4.0 [\#936](https://github.com/liyasthomas/postwoman/pull/936) ([dependabot[bot]](https://github.com/apps/dependabot)) - ⬆️ Bump firebase from 7.15.0 to 7.15.1 [\#935](https://github.com/liyasthomas/postwoman/pull/935) ([dependabot[bot]](https://github.com/apps/dependabot)) - Transpiled ES5 code to ES6/ES7 [\#934](https://github.com/liyasthomas/postwoman/pull/934) ([liyasthomas](https://github.com/liyasthomas)) - Create Dependabot config file [\#932](https://github.com/liyasthomas/postwoman/pull/932) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Hide download response button for non-JSON responses [\#931](https://github.com/liyasthomas/postwoman/pull/931) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps-dev\): bump cypress from 4.7.0 to 4.8.0 [\#928](https://github.com/liyasthomas/postwoman/pull/928) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - fix: environment and collection sync issue with firebase [\#926](https://github.com/liyasthomas/postwoman/pull/926) ([myussufz](https://github.com/myussufz)) - chore\(deps\): bump @nuxtjs/axios from 5.10.3 to 5.11.0 [\#925](https://github.com/liyasthomas/postwoman/pull/925) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump eslint from 7.1.0 to 7.2.0 [\#924](https://github.com/liyasthomas/postwoman/pull/924) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - GraphQL response options only visible when a response is shown [\#923](https://github.com/liyasthomas/postwoman/pull/923) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps\): bump firebase from 7.14.6 to 7.15.0 [\#922](https://github.com/liyasthomas/postwoman/pull/922) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/sitemap from 2.3.0 to 2.3.1 [\#921](https://github.com/liyasthomas/postwoman/pull/921) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Added ability to download GraphQL responses [\#920](https://github.com/liyasthomas/postwoman/pull/920) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps\): bump nuxt-i18n from 6.12.1 to 6.12.2 [\#919](https://github.com/liyasthomas/postwoman/pull/919) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/gtm from 2.2.3 to 2.3.0 [\#917](https://github.com/liyasthomas/postwoman/pull/917) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Cancel Request from the Keyboard [\#916](https://github.com/liyasthomas/postwoman/pull/916) ([AndrewBastin](https://github.com/AndrewBastin)) - Cancellable Requests [\#915](https://github.com/liyasthomas/postwoman/pull/915) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps\): bump nuxt-i18n from 6.12.0 to 6.12.1 [\#914](https://github.com/liyasthomas/postwoman/pull/914) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.14.5 to 7.14.6 [\#913](https://github.com/liyasthomas/postwoman/pull/913) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) ## [v1.9.7](https://github.com/liyasthomas/postwoman/tree/v1.9.7) (2020-05-12) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/v1.9.5...v1.9.7) **Fixed bugs:** - Empty header in headers list results in SyntaxError: Failed to execute 'setRequestHeader' [\#765](https://github.com/liyasthomas/postwoman/issues/765) - Getting cannot read value of undefined [\#731](https://github.com/liyasthomas/postwoman/issues/731) - Environment variables in collections [\#642](https://github.com/liyasthomas/postwoman/issues/642) **Closed issues:** - Import/Export collections from private github repos to share among teams. [\#867](https://github.com/liyasthomas/postwoman/issues/867) - Unable to use postwoman with latest docker image from docker hub [\#866](https://github.com/liyasthomas/postwoman/issues/866) - Access to nonexistent routes will not be redirect to page 404 [\#849](https://github.com/liyasthomas/postwoman/issues/849) - Error: Network Error. Check console for details. [\#827](https://github.com/liyasthomas/postwoman/issues/827) - 'Documentation Generated' response stacking past top of page if submit clicked enough times/fast enough [\#826](https://github.com/liyasthomas/postwoman/issues/826) - The UI could use some improvements [\#825](https://github.com/liyasthomas/postwoman/issues/825) - Postwoman won't build, produces 'FATAL Nuxt build error' [\#824](https://github.com/liyasthomas/postwoman/issues/824) - Improve contrast of UI components in all themes [\#819](https://github.com/liyasthomas/postwoman/issues/819) - Add an option to hide and/or collapse the right panel [\#818](https://github.com/liyasthomas/postwoman/issues/818) - Docker Cannot log in normally in the container [\#817](https://github.com/liyasthomas/postwoman/issues/817) - Body in Request [\#815](https://github.com/liyasthomas/postwoman/issues/815) - How to run postwoman under reverse proxy [\#812](https://github.com/liyasthomas/postwoman/issues/812) - Call local support [\#811](https://github.com/liyasthomas/postwoman/issues/811) - feature [\#810](https://github.com/liyasthomas/postwoman/issues/810) - support response json array [\#805](https://github.com/liyasthomas/postwoman/issues/805) - socket binnery support [\#801](https://github.com/liyasthomas/postwoman/issues/801) - Ability to join and leave rooms in Socket.IO connection [\#796](https://github.com/liyasthomas/postwoman/issues/796) - How can I synchronize my data on local? [\#794](https://github.com/liyasthomas/postwoman/issues/794) - I cant login [\#792](https://github.com/liyasthomas/postwoman/issues/792) - Unresolved merge conflict in index.vue.orig [\#786](https://github.com/liyasthomas/postwoman/issues/786) - You send data my request to Google [\#780](https://github.com/liyasthomas/postwoman/issues/780) - I have question by \#750, it's closed,but my problem is still.... [\#770](https://github.com/liyasthomas/postwoman/issues/770) - Add Format Body option [\#767](https://github.com/liyasthomas/postwoman/issues/767) - Body scroll after modal is open [\#766](https://github.com/liyasthomas/postwoman/issues/766) - text.match is not a function [\#764](https://github.com/liyasthomas/postwoman/issues/764) - Request : Copy response headers [\#763](https://github.com/liyasthomas/postwoman/issues/763) - The accordion \(expand\) labels are out of place on mobile [\#762](https://github.com/liyasthomas/postwoman/issues/762) - why does the graphql case can't be saved? [\#761](https://github.com/liyasthomas/postwoman/issues/761) - Mobile responsiveness issues [\#760](https://github.com/liyasthomas/postwoman/issues/760) - Allow importing environment variables via Postman environment json files [\#759](https://github.com/liyasthomas/postwoman/issues/759) - Report abuse: liyasthomas/postwoman \(Contact Links\) [\#754](https://github.com/liyasthomas/postwoman/issues/754) - Report abuse: liyasthomas/postwoman \(Contact Links\) [\#753](https://github.com/liyasthomas/postwoman/issues/753) - Request headers kept same after changing request type [\#752](https://github.com/liyasthomas/postwoman/issues/752) - I used it to post test,but response network error [\#750](https://github.com/liyasthomas/postwoman/issues/750) - Add compatibility for postman collections & environments [\#746](https://github.com/liyasthomas/postwoman/issues/746) - Improve documentation on how to use environments [\#742](https://github.com/liyasthomas/postwoman/issues/742) - Add GraphQL syntax highlighting [\#741](https://github.com/liyasthomas/postwoman/issues/741) - Broken link to translations branch [\#737](https://github.com/liyasthomas/postwoman/issues/737) - Add docker Images for all Tags [\#722](https://github.com/liyasthomas/postwoman/issues/722) - Provide post-build resources and default setting files [\#714](https://github.com/liyasthomas/postwoman/issues/714) - Theme lacks of contrast [\#709](https://github.com/liyasthomas/postwoman/issues/709) - Postwoman raiase a connection error when communicate with localhost. [\#708](https://github.com/liyasthomas/postwoman/issues/708) - CORS issue when hosting [\#707](https://github.com/liyasthomas/postwoman/issues/707) - Add a description to the request or collection when saving it [\#706](https://github.com/liyasthomas/postwoman/issues/706) - Error: Network Error. Check console for details [\#704](https://github.com/liyasthomas/postwoman/issues/704) - Save collections on account sync turn on [\#679](https://github.com/liyasthomas/postwoman/issues/679) - Tests should be saved together with requests [\#643](https://github.com/liyasthomas/postwoman/issues/643) - npm modules of postwoman's vue components [\#384](https://github.com/liyasthomas/postwoman/issues/384) - \[request\] VS code extension [\#313](https://github.com/liyasthomas/postwoman/issues/313) - remove prerequest \<\< \>\> bindings when pre-request script is toggled off [\#234](https://github.com/liyasthomas/postwoman/issues/234) - Dynamic Headers [\#91](https://github.com/liyasthomas/postwoman/issues/91) **Merged pull requests:** - chore\(deps\): bump @nuxtjs/sitemap from 2.2.1 to 2.3.0 [\#864](https://github.com/liyasthomas/postwoman/pull/864) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - docs: add sboulema as a contributor [\#863](https://github.com/liyasthomas/postwoman/pull/863) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - Allow importing environment variables via Postman environment json files [\#862](https://github.com/liyasthomas/postwoman/pull/862) ([sboulema](https://github.com/sboulema)) - chore\(deps\): bump nuxt-i18n from 6.11.0 to 6.11.1 [\#861](https://github.com/liyasthomas/postwoman/pull/861) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Produce valid output when showing/copying as code [\#857](https://github.com/liyasthomas/postwoman/pull/857) ([Hydrophobefireman](https://github.com/Hydrophobefireman)) - dotenv [\#856](https://github.com/liyasthomas/postwoman/pull/856) ([liyasthomas](https://github.com/liyasthomas)) - Save Collections/Environments on enabling sync [\#854](https://github.com/liyasthomas/postwoman/pull/854) ([sboulema](https://github.com/sboulema)) - chore\(deps\): bump firebase from 7.14.2 to 7.14.3 [\#853](https://github.com/liyasthomas/postwoman/pull/853) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Environment variables in collections [\#851](https://github.com/liyasthomas/postwoman/pull/851) ([sboulema](https://github.com/sboulema)) - Add format body option [\#847](https://github.com/liyasthomas/postwoman/pull/847) ([sboulema](https://github.com/sboulema)) - Save GraphQL Docs [\#846](https://github.com/liyasthomas/postwoman/pull/846) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps-dev\): bump node-sass from 4.14.0 to 4.14.1 [\#844](https://github.com/liyasthomas/postwoman/pull/844) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Remove not-deleted index.vue merge file [\#842](https://github.com/liyasthomas/postwoman/pull/842) ([AndrewBastin](https://github.com/AndrewBastin)) - URL Path Parameters \#834 [\#840](https://github.com/liyasthomas/postwoman/pull/840) ([sboulema](https://github.com/sboulema)) - chore\(deps\): remove stale dependency [\#839](https://github.com/liyasthomas/postwoman/pull/839) ([jamesgeorge007](https://github.com/jamesgeorge007)) - GraphQL Query Editor Syntax Highlighting [\#838](https://github.com/liyasthomas/postwoman/pull/838) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps-dev\): bump lint-staged from 10.2.1 to 10.2.2 [\#837](https://github.com/liyasthomas/postwoman/pull/837) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(store\): better code structure [\#835](https://github.com/liyasthomas/postwoman/pull/835) ([jameslahm](https://github.com/jameslahm)) - chore\(deps\): bump @nuxtjs/axios from 5.10.2 to 5.10.3 [\#832](https://github.com/liyasthomas/postwoman/pull/832) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.10.1 to 6.11.0 [\#831](https://github.com/liyasthomas/postwoman/pull/831) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.2.0 to 10.2.1 [\#830](https://github.com/liyasthomas/postwoman/pull/830) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Add ability to navigate through message history [\#828](https://github.com/liyasthomas/postwoman/pull/828) ([jinyus](https://github.com/jinyus)) - chore\(config\): delete render option [\#823](https://github.com/liyasthomas/postwoman/pull/823) ([jameslahm](https://github.com/jameslahm)) - chore\(deps-dev\): bump cypress from 4.4.1 to 4.5.0 [\#822](https://github.com/liyasthomas/postwoman/pull/822) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.1.7 to 10.2.0 [\#821](https://github.com/liyasthomas/postwoman/pull/821) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Realtime SocketIO support for json user input [\#820](https://github.com/liyasthomas/postwoman/pull/820) ([feydan](https://github.com/feydan)) - chore\(deps\): bump @nuxtjs/axios from 5.10.1 to 5.10.2 [\#816](https://github.com/liyasthomas/postwoman/pull/816) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Modify responseType by Object\(json\) or Array\(json5\) [\#813](https://github.com/liyasthomas/postwoman/pull/813) ([shtakai](https://github.com/shtakai)) - chore\(deps\): bump nuxt-i18n from 6.9.2 to 6.10.1 [\#809](https://github.com/liyasthomas/postwoman/pull/809) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.14.1 to 7.14.2 [\#808](https://github.com/liyasthomas/postwoman/pull/808) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump node-sass from 4.13.1 to 4.14.0 [\#807](https://github.com/liyasthomas/postwoman/pull/807) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/sitemap from 2.2.0 to 2.2.1 [\#806](https://github.com/liyasthomas/postwoman/pull/806) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/axios from 5.10.0 to 5.10.1 [\#803](https://github.com/liyasthomas/postwoman/pull/803) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.9.1 to 6.9.2 [\#802](https://github.com/liyasthomas/postwoman/pull/802) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.1.6 to 10.1.7 [\#800](https://github.com/liyasthomas/postwoman/pull/800) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump prettier from 2.0.4 to 2.0.5 [\#799](https://github.com/liyasthomas/postwoman/pull/799) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/axios from 5.9.7 to 5.10.0 [\#798](https://github.com/liyasthomas/postwoman/pull/798) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump cypress from 4.4.0 to 4.4.1 [\#797](https://github.com/liyasthomas/postwoman/pull/797) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Listen to all events in socket.io connection [\#795](https://github.com/liyasthomas/postwoman/pull/795) ([konradkalemba](https://github.com/konradkalemba)) - Fix postman import with empty url [\#791](https://github.com/liyasthomas/postwoman/pull/791) ([Nikita240](https://github.com/Nikita240)) - chore\(deps-dev\): bump lint-staged from 10.1.5 to 10.1.6 [\#789](https://github.com/liyasthomas/postwoman/pull/789) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.1.3 to 10.1.5 [\#787](https://github.com/liyasthomas/postwoman/pull/787) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.14.0 to 7.14.1 [\#782](https://github.com/liyasthomas/postwoman/pull/782) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump yargs-parser from 18.1.2 to 18.1.3 [\#781](https://github.com/liyasthomas/postwoman/pull/781) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump start-server-and-test from 1.10.11 to 1.11.0 [\#778](https://github.com/liyasthomas/postwoman/pull/778) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.8.1 to 6.9.1 [\#776](https://github.com/liyasthomas/postwoman/pull/776) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump ace-builds from 1.4.9 to 1.4.11 [\#775](https://github.com/liyasthomas/postwoman/pull/775) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump cypress from 4.3.0 to 4.4.0 [\#774](https://github.com/liyasthomas/postwoman/pull/774) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.13.2 to 7.14.0 [\#758](https://github.com/liyasthomas/postwoman/pull/758) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump husky from 4.2.3 to 4.2.5 [\#757](https://github.com/liyasthomas/postwoman/pull/757) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.1.2 to 10.1.3 [\#756](https://github.com/liyasthomas/postwoman/pull/756) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Fix indicator if extension is installed [\#748](https://github.com/liyasthomas/postwoman/pull/748) ([levrik](https://github.com/levrik)) - Remove support for legacy extensions [\#747](https://github.com/liyasthomas/postwoman/pull/747) ([levrik](https://github.com/levrik)) - Fix GQL introspection query not sent through extension [\#745](https://github.com/liyasthomas/postwoman/pull/745) ([levrik](https://github.com/levrik)) - chore\(deps-dev\): bump prettier from 2.0.2 to 2.0.4 [\#744](https://github.com/liyasthomas/postwoman/pull/744) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/sitemap from 2.1.0 to 2.2.0 [\#743](https://github.com/liyasthomas/postwoman/pull/743) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.1.1 to 10.1.2 [\#740](https://github.com/liyasthomas/postwoman/pull/740) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.8.0 to 6.8.1 [\#736](https://github.com/liyasthomas/postwoman/pull/736) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump ace-builds from 1.4.8 to 1.4.9 [\#735](https://github.com/liyasthomas/postwoman/pull/735) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.13.1 to 7.13.2 [\#734](https://github.com/liyasthomas/postwoman/pull/734) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump vue-virtual-scroll-list from 1.4.6 to 1.4.7 [\#733](https://github.com/liyasthomas/postwoman/pull/733) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.7.2 to 6.8.0 [\#732](https://github.com/liyasthomas/postwoman/pull/732) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt from 2.12.1 to 2.12.2 [\#729](https://github.com/liyasthomas/postwoman/pull/729) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.7.1 to 6.7.2 [\#728](https://github.com/liyasthomas/postwoman/pull/728) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.1.0 to 10.1.1 [\#727](https://github.com/liyasthomas/postwoman/pull/727) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump cypress from 4.2.0 to 4.3.0 [\#726](https://github.com/liyasthomas/postwoman/pull/726) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.0.10 to 10.1.0 [\#725](https://github.com/liyasthomas/postwoman/pull/725) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.7.0 to 6.7.1 [\#724](https://github.com/liyasthomas/postwoman/pull/724) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/axios from 5.9.6 to 5.9.7 [\#723](https://github.com/liyasthomas/postwoman/pull/723) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump lint-staged from 10.0.9 to 10.0.10 [\#721](https://github.com/liyasthomas/postwoman/pull/721) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/axios from 5.9.5 to 5.9.6 [\#719](https://github.com/liyasthomas/postwoman/pull/719) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/sitemap from 2.0.1 to 2.1.0 [\#718](https://github.com/liyasthomas/postwoman/pull/718) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.13.0 to 7.13.1 [\#717](https://github.com/liyasthomas/postwoman/pull/717) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump yargs-parser from 18.1.1 to 18.1.2 [\#713](https://github.com/liyasthomas/postwoman/pull/713) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.6.1 to 6.7.0 [\#712](https://github.com/liyasthomas/postwoman/pull/712) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt from 2.12.0 to 2.12.1 [\#711](https://github.com/liyasthomas/postwoman/pull/711) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.12.0 to 7.13.0 [\#710](https://github.com/liyasthomas/postwoman/pull/710) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Updating the UI and style files [\#705](https://github.com/liyasthomas/postwoman/pull/705) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps-dev\): bump lint-staged from 10.0.8 to 10.0.9 [\#703](https://github.com/liyasthomas/postwoman/pull/703) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Improving performance [\#702](https://github.com/liyasthomas/postwoman/pull/702) ([liyasthomas](https://github.com/liyasthomas)) - :package: Updating packages [\#701](https://github.com/liyasthomas/postwoman/pull/701) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps-dev\): bump prettier from 2.0.1 to 2.0.2 [\#700](https://github.com/liyasthomas/postwoman/pull/700) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump prettier from 1.19.1 to 2.0.1 [\#697](https://github.com/liyasthomas/postwoman/pull/697) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) ## [v1.9.5](https://github.com/liyasthomas/postwoman/tree/v1.9.5) (2020-03-22) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/v1.9.0...v1.9.5) **Fixed bugs:** - Test script is not run after failing request [\#644](https://github.com/liyasthomas/postwoman/issues/644) - \[HELP\] Auth permission denied [\#621](https://github.com/liyasthomas/postwoman/issues/621) - Can't login on Brave Browser [\#607](https://github.com/liyasthomas/postwoman/issues/607) **Closed issues:** - \[UI/UX\] - Change place of Send button [\#696](https://github.com/liyasthomas/postwoman/issues/696) - Support preview of JSON:API's "application/vnd.api+json" Content-Type [\#694](https://github.com/liyasthomas/postwoman/issues/694) - Report Portal integration [\#691](https://github.com/liyasthomas/postwoman/issues/691) - Docs request: how to prevent secrets from leaving local storage wrt. sync. [\#686](https://github.com/liyasthomas/postwoman/issues/686) - \[bug\] - Can't make a request to HTTP [\#676](https://github.com/liyasthomas/postwoman/issues/676) - Looking forward to that the postwoman Compatible 'swagger ' at next version [\#675](https://github.com/liyasthomas/postwoman/issues/675) - Error: Network Error. Check console for details. [\#673](https://github.com/liyasthomas/postwoman/issues/673) - \[Bug\] - Can't login to Github and Google [\#661](https://github.com/liyasthomas/postwoman/issues/661) - A question that has been raised but not resolved [\#658](https://github.com/liyasthomas/postwoman/issues/658) - An unknown error occurred whilst the proxy was processing your request. [\#656](https://github.com/liyasthomas/postwoman/issues/656) - Running app from downloaded zip fails to compile [\#651](https://github.com/liyasthomas/postwoman/issues/651) - Environment variable in path won't update [\#641](https://github.com/liyasthomas/postwoman/issues/641) - Info: The current domain is not authorized for OAuth operations Error [\#637](https://github.com/liyasthomas/postwoman/issues/637) - A suggestion for UI [\#635](https://github.com/liyasthomas/postwoman/issues/635) - How to use postwoman for local development and testing [\#634](https://github.com/liyasthomas/postwoman/issues/634) - How to debug localhost \(cors\) [\#630](https://github.com/liyasthomas/postwoman/issues/630) - Support SocketIO connections on Realtime page [\#611](https://github.com/liyasthomas/postwoman/issues/611) - Requests to local API returning error response [\#608](https://github.com/liyasthomas/postwoman/issues/608) - Why does the URL input field display only one line [\#604](https://github.com/liyasthomas/postwoman/issues/604) - Parameter list not showing JSON object fields \(force raw?\) [\#597](https://github.com/liyasthomas/postwoman/issues/597) - Add setting to disable scroll animations [\#592](https://github.com/liyasthomas/postwoman/issues/592) - Bigger URL and/or Path input field [\#581](https://github.com/liyasthomas/postwoman/issues/581) - Ability to connect to a MQTT broker [\#342](https://github.com/liyasthomas/postwoman/issues/342) - \[request\] Offline cross-platform native build [\#267](https://github.com/liyasthomas/postwoman/issues/267) - On Save Update existing API [\#204](https://github.com/liyasthomas/postwoman/issues/204) - Import and export environments from JSON [\#190](https://github.com/liyasthomas/postwoman/issues/190) - Fast URL entry [\#62](https://github.com/liyasthomas/postwoman/issues/62) **Merged pull requests:** - Add application/vnd.api+json [\#695](https://github.com/liyasthomas/postwoman/pull/695) ([allthesignals](https://github.com/allthesignals)) - Fix raw input \(JSON\) [\#693](https://github.com/liyasthomas/postwoman/pull/693) ([leomp12](https://github.com/leomp12)) - chore\(deps\): bump firebase from 7.11.0 to 7.12.0 [\#689](https://github.com/liyasthomas/postwoman/pull/689) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump vuefire from 2.2.1 to 2.2.2 [\#688](https://github.com/liyasthomas/postwoman/pull/688) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump cypress from 4.1.0 to 4.2.0 [\#685](https://github.com/liyasthomas/postwoman/pull/685) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump start-server-and-test from 1.10.10 to 1.10.11 [\#684](https://github.com/liyasthomas/postwoman/pull/684) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.6.0 to 6.6.1 [\#683](https://github.com/liyasthomas/postwoman/pull/683) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt from 2.11.0 to 2.12.0 [\#682](https://github.com/liyasthomas/postwoman/pull/682) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Fix setting default raw params [\#681](https://github.com/liyasthomas/postwoman/pull/681) ([leomp12](https://github.com/leomp12)) - Fix handling content type and raw input [\#678](https://github.com/liyasthomas/postwoman/pull/678) ([leomp12](https://github.com/leomp12)) - \[Snyk\] Security upgrade yargs-parser from 18.1.0 to 18.1.1 [\#674](https://github.com/liyasthomas/postwoman/pull/674) ([snyk-bot](https://github.com/snyk-bot)) - chore\(deps-dev\): bump start-server-and-test from 1.10.9 to 1.10.10 [\#672](https://github.com/liyasthomas/postwoman/pull/672) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.10.0 to 7.11.0 [\#671](https://github.com/liyasthomas/postwoman/pull/671) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ✅ Updating tests [\#669](https://github.com/liyasthomas/postwoman/pull/669) ([liyasthomas](https://github.com/liyasthomas)) - Updating tests [\#668](https://github.com/liyasthomas/postwoman/pull/668) ([liyasthomas](https://github.com/liyasthomas)) - APIs [\#667](https://github.com/liyasthomas/postwoman/pull/667) ([liyasthomas](https://github.com/liyasthomas)) - Insecure Websocket connection issue while connecting to MQTT broker. [\#666](https://github.com/liyasthomas/postwoman/pull/666) ([rahulnpadalkar](https://github.com/rahulnpadalkar)) - Improving performance [\#664](https://github.com/liyasthomas/postwoman/pull/664) ([liyasthomas](https://github.com/liyasthomas)) - Feature/mqtt [\#663](https://github.com/liyasthomas/postwoman/pull/663) ([liyasthomas](https://github.com/liyasthomas)) - Added Support for MQTT [\#662](https://github.com/liyasthomas/postwoman/pull/662) ([rahulnpadalkar](https://github.com/rahulnpadalkar)) - chore\(deps\): bump yargs-parser from 18.0.0 to 18.1.0 [\#660](https://github.com/liyasthomas/postwoman/pull/660) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump start-server-and-test from 1.10.8 to 1.10.9 [\#659](https://github.com/liyasthomas/postwoman/pull/659) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Added icon slot to tabs [\#657](https://github.com/liyasthomas/postwoman/pull/657) ([liyasthomas](https://github.com/liyasthomas)) - Refactor/ui [\#655](https://github.com/liyasthomas/postwoman/pull/655) ([liyasthomas](https://github.com/liyasthomas)) - even [\#654](https://github.com/liyasthomas/postwoman/pull/654) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump yargs-parser from 17.0.0 to 18.0.0 [\#653](https://github.com/liyasthomas/postwoman/pull/653) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.9.3 to 7.10.0 [\#652](https://github.com/liyasthomas/postwoman/pull/652) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Added the ability to prettify GraphQL queries [\#650](https://github.com/liyasthomas/postwoman/pull/650) ([AndrewBastin](https://github.com/AndrewBastin)) - Add http/https support to socketio url valid [\#648](https://github.com/liyasthomas/postwoman/pull/648) ([moonrailgun](https://github.com/moonrailgun)) - Refactor/ui [\#647](https://github.com/liyasthomas/postwoman/pull/647) ([liyasthomas](https://github.com/liyasthomas)) - Even [\#646](https://github.com/liyasthomas/postwoman/pull/646) ([liyasthomas](https://github.com/liyasthomas)) - Run tests even after failed request [\#645](https://github.com/liyasthomas/postwoman/pull/645) ([liyasthomas](https://github.com/liyasthomas)) - Feature: add socket io support [\#640](https://github.com/liyasthomas/postwoman/pull/640) ([moonrailgun](https://github.com/moonrailgun)) - Removed linting for the collection docs import editor [\#639](https://github.com/liyasthomas/postwoman/pull/639) ([AndrewBastin](https://github.com/AndrewBastin)) - Moving or renaming files [\#638](https://github.com/liyasthomas/postwoman/pull/638) ([liyasthomas](https://github.com/liyasthomas)) - Refactor/ui [\#636](https://github.com/liyasthomas/postwoman/pull/636) ([liyasthomas](https://github.com/liyasthomas)) - Updated messages for when GraphQL Get Schema fails [\#633](https://github.com/liyasthomas/postwoman/pull/633) ([AndrewBastin](https://github.com/AndrewBastin)) - Minor GraphQL page improvements [\#631](https://github.com/liyasthomas/postwoman/pull/631) ([dmitryyankowski](https://github.com/dmitryyankowski)) - Ignore empty GQL Variable Strings [\#629](https://github.com/liyasthomas/postwoman/pull/629) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps-dev\): bump cypress from 4.0.2 to 4.1.0 [\#628](https://github.com/liyasthomas/postwoman/pull/628) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump nuxt-i18n from 6.5.0 to 6.6.0 [\#627](https://github.com/liyasthomas/postwoman/pull/627) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.9.1 to 7.9.3 [\#626](https://github.com/liyasthomas/postwoman/pull/626) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/google-tag-manager from 2.3.1 to 2.3.2 [\#625](https://github.com/liyasthomas/postwoman/pull/625) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - test: purge travis [\#623](https://github.com/liyasthomas/postwoman/pull/623) ([yubathom](https://github.com/yubathom)) - Added shortcut to quickly run the GraphQL query [\#620](https://github.com/liyasthomas/postwoman/pull/620) ([AndrewBastin](https://github.com/AndrewBastin)) - docs: add dmitryyankowski as a contributor [\#619](https://github.com/liyasthomas/postwoman/pull/619) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - Link multiple auth providers [\#618](https://github.com/liyasthomas/postwoman/pull/618) ([liyasthomas](https://github.com/liyasthomas)) - Add --staged parameter to pretty-quick pre-commit [\#617](https://github.com/liyasthomas/postwoman/pull/617) ([dmitryyankowski](https://github.com/dmitryyankowski)) - :bug: FIxed URI not updating on Clear content, minor formData improve… [\#612](https://github.com/liyasthomas/postwoman/pull/612) ([liyasthomas](https://github.com/liyasthomas)) - Update proxy information. [\#610](https://github.com/liyasthomas/postwoman/pull/610) ([NBTX](https://github.com/NBTX)) - Fixed install extension toast appearing even when extension is installed [\#609](https://github.com/liyasthomas/postwoman/pull/609) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps-dev\): bump lint-staged from 10.0.7 to 10.0.8 [\#606](https://github.com/liyasthomas/postwoman/pull/606) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - JSON linting in the code editor [\#605](https://github.com/liyasthomas/postwoman/pull/605) ([AndrewBastin](https://github.com/AndrewBastin)) - Added regex to handle url parts [\#603](https://github.com/liyasthomas/postwoman/pull/603) ([JacobAnavisca](https://github.com/JacobAnavisca)) - GraphQL page improvements, and more [\#602](https://github.com/liyasthomas/postwoman/pull/602) ([dmitryyankowski](https://github.com/dmitryyankowski)) - I18n [\#601](https://github.com/liyasthomas/postwoman/pull/601) ([liyasthomas](https://github.com/liyasthomas)) - feat\(i18n\): add Korean [\#600](https://github.com/liyasthomas/postwoman/pull/600) ([9j](https://github.com/9j)) - Improve page load/unload experience \(remove FOUCs\) [\#599](https://github.com/liyasthomas/postwoman/pull/599) ([NBTX](https://github.com/NBTX)) - Feature: Add prettier/pretty-quick formatting w/ Husky pre-commit [\#596](https://github.com/liyasthomas/postwoman/pull/596) ([dmitryyankowski](https://github.com/dmitryyankowski)) ## [v1.9.0](https://github.com/liyasthomas/postwoman/tree/v1.9.0) (2020-02-24) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/v1.8.0...v1.9.0) **Fixed bugs:** - Auto Theme Selection is kinda difficult to see [\#563](https://github.com/liyasthomas/postwoman/issues/563) - Can't send request to localhost via Chrome extention [\#560](https://github.com/liyasthomas/postwoman/issues/560) - Validation for duplicate collection ignores letter case [\#547](https://github.com/liyasthomas/postwoman/issues/547) - Build failed [\#327](https://github.com/liyasthomas/postwoman/issues/327) - Fixed typo in translation file for Auto theme [\#556](https://github.com/liyasthomas/postwoman/pull/556) ([AndrewBastin](https://github.com/AndrewBastin)) **Closed issues:** - don't run [\#577](https://github.com/liyasthomas/postwoman/issues/577) - Get correct response data but occurs with error "Cannot read property 'value' of undefined" [\#575](https://github.com/liyasthomas/postwoman/issues/575) - firebase_app\_\_WEBPACK_IMPORTED_MODULE_2\_\_\_default.a.firestore is not a function [\#558](https://github.com/liyasthomas/postwoman/issues/558) - Disable SSL cert for websockets [\#557](https://github.com/liyasthomas/postwoman/issues/557) - relative module not found during start [\#552](https://github.com/liyasthomas/postwoman/issues/552) - Feature Request: Subfolders [\#540](https://github.com/liyasthomas/postwoman/issues/540) - Feature request: Keyboard shortcuts for folder creation [\#539](https://github.com/liyasthomas/postwoman/issues/539) - Add max-height and overflow: auto to "parameter list" textarea [\#532](https://github.com/liyasthomas/postwoman/issues/532) - Friendly minded GraphQL [\#468](https://github.com/liyasthomas/postwoman/issues/468) - multipart/form-data support [\#434](https://github.com/liyasthomas/postwoman/issues/434) - IE Support [\#386](https://github.com/liyasthomas/postwoman/issues/386) - ⏬ Import a Postman's Collection [\#333](https://github.com/liyasthomas/postwoman/issues/333) - Implement pre-request and post-request scripts \(and request chaining\) [\#218](https://github.com/liyasthomas/postwoman/issues/218) - Environment management and configuration [\#147](https://github.com/liyasthomas/postwoman/issues/147) **Merged pull requests:** - POST request body editor reacts to the content type [\#594](https://github.com/liyasthomas/postwoman/pull/594) ([AndrewBastin](https://github.com/AndrewBastin)) - Fix variablesJSONString store default for GraphQL page [\#593](https://github.com/liyasthomas/postwoman/pull/593) ([dmitryyankowski](https://github.com/dmitryyankowski)) - Environment Mangement [\#591](https://github.com/liyasthomas/postwoman/pull/591) ([JacobAnavisca](https://github.com/JacobAnavisca)) - GraphQL Query Autocompletion [\#590](https://github.com/liyasthomas/postwoman/pull/590) ([AndrewBastin](https://github.com/AndrewBastin)) - Refactor/lint [\#589](https://github.com/liyasthomas/postwoman/pull/589) ([liyasthomas](https://github.com/liyasthomas)) - Even [\#588](https://github.com/liyasthomas/postwoman/pull/588) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump firebase from 7.9.0 to 7.9.1 [\#587](https://github.com/liyasthomas/postwoman/pull/587) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Even [\#586](https://github.com/liyasthomas/postwoman/pull/586) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump firebase from 7.8.2 to 7.9.0 [\#585](https://github.com/liyasthomas/postwoman/pull/585) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump vue-virtual-scroll-list from 1.4.5 to 1.4.6 [\#584](https://github.com/liyasthomas/postwoman/pull/584) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Adapt extension check to new extensions [\#583](https://github.com/liyasthomas/postwoman/pull/583) ([levrik](https://github.com/levrik)) - Update link to extension repo in README [\#582](https://github.com/liyasthomas/postwoman/pull/582) ([levrik](https://github.com/levrik)) - Even [\#579](https://github.com/liyasthomas/postwoman/pull/579) ([liyasthomas](https://github.com/liyasthomas)) - Refactor/lint [\#578](https://github.com/liyasthomas/postwoman/pull/578) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump vue-virtual-scroll-list from 1.4.4 to 1.4.5 [\#576](https://github.com/liyasthomas/postwoman/pull/576) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Postman collection parsing [\#574](https://github.com/liyasthomas/postwoman/pull/574) ([JacobAnavisca](https://github.com/JacobAnavisca)) - Unify Chrome and Firefox extensions [\#573](https://github.com/liyasthomas/postwoman/pull/573) ([levrik](https://github.com/levrik)) - fix: drop the toast which doesn't show up [\#572](https://github.com/liyasthomas/postwoman/pull/572) ([jamesgeorge007](https://github.com/jamesgeorge007)) - :sparkles: Native share + updated meta description [\#571](https://github.com/liyasthomas/postwoman/pull/571) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump firebase from 7.8.1 to 7.8.2 [\#570](https://github.com/liyasthomas/postwoman/pull/570) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump cypress from 4.0.1 to 4.0.2 [\#569](https://github.com/liyasthomas/postwoman/pull/569) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Added create collection and save request syncs [\#568](https://github.com/liyasthomas/postwoman/pull/568) ([JacobAnavisca](https://github.com/JacobAnavisca)) - Moved common headers to a separate file [\#566](https://github.com/liyasthomas/postwoman/pull/566) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(deps-dev\): bump cypress from 4.0.0 to 4.0.1 [\#565](https://github.com/liyasthomas/postwoman/pull/565) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump yargs-parser from 16.1.0 to 17.0.0 [\#564](https://github.com/liyasthomas/postwoman/pull/564) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump cypress from 3.8.3 to 4.0.0 [\#562](https://github.com/liyasthomas/postwoman/pull/562) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump firebase from 7.8.0 to 7.8.1 [\#561](https://github.com/liyasthomas/postwoman/pull/561) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore: use typeof as an operator and make use of localizable strings [\#559](https://github.com/liyasthomas/postwoman/pull/559) ([jamesgeorge007](https://github.com/jamesgeorge007)) - Support for Formdata [\#555](https://github.com/liyasthomas/postwoman/pull/555) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump @nuxtjs/pwa from 3.0.0-beta.19 to 3.0.0-beta.20 [\#554](https://github.com/liyasthomas/postwoman/pull/554) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/axios from 5.9.4 to 5.9.5 [\#553](https://github.com/liyasthomas/postwoman/pull/553) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Added toggle to decide whether extensions should be used [\#551](https://github.com/liyasthomas/postwoman/pull/551) ([AndrewBastin](https://github.com/AndrewBastin)) - Show Ctrl instead of Command for shortcuts non-Apple platforms [\#549](https://github.com/liyasthomas/postwoman/pull/549) ([AndrewBastin](https://github.com/AndrewBastin)) - fix\(chore\): Take letter casing into account while checking for duplicate collection [\#548](https://github.com/liyasthomas/postwoman/pull/548) ([jamesgeorge007](https://github.com/jamesgeorge007)) - update e2e tests [\#546](https://github.com/liyasthomas/postwoman/pull/546) ([yubathom](https://github.com/yubathom)) - chore\(deps\): bump @nuxtjs/axios from 5.9.3 to 5.9.4 [\#545](https://github.com/liyasthomas/postwoman/pull/545) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Refactor [\#543](https://github.com/liyasthomas/postwoman/pull/543) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump firebase from 7.7.0 to 7.8.0 [\#542](https://github.com/liyasthomas/postwoman/pull/542) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump graphql from 14.5.8 to 14.6.0 [\#541](https://github.com/liyasthomas/postwoman/pull/541) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - i18n [\#538](https://github.com/liyasthomas/postwoman/pull/538) ([liyasthomas](https://github.com/liyasthomas)) - Modification of French translations [\#537](https://github.com/liyasthomas/postwoman/pull/537) ([thomasbnt](https://github.com/thomasbnt)) - Even [\#535](https://github.com/liyasthomas/postwoman/pull/535) ([liyasthomas](https://github.com/liyasthomas)) - Updated GraphQL Query Variable Editor [\#534](https://github.com/liyasthomas/postwoman/pull/534) ([AndrewBastin](https://github.com/AndrewBastin)) - Updating spanish translation [\#529](https://github.com/liyasthomas/postwoman/pull/529) ([liyasthomas](https://github.com/liyasthomas)) - even merge [\#528](https://github.com/liyasthomas/postwoman/pull/528) ([liyasthomas](https://github.com/liyasthomas)) ## [v1.8.0](https://github.com/liyasthomas/postwoman/tree/v1.8.0) (2020-01-28) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/v1.5.0...v1.8.0) **Fixed bugs:** - Warn the user if name field was left blank while creating a new collection [\#515](https://github.com/liyasthomas/postwoman/issues/515) - Multiple collections with the same name shouldn't exist [\#509](https://github.com/liyasthomas/postwoman/issues/509) - GraphQL String variables are null [\#497](https://github.com/liyasthomas/postwoman/issues/497) - Post request body is empty [\#473](https://github.com/liyasthomas/postwoman/issues/473) **Closed issues:** - Allow importing Postman collections [\#524](https://github.com/liyasthomas/postwoman/issues/524) - Request descriptions [\#511](https://github.com/liyasthomas/postwoman/issues/511) - Sync collection with a cloud storage \(e.g: Google drive\) [\#507](https://github.com/liyasthomas/postwoman/issues/507) - Ability to run all requests of a folder/collection [\#498](https://github.com/liyasthomas/postwoman/issues/498) - Change import/export collection on requests page icon [\#495](https://github.com/liyasthomas/postwoman/issues/495) - Application contains many hard-coded strings that aren't translatable [\#488](https://github.com/liyasthomas/postwoman/issues/488) - import cURL error [\#477](https://github.com/liyasthomas/postwoman/issues/477) - move to postwoman org [\#475](https://github.com/liyasthomas/postwoman/issues/475) - Create standalone vue components of the request builder. [\#474](https://github.com/liyasthomas/postwoman/issues/474) - ULR parsing and var auto creation [\#469](https://github.com/liyasthomas/postwoman/issues/469) - What about additional loaders: + Pug, TypeScript, SASS, material-vue ? [\#467](https://github.com/liyasthomas/postwoman/issues/467) - \[suggestion\] - Tests tab [\#465](https://github.com/liyasthomas/postwoman/issues/465) - cookie not found support [\#443](https://github.com/liyasthomas/postwoman/issues/443) - Feature Request: Consumer Driven Contract Testing [\#420](https://github.com/liyasthomas/postwoman/issues/420) - Feature Request: Support OAuth2/OIDC [\#337](https://github.com/liyasthomas/postwoman/issues/337) - Enable running proxy as a backend for Request Capture [\#325](https://github.com/liyasthomas/postwoman/issues/325) - Label doesn't change when switching between collection requests [\#291](https://github.com/liyasthomas/postwoman/issues/291) - Add DB cache [\#26](https://github.com/liyasthomas/postwoman/issues/26) **Merged pull requests:** - Enhancements [\#531](https://github.com/liyasthomas/postwoman/pull/531) ([jamesgeorge007](https://github.com/jamesgeorge007)) - Merge pull request \#530 from liyasthomas/feature/post-request-tests [\#530](https://github.com/liyasthomas/postwoman/pull/530) ([liyasthomas](https://github.com/liyasthomas)) - Refactor [\#523](https://github.com/liyasthomas/postwoman/pull/523) ([liyasthomas](https://github.com/liyasthomas)) - chore\(deps\): bump nuxt-i18n from 6.4.1 to 6.5.0 [\#522](https://github.com/liyasthomas/postwoman/pull/522) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump v-tooltip from 2.0.2 to 2.0.3 [\#521](https://github.com/liyasthomas/postwoman/pull/521) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump cypress from 3.8.2 to 3.8.3 [\#520](https://github.com/liyasthomas/postwoman/pull/520) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Feature/post request tests [\#518](https://github.com/liyasthomas/postwoman/pull/518) ([nickpalenchar](https://github.com/nickpalenchar)) - Validations for edit and create collections activity [\#516](https://github.com/liyasthomas/postwoman/pull/516) ([jamesgeorge007](https://github.com/jamesgeorge007)) - Auth [\#513](https://github.com/liyasthomas/postwoman/pull/513) ([liyasthomas](https://github.com/liyasthomas)) - Support for Google Chrome Extension [\#512](https://github.com/liyasthomas/postwoman/pull/512) ([AndrewBastin](https://github.com/AndrewBastin)) - Validate duplicate collections [\#510](https://github.com/liyasthomas/postwoman/pull/510) ([jamesgeorge007](https://github.com/jamesgeorge007)) - GraphQL query validation based on schema [\#508](https://github.com/liyasthomas/postwoman/pull/508) ([AndrewBastin](https://github.com/AndrewBastin)) - Lint and refactor [\#506](https://github.com/liyasthomas/postwoman/pull/506) ([liyasthomas](https://github.com/liyasthomas)) - Syntax Error marking in GraphQL query editor [\#505](https://github.com/liyasthomas/postwoman/pull/505) ([AndrewBastin](https://github.com/AndrewBastin)) - Merge pull request \#504 from liyasthomas/dependabot/npm_and_yarn/node-sass-4.13.1 [\#504](https://github.com/liyasthomas/postwoman/pull/504) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump @nuxtjs/axios from 5.9.2 to 5.9.3 [\#503](https://github.com/liyasthomas/postwoman/pull/503) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps-dev\): bump sass-loader from 8.0.1 to 8.0.2 [\#502](https://github.com/liyasthomas/postwoman/pull/502) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - chore\(deps\): bump ace-builds from 1.4.7 to 1.4.8 [\#501](https://github.com/liyasthomas/postwoman/pull/501) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Refactoring proxy handling to be done in strategies [\#500](https://github.com/liyasthomas/postwoman/pull/500) ([AndrewBastin](https://github.com/AndrewBastin)) - 💚 Fixed \#497 [\#499](https://github.com/liyasthomas/postwoman/pull/499) ([pushrbx](https://github.com/pushrbx)) - Feat/firefox strategy [\#496](https://github.com/liyasthomas/postwoman/pull/496) ([liyasthomas](https://github.com/liyasthomas)) - Firefox Extension compatibility [\#494](https://github.com/liyasthomas/postwoman/pull/494) ([AndrewBastin](https://github.com/AndrewBastin)) - i18n Japanese: Added new translations [\#492](https://github.com/liyasthomas/postwoman/pull/492) ([reefqi037](https://github.com/reefqi037)) - Merge pull request \#491 from liyasthomas/i18n [\#491](https://github.com/liyasthomas/postwoman/pull/491) ([liyasthomas](https://github.com/liyasthomas)) - Replaced hard-coded strings with localizable strings [\#490](https://github.com/liyasthomas/postwoman/pull/490) ([liyasthomas](https://github.com/liyasthomas)) - Network Strategies [\#487](https://github.com/liyasthomas/postwoman/pull/487) ([AndrewBastin](https://github.com/AndrewBastin)) - chore\(oauth\): Added method signatures as per JSDoc conventions [\#486](https://github.com/liyasthomas/postwoman/pull/486) ([jamesgeorge007](https://github.com/jamesgeorge007)) - chore: Minor tweaks [\#485](https://github.com/liyasthomas/postwoman/pull/485) ([jamesgeorge007](https://github.com/jamesgeorge007)) - ⬆️ Bump cypress from 3.8.1 to 3.8.2 [\#483](https://github.com/liyasthomas/postwoman/pull/483) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump sass-loader from 8.0.0 to 8.0.1 [\#482](https://github.com/liyasthomas/postwoman/pull/482) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump @nuxtjs/google-analytics from 2.2.2 to 2.2.3 [\#481](https://github.com/liyasthomas/postwoman/pull/481) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - GraphQL Type Highlight and Links [\#479](https://github.com/liyasthomas/postwoman/pull/479) ([AndrewBastin](https://github.com/AndrewBastin)) - OAuth 2.0/OIDC Access Token Retrieval Support [\#476](https://github.com/liyasthomas/postwoman/pull/476) ([reefqi037](https://github.com/reefqi037)) ## [v1.5.0](https://github.com/liyasthomas/postwoman/tree/v1.5.0) (2020-01-04) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/v1.0.0...v1.5.0) **Fixed bugs:** - WebSocket page freezes when pasting long URL [\#471](https://github.com/liyasthomas/postwoman/issues/471) - API Documentation won't be generated [\#456](https://github.com/liyasthomas/postwoman/issues/456) - Sharing Requests via link is not working [\#435](https://github.com/liyasthomas/postwoman/issues/435) - URL input text is so stutters [\#412](https://github.com/liyasthomas/postwoman/issues/412) - Save to collections after deleting all the collections causes an error page [\#390](https://github.com/liyasthomas/postwoman/issues/390) - Bearer token doesn’t work with CORS when only authorization header is allowed [\#353](https://github.com/liyasthomas/postwoman/issues/353) - Make the UI more compact [\#314](https://github.com/liyasthomas/postwoman/issues/314) - Allow reserved characters on websocket URI [\#289](https://github.com/liyasthomas/postwoman/issues/289) - Unable to edit or delete row in history table [\#281](https://github.com/liyasthomas/postwoman/issues/281) - Allow url request with `/` at eol [\#275](https://github.com/liyasthomas/postwoman/issues/275) - \[request\] localhost support [\#274](https://github.com/liyasthomas/postwoman/issues/274) - Code generation for Fetch request type of some methods \(POST, PUT, PATCH\) won't be shown [\#268](https://github.com/liyasthomas/postwoman/issues/268) - \[BUG\] \[UI\] \[Mobile\] Get results not scrollable. [\#266](https://github.com/liyasthomas/postwoman/issues/266) - POSTing large raw JSON packets [\#265](https://github.com/liyasthomas/postwoman/issues/265) **Closed issues:** - Can WSDL be implemented, similar to SoapUI? [\#461](https://github.com/liyasthomas/postwoman/issues/461) - Module not found: Error: Can't resolve '../.postwoman/version.json' [\#457](https://github.com/liyasthomas/postwoman/issues/457) - \* ../.postwoman/version.json in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./layouts/default.vue?vue&type=script&lang=js& friendly-errors 11:12:37 [\#448](https://github.com/liyasthomas/postwoman/issues/448) - Raw Request Body should be supported to format the JSON string [\#446](https://github.com/liyasthomas/postwoman/issues/446) - npm run dev module was not found: ../.postwoman/version.json [\#442](https://github.com/liyasthomas/postwoman/issues/442) - graphql and websocket work, but http and https do not [\#441](https://github.com/liyasthomas/postwoman/issues/441) - Can I test localhost? [\#433](https://github.com/liyasthomas/postwoman/issues/433) - No 'Access-Control-Allow-Origin' [\#426](https://github.com/liyasthomas/postwoman/issues/426) - When uninstall the PWA the "install PWA" link in postwoman.io isn't appear anymore [\#419](https://github.com/liyasthomas/postwoman/issues/419) - Toggling options will reset the UI to English [\#417](https://github.com/liyasthomas/postwoman/issues/417) - Ability to send Binary data using Postwoman [\#415](https://github.com/liyasthomas/postwoman/issues/415) - Oh my dear god why don't we just wrap it in electron [\#413](https://github.com/liyasthomas/postwoman/issues/413) - UI improvement suggestion for request method drop down [\#409](https://github.com/liyasthomas/postwoman/issues/409) - Can I share a request with my team? [\#408](https://github.com/liyasthomas/postwoman/issues/408) - Does it not support the post method? [\#403](https://github.com/liyasthomas/postwoman/issues/403) - Post can't send request [\#401](https://github.com/liyasthomas/postwoman/issues/401) - \[Bug\] fix header icons overlap [\#399](https://github.com/liyasthomas/postwoman/issues/399) - Custom request method [\#398](https://github.com/liyasthomas/postwoman/issues/398) - Improve translate for pt-BR \(i18n\) [\#395](https://github.com/liyasthomas/postwoman/issues/395) - Raw input disabled is not working properly [\#394](https://github.com/liyasthomas/postwoman/issues/394) - Input area is not clearly to identify for users because the dark mode [\#393](https://github.com/liyasthomas/postwoman/issues/393) - \[UX\] Setting to make sidebar buttons small [\#389](https://github.com/liyasthomas/postwoman/issues/389) - \[UX\] Improve responsive breaking points [\#388](https://github.com/liyasthomas/postwoman/issues/388) - \[UX\] Hide history/collections [\#387](https://github.com/liyasthomas/postwoman/issues/387) - Clearing shortcut overrides browser default [\#374](https://github.com/liyasthomas/postwoman/issues/374) - Proxy server default configuration [\#373](https://github.com/liyasthomas/postwoman/issues/373) - Intent to translate [\#367](https://github.com/liyasthomas/postwoman/issues/367) - \[request\]: CLI possibilities [\#363](https://github.com/liyasthomas/postwoman/issues/363) - Feature request: OAuth header support/integration [\#358](https://github.com/liyasthomas/postwoman/issues/358) - Static builds on releases [\#352](https://github.com/liyasthomas/postwoman/issues/352) - fix:SSE onclose handle [\#349](https://github.com/liyasthomas/postwoman/issues/349) - i18n support [\#348](https://github.com/liyasthomas/postwoman/issues/348) - Separate layers in dockerfile to improve image build [\#339](https://github.com/liyasthomas/postwoman/issues/339) - Internal server environment usage requirements [\#336](https://github.com/liyasthomas/postwoman/issues/336) - Server Sent Events [\#329](https://github.com/liyasthomas/postwoman/issues/329) - Generate API documentation [\#326](https://github.com/liyasthomas/postwoman/issues/326) - \[Request\] Use responses for next request? [\#324](https://github.com/liyasthomas/postwoman/issues/324) - Auth info on WebSocket connections [\#321](https://github.com/liyasthomas/postwoman/issues/321) - Set response panel to fullscreen [\#320](https://github.com/liyasthomas/postwoman/issues/320) - Graphql support [\#312](https://github.com/liyasthomas/postwoman/issues/312) - Keyboard shortcuts [\#302](https://github.com/liyasthomas/postwoman/issues/302) - File/binary request body support [\#298](https://github.com/liyasthomas/postwoman/issues/298) - Make response body area expandable [\#294](https://github.com/liyasthomas/postwoman/issues/294) - It's possible to tab into read only and non-form elements [\#287](https://github.com/liyasthomas/postwoman/issues/287) - Change cursor to disabled on disabled inputs [\#286](https://github.com/liyasthomas/postwoman/issues/286) - Hover Styling on Inputs [\#285](https://github.com/liyasthomas/postwoman/issues/285) - Focus Styles on Buttons [\#284](https://github.com/liyasthomas/postwoman/issues/284) - Mobile can't see console for request errors [\#283](https://github.com/liyasthomas/postwoman/issues/283) - Missing Focus on Inputs [\#279](https://github.com/liyasthomas/postwoman/issues/279) - Download the request result into a file. [\#278](https://github.com/liyasthomas/postwoman/issues/278) - Improve UI Contrast [\#277](https://github.com/liyasthomas/postwoman/issues/277) - Duplicated query string in generated code [\#272](https://github.com/liyasthomas/postwoman/issues/272) - Query parameters are duplicated [\#271](https://github.com/liyasthomas/postwoman/issues/271) - Generated code is incorrect [\#269](https://github.com/liyasthomas/postwoman/issues/269) - \[UI\] \[UX\] Allow app to take width of browser [\#236](https://github.com/liyasthomas/postwoman/issues/236) - Extend syntax highlighting with ACE for pre-request script textarea [\#235](https://github.com/liyasthomas/postwoman/issues/235) - Store pre-request scripts in history [\#233](https://github.com/liyasthomas/postwoman/issues/233) - Lacking documentation and wiki [\#232](https://github.com/liyasthomas/postwoman/issues/232) - Store the time spent on fetching a response [\#225](https://github.com/liyasthomas/postwoman/issues/225) - I can't send POST method [\#210](https://github.com/liyasthomas/postwoman/issues/210) - Cache view [\#188](https://github.com/liyasthomas/postwoman/issues/188) - Handling request failures when build number is obtained from GitHub [\#122](https://github.com/liyasthomas/postwoman/issues/122) **Merged pull requests:** - ⬆️ Bump @nuxtjs/axios from 5.9.0 to 5.9.2 [\#472](https://github.com/liyasthomas/postwoman/pull/472) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Added variables to graphql page. [\#464](https://github.com/liyasthomas/postwoman/pull/464) ([pushrbx](https://github.com/pushrbx)) - i18n [\#463](https://github.com/liyasthomas/postwoman/pull/463) ([liyasthomas](https://github.com/liyasthomas)) - ⬆️ Bump cypress from 3.8.0 to 3.8.1 [\#460](https://github.com/liyasthomas/postwoman/pull/460) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - i18n\(de-DE\): improve some translations [\#459](https://github.com/liyasthomas/postwoman/pull/459) ([gabschne](https://github.com/gabschne)) - bn-BD i18n [\#455](https://github.com/liyasthomas/postwoman/pull/455) ([hmtanbir](https://github.com/hmtanbir)) - API documentation page [\#451](https://github.com/liyasthomas/postwoman/pull/451) ([liyasthomas](https://github.com/liyasthomas)) - ⬆️ Bump @nuxtjs/axios from 5.8.0 to 5.9.0 [\#450](https://github.com/liyasthomas/postwoman/pull/450) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump nuxt from 2.10.2 to 2.11.0 [\#449](https://github.com/liyasthomas/postwoman/pull/449) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Various UI tweaks [\#439](https://github.com/liyasthomas/postwoman/pull/439) ([liyasthomas](https://github.com/liyasthomas)) - i18n [\#438](https://github.com/liyasthomas/postwoman/pull/438) ([liyasthomas](https://github.com/liyasthomas)) - Burmese translation added [\#437](https://github.com/liyasthomas/postwoman/pull/437) ([ZattWine](https://github.com/ZattWine)) - chore: stick to Vue.js best practices [\#432](https://github.com/liyasthomas/postwoman/pull/432) ([jamesgeorge007](https://github.com/jamesgeorge007)) - Styled select input [\#431](https://github.com/liyasthomas/postwoman/pull/431) ([liyasthomas](https://github.com/liyasthomas)) - Bumped dependencies and Improved UI contrast [\#430](https://github.com/liyasthomas/postwoman/pull/430) ([liyasthomas](https://github.com/liyasthomas)) - ⬆️ Bump cypress from 3.7.0 to 3.8.0 [\#429](https://github.com/liyasthomas/postwoman/pull/429) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - I18n [\#428](https://github.com/liyasthomas/postwoman/pull/428) ([liyasthomas](https://github.com/liyasthomas)) - I18n Japanese translation added [\#427](https://github.com/liyasthomas/postwoman/pull/427) ([reefqi037](https://github.com/reefqi037)) - Even [\#424](https://github.com/liyasthomas/postwoman/pull/424) ([liyasthomas](https://github.com/liyasthomas)) - I18n [\#423](https://github.com/liyasthomas/postwoman/pull/423) ([liyasthomas](https://github.com/liyasthomas)) - I18n German translation added [\#422](https://github.com/liyasthomas/postwoman/pull/422) ([NJannasch](https://github.com/NJannasch)) - Header key autocompletion [\#421](https://github.com/liyasthomas/postwoman/pull/421) ([AndrewBastin](https://github.com/AndrewBastin)) - Update id-ID.js [\#416](https://github.com/liyasthomas/postwoman/pull/416) ([williamsp](https://github.com/williamsp)) - Improving translation for id-ID [\#414](https://github.com/liyasthomas/postwoman/pull/414) ([williamsp](https://github.com/williamsp)) - Fixing bug on request saving [\#410](https://github.com/liyasthomas/postwoman/pull/410) ([adevr](https://github.com/adevr)) - ⬆️ Bump @nuxtjs/google-analytics from 2.2.1 to 2.2.2 [\#407](https://github.com/liyasthomas/postwoman/pull/407) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump vue-virtual-scroll-list from 1.4.3 to 1.4.4 [\#406](https://github.com/liyasthomas/postwoman/pull/406) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump nuxt-i18n from 6.4.0 to 6.4.1 [\#405](https://github.com/liyasthomas/postwoman/pull/405) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - I18n [\#404](https://github.com/liyasthomas/postwoman/pull/404) ([yubathom](https://github.com/yubathom)) - Custom methods support [\#400](https://github.com/liyasthomas/postwoman/pull/400) ([liyasthomas](https://github.com/liyasthomas)) - App UI [\#391](https://github.com/liyasthomas/postwoman/pull/391) ([liyasthomas](https://github.com/liyasthomas)) - i18n [\#383](https://github.com/liyasthomas/postwoman/pull/383) ([liyasthomas](https://github.com/liyasthomas)) - Added Turkish Language Support [\#382](https://github.com/liyasthomas/postwoman/pull/382) ([AliAnilKocak](https://github.com/AliAnilKocak)) - Translated new words to Farsi lang [\#380](https://github.com/liyasthomas/postwoman/pull/380) ([hosseinnedaee](https://github.com/hosseinnedaee)) - Two Way Data Binding \(v-model\) to Ace Editor component [\#379](https://github.com/liyasthomas/postwoman/pull/379) ([AndrewBastin](https://github.com/AndrewBastin)) - fix: twitter summary card image url [\#378](https://github.com/liyasthomas/postwoman/pull/378) ([peterpeterparker](https://github.com/peterpeterparker)) - Added nav shortcuts to GraphQL query and response, updated GraphQL shortcut icons [\#377](https://github.com/liyasthomas/postwoman/pull/377) ([AndrewBastin](https://github.com/AndrewBastin)) - Bump cypress from 3.6.1 to 3.7.0 [\#376](https://github.com/liyasthomas/postwoman/pull/376) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Bump vuex-persist from 2.1.1 to 2.2.0 [\#375](https://github.com/liyasthomas/postwoman/pull/375) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - I18n [\#372](https://github.com/liyasthomas/postwoman/pull/372) ([EdikWang](https://github.com/EdikWang)) - Use GraphQL logo for GraphQL tab [\#371](https://github.com/liyasthomas/postwoman/pull/371) ([NBTX](https://github.com/NBTX)) - Update i18n keywords for Bahasa Indonesia [\#369](https://github.com/liyasthomas/postwoman/pull/369) ([wahwahid](https://github.com/wahwahid)) - Intent to translate to Spanish on I18n [\#368](https://github.com/liyasthomas/postwoman/pull/368) ([adlpaf](https://github.com/adlpaf)) - I18n [\#366](https://github.com/liyasthomas/postwoman/pull/366) ([liyasthomas](https://github.com/liyasthomas)) - Add translations for FR/EN catalogues [\#364](https://github.com/liyasthomas/postwoman/pull/364) ([LaurentBrieu](https://github.com/LaurentBrieu)) - Added Bahasa Indonesia language support [\#362](https://github.com/liyasthomas/postwoman/pull/362) ([wahwahid](https://github.com/wahwahid)) - i18n [\#361](https://github.com/liyasthomas/postwoman/pull/361) ([liyasthomas](https://github.com/liyasthomas)) - Add Simplified Chinese language [\#360](https://github.com/liyasthomas/postwoman/pull/360) ([EdikWang](https://github.com/EdikWang)) - Added Brazilian Portuguese language support [\#359](https://github.com/liyasthomas/postwoman/pull/359) ([tetri](https://github.com/tetri)) - Added Farsi language support [\#357](https://github.com/liyasthomas/postwoman/pull/357) ([hosseinnedaee](https://github.com/hosseinnedaee)) - Adding french language basic [\#355](https://github.com/liyasthomas/postwoman/pull/355) ([thomasbnt](https://github.com/thomasbnt)) - Basic i18n support [\#351](https://github.com/liyasthomas/postwoman/pull/351) ([liyasthomas](https://github.com/liyasthomas)) - Undo header/param/body param deletion [\#350](https://github.com/liyasthomas/postwoman/pull/350) ([AndrewBastin](https://github.com/AndrewBastin)) - Added ability to run GraphQL queries [\#346](https://github.com/liyasthomas/postwoman/pull/346) ([AndrewBastin](https://github.com/AndrewBastin)) - Add Proxy URL option [\#345](https://github.com/liyasthomas/postwoman/pull/345) ([NBTX](https://github.com/NBTX)) - ♻️ Refactor Functions [\#344](https://github.com/liyasthomas/postwoman/pull/344) ([athul](https://github.com/athul)) - refactor: minor improvements [\#343](https://github.com/liyasthomas/postwoman/pull/343) ([jamesgeorge007](https://github.com/jamesgeorge007)) ## [v1.0.0](https://github.com/liyasthomas/postwoman/tree/v1.0.0) (2019-11-04) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/v0.1.0...v1.0.0) **Fixed bugs:** - Bearer Token value still left even after being cleared [\#212](https://github.com/liyasthomas/postwoman/issues/212) - All changes in input fields lost when you switch to another page [\#203](https://github.com/liyasthomas/postwoman/issues/203) - POST request json bodies aren't sent [\#180](https://github.com/liyasthomas/postwoman/issues/180) - Headers turn into 0 : \[Object object\] [\#166](https://github.com/liyasthomas/postwoman/issues/166) - Send Again Button Constantly Flickering [\#157](https://github.com/liyasthomas/postwoman/issues/157) - There are cross-domain problems [\#128](https://github.com/liyasthomas/postwoman/issues/128) - Raw requests are not being sent [\#124](https://github.com/liyasthomas/postwoman/issues/124) - Request Body Is Not Sent [\#113](https://github.com/liyasthomas/postwoman/issues/113) - default menu option - 'Http' is not highlighted when launched from installed pwa app \(UI bug\) [\#100](https://github.com/liyasthomas/postwoman/issues/100) - App is broken with old history in localStorage [\#74](https://github.com/liyasthomas/postwoman/issues/74) - Last added history entry is removed automatically after refresh [\#66](https://github.com/liyasthomas/postwoman/issues/66) - Cannot use localhost as base url [\#56](https://github.com/liyasthomas/postwoman/issues/56) - \[CORS\] No 'Access-Control-Allow-Origin' header is present on the requested resource [\#2](https://github.com/liyasthomas/postwoman/issues/2) **Closed issues:** - Section labels don't display properly in Firefox [\#237](https://github.com/liyasthomas/postwoman/issues/237) - Unsupported URLs \[BUG\]? [\#229](https://github.com/liyasthomas/postwoman/issues/229) - Credentials are still being included in Permalink even when "Include in URL" is turned off [\#227](https://github.com/liyasthomas/postwoman/issues/227) - Display sendRequest runtime errors in the console [\#206](https://github.com/liyasthomas/postwoman/issues/206) - Chain requests. Execute a bunch of requests one by one and produce results [\#196](https://github.com/liyasthomas/postwoman/issues/196) - Allow User to Choose Whether to Include Authentication in Permalink [\#178](https://github.com/liyasthomas/postwoman/issues/178) - Allow HTTP \(not HTTPS\) on postwoman.io [\#175](https://github.com/liyasthomas/postwoman/issues/175) - Docker-compose in development [\#168](https://github.com/liyasthomas/postwoman/issues/168) - Add Docker [\#164](https://github.com/liyasthomas/postwoman/issues/164) - Missing "Landing/start page" [\#162](https://github.com/liyasthomas/postwoman/issues/162) - Response with content-type "application/hal+json" shows as \[Object object\] [\#158](https://github.com/liyasthomas/postwoman/issues/158) - Clear Input [\#155](https://github.com/liyasthomas/postwoman/issues/155) - A place to discuss [\#149](https://github.com/liyasthomas/postwoman/issues/149) - Inconsistent version name [\#141](https://github.com/liyasthomas/postwoman/issues/141) - introduce some script language to parse the response and pass environment variable as request parameter [\#139](https://github.com/liyasthomas/postwoman/issues/139) - Add links to the footer version and commit sha [\#134](https://github.com/liyasthomas/postwoman/issues/134) - Please add a label for each request. It will be helpful. [\#133](https://github.com/liyasthomas/postwoman/issues/133) - Use 'icon buttons' instead of 'text buttons' [\#130](https://github.com/liyasthomas/postwoman/issues/130) - Change .editorconfig [\#115](https://github.com/liyasthomas/postwoman/issues/115) - \[UX\] Provide Focus State for Buttons, etc. [\#112](https://github.com/liyasthomas/postwoman/issues/112) - Autoresize the textarea [\#102](https://github.com/liyasthomas/postwoman/issues/102) - Content-Type revamping [\#99](https://github.com/liyasthomas/postwoman/issues/99) - Add linter semistandard [\#98](https://github.com/liyasthomas/postwoman/issues/98) - Add version number in footer [\#97](https://github.com/liyasthomas/postwoman/issues/97) - Show "Send" button all over the page or enable hotkeys [\#94](https://github.com/liyasthomas/postwoman/issues/94) - Import request from cURL [\#93](https://github.com/liyasthomas/postwoman/issues/93) - Search on History [\#92](https://github.com/liyasthomas/postwoman/issues/92) - Add support for "application/hal+json" Content-Type [\#88](https://github.com/liyasthomas/postwoman/issues/88) - The query string is built incorrectly when the path contains a parameter [\#87](https://github.com/liyasthomas/postwoman/issues/87) - The history doesn't show a date with the timestamp. [\#81](https://github.com/liyasthomas/postwoman/issues/81) - Option to Copy request as Fetch or XHR Or CURL [\#76](https://github.com/liyasthomas/postwoman/issues/76) - Not working on Brave Browser anymore [\#71](https://github.com/liyasthomas/postwoman/issues/71) - Why da fuq is your name plastered all over the README? [\#70](https://github.com/liyasthomas/postwoman/issues/70) - Comparison with Postman is missing [\#69](https://github.com/liyasthomas/postwoman/issues/69) - Add Tests [\#65](https://github.com/liyasthomas/postwoman/issues/65) - HTTP request with different library [\#61](https://github.com/liyasthomas/postwoman/issues/61) - Editorconfig file [\#60](https://github.com/liyasthomas/postwoman/issues/60) - 500 this.isValidURL is not a function [\#58](https://github.com/liyasthomas/postwoman/issues/58) - Request Headers [\#57](https://github.com/liyasthomas/postwoman/issues/57) - Colored response codes based on status code [\#46](https://github.com/liyasthomas/postwoman/issues/46) - Improve SEO [\#45](https://github.com/liyasthomas/postwoman/issues/45) - Add html preview to response section [\#41](https://github.com/liyasthomas/postwoman/issues/41) - websocket support [\#40](https://github.com/liyasthomas/postwoman/issues/40) - Styling with Tailwindcss [\#38](https://github.com/liyasthomas/postwoman/issues/38) - Not Working in IE 11 [\#37](https://github.com/liyasthomas/postwoman/issues/37) - Raw request body for POST requests and Authorization key/value in Header [\#36](https://github.com/liyasthomas/postwoman/issues/36) - Code highlight on response body [\#33](https://github.com/liyasthomas/postwoman/issues/33) - Template selector [\#32](https://github.com/liyasthomas/postwoman/issues/32) - Vue template [\#31](https://github.com/liyasthomas/postwoman/issues/31) - Add copy response to clipboard button [\#30](https://github.com/liyasthomas/postwoman/issues/30) - Ability to store/share/create collections [\#29](https://github.com/liyasthomas/postwoman/issues/29) - PWA not installable [\#19](https://github.com/liyasthomas/postwoman/issues/19) - Send request on Enter Key press [\#17](https://github.com/liyasthomas/postwoman/issues/17) - Simple Misspelling [\#8](https://github.com/liyasthomas/postwoman/issues/8) - Readable [\#5](https://github.com/liyasthomas/postwoman/issues/5) - Serialize a request into JSON? [\#4](https://github.com/liyasthomas/postwoman/issues/4) **Merged pull requests:** - docs: add liyasthomas as a contributor [\#264](https://github.com/liyasthomas/postwoman/pull/264) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add jamesgeorge007 as a contributor [\#263](https://github.com/liyasthomas/postwoman/pull/263) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add NBTX as a contributor [\#262](https://github.com/liyasthomas/postwoman/pull/262) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - Fix .all-contributorsrc badge template. [\#260](https://github.com/liyasthomas/postwoman/pull/260) ([NBTX](https://github.com/NBTX)) - docs: add hosseinnedaee as a contributor [\#259](https://github.com/liyasthomas/postwoman/pull/259) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add nityanandagohain as a contributor [\#257](https://github.com/liyasthomas/postwoman/pull/257) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add JacobAnavisca as a contributor [\#256](https://github.com/liyasthomas/postwoman/pull/256) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add izerozlu as a contributor [\#255](https://github.com/liyasthomas/postwoman/pull/255) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add vlad0337187 as a contributor [\#254](https://github.com/liyasthomas/postwoman/pull/254) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add AndrewBastin as a contributor [\#253](https://github.com/liyasthomas/postwoman/pull/253) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add terranblake as a contributor [\#252](https://github.com/liyasthomas/postwoman/pull/252) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add nickpalenchar as a contributor [\#251](https://github.com/liyasthomas/postwoman/pull/251) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add yubathom as a contributor [\#250](https://github.com/liyasthomas/postwoman/pull/250) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add larouxn as a contributor [\#249](https://github.com/liyasthomas/postwoman/pull/249) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add NBTX as a contributor [\#248](https://github.com/liyasthomas/postwoman/pull/248) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - docs: add liyasthomas as a contributor [\#247](https://github.com/liyasthomas/postwoman/pull/247) ([allcontributors[bot]](https://github.com/apps/allcontributors)) - Make page changes more fluid [\#246](https://github.com/liyasthomas/postwoman/pull/246) ([NBTX](https://github.com/NBTX)) - Minor tweaks [\#245](https://github.com/liyasthomas/postwoman/pull/245) ([liyasthomas](https://github.com/liyasthomas)) - Add brand new logo to the project [\#244](https://github.com/liyasthomas/postwoman/pull/244) ([caneco](https://github.com/caneco)) - ⬆️ Bump @nuxtjs/google-tag-manager from 2.3.0 to 2.3.1 [\#243](https://github.com/liyasthomas/postwoman/pull/243) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump yargs-parser from 15.0.0 to 16.1.0 [\#242](https://github.com/liyasthomas/postwoman/pull/242) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump @nuxtjs/toast from 3.2.1 to 3.3.0 [\#241](https://github.com/liyasthomas/postwoman/pull/241) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump highlight.js from 9.15.10 to 9.16.2 [\#240](https://github.com/liyasthomas/postwoman/pull/240) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump cypress from 3.5.0 to 3.6.0 [\#239](https://github.com/liyasthomas/postwoman/pull/239) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Fix legend labels in Firefox, fix colored labels slider [\#238](https://github.com/liyasthomas/postwoman/pull/238) ([NBTX](https://github.com/NBTX)) - Feature/pre request script [\#231](https://github.com/liyasthomas/postwoman/pull/231) ([nickpalenchar](https://github.com/nickpalenchar)) - Documentation Cleanup [\#230](https://github.com/liyasthomas/postwoman/pull/230) ([amitdash291](https://github.com/amitdash291)) - Fix \#227 Exclude credentials from permalink [\#228](https://github.com/liyasthomas/postwoman/pull/228) ([reefqi037](https://github.com/reefqi037)) - ⬆️ Bump cypress from 3.4.1 to 3.5.0 [\#224](https://github.com/liyasthomas/postwoman/pull/224) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump @nuxtjs/axios from 5.6.0 to 5.8.0 [\#223](https://github.com/liyasthomas/postwoman/pull/223) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump node-sass from 4.12.0 to 4.13.0 [\#222](https://github.com/liyasthomas/postwoman/pull/222) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump nuxt from 2.10.1 to 2.10.2 [\#221](https://github.com/liyasthomas/postwoman/pull/221) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump @nuxtjs/google-analytics from 2.2.0 to 2.2.1 [\#220](https://github.com/liyasthomas/postwoman/pull/220) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump vuex-persist from 2.1.0 to 2.1.1 [\#219](https://github.com/liyasthomas/postwoman/pull/219) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Add the ApolloTV proxy server [\#217](https://github.com/liyasthomas/postwoman/pull/217) ([NBTX](https://github.com/NBTX)) - Fixed frame colors toggle [\#216](https://github.com/liyasthomas/postwoman/pull/216) ([mateusppereira](https://github.com/mateusppereira)) - Re-order sections and add toggle for including authentication in URL [\#215](https://github.com/liyasthomas/postwoman/pull/215) ([NBTX](https://github.com/NBTX)) - chore: minor code refactor [\#214](https://github.com/liyasthomas/postwoman/pull/214) ([jamesgeorge007](https://github.com/jamesgeorge007)) - Fix \#212 Clear bearer token value [\#213](https://github.com/liyasthomas/postwoman/pull/213) ([reefqi037](https://github.com/reefqi037)) - bug: keeping information on page change [\#211](https://github.com/liyasthomas/postwoman/pull/211) ([breno-pereira](https://github.com/breno-pereira)) - Work in Progress: feature/allow-collections-importing [\#209](https://github.com/liyasthomas/postwoman/pull/209) ([vlad0337187](https://github.com/vlad0337187)) - fix: don't display 'Collection is empty' label if collection has any … [\#208](https://github.com/liyasthomas/postwoman/pull/208) ([vlad0337187](https://github.com/vlad0337187)) - Feature/log errors [\#207](https://github.com/liyasthomas/postwoman/pull/207) ([nickpalenchar](https://github.com/nickpalenchar)) - Use returned value from toggle component on change event [\#205](https://github.com/liyasthomas/postwoman/pull/205) ([hosseinnedaee](https://github.com/hosseinnedaee)) - Fix proxy URL [\#201](https://github.com/liyasthomas/postwoman/pull/201) ([NBTX](https://github.com/NBTX)) - Fix CORS and Mixed-Content issue & Bug Fixes [\#200](https://github.com/liyasthomas/postwoman/pull/200) ([NBTX](https://github.com/NBTX)) - Fix CORS and mixed content issue [\#199](https://github.com/liyasthomas/postwoman/pull/199) ([hosseinnedaee](https://github.com/hosseinnedaee)) - ⬆️ Bump start-server-and-test from 1.10.5 to 1.10.6 [\#198](https://github.com/liyasthomas/postwoman/pull/198) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Added Tooltips [\#197](https://github.com/liyasthomas/postwoman/pull/197) ([AndrewBastin](https://github.com/AndrewBastin)) - ⬆️ Bump start-server-and-test from 1.10.3 to 1.10.5 [\#194](https://github.com/liyasthomas/postwoman/pull/194) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump @nuxtjs/google-tag-manager from 2.2.1 to 2.3.0 [\#193](https://github.com/liyasthomas/postwoman/pull/193) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump nuxt from 2.10.0 to 2.10.1 [\#192](https://github.com/liyasthomas/postwoman/pull/192) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - ⬆️ Bump yargs-parser from 14.0.0 to 15.0.0 [\#191](https://github.com/liyasthomas/postwoman/pull/191) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Add quotation marks for generated code [\#187](https://github.com/liyasthomas/postwoman/pull/187) ([johnhenry](https://github.com/johnhenry)) - Added auto theme [\#185](https://github.com/liyasthomas/postwoman/pull/185) ([AndrewBastin](https://github.com/AndrewBastin)) - Add Request name label for every requests [\#184](https://github.com/liyasthomas/postwoman/pull/184) ([sharath2106](https://github.com/sharath2106)) - updated threshold and rootMargin for IntersectionObserver [\#182](https://github.com/liyasthomas/postwoman/pull/182) ([edisonaugusthy](https://github.com/edisonaugusthy)) - Add basic e2e tests [\#181](https://github.com/liyasthomas/postwoman/pull/181) ([yubathom](https://github.com/yubathom)) - ⬆️ Bump nuxt from 2.9.2 to 2.10.0 [\#179](https://github.com/liyasthomas/postwoman/pull/179) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - 🐛 Fixed sitemap configuration [\#177](https://github.com/liyasthomas/postwoman/pull/177) ([NicoPennec](https://github.com/NicoPennec)) - Collections [\#176](https://github.com/liyasthomas/postwoman/pull/176) ([TheHollidayInn](https://github.com/TheHollidayInn)) - Code Refactoring [\#173](https://github.com/liyasthomas/postwoman/pull/173) ([edisonaugusthy](https://github.com/edisonaugusthy)) - Added Black Theme [\#172](https://github.com/liyasthomas/postwoman/pull/172) ([AndrewBastin](https://github.com/AndrewBastin)) ## [v0.1.0](https://github.com/liyasthomas/postwoman/tree/v0.1.0) (2019-08-22) [Full Changelog](https://github.com/liyasthomas/postwoman/compare/91c08a5e6305cc95a0df46a33fdd0013bf7339b4...v0.1.0) \* _This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)_
CHANGELOG.md
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.0060952273197472095, 0.0005129092605784535, 0.00016160958330146968, 0.00017656768613960594, 0.0009252561721950769 ]
{ "id": 4, "code_window": [ " <span v-else-if=\"tab.label\">{{ tab.label }}</span>\n", " <span v-if=\"tab.info && tab.info !== 'null'\" class=\"tab-info\">\n", " {{ tab.info }}\n", " </span>\n", " </button>\n", " </div>\n", " <div class=\"flex justify-center items-center\">\n", " <slot name=\"actions\"></slot>\n", " </div>\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <span\n", " v-if=\"tab.indicator\"\n", " class=\"bg-accentLight h-1 w-1 ml-2 rounded-full\"\n", " ></span>\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tabs.vue", "type": "add", "edit_start_line_idx": 36 }
<template> <div v-show="active"> <slot></slot> </div> </template> <script> import { defineComponent } from "@nuxtjs/composition-api" export default defineComponent({ name: "SmartTab", props: { label: { type: String, default: null }, info: { type: String, default: null }, icon: { type: String, default: null }, id: { type: String, default: null, required: true }, selected: { type: Boolean, default: false, }, }, data() { return { active: false, } }, mounted() { this.active = this.selected }, }) </script>
packages/hoppscotch-app/components/smart/Tab.vue
1
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00035141216358169913, 0.00021665508393198252, 0.0001708752242848277, 0.0001721664739307016, 0.00007780906889820471 ]
{ "id": 4, "code_window": [ " <span v-else-if=\"tab.label\">{{ tab.label }}</span>\n", " <span v-if=\"tab.info && tab.info !== 'null'\" class=\"tab-info\">\n", " {{ tab.info }}\n", " </span>\n", " </button>\n", " </div>\n", " <div class=\"flex justify-center items-center\">\n", " <slot name=\"actions\"></slot>\n", " </div>\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <span\n", " v-if=\"tab.indicator\"\n", " class=\"bg-accentLight h-1 w-1 ml-2 rounded-full\"\n", " ></span>\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tabs.vue", "type": "add", "edit_start_line_idx": 36 }
@mixin baseTheme { --font-sans: "Inter", sans-serif; --font-mono: "Roboto Mono", monospace; --font-icon: "Material Icons"; } @mixin darkTheme { // Background color --primary-color: theme("colors.true-gray.900"); // Light Background color --primary-light-color: theme("colors.dark.600"); // Dark Background color --primary-dark-color: theme("colors.true-gray.800"); // Text color --secondary-color: theme("colors.true-gray.400"); // Light Text color --secondary-light-color: theme("colors.true-gray.500"); // Dark Text color --secondary-dark-color: theme("colors.true-gray.100"); // Border color --divider-color: theme("colors.true-gray.800"); // Light Border color --divider-light-color: theme("colors.dark.500"); // Dark Border color --divider-dark-color: theme("colors.dark.300"); // Error color --error-color: theme("colors.warm-gray.800"); // Tooltip color --tooltip-color: theme("colors.true-gray.100"); // Popover color --popover-color: theme("colors.dark.700"); // Editor theme --editor-theme: "merbivore_soft"; } @mixin lightTheme { // Background color --primary-color: theme("colors.white"); // Light Background color --primary-light-color: theme("colors.true-gray.50"); // Dark Background color --primary-dark-color: theme("colors.true-gray.100"); // Text color --secondary-color: theme("colors.true-gray.500"); // Light Text color --secondary-light-color: theme("colors.true-gray.400"); // Dark Text color --secondary-dark-color: theme("colors.true-gray.900"); // Border color --divider-color: theme("colors.true-gray.200"); // Light Border color --divider-light-color: theme("colors.true-gray.100"); // Dark Border color --divider-dark-color: theme("colors.true-gray.300"); // Error color --error-color: theme("colors.yellow.100"); // Tooltip color --tooltip-color: theme("colors.true-gray.800"); // Popover color --popover-color: theme("colors.white"); // Editor theme --editor-theme: "textmate"; } @mixin blackTheme { // Background color --primary-color: theme("colors.dark.900"); // Light Background color --primary-light-color: theme("colors.true-gray.900"); // Dark Background color --primary-dark-color: theme("colors.dark.800"); // Text color --secondary-color: theme("colors.true-gray.400"); // Light Text color --secondary-light-color: theme("colors.true-gray.500"); // Dark Text color --secondary-dark-color: theme("colors.true-gray.100"); // Border color --divider-color: theme("colors.true-gray.800"); // Light Border color --divider-light-color: theme("colors.dark.700"); // Dark Border color --divider-dark-color: theme("colors.dark.300"); // Error color --error-color: theme("colors.warm-gray.900"); // Tooltip color --tooltip-color: theme("colors.true-gray.100"); // Popover color --popover-color: theme("colors.dark.700"); // Editor theme --editor-theme: "twilight"; } @mixin greenTheme { // Accent color --accent-color: theme("colors.green.500"); // Light Accent color --accent-light-color: theme("colors.green.400"); // Dark Accent color --accent-dark-color: theme("colors.green.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.green.200"); // Gradient via --gradient-via-color: theme("colors.green.400"); // Gradient to --gradient-to-color: theme("colors.green.600"); } @mixin tealTheme { // Accent color --accent-color: theme("colors.teal.500"); // Light Accent color --accent-light-color: theme("colors.teal.400"); // Dark Accent color --accent-dark-color: theme("colors.teal.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.teal.200"); // Gradient via --gradient-via-color: theme("colors.teal.400"); // Gradient to --gradient-to-color: theme("colors.teal.600"); } @mixin blueTheme { // Accent color --accent-color: theme("colors.blue.500"); // Light Accent color --accent-light-color: theme("colors.blue.400"); // Dark Accent color --accent-dark-color: theme("colors.blue.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.blue.200"); // Gradient via --gradient-via-color: theme("colors.blue.400"); // Gradient to --gradient-to-color: theme("colors.blue.600"); } @mixin indigoTheme { // Accent color --accent-color: theme("colors.indigo.500"); // Light Accent color --accent-light-color: theme("colors.indigo.400"); // Dark Accent color --accent-dark-color: theme("colors.indigo.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.indigo.200"); // Gradient via --gradient-via-color: theme("colors.indigo.400"); // Gradient to --gradient-to-color: theme("colors.indigo.600"); } @mixin purpleTheme { // Accent color --accent-color: theme("colors.purple.500"); // Light Accent color --accent-light-color: theme("colors.purple.400"); // Dark Accent color --accent-dark-color: theme("colors.purple.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.purple.200"); // Gradient via --gradient-via-color: theme("colors.purple.400"); // Gradient to --gradient-to-color: theme("colors.purple.600"); } @mixin yellowTheme { // Accent color --accent-color: theme("colors.yellow.500"); // Light Accent color --accent-light-color: theme("colors.yellow.400"); // Dark Accent color --accent-dark-color: theme("colors.yellow.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.yellow.200"); // Gradient via --gradient-via-color: theme("colors.yellow.400"); // Gradient to --gradient-to-color: theme("colors.yellow.600"); } @mixin orangeTheme { // Accent color --accent-color: theme("colors.orange.500"); // Light Accent color --accent-light-color: theme("colors.orange.400"); // Dark Accent color --accent-dark-color: theme("colors.orange.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.orange.200"); // Gradient via --gradient-via-color: theme("colors.orange.400"); // Gradient to --gradient-to-color: theme("colors.orange.600"); } @mixin redTheme { // Accent color --accent-color: theme("colors.red.500"); // Light Accent color --accent-light-color: theme("colors.red.400"); // Dark Accent color --accent-dark-color: theme("colors.red.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.red.200"); // Gradient via --gradient-via-color: theme("colors.red.400"); // Gradient to --gradient-to-color: theme("colors.red.600"); } @mixin pinkTheme { // Accent color --accent-color: theme("colors.pink.500"); // Light Accent color --accent-light-color: theme("colors.pink.400"); // Dark Accent color --accent-dark-color: theme("colors.pink.600"); // Light Contrast color --accent-contrast-color: theme("colors.white"); // Gradient from --gradient-from-color: theme("colors.pink.200"); // Gradient via --gradient-via-color: theme("colors.pink.400"); // Gradient to --gradient-to-color: theme("colors.pink.600"); } :root { @include baseTheme; @include darkTheme; @include greenTheme; } :root.light { @include lightTheme; } :root.dark { @include darkTheme; } :root.black { @include blackTheme; } :root[data-accent="blue"] { @include blueTheme; } :root[data-accent="green"] { @include greenTheme; } :root[data-accent="teal"] { @include tealTheme; } :root[data-accent="indigo"] { @include indigoTheme; } :root[data-accent="purple"] { @include purpleTheme; } :root[data-accent="orange"] { @include orangeTheme; } :root[data-accent="pink"] { @include pinkTheme; } :root[data-accent="red"] { @include redTheme; } :root[data-accent="yellow"] { @include yellowTheme; } @mixin fontSmall { // Font size --body-font-size: 0.75rem; // Line height --body-line-height: 1rem; // Upper primary sticky fold --upper-primary-sticky-fold: 4.125rem; // Upper secondary sticky fold --upper-secondary-sticky-fold: 6.125rem; // Upper tertiary sticky fold --upper-tertiary-sticky-fold: 8.188rem; // Lower primary sticky fold --lower-primary-sticky-fold: 3rem; // Lower secondary sticky fold --lower-secondary-sticky-fold: 5rem; // Sidebar primary sticky fold --sidebar-primary-sticky-fold: 2rem; // Sidebar secondary sticky fold --sidebar-secondary-sticky-fold: 4rem; } @mixin fontMedium { // Font size --body-font-size: 0.875rem; // Line height --body-line-height: 1.25rem; // Upper primary sticky fold --upper-primary-sticky-fold: 4.375rem; // Upper secondary sticky fold --upper-secondary-sticky-fold: 6.625rem; // Upper tertiary sticky fold --upper-tertiary-sticky-fold: 8.813rem; // Lower primary sticky fold --lower-primary-sticky-fold: 3.25rem; // Lower secondary sticky fold --lower-secondary-sticky-fold: 5.5rem; // Sidebar primary sticky fold --sidebar-primary-sticky-fold: 2.25rem; // Sidebar secondary sticky fold --sidebar-secondary-sticky-fold: 4.5rem; } @mixin fontLarge { // Font size --body-font-size: 1rem; // Line height --body-line-height: 1.5rem; // Upper primary sticky fold --upper-primary-sticky-fold: 4.625rem; // Upper secondary sticky fold --upper-secondary-sticky-fold: 7.125rem; // Upper tertiary sticky fold --upper-tertiary-sticky-fold: 9.5rem; // Lower primary sticky fold --lower-primary-sticky-fold: 3.5rem; // Lower secondary sticky fold --lower-secondary-sticky-fold: 6rem; // Sidebar primary sticky fold --sidebar-primary-sticky-fold: 2.5rem; // Sidebar secondary sticky fold --sidebar-secondary-sticky-fold: 5rem; } :root[data-font-size="small"] { @include fontSmall; } :root[data-font-size="medium"] { @include fontMedium; } :root[data-font-size="large"] { @include fontLarge; }
packages/hoppscotch-app/assets/scss/themes.scss
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.0001782033359631896, 0.00017438552458770573, 0.000163558084750548, 0.00017533637583255768, 0.0000033872336189233465 ]
{ "id": 4, "code_window": [ " <span v-else-if=\"tab.label\">{{ tab.label }}</span>\n", " <span v-if=\"tab.info && tab.info !== 'null'\" class=\"tab-info\">\n", " {{ tab.info }}\n", " </span>\n", " </button>\n", " </div>\n", " <div class=\"flex justify-center items-center\">\n", " <slot name=\"actions\"></slot>\n", " </div>\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <span\n", " v-if=\"tab.indicator\"\n", " class=\"bg-accentLight h-1 w-1 ml-2 rounded-full\"\n", " ></span>\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tabs.vue", "type": "add", "edit_start_line_idx": 36 }
export const ShellHttpieCodegen = { id: "shell-httpie", name: "Shell HTTPie", language: "sh", generator: ({ url, pathName, queryString, auth, httpUser, httpPassword, bearerToken, method, rawInput, rawParams, rawRequestBody, contentType, headers, }) => { const methodsWithBody = ["POST", "PUT", "PATCH", "DELETE"] const includeBody = methodsWithBody.includes(method) const requestString = [] let requestBody = rawInput ? rawParams : rawRequestBody requestBody = requestBody.replace(/'/g, "\\'") if (requestBody.length !== 0 && includeBody) { // Send request body via redirected input requestString.push(`echo -n $'${requestBody}' | `) } // Executable itself requestString.push(`http`) // basic authentication if (auth === "Basic Auth") { requestString.push(` -a ${httpUser}:${httpPassword}`) } // URL let escapedUrl = `${url}${pathName}?${queryString}` escapedUrl = escapedUrl.replace(/'/g, "\\'") requestString.push(` ${method} $'${escapedUrl}'`) // All headers if (contentType) { requestString.push(` 'Content-Type:${contentType}; charset=utf-8'`) } if (headers) { headers.forEach(({ key, value }) => { requestString.push( ` $'${key.replace(/'/g, "\\'")}:${value.replace(/'/g, "\\'")}'` ) }) } if (auth === "Bearer Token" || auth === "OAuth 2.0") { requestString.push(` 'Authorization:Bearer ${bearerToken}'`) } return requestString.join("") }, }
packages/hoppscotch-app/helpers/codegen/generators/shell-httpie.js
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00017411397129762918, 0.0001698873093118891, 0.0001664647425059229, 0.0001693188532954082, 0.0000028199424377817195 ]
{ "id": 4, "code_window": [ " <span v-else-if=\"tab.label\">{{ tab.label }}</span>\n", " <span v-if=\"tab.info && tab.info !== 'null'\" class=\"tab-info\">\n", " {{ tab.info }}\n", " </span>\n", " </button>\n", " </div>\n", " <div class=\"flex justify-center items-center\">\n", " <slot name=\"actions\"></slot>\n", " </div>\n" ], "labels": [ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ " <span\n", " v-if=\"tab.indicator\"\n", " class=\"bg-accentLight h-1 w-1 ml-2 rounded-full\"\n", " ></span>\n" ], "file_path": "packages/hoppscotch-app/components/smart/Tabs.vue", "type": "add", "edit_start_line_idx": 36 }
<template> <div class="flex items-center group"> <span class="cursor-pointer flex px-2 w-16 justify-center items-center truncate" :class="entryStatus.className" data-testid="restore_history_entry" :title="`${duration}`" @click="$emit('use-entry')" > {{ entry.request.method }} </span> <span class=" cursor-pointer flex flex-1 min-w-0 py-2 pr-2 transition group-hover:text-secondaryDark " data-testid="restore_history_entry" :title="`${duration}`" @click="$emit('use-entry')" > <span class="truncate"> {{ entry.request.endpoint }} </span> </span> <ButtonSecondary v-tippy="{ theme: 'tooltip' }" svg="trash" color="red" :title="$t('action.remove')" class="hidden group-hover:inline-flex" data-testid="delete_history_entry" @click.native="$emit('delete-entry')" /> <ButtonSecondary v-tippy="{ theme: 'tooltip' }" :title="!entry.star ? $t('add.star') : $t('remove.star')" :class="{ 'group-hover:inline-flex hidden': !entry.star }" :svg="entry.star ? 'star-solid' : 'star'" color="yellow" data-testid="star_button" @click.native="$emit('toggle-star')" /> </div> </template> <script lang="ts"> import { computed, defineComponent, PropType, useContext, } from "@nuxtjs/composition-api" import findStatusGroup from "~/helpers/findStatusGroup" import { RESTHistoryEntry } from "~/newstore/history" export default defineComponent({ props: { entry: { type: Object as PropType<RESTHistoryEntry>, default: () => {} }, showMore: Boolean, }, setup(props) { const { app: { i18n }, } = useContext() const $t = i18n.t.bind(i18n) const duration = computed(() => { if (props.entry.responseMeta.duration) { const responseDuration = props.entry.responseMeta.duration if (!responseDuration) return "" return responseDuration > 0 ? `${$t("request.duration")}: ${responseDuration}ms` : $t("error.no_duration") } else return $t("error.no_duration") }) const entryStatus = computed(() => { const foundStatusGroup = findStatusGroup( props.entry.responseMeta.statusCode ) return ( foundStatusGroup || { className: "", } ) }) return { duration, entryStatus, } }, }) </script>
packages/hoppscotch-app/components/history/rest/Card.vue
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.0002167493657907471, 0.00017999409465119243, 0.00016946632240433246, 0.00017339493206236511, 0.000015463803720194846 ]
{ "id": 5, "code_window": [ " },\n", " {\n", " name: \"Response: Assert property from body\",\n", " script: `\\n\\n// Check JSON response property\n", "pw.test(\"Check JSON response property\", ()=> {\n", " pw.expect(pw.response.method).toBe(\"GET\");\n", "});`,\n", " },\n", " {\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " pw.expect(pw.response.body.method).toBe(\"GET\");\n" ], "file_path": "packages/hoppscotch-app/helpers/testSnippets.js", "type": "replace", "edit_start_line_idx": 12 }
export default [ { name: "Response: Status code is 200", script: `\n\n// Check status code is 200 pw.test("Status code is 200", ()=> { pw.expect(pw.response.status).toBe(200); });`, }, { name: "Response: Assert property from body", script: `\n\n// Check JSON response property pw.test("Check JSON response property", ()=> { pw.expect(pw.response.method).toBe("GET"); });`, }, { name: "Status code: Status code is 2xx", script: `\n\n// Check status code is 2xx pw.test("Status code is 2xx", ()=> { pw.expect(pw.response.status).toBeLevel2xx(); });`, }, { name: "Status code: Status code is 3xx", script: `\n\n// Check status code is 3xx pw.test("Status code is 3xx", ()=> { pw.expect(pw.response.status).toBeLevel3xx(); });`, }, { name: "Status code: Status code is 4xx", script: `\n\n// Check status code is 4xx pw.test("Status code is 4xx", ()=> { pw.expect(pw.response.status).toBeLevel4xx(); });`, }, { name: "Status code: Status code is 5xx", script: `\n\n// Check status code is 5xx pw.test("Status code is 5xx", ()=> { pw.expect(pw.response.status).toBeLevel5xx(); });`, }, ]
packages/hoppscotch-app/helpers/testSnippets.js
1
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.009997445158660412, 0.003664309624582529, 0.000299140257993713, 0.0006204477394931018, 0.004014059901237488 ]
{ "id": 5, "code_window": [ " },\n", " {\n", " name: \"Response: Assert property from body\",\n", " script: `\\n\\n// Check JSON response property\n", "pw.test(\"Check JSON response property\", ()=> {\n", " pw.expect(pw.response.method).toBe(\"GET\");\n", "});`,\n", " },\n", " {\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " pw.expect(pw.response.body.method).toBe(\"GET\");\n" ], "file_path": "packages/hoppscotch-app/helpers/testSnippets.js", "type": "replace", "edit_start_line_idx": 12 }
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 596 194.5" width="2500" height="816"><style>.st0{fill:#3780ff}.st1{fill:#38b137}.st2{fill:#fa3913}.st3{fill:#fcbd06}</style><path class="st0" d="M73.4 0h5.3c18.4.4 36.5 7.8 49.5 20.9-4.8 4.9-9.7 9.6-14.4 14.5-7.3-6.6-16.1-11.7-25.7-13.5-14.2-3-29.5-.3-41.4 7.8C33.7 38.2 24.9 52.6 23 68c-2.1 15.2 2.2 31.2 12.1 43 9.5 11.5 24 18.7 39 19.2 14 .8 28.6-3.5 38.8-13.3 8-6.9 11.7-17.4 12.9-27.6-16.6 0-33.2.1-49.8 0V68.7h69.9c3.6 22.1-1.6 47-18.4 62.8-11.2 11.2-26.7 17.8-42.5 19.1-15.3 1.5-31.1-1.4-44.7-8.8C24 133.1 11 118.4 4.6 101.1c-6-15.9-6.1-33.9-.5-49.9C9.2 36.6 19 23.7 31.6 14.7 43.7 5.8 58.4.9 73.4 0z"/><path class="st1" d="M474.4 5.2h21.4V148c-7.1 0-14.3.1-21.4-.1.1-47.5 0-95.1 0-142.7z"/><path class="st2" d="M193.5 54.7c13.2-2.5 27.5.3 38.4 8.2 9.9 7 16.8 18 18.9 30 2.7 13.9-.7 29.1-9.7 40.1-9.7 12.3-25.6 18.9-41.1 17.9-14.2-.8-28-7.9-36.4-19.5-9.5-12.8-11.8-30.4-6.6-45.4 5.2-16.1 19.9-28.4 36.5-31.3m3 19c-5.4 1.4-10.4 4.5-14 8.9-9.7 11.6-9.1 30.5 1.6 41.3 6.1 6.2 15.3 9.1 23.8 7.4 7.9-1.4 14.8-6.7 18.6-13.7 6.6-11.9 4.7-28.3-5.4-37.6-6.5-6-16-8.5-24.6-6.3z"/><path class="st3" d="M299.5 54.7c15.1-2.9 31.6 1.3 42.9 11.9 18.4 16.5 20.4 47.4 4.7 66.4-9.5 12-24.9 18.6-40.1 17.9-14.5-.4-28.8-7.6-37.4-19.5-9.7-13.1-11.8-31.1-6.3-46.4 5.5-15.6 19.9-27.5 36.2-30.3m3 19c-5.4 1.4-10.4 4.5-14 8.8-9.6 11.4-9.2 30 1.1 40.9 6.1 6.5 15.6 9.7 24.4 7.9 7.8-1.5 14.8-6.7 18.6-13.7 6.5-12 4.6-28.4-5.6-37.7-6.5-6-16-8.4-24.5-6.2z"/><path class="st0" d="M389.4 60.5c11.5-7.2 26.8-9.2 39.2-3 3.9 1.7 7.1 4.6 10.2 7.5.1-2.7 0-5.5.1-8.3 6.7.1 13.4 0 20.2.1V145c-.1 13.3-3.5 27.4-13.1 37.1-10.5 10.7-26.6 14-41.1 11.8-15.5-2.3-29-13.6-35-27.9 6-2.9 12.3-5.2 18.5-7.9 3.5 8.2 10.6 15.2 19.5 16.8 8.9 1.6 19.2-.6 25-8 6.2-7.6 6.2-18 5.9-27.3-4.6 4.5-9.9 8.5-16.3 10-13.9 3.9-29.2-.9-39.9-10.3-10.8-9.4-17.2-23.9-16.6-38.3.3-16.3 9.5-32 23.4-40.5m20.7 12.8c-6.1 1-11.8 4.4-15.7 9.1-9.4 11.2-9.4 29.1.1 40.1 5.4 6.5 14.1 10.1 22.5 9.2 7.9-.8 15.2-5.8 19.1-12.7 6.6-11.7 5.5-27.6-3.4-37.8-5.5-6.3-14.3-9.4-22.6-7.9z"/><path class="st2" d="M521.5 65.6c12-11.2 30.5-15 45.9-9.1C582 62 591.3 75.9 596 90.2c-21.7 9-43.3 17.9-65 26.9 3 5.7 7.6 10.9 13.8 13 8.7 3.1 19.1 2 26.4-3.8 2.9-2.2 5.2-5.1 7.4-7.9 5.5 3.7 11 7.3 16.5 11-7.8 11.7-20.9 19.9-35 21.2-15.6 1.9-32.2-4.1-42.3-16.3-16.6-19.2-15-51.4 3.7-68.7m10.7 18.5c-3.4 4.9-4.8 10.9-4.7 16.8 14.5-6 29-12 43.5-18.1-2.4-5.6-8.2-9-14.1-9.9-9.5-1.7-19.4 3.4-24.7 11.2z"/></svg>
packages/hoppscotch-app/static/images/users/google.svg
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.00027753651374951005, 0.00027753651374951005, 0.00027753651374951005, 0.00027753651374951005, 0 ]
{ "id": 5, "code_window": [ " },\n", " {\n", " name: \"Response: Assert property from body\",\n", " script: `\\n\\n// Check JSON response property\n", "pw.test(\"Check JSON response property\", ()=> {\n", " pw.expect(pw.response.method).toBe(\"GET\");\n", "});`,\n", " },\n", " {\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " pw.expect(pw.response.body.method).toBe(\"GET\");\n" ], "file_path": "packages/hoppscotch-app/helpers/testSnippets.js", "type": "replace", "edit_start_line_idx": 12 }
const DEFAULT_TAG = "button" const ANCHOR_TAG = "a" const FRAMEWORK_LINK = "NuxtLink" // or "router-link", "g-link"... const getLinkTag = ({ to, blank }) => { if (!to) { return DEFAULT_TAG } else if (blank) { return ANCHOR_TAG } else if (/^\/(?!\/).*$/.test(to)) { // regex101.com/r/LU1iFL/1 return FRAMEWORK_LINK } else { return ANCHOR_TAG } } export { getLinkTag as default, ANCHOR_TAG, FRAMEWORK_LINK }
packages/hoppscotch-app/assets/js/getLinkTag.js
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.0001733716344460845, 0.00017217983258888125, 0.00017098801617976278, 0.00017217983258888125, 0.0000011918091331608593 ]
{ "id": 5, "code_window": [ " },\n", " {\n", " name: \"Response: Assert property from body\",\n", " script: `\\n\\n// Check JSON response property\n", "pw.test(\"Check JSON response property\", ()=> {\n", " pw.expect(pw.response.method).toBe(\"GET\");\n", "});`,\n", " },\n", " {\n" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " pw.expect(pw.response.body.method).toBe(\"GET\");\n" ], "file_path": "packages/hoppscotch-app/helpers/testSnippets.js", "type": "replace", "edit_start_line_idx": 12 }
import { ref } from "@nuxtjs/composition-api" const NAVIGATION_KEYS = ["ArrowDown", "ArrowUp", "Enter"] export function useArrowKeysNavigation(searchItems: any, options: any = {}) { function handleArrowKeysNavigation( event: any, itemIndex: any, preventPropagation: Boolean ) { if (!NAVIGATION_KEYS.includes(event.key)) return if (preventPropagation) event.stopImmediatePropagation() const itemsLength = searchItems.value.length const lastItemIndex = itemsLength - 1 const itemIndexValue = itemIndex.value const action = searchItems.value[itemIndexValue].action if (action && event.key === "Enter" && options.onEnter) { options.onEnter(action) return } if (event.key === "ArrowDown") { itemIndex.value = itemIndexValue < lastItemIndex ? itemIndexValue + 1 : 0 } else if (itemIndexValue === 0) itemIndex.value = lastItemIndex else if (event.key === "ArrowUp") itemIndex.value = itemIndexValue - 1 } const preventPropagation = options && options.stopPropagation const selectedEntry = ref(0) const onKeyUp = (event: any) => { handleArrowKeysNavigation(event, selectedEntry, preventPropagation) } function bindArrowKeysListerners() { window.addEventListener("keydown", onKeyUp, { capture: preventPropagation }) } function unbindArrowKeysListerners() { window.removeEventListener("keydown", onKeyUp, { capture: preventPropagation, }) } return { bindArrowKeysListerners, unbindArrowKeysListerners, selectedEntry, } }
packages/hoppscotch-app/helpers/powerSearchNavigation.ts
0
https://github.com/hoppscotch/hoppscotch/commit/e2fd104c2dd7401abe81c653427d0176eed40846
[ 0.0001776700810296461, 0.0001743066677590832, 0.00016890493861865252, 0.00017496105283498764, 0.0000031203653634293005 ]
{ "id": 0, "code_window": [ "// Type definitions for react-i18next 4.6\n", "// Project: https://github.com/i18next/react-i18next\n", "// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>\n", "// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n", "// TypeScript Version: 2.8\n", "\n", "import { TranslationFunction } from \"i18next\";\n", "\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "// Netanel Gilad <https://github.com/netanelgilad>\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "add", "edit_start_line_idx": 3 }
import * as React from "react"; import { i18n } from "i18next"; export interface TranslateOptions { withRef?: boolean; bindI18n?: string; bindStore?: string; translateFuncName?: string; wait?: boolean; nsMode?: string; i18n?: i18n; } // tslint:disable-next-line:ban-types export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): <C extends Function>(WrappedComponent: C) => C;
types/react-i18next/v4/translate.d.ts
1
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.011272793635725975, 0.00641202786937356, 0.001551261986605823, 0.00641202786937356, 0.004860765766352415 ]
{ "id": 0, "code_window": [ "// Type definitions for react-i18next 4.6\n", "// Project: https://github.com/i18next/react-i18next\n", "// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>\n", "// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n", "// TypeScript Version: 2.8\n", "\n", "import { TranslationFunction } from \"i18next\";\n", "\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "// Netanel Gilad <https://github.com/netanelgilad>\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "add", "edit_start_line_idx": 3 }
import * as React from 'react'; import { IconBaseProps } from 'react-icon-base'; export default class MdSatellite extends React.Component<IconBaseProps> { }
types/react-icons/md/satellite.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00017116451635956764, 0.00017116451635956764, 0.00017116451635956764, 0.00017116451635956764, 0 ]
{ "id": 0, "code_window": [ "// Type definitions for react-i18next 4.6\n", "// Project: https://github.com/i18next/react-i18next\n", "// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>\n", "// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n", "// TypeScript Version: 2.8\n", "\n", "import { TranslationFunction } from \"i18next\";\n", "\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "// Netanel Gilad <https://github.com/netanelgilad>\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "add", "edit_start_line_idx": 3 }
import { assignInAll } from "../fp"; export = assignInAll;
types/lodash/fp/assignInAll.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00017366779502481222, 0.00017366779502481222, 0.00017366779502481222, 0.00017366779502481222, 0 ]
{ "id": 0, "code_window": [ "// Type definitions for react-i18next 4.6\n", "// Project: https://github.com/i18next/react-i18next\n", "// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>\n", "// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n", "// TypeScript Version: 2.8\n", "\n", "import { TranslationFunction } from \"i18next\";\n", "\n" ], "labels": [ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "// Netanel Gilad <https://github.com/netanelgilad>\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "add", "edit_start_line_idx": 3 }
import * as React from 'react'; import { IconBaseProps } from 'react-icon-base'; declare class IoChatboxes extends React.Component<IconBaseProps> { } export = IoChatboxes;
types/react-icons/lib/io/chatboxes.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00017431331798434258, 0.00017431331798434258, 0.00017431331798434258, 0.00017431331798434258, 0 ]
{ "id": 1, "code_window": [ " * your own interface just like this one, but with your name of the translation function.\n", " *\n", " * interface MyComponentProps extends ReactI18next.InjectedTranslateProps {}\n", " */\n", "export interface InjectedTranslateProps {\n", " t?: TranslationFunction;\n", "}\n", "\n", "export as namespace reactI18Next;" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " t: TranslationFunction;\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "replace", "edit_start_line_idx": 33 }
// Type definitions for react-i18next 4.6 // Project: https://github.com/i18next/react-i18next // Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import { TranslationFunction } from "i18next"; import I18nextProvider from "./I18nextProvider"; import Interpolate from "./interpolate"; import loadNamespaces from "./loadNamespaces"; import Trans from "./trans"; import translate from "./translate"; export { I18nextProvider, Interpolate, loadNamespaces, Trans, translate, // Exports for TypeScript only TranslationFunction }; /** * Extend your component's Prop interface with this one to get access to `this.props.t` * * Please note that if you use the `translateFuncName` option, you should create * your own interface just like this one, but with your name of the translation function. * * interface MyComponentProps extends ReactI18next.InjectedTranslateProps {} */ export interface InjectedTranslateProps { t?: TranslationFunction; } export as namespace reactI18Next;
types/react-i18next/v4/index.d.ts
1
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.9975091218948364, 0.24973176419734955, 0.00017235695850104094, 0.0006227840203791857, 0.4317294955253601 ]
{ "id": 1, "code_window": [ " * your own interface just like this one, but with your name of the translation function.\n", " *\n", " * interface MyComponentProps extends ReactI18next.InjectedTranslateProps {}\n", " */\n", "export interface InjectedTranslateProps {\n", " t?: TranslationFunction;\n", "}\n", "\n", "export as namespace reactI18Next;" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " t: TranslationFunction;\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "replace", "edit_start_line_idx": 33 }
url(); url('domain'); url(1); url('domain', 'test.www.example.com/path/here'); url(-1, 'test.www.example.com/path/here');
types/js-url/js-url-tests.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00017456912610214204, 0.00017456912610214204, 0.00017456912610214204, 0.00017456912610214204, 0 ]
{ "id": 1, "code_window": [ " * your own interface just like this one, but with your name of the translation function.\n", " *\n", " * interface MyComponentProps extends ReactI18next.InjectedTranslateProps {}\n", " */\n", "export interface InjectedTranslateProps {\n", " t?: TranslationFunction;\n", "}\n", "\n", "export as namespace reactI18Next;" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " t: TranslationFunction;\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "replace", "edit_start_line_idx": 33 }
import * as React from 'react'; import { IconBaseProps } from 'react-icon-base'; declare class GoDash extends React.Component<IconBaseProps> { } export = GoDash;
types/react-icons/lib/go/dash.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00041791770490817726, 0.00041791770490817726, 0.00041791770490817726, 0.00041791770490817726, 0 ]
{ "id": 1, "code_window": [ " * your own interface just like this one, but with your name of the translation function.\n", " *\n", " * interface MyComponentProps extends ReactI18next.InjectedTranslateProps {}\n", " */\n", "export interface InjectedTranslateProps {\n", " t?: TranslationFunction;\n", "}\n", "\n", "export as namespace reactI18Next;" ], "labels": [ "keep", "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ], "after_edit": [ " t: TranslationFunction;\n" ], "file_path": "types/react-i18next/v4/index.d.ts", "type": "replace", "edit_start_line_idx": 33 }
{ "extends": "dtslint/dt.json", "rules": { "object-literal-key-quotes": false } }
types/fhir-js-client/tslint.json
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.0001725319161778316, 0.0001725319161778316, 0.0001725319161778316, 0.0001725319161778316, 0 ]
{ "id": 2, "code_window": [ "import * as React from \"react\";\n", "import { i18n } from \"i18next\";\n", "\n", "export interface TranslateOptions {\n", " withRef?: boolean;\n", " bindI18n?: string;\n", " bindStore?: string;\n" ], "labels": [ "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { InjectedTranslateProps } from \"react-i18next\";\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 2 }
import * as React from "react"; import { i18n } from "i18next"; export interface TranslateOptions { withRef?: boolean; bindI18n?: string; bindStore?: string; translateFuncName?: string; wait?: boolean; nsMode?: string; i18n?: i18n; } // tslint:disable-next-line:ban-types export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): <C extends Function>(WrappedComponent: C) => C;
types/react-i18next/v4/translate.d.ts
1
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.99916672706604, 0.9985581636428833, 0.9979496598243713, 0.9985581636428833, 0.0006085336208343506 ]
{ "id": 2, "code_window": [ "import * as React from \"react\";\n", "import { i18n } from \"i18next\";\n", "\n", "export interface TranslateOptions {\n", " withRef?: boolean;\n", " bindI18n?: string;\n", " bindStore?: string;\n" ], "labels": [ "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { InjectedTranslateProps } from \"react-i18next\";\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 2 }
{ "extends": "dtslint/dt.json" }
types/lodash.issymbol/tslint.json
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00017171967192552984, 0.00017171967192552984, 0.00017171967192552984, 0.00017171967192552984, 0 ]
{ "id": 2, "code_window": [ "import * as React from \"react\";\n", "import { i18n } from \"i18next\";\n", "\n", "export interface TranslateOptions {\n", " withRef?: boolean;\n", " bindI18n?: string;\n", " bindStore?: string;\n" ], "labels": [ "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { InjectedTranslateProps } from \"react-i18next\";\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 2 }
// Type definitions for command-line-usage 5.0 // Project: https://github.com/75lb/command-line-usage#readme // Definitions by: matrumz <https://github.com/matrumz> // Andrija Dvorski <https://github.com/Dvorsky> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /** * Generates a usage guide suitable for a command-line app. * @param sections One or more Section objects * @alias module:command-line-usage */ declare function commandLineUsage(sections: commandLineUsage.Section | commandLineUsage.Section[]): string; export = commandLineUsage; declare namespace commandLineUsage { /** Section object. */ type Section = Content | OptionList; /** A Content section comprises a header and one or more lines of content. */ interface Content { /** The section header, always bold and underlined. */ header?: string; /** * Overloaded property, accepting data in one of four formats. * 1. A single string (one line of text). * 2. An array of strings (multiple lines of text). * 3. An array of objects (recordset-style data). In this case, the data will be rendered in table format. The property names of each object are not important, so long as they are * consistent throughout the array. * 4. An object with two properties - data and options. In this case, the data and options will be passed directly to the underlying table layout module for rendering. */ content?: string | string[] | any[] | { data: any; options: any }; /** Set to true to avoid indentation and wrapping. Useful for banners. */ raw?: boolean; } /** Describes a command-line option. Additionally, if generating a usage guide with command-line-usage you could optionally add description and typeLabel properties to each definition. */ interface OptionDefinition { name: string; /** * The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received. * * The most common values used are String (the default), Number and Boolean but you can use a custom function. */ type?: any; /** getopt-style short option names. Can be any single character (unicode included) except a digit or hyphen. */ alias?: string; /** Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified). */ multiple?: boolean; /** Identical to multiple but with greedy parsing disabled. */ lazyMultiple?: boolean; /** Any values unaccounted for by an option definition will be set on the defaultOption. This flag is typically set on the most commonly-used option to make for more concise usage. */ defaultOption?: boolean; /** An initial value for the option. */ defaultValue?: any; /** * When your app has a large amount of options it makes sense to organise them in groups. * * There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition). */ group?: string | string[]; /** A string describing the option. */ description?: string; /** A string to replace the default type string (e.g. <string>). It's often more useful to set a more descriptive type label, like <ms>, <files>, <command>, etc.. */ typeLabel?: string; } /** A OptionList section adds a table displaying details of the available options. */ interface OptionList { header?: string; /** An array of option definition objects. */ optionList?: OptionDefinition[]; /** If specified, only options from this particular group will be printed. */ group?: string | string[]; /** The names of one of more option definitions to hide from the option list. */ hide?: string | string[]; /** If true, the option alias will be displayed after the name, i.e. --verbose, -v instead of -v, --verbose). */ reverseNameOrder?: boolean; /** An options object suitable for passing into table-layout. */ tableOptions?: any; } }
types/command-line-usage/index.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.001072163344360888, 0.0003006173064932227, 0.0001673307706369087, 0.0001870825217338279, 0.00027840721304528415 ]
{ "id": 2, "code_window": [ "import * as React from \"react\";\n", "import { i18n } from \"i18next\";\n", "\n", "export interface TranslateOptions {\n", " withRef?: boolean;\n", " bindI18n?: string;\n", " bindStore?: string;\n" ], "labels": [ "keep", "add", "keep", "keep", "keep", "keep", "keep" ], "after_edit": [ "import { InjectedTranslateProps } from \"react-i18next\";\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 2 }
// Type definitions for lodash.flatMap 4.5 // Project: http://lodash.com/ // Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts import { flatMap } from "lodash"; export = flatMap;
types/lodash.flatmap/index.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00017619742720853537, 0.00017378883785568178, 0.00017138023395091295, 0.00017378883785568178, 0.0000024085966288112104 ]
{ "id": 3, "code_window": [ " i18n?: i18n;\n", "}\n", "\n", "// tslint:disable-next-line:ban-types\n" ], "labels": [ "keep", "keep", "add", "keep" ], "after_edit": [ "// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766\n", "type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;\n", "\n", "// Injects props and removes them from the prop requirements.\n", "// Adds the new properties t (or whatever the translation function is called) and i18n if needed.\n", "export type InferableComponentEnhancerWithProps<TTranslateFunctionName extends string> =\n", " <P extends { [key: string]: any }>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>\n", " React.ComponentClass<Omit<P, keyof InjectedTranslateProps | TTranslateFunctionName>>;\n", "\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 13 }
import * as React from "react"; import { i18n } from "i18next"; export interface TranslateOptions { withRef?: boolean; bindI18n?: string; bindStore?: string; translateFuncName?: string; wait?: boolean; nsMode?: string; i18n?: i18n; } // tslint:disable-next-line:ban-types export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): <C extends Function>(WrappedComponent: C) => C;
types/react-i18next/v4/translate.d.ts
1
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.4089590907096863, 0.20830745995044708, 0.007655829656869173, 0.20830745995044708, 0.2006516307592392 ]
{ "id": 3, "code_window": [ " i18n?: i18n;\n", "}\n", "\n", "// tslint:disable-next-line:ban-types\n" ], "labels": [ "keep", "keep", "add", "keep" ], "after_edit": [ "// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766\n", "type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;\n", "\n", "// Injects props and removes them from the prop requirements.\n", "// Adds the new properties t (or whatever the translation function is called) and i18n if needed.\n", "export type InferableComponentEnhancerWithProps<TTranslateFunctionName extends string> =\n", " <P extends { [key: string]: any }>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>\n", " React.ComponentClass<Omit<P, keyof InjectedTranslateProps | TTranslateFunctionName>>;\n", "\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 13 }
import locutus_c_math_abs = require('locutus/c/math/abs'); import locutus_golang_strings_Contains = require('locutus/golang/strings/Contains'); import locutus_golang_strings_Count = require('locutus/golang/strings/Count'); import locutus_golang_strings_Index = require('locutus/golang/strings/Index'); import locutus_golang_strings_LastIndex = require('locutus/golang/strings/LastIndex'); import locutus_php_array_array_change_key_case = require('locutus/php/array/array_change_key_case'); import locutus_php_array_array_chunk = require('locutus/php/array/array_chunk'); import locutus_php_array_array_combine = require('locutus/php/array/array_combine'); import locutus_php_array_array_count_values = require('locutus/php/array/array_count_values'); import locutus_php_array_array_diff = require('locutus/php/array/array_diff'); import locutus_php_array_array_diff_assoc = require('locutus/php/array/array_diff_assoc'); import locutus_php_array_array_diff_key = require('locutus/php/array/array_diff_key'); import locutus_php_array_array_diff_uassoc = require('locutus/php/array/array_diff_uassoc'); import locutus_php_array_array_diff_ukey = require('locutus/php/array/array_diff_ukey'); import locutus_php_array_array_fill = require('locutus/php/array/array_fill'); import locutus_php_array_array_fill_keys = require('locutus/php/array/array_fill_keys'); import locutus_php_array_array_filter = require('locutus/php/array/array_filter'); import locutus_php_array_array_flip = require('locutus/php/array/array_flip'); import locutus_php_array_array_intersect = require('locutus/php/array/array_intersect'); import locutus_php_array_array_intersect_assoc = require('locutus/php/array/array_intersect_assoc'); import locutus_php_array_array_intersect_key = require('locutus/php/array/array_intersect_key'); import locutus_php_array_array_intersect_uassoc = require('locutus/php/array/array_intersect_uassoc'); import locutus_php_array_array_intersect_ukey = require('locutus/php/array/array_intersect_ukey'); import locutus_php_array_array_key_exists = require('locutus/php/array/array_key_exists'); import locutus_php_array_array_keys = require('locutus/php/array/array_keys'); import locutus_php_array_array_map = require('locutus/php/array/array_map'); import locutus_php_array_array_merge = require('locutus/php/array/array_merge'); import locutus_php_array_array_merge_recursive = require('locutus/php/array/array_merge_recursive'); import locutus_php_array_array_multisort = require('locutus/php/array/array_multisort'); import locutus_php_array_array_pad = require('locutus/php/array/array_pad'); import locutus_php_array_array_pop = require('locutus/php/array/array_pop'); import locutus_php_array_array_product = require('locutus/php/array/array_product'); import locutus_php_array_array_push = require('locutus/php/array/array_push'); import locutus_php_array_array_rand = require('locutus/php/array/array_rand'); import locutus_php_array_array_reduce = require('locutus/php/array/array_reduce'); import locutus_php_array_array_replace = require('locutus/php/array/array_replace'); import locutus_php_array_array_replace_recursive = require('locutus/php/array/array_replace_recursive'); import locutus_php_array_array_reverse = require('locutus/php/array/array_reverse'); import locutus_php_array_array_search = require('locutus/php/array/array_search'); import locutus_php_array_array_shift = require('locutus/php/array/array_shift'); import locutus_php_array_array_slice = require('locutus/php/array/array_slice'); import locutus_php_array_array_splice = require('locutus/php/array/array_splice'); import locutus_php_array_array_sum = require('locutus/php/array/array_sum'); import locutus_php_array_array_udiff = require('locutus/php/array/array_udiff'); import locutus_php_array_array_udiff_assoc = require('locutus/php/array/array_udiff_assoc'); import locutus_php_array_array_udiff_uassoc = require('locutus/php/array/array_udiff_uassoc'); import locutus_php_array_array_uintersect = require('locutus/php/array/array_uintersect'); import locutus_php_array_array_uintersect_uassoc = require('locutus/php/array/array_uintersect_uassoc'); import locutus_php_array_array_unique = require('locutus/php/array/array_unique'); import locutus_php_array_array_unshift = require('locutus/php/array/array_unshift'); import locutus_php_array_array_values = require('locutus/php/array/array_values'); import locutus_php_array_array_walk = require('locutus/php/array/array_walk'); import locutus_php_array_arsort = require('locutus/php/array/arsort'); import locutus_php_array_asort = require('locutus/php/array/asort'); import locutus_php_array_count = require('locutus/php/array/count'); import locutus_php_array_current = require('locutus/php/array/current'); import locutus_php_array_each = require('locutus/php/array/each'); import locutus_php_array_end = require('locutus/php/array/end'); import locutus_php_array_in_array = require('locutus/php/array/in_array'); import locutus_php_array_key = require('locutus/php/array/key'); import locutus_php_array_krsort = require('locutus/php/array/krsort'); import locutus_php_array_ksort = require('locutus/php/array/ksort'); import locutus_php_array_natcasesort = require('locutus/php/array/natcasesort'); import locutus_php_array_natsort = require('locutus/php/array/natsort'); import locutus_php_array_next = require('locutus/php/array/next'); import locutus_php_array_pos = require('locutus/php/array/pos'); import locutus_php_array_prev = require('locutus/php/array/prev'); import locutus_php_array_range = require('locutus/php/array/range'); import locutus_php_array_reset = require('locutus/php/array/reset'); import locutus_php_array_rsort = require('locutus/php/array/rsort'); import locutus_php_array_shuffle = require('locutus/php/array/shuffle'); import locutus_php_array_sizeof = require('locutus/php/array/sizeof'); import locutus_php_array_sort = require('locutus/php/array/sort'); import locutus_php_array_uasort = require('locutus/php/array/uasort'); import locutus_php_array_uksort = require('locutus/php/array/uksort'); import locutus_php_array_usort = require('locutus/php/array/usort'); import locutus_php_bc_bcadd = require('locutus/php/bc/bcadd'); import locutus_php_bc_bccomp = require('locutus/php/bc/bccomp'); import locutus_php_bc_bcdiv = require('locutus/php/bc/bcdiv'); import locutus_php_bc_bcmul = require('locutus/php/bc/bcmul'); import locutus_php_bc_bcround = require('locutus/php/bc/bcround'); import locutus_php_bc_bcscale = require('locutus/php/bc/bcscale'); import locutus_php_bc_bcsub = require('locutus/php/bc/bcsub'); import locutus_php_ctype_ctype_alnum = require('locutus/php/ctype/ctype_alnum'); import locutus_php_ctype_ctype_alpha = require('locutus/php/ctype/ctype_alpha'); import locutus_php_ctype_ctype_cntrl = require('locutus/php/ctype/ctype_cntrl'); import locutus_php_ctype_ctype_digit = require('locutus/php/ctype/ctype_digit'); import locutus_php_ctype_ctype_graph = require('locutus/php/ctype/ctype_graph'); import locutus_php_ctype_ctype_lower = require('locutus/php/ctype/ctype_lower'); import locutus_php_ctype_ctype_print = require('locutus/php/ctype/ctype_print'); import locutus_php_ctype_ctype_punct = require('locutus/php/ctype/ctype_punct'); import locutus_php_ctype_ctype_space = require('locutus/php/ctype/ctype_space'); import locutus_php_ctype_ctype_upper = require('locutus/php/ctype/ctype_upper'); import locutus_php_ctype_ctype_xdigit = require('locutus/php/ctype/ctype_xdigit'); import locutus_php_datetime_checkdate = require('locutus/php/datetime/checkdate'); import locutus_php_datetime_date = require('locutus/php/datetime/date'); import locutus_php_datetime_date_parse = require('locutus/php/datetime/date_parse'); import locutus_php_datetime_getdate = require('locutus/php/datetime/getdate'); import locutus_php_datetime_gettimeofday = require('locutus/php/datetime/gettimeofday'); import locutus_php_datetime_gmdate = require('locutus/php/datetime/gmdate'); import locutus_php_datetime_gmmktime = require('locutus/php/datetime/gmmktime'); import locutus_php_datetime_gmstrftime = require('locutus/php/datetime/gmstrftime'); import locutus_php_datetime_idate = require('locutus/php/datetime/idate'); import locutus_php_datetime_microtime = require('locutus/php/datetime/microtime'); import locutus_php_datetime_mktime = require('locutus/php/datetime/mktime'); import locutus_php_datetime_strftime = require('locutus/php/datetime/strftime'); import locutus_php_datetime_strptime = require('locutus/php/datetime/strptime'); import locutus_php_datetime_strtotime = require('locutus/php/datetime/strtotime'); import locutus_php_datetime_time = require('locutus/php/datetime/time'); import locutus_php_exec_escapeshellarg = require('locutus/php/exec/escapeshellarg'); import locutus_php_filesystem_basename = require('locutus/php/filesystem/basename'); import locutus_php_filesystem_dirname = require('locutus/php/filesystem/dirname'); import locutus_php_filesystem_file_get_contents = require('locutus/php/filesystem/file_get_contents'); import locutus_php_filesystem_pathinfo = require('locutus/php/filesystem/pathinfo'); import locutus_php_filesystem_realpath = require('locutus/php/filesystem/realpath'); import locutus_php_funchand_call_user_func = require('locutus/php/funchand/call_user_func'); import locutus_php_funchand_call_user_func_array = require('locutus/php/funchand/call_user_func_array'); import locutus_php_funchand_create_function = require('locutus/php/funchand/create_function'); import locutus_php_funchand_function_exists = require('locutus/php/funchand/function_exists'); import locutus_php_funchand_get_defined_functions = require('locutus/php/funchand/get_defined_functions'); import locutus_php_i18n_i18n_loc_get_default = require('locutus/php/i18n/i18n_loc_get_default'); import locutus_php_i18n_i18n_loc_set_default = require('locutus/php/i18n/i18n_loc_set_default'); import locutus_php_info_assert_options = require('locutus/php/info/assert_options'); import locutus_php_info_getenv = require('locutus/php/info/getenv'); import locutus_php_info_ini_get = require('locutus/php/info/ini_get'); import locutus_php_info_ini_set = require('locutus/php/info/ini_set'); import locutus_php_info_set_time_limit = require('locutus/php/info/set_time_limit'); import locutus_php_info_version_compare = require('locutus/php/info/version_compare'); import locutus_php_json_json_decode = require('locutus/php/json/json_decode'); import locutus_php_json_json_encode = require('locutus/php/json/json_encode'); import locutus_php_json_json_last_error = require('locutus/php/json/json_last_error'); import locutus_php_math_abs = require('locutus/php/math/abs'); import locutus_php_math_acos = require('locutus/php/math/acos'); import locutus_php_math_acosh = require('locutus/php/math/acosh'); import locutus_php_math_asin = require('locutus/php/math/asin'); import locutus_php_math_asinh = require('locutus/php/math/asinh'); import locutus_php_math_atan = require('locutus/php/math/atan'); import locutus_php_math_atan2 = require('locutus/php/math/atan2'); import locutus_php_math_atanh = require('locutus/php/math/atanh'); import locutus_php_math_base_convert = require('locutus/php/math/base_convert'); import locutus_php_math_bindec = require('locutus/php/math/bindec'); import locutus_php_math_ceil = require('locutus/php/math/ceil'); import locutus_php_math_cos = require('locutus/php/math/cos'); import locutus_php_math_cosh = require('locutus/php/math/cosh'); import locutus_php_math_decbin = require('locutus/php/math/decbin'); import locutus_php_math_dechex = require('locutus/php/math/dechex'); import locutus_php_math_decoct = require('locutus/php/math/decoct'); import locutus_php_math_deg2rad = require('locutus/php/math/deg2rad'); import locutus_php_math_exp = require('locutus/php/math/exp'); import locutus_php_math_expm1 = require('locutus/php/math/expm1'); import locutus_php_math_floor = require('locutus/php/math/floor'); import locutus_php_math_fmod = require('locutus/php/math/fmod'); import locutus_php_math_getrandmax = require('locutus/php/math/getrandmax'); import locutus_php_math_hexdec = require('locutus/php/math/hexdec'); import locutus_php_math_hypot = require('locutus/php/math/hypot'); import locutus_php_math_is_finite = require('locutus/php/math/is_finite'); import locutus_php_math_is_infinite = require('locutus/php/math/is_infinite'); import locutus_php_math_is_nan = require('locutus/php/math/is_nan'); import locutus_php_math_lcg_value = require('locutus/php/math/lcg_value'); import locutus_php_math_log = require('locutus/php/math/log'); import locutus_php_math_log10 = require('locutus/php/math/log10'); import locutus_php_math_log1p = require('locutus/php/math/log1p'); import locutus_php_math_max = require('locutus/php/math/max'); import locutus_php_math_min = require('locutus/php/math/min'); import locutus_php_math_mt_getrandmax = require('locutus/php/math/mt_getrandmax'); import locutus_php_math_mt_rand = require('locutus/php/math/mt_rand'); import locutus_php_math_octdec = require('locutus/php/math/octdec'); import locutus_php_math_pi = require('locutus/php/math/pi'); import locutus_php_math_pow = require('locutus/php/math/pow'); import locutus_php_math_rad2deg = require('locutus/php/math/rad2deg'); import locutus_php_math_rand = require('locutus/php/math/rand'); import locutus_php_math_round = require('locutus/php/math/round'); import locutus_php_math_sin = require('locutus/php/math/sin'); import locutus_php_math_sinh = require('locutus/php/math/sinh'); import locutus_php_math_sqrt = require('locutus/php/math/sqrt'); import locutus_php_math_tan = require('locutus/php/math/tan'); import locutus_php_math_tanh = require('locutus/php/math/tanh'); import locutus_php_misc_pack = require('locutus/php/misc/pack'); import locutus_php_misc_uniqid = require('locutus/php/misc/uniqid'); import locutus_php_net_gopher_gopher_parsedir = require('locutus/php/net-gopher/gopher_parsedir'); import locutus_php_network_inet_ntop = require('locutus/php/network/inet_ntop'); import locutus_php_network_inet_pton = require('locutus/php/network/inet_pton'); import locutus_php_network_ip2long = require('locutus/php/network/ip2long'); import locutus_php_network_long2ip = require('locutus/php/network/long2ip'); import locutus_php_network_setcookie = require('locutus/php/network/setcookie'); import locutus_php_network_setrawcookie = require('locutus/php/network/setrawcookie'); import locutus_php_pcre_preg_quote = require('locutus/php/pcre/preg_quote'); import locutus_php_pcre_sql_regcase = require('locutus/php/pcre/sql_regcase'); import locutus_php_strings_addcslashes = require('locutus/php/strings/addcslashes'); import locutus_php_strings_addslashes = require('locutus/php/strings/addslashes'); import locutus_php_strings_bin2hex = require('locutus/php/strings/bin2hex'); import locutus_php_strings_chop = require('locutus/php/strings/chop'); import locutus_php_strings_chr = require('locutus/php/strings/chr'); import locutus_php_strings_chunk_split = require('locutus/php/strings/chunk_split'); import locutus_php_strings_convert_cyr_string = require('locutus/php/strings/convert_cyr_string'); import locutus_php_strings_convert_uuencode = require('locutus/php/strings/convert_uuencode'); import locutus_php_strings_count_chars = require('locutus/php/strings/count_chars'); import locutus_php_strings_crc32 = require('locutus/php/strings/crc32'); import locutus_php_strings_echo = require('locutus/php/strings/echo'); import locutus_php_strings_explode = require('locutus/php/strings/explode'); import locutus_php_strings_get_html_translation_table = require('locutus/php/strings/get_html_translation_table'); import locutus_php_strings_hex2bin = require('locutus/php/strings/hex2bin'); import locutus_php_strings_html_entity_decode = require('locutus/php/strings/html_entity_decode'); import locutus_php_strings_htmlentities = require('locutus/php/strings/htmlentities'); import locutus_php_strings_htmlspecialchars = require('locutus/php/strings/htmlspecialchars'); import locutus_php_strings_htmlspecialchars_decode = require('locutus/php/strings/htmlspecialchars_decode'); import locutus_php_strings_implode = require('locutus/php/strings/implode'); import locutus_php_strings_join = require('locutus/php/strings/join'); import locutus_php_strings_lcfirst = require('locutus/php/strings/lcfirst'); import locutus_php_strings_levenshtein = require('locutus/php/strings/levenshtein'); import locutus_php_strings_localeconv = require('locutus/php/strings/localeconv'); import locutus_php_strings_ltrim = require('locutus/php/strings/ltrim'); import locutus_php_strings_md5 = require('locutus/php/strings/md5'); import locutus_php_strings_md5_file = require('locutus/php/strings/md5_file'); import locutus_php_strings_metaphone = require('locutus/php/strings/metaphone'); import locutus_php_strings_money_format = require('locutus/php/strings/money_format'); import locutus_php_strings_nl2br = require('locutus/php/strings/nl2br'); import locutus_php_strings_nl_langinfo = require('locutus/php/strings/nl_langinfo'); import locutus_php_strings_number_format = require('locutus/php/strings/number_format'); import locutus_php_strings_ord = require('locutus/php/strings/ord'); import locutus_php_strings_parse_str = require('locutus/php/strings/parse_str'); import locutus_php_strings_printf = require('locutus/php/strings/printf'); import locutus_php_strings_quoted_printable_decode = require('locutus/php/strings/quoted_printable_decode'); import locutus_php_strings_quoted_printable_encode = require('locutus/php/strings/quoted_printable_encode'); import locutus_php_strings_quotemeta = require('locutus/php/strings/quotemeta'); import locutus_php_strings_rtrim = require('locutus/php/strings/rtrim'); import locutus_php_strings_setlocale = require('locutus/php/strings/setlocale'); import locutus_php_strings_sha1 = require('locutus/php/strings/sha1'); import locutus_php_strings_sha1_file = require('locutus/php/strings/sha1_file'); import locutus_php_strings_similar_text = require('locutus/php/strings/similar_text'); import locutus_php_strings_soundex = require('locutus/php/strings/soundex'); import locutus_php_strings_split = require('locutus/php/strings/split'); import locutus_php_strings_sprintf = require('locutus/php/strings/sprintf'); import locutus_php_strings_sscanf = require('locutus/php/strings/sscanf'); import locutus_php_strings_str_getcsv = require('locutus/php/strings/str_getcsv'); import locutus_php_strings_str_ireplace = require('locutus/php/strings/str_ireplace'); import locutus_php_strings_str_pad = require('locutus/php/strings/str_pad'); import locutus_php_strings_str_repeat = require('locutus/php/strings/str_repeat'); import locutus_php_strings_str_replace = require('locutus/php/strings/str_replace'); import locutus_php_strings_str_rot13 = require('locutus/php/strings/str_rot13'); import locutus_php_strings_str_shuffle = require('locutus/php/strings/str_shuffle'); import locutus_php_strings_str_split = require('locutus/php/strings/str_split'); import locutus_php_strings_str_word_count = require('locutus/php/strings/str_word_count'); import locutus_php_strings_strcasecmp = require('locutus/php/strings/strcasecmp'); import locutus_php_strings_strchr = require('locutus/php/strings/strchr'); import locutus_php_strings_strcmp = require('locutus/php/strings/strcmp'); import locutus_php_strings_strcoll = require('locutus/php/strings/strcoll'); import locutus_php_strings_strcspn = require('locutus/php/strings/strcspn'); import locutus_php_strings_strip_tags = require('locutus/php/strings/strip_tags'); import locutus_php_strings_stripos = require('locutus/php/strings/stripos'); import locutus_php_strings_stripslashes = require('locutus/php/strings/stripslashes'); import locutus_php_strings_stristr = require('locutus/php/strings/stristr'); import locutus_php_strings_strlen = require('locutus/php/strings/strlen'); import locutus_php_strings_strnatcasecmp = require('locutus/php/strings/strnatcasecmp'); import locutus_php_strings_strnatcmp = require('locutus/php/strings/strnatcmp'); import locutus_php_strings_strncasecmp = require('locutus/php/strings/strncasecmp'); import locutus_php_strings_strncmp = require('locutus/php/strings/strncmp'); import locutus_php_strings_strpbrk = require('locutus/php/strings/strpbrk'); import locutus_php_strings_strpos = require('locutus/php/strings/strpos'); import locutus_php_strings_strrchr = require('locutus/php/strings/strrchr'); import locutus_php_strings_strrev = require('locutus/php/strings/strrev'); import locutus_php_strings_strripos = require('locutus/php/strings/strripos'); import locutus_php_strings_strrpos = require('locutus/php/strings/strrpos'); import locutus_php_strings_strspn = require('locutus/php/strings/strspn'); import locutus_php_strings_strstr = require('locutus/php/strings/strstr'); import locutus_php_strings_strtok = require('locutus/php/strings/strtok'); import locutus_php_strings_strtolower = require('locutus/php/strings/strtolower'); import locutus_php_strings_strtoupper = require('locutus/php/strings/strtoupper'); import locutus_php_strings_strtr = require('locutus/php/strings/strtr'); import locutus_php_strings_substr = require('locutus/php/strings/substr'); import locutus_php_strings_substr_compare = require('locutus/php/strings/substr_compare'); import locutus_php_strings_substr_count = require('locutus/php/strings/substr_count'); import locutus_php_strings_substr_replace = require('locutus/php/strings/substr_replace'); import locutus_php_strings_trim = require('locutus/php/strings/trim'); import locutus_php_strings_ucfirst = require('locutus/php/strings/ucfirst'); import locutus_php_strings_ucwords = require('locutus/php/strings/ucwords'); import locutus_php_strings_vprintf = require('locutus/php/strings/vprintf'); import locutus_php_strings_vsprintf = require('locutus/php/strings/vsprintf'); import locutus_php_strings_wordwrap = require('locutus/php/strings/wordwrap'); import locutus_php_url_base64_decode = require('locutus/php/url/base64_decode'); import locutus_php_url_base64_encode = require('locutus/php/url/base64_encode'); import locutus_php_url_http_build_query = require('locutus/php/url/http_build_query'); import locutus_php_url_parse_url = require('locutus/php/url/parse_url'); import locutus_php_url_rawurldecode = require('locutus/php/url/rawurldecode'); import locutus_php_url_rawurlencode = require('locutus/php/url/rawurlencode'); import locutus_php_url_urldecode = require('locutus/php/url/urldecode'); import locutus_php_url_urlencode = require('locutus/php/url/urlencode'); import locutus_php_var_doubleval = require('locutus/php/var/doubleval'); import locutus_php_var_empty = require('locutus/php/var/empty'); import locutus_php_var_floatval = require('locutus/php/var/floatval'); import locutus_php_var_gettype = require('locutus/php/var/gettype'); import locutus_php_var_intval = require('locutus/php/var/intval'); import locutus_php_var_is_array = require('locutus/php/var/is_array'); import locutus_php_var_is_binary = require('locutus/php/var/is_binary'); import locutus_php_var_is_bool = require('locutus/php/var/is_bool'); import locutus_php_var_is_buffer = require('locutus/php/var/is_buffer'); import locutus_php_var_is_callable = require('locutus/php/var/is_callable'); import locutus_php_var_is_double = require('locutus/php/var/is_double'); import locutus_php_var_is_float = require('locutus/php/var/is_float'); import locutus_php_var_is_int = require('locutus/php/var/is_int'); import locutus_php_var_is_integer = require('locutus/php/var/is_integer'); import locutus_php_var_is_long = require('locutus/php/var/is_long'); import locutus_php_var_is_null = require('locutus/php/var/is_null'); import locutus_php_var_is_numeric = require('locutus/php/var/is_numeric'); import locutus_php_var_is_object = require('locutus/php/var/is_object'); import locutus_php_var_is_real = require('locutus/php/var/is_real'); import locutus_php_var_is_scalar = require('locutus/php/var/is_scalar'); import locutus_php_var_is_string = require('locutus/php/var/is_string'); import locutus_php_var_is_unicode = require('locutus/php/var/is_unicode'); import locutus_php_var_isset = require('locutus/php/var/isset'); import locutus_php_var_print_r = require('locutus/php/var/print_r'); import locutus_php_var_serialize = require('locutus/php/var/serialize'); import locutus_php_var_strval = require('locutus/php/var/strval'); import locutus_php_var_unserialize = require('locutus/php/var/unserialize'); import locutus_php_var_var_dump = require('locutus/php/var/var_dump'); import locutus_php_var_var_export = require('locutus/php/var/var_export'); import locutus_php_xdiff_xdiff_string_diff = require('locutus/php/xdiff/xdiff_string_diff'); import locutus_php_xdiff_xdiff_string_patch = require('locutus/php/xdiff/xdiff_string_patch'); import locutus_php_xml_utf8_decode = require('locutus/php/xml/utf8_decode'); import locutus_php_xml_utf8_encode = require('locutus/php/xml/utf8_encode'); import locutus_python_string_capwords = require('locutus/python/string/capwords'); import locutus_ruby_Math_acos = require('locutus/ruby/Math/acos'); import locutus_c_math = require('locutus/c/math'); import locutus_golang_strings = require('locutus/golang/strings'); import locutus_php_array = require('locutus/php/array'); import locutus_php_bc = require('locutus/php/bc'); import locutus_php_ctype = require('locutus/php/ctype'); import locutus_php_datetime = require('locutus/php/datetime'); import locutus_php_exec = require('locutus/php/exec'); import locutus_php_filesystem = require('locutus/php/filesystem'); import locutus_php_funchand = require('locutus/php/funchand'); import locutus_php_i18n = require('locutus/php/i18n'); import locutus_php_info = require('locutus/php/info'); import locutus_php_json = require('locutus/php/json'); import locutus_php_math = require('locutus/php/math'); import locutus_php_misc = require('locutus/php/misc'); import locutus_php_net_gopher = require('locutus/php/net-gopher'); import locutus_php_network = require('locutus/php/network'); import locutus_php_pcre = require('locutus/php/pcre'); import locutus_php_strings = require('locutus/php/strings'); import locutus_php_url = require('locutus/php/url'); import locutus_php_var = require('locutus/php/var'); import locutus_php_xdiff = require('locutus/php/xdiff'); import locutus_php_xml = require('locutus/php/xml'); import locutus_python_string = require('locutus/python/string'); import locutus_ruby_Math = require('locutus/ruby/Math'); import locutus_c = require('locutus/c'); import locutus_golang = require('locutus/golang'); import locutus_php = require('locutus/php'); import locutus_python = require('locutus/python'); import locutus_ruby = require('locutus/ruby'); import locutus = require('locutus');
types/locutus/locutus-tests.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.0032847526017576456, 0.0003087795339524746, 0.00016553197929169983, 0.0001689236960373819, 0.0005933693610131741 ]
{ "id": 3, "code_window": [ " i18n?: i18n;\n", "}\n", "\n", "// tslint:disable-next-line:ban-types\n" ], "labels": [ "keep", "keep", "add", "keep" ], "after_edit": [ "// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766\n", "type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;\n", "\n", "// Injects props and removes them from the prop requirements.\n", "// Adds the new properties t (or whatever the translation function is called) and i18n if needed.\n", "export type InferableComponentEnhancerWithProps<TTranslateFunctionName extends string> =\n", " <P extends { [key: string]: any }>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>\n", " React.ComponentClass<Omit<P, keyof InjectedTranslateProps | TTranslateFunctionName>>;\n", "\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 13 }
declare namespace adone.math { /** * Represents a set of bits */ class BitSet { /** * Creates a new bitset of n bits */ constructor(n: number); /** * Creates a new bitset from a dehydrated bitset */ constructor(key: string); /** * Checks whether a bit at a specific index is set */ get(idx: number): boolean; /** * Sets a single bit. * Returns true if set was successfull */ set(idx: number): boolean; /** * Sets a range of bits. * Returns true if set was successfull */ setRange(from: number, to: number): boolean; /** * Unsets a single bit. * Returns true if unset was successfull */ unset(idx: number): boolean; /** * Unsets a range of bits. * Returns true if unset was successfull */ unsetRange(from: number, to: number): boolean; /** * Toggles a single bit */ toggle(idx: number): boolean; /** * Toggles a range of bits */ toggleRange(from: number, to: number): boolean; /** * Clears the entire bitset */ clear(): boolean; /** * Clones the set */ clone(): BitSet; /** * Turns the bitset into a comma separated string that skips leading & trailing 0 words. * Ends with the number of leading 0s and MAX_BIT. * Useful if you need the bitset to be an object key (eg dynamic programming). * Can rehydrate by passing the result into the constructor */ dehydrate(): string; /** * Performs a bitwise AND on 2 bitsets or 1 bitset and 1 index. * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. */ and(value: number | BitSet): BitSet; /** * Performs a bitwise OR on 2 bitsets or 1 bitset and 1 index. * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. */ or(value: number | BitSet): BitSet; /** * Performs a bitwise XOR on 2 bitsets or 1 bitset and 1 index. * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. */ xor(value: number | BitSet): BitSet; /** * Runs a custom function on every set bit. * Faster than iterating over the entire bitset with a get(). * If the callback returns `false` it stops iterating. */ forEach(callback: ((idx: number) => void | boolean)): void; /** * Performs a circular shift bitset by an offset * * @param n number of positions that the bitset that will be shifted to the right. Using a negative number will result in a left shift. */ circularShift(n: number): BitSet; /** * Gets the cardinality (count of set bits) for the entire bitset */ getCardinality(): number; /** * Gets the indices of all set bits */ getIndices(): number[]; /** * Checks if one bitset is subset of another. */ isSubsetOf(other: BitSet): boolean; /** * Quickly determines if a bitset is empty */ isEmpty(): boolean; /** * Quickly determines if both bitsets are equal (faster than checking if the XOR of the two is === 0). * Both bitsets must have the same number of words, no length check is performed to prevent and overflow. */ isEqual(other: BitSet): boolean; /** * Gets a string representation of the entire bitset, including leading 0s */ toString(): string; /** * Finds first set bit (useful for processing queues, breadth-first tree searches, etc.). * Returns -1 if not found * * @param startWord the word to start with (only used internally by nextSetBit) */ ffs(startWord?: number): number; /** * Finds first zero (unset bit). * Returns -1 if not found * * @param startWord the word to start with (only used internally by nextUnsetBit) */ ffz(startWord?: number): number; /** * Finds last set bit. * Returns -1 if not found * * @param startWord the word to start with (only used internally by previousSetBit) */ fls(startWord?: number): number; /** * Finds last zero (unset bit). * Returns -1 if not found * * @param startWord the word to start with (only used internally by previousUnsetBit) */ flz(startWord?: number): number; /** * Finds first set bit, starting at a given index. * Return -1 if not found * * @param idx the starting index for the next set bit */ nextSetBit(idx: number): number; /** * Finds first unset bit, starting at a given index. * Return -1 if not found * * @param idx the starting index for the next unset bit */ nextUnsetBit(idx: number): number; /** * Finds last set bit, up to a given index. * Returns -1 if not found * * @param idx the starting index for the next unset bit (going in reverse) */ previousSetBit(idx: number): number; /** * Finds last unset bit, up to a given index. * Returns -1 if not found */ previousUnsetBit(idx: number): number; /** * Converts the bitset to a math.Long number */ toLong(): Long; /** * Reads an unsigned integer of the given bits from the given offset * * @param bits number of bits, 1 by default * @param offset offset, 0 by default */ readUInt(bits?: number, offset?: number): number; /** * Writes the given unsigned integer * * @param val integer * @param bits number of bits to write, 1 by default * @param offset write offset, 0 by default */ writeUInt(val: number, bits?: number, offset?: number): void; /** * Creates a new BitSet from the given math.Long number */ static fromLong(l: Long): BitSet; } }
types/adone/glosses/math/bitset.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.000295602367259562, 0.00017569740884937346, 0.00016672573110554367, 0.0001698513369774446, 0.000025832267056102864 ]
{ "id": 3, "code_window": [ " i18n?: i18n;\n", "}\n", "\n", "// tslint:disable-next-line:ban-types\n" ], "labels": [ "keep", "keep", "add", "keep" ], "after_edit": [ "// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766\n", "type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;\n", "\n", "// Injects props and removes them from the prop requirements.\n", "// Adds the new properties t (or whatever the translation function is called) and i18n if needed.\n", "export type InferableComponentEnhancerWithProps<TTranslateFunctionName extends string> =\n", " <P extends { [key: string]: any }>(component: React.ComponentClass<P> | React.StatelessComponent<P>) =>\n", " React.ComponentClass<Omit<P, keyof InjectedTranslateProps | TTranslateFunctionName>>;\n", "\n" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "add", "edit_start_line_idx": 13 }
import { isNative } from "../fp"; export = isNative;
types/lodash/fp/isNative.d.ts
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.00017828337149694562, 0.00017828337149694562, 0.00017828337149694562, 0.00017828337149694562, 0 ]
{ "id": 4, "code_window": [ "// tslint:disable-next-line:ban-types\n", "export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): <C extends Function>(WrappedComponent: C) => C;\n" ], "labels": [ "keep", "replace" ], "after_edit": [ "export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): InferableComponentEnhancerWithProps<\"t\">;" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "replace", "edit_start_line_idx": 14 }
import * as React from "react"; import { i18n } from "i18next"; export interface TranslateOptions { withRef?: boolean; bindI18n?: string; bindStore?: string; translateFuncName?: string; wait?: boolean; nsMode?: string; i18n?: i18n; } // tslint:disable-next-line:ban-types export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): <C extends Function>(WrappedComponent: C) => C;
types/react-i18next/v4/translate.d.ts
1
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.9978780746459961, 0.5005066990852356, 0.0031353605445474386, 0.5005066990852356, 0.4973713755607605 ]
{ "id": 4, "code_window": [ "// tslint:disable-next-line:ban-types\n", "export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): <C extends Function>(WrappedComponent: C) => C;\n" ], "labels": [ "keep", "replace" ], "after_edit": [ "export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): InferableComponentEnhancerWithProps<\"t\">;" ], "file_path": "types/react-i18next/v4/translate.d.ts", "type": "replace", "edit_start_line_idx": 14 }
{ "compilerOptions": { "module": "commonjs", "lib": [ "es6" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", "muri-tests.ts" ] }
types/muri/tsconfig.json
0
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/9440fd14094e78c2db7345583a3aba9b36f0eefb
[ 0.0001746405614539981, 0.00017159200797323138, 0.00016914894513320178, 0.00017098654643632472, 0.0000022824560801382177 ]