From aa7c5a44cc416baea1468b22cfa8d1a66d78b7c1 Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Tue, 20 Aug 2019 23:04:41 +0530 Subject: [PATCH 001/163] Added hyphen pattern case preserve logic --- src/vs/base/common/search.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/vs/base/common/search.ts b/src/vs/base/common/search.ts index c18233d61b9..98aedcdef4a 100644 --- a/src/vs/base/common/search.ts +++ b/src/vs/base/common/search.ts @@ -12,7 +12,11 @@ export function buildReplaceStringWithCasePreserved(matches: string[] | null, pa } else if (matches[0].toLowerCase() === matches[0]) { return pattern.toLowerCase(); } else if (strings.containsUppercaseCharacter(matches[0][0])) { - return pattern[0].toUpperCase() + pattern.substr(1); + if (validateHyphenPattern(matches, pattern)) { + return buildReplaceStringForHyphenPatterns(matches, pattern); + } else { + return pattern[0].toUpperCase() + pattern.substr(1); + } } else { // we don't understand its pattern yet. return pattern; @@ -21,3 +25,20 @@ export function buildReplaceStringWithCasePreserved(matches: string[] | null, pa return pattern; } } + +function validateHyphenPattern(matches: string[], pattern: string): boolean { + const doesConatinHyphen = matches[0].indexOf('-') !== -1 && pattern.indexOf('-') !== -1; + const doesConatinSameNumberOfHyphens = matches[0].split('-').length === pattern.split('-').length; + return doesConatinHyphen && doesConatinSameNumberOfHyphens; +} + +function buildReplaceStringForHyphenPatterns(matches: string[], pattern: string): string { + const splitPatternAtHyphen = pattern.split('-'); + const splitMatchAtHyphen = matches[0].split('-'); + let replaceString: string = ''; + + splitPatternAtHyphen.forEach((splitValues, index) => { + replaceString += buildReplaceStringWithCasePreserved([splitMatchAtHyphen[index]], splitValues) + '-'; + }); + return replaceString.slice(0, -1); +} From d1573608e12a73fd7ceb441f1bebacf9f552d1e8 Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Tue, 20 Aug 2019 23:25:22 +0530 Subject: [PATCH 002/163] Replace Pattern test updated --- .../contrib/find/test/replacePattern.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/vs/editor/contrib/find/test/replacePattern.test.ts b/src/vs/editor/contrib/find/test/replacePattern.test.ts index e4c78422b8f..8a651279a6d 100644 --- a/src/vs/editor/contrib/find/test/replacePattern.test.ts +++ b/src/vs/editor/contrib/find/test/replacePattern.test.ts @@ -176,6 +176,13 @@ suite('Replace Pattern test', () => { assert.equal(buildReplaceStringWithCasePreserved(actual, replacePattern), 'Def'); actual = ['aBC']; assert.equal(buildReplaceStringWithCasePreserved(actual, replacePattern), 'Def'); + + actual = ['Foo-Bar']; + assert.equal(buildReplaceStringWithCasePreserved(actual, 'newfoo-newbar'), 'Newfoo-Newbar'); + actual = ['Foo-Bar-Abc']; + assert.equal(buildReplaceStringWithCasePreserved(actual, 'newfoo-newbar-newabc'), 'Newfoo-Newbar-Newabc'); + actual = ['Foo-Bar-abc']; + assert.equal(buildReplaceStringWithCasePreserved(actual, 'newfoo-newbar'), 'Newfoo-newbar'); }); test('preserve case', () => { @@ -198,5 +205,17 @@ suite('Replace Pattern test', () => { assert.equal(actual, 'Def'); actual = replacePattern.buildReplaceString(['aBC'], true); assert.equal(actual, 'Def'); + + replacePattern = parseReplaceString('newfoo-newbar'); + actual = replacePattern.buildReplaceString(['Foo-Bar'], true); + assert.equal(actual, 'Newfoo-Newbar'); + + replacePattern = parseReplaceString('newfoo-newbar-newabc'); + actual = replacePattern.buildReplaceString(['Foo-Bar-Abc'], true); + assert.equal(actual, 'Newfoo-Newbar-Newabc'); + + replacePattern = parseReplaceString('newfoo-newbar'); + actual = replacePattern.buildReplaceString(['Foo-Bar-abc'], true); + assert.equal(actual, 'Newfoo-newbar'); }); }); From 39e0512f232dc0dd72c9e10c665ba90eb9ba3c40 Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Wed, 21 Aug 2019 10:59:02 +0530 Subject: [PATCH 003/163] Made the function generic and passed hyphen as a paramater --- src/vs/base/common/search.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vs/base/common/search.ts b/src/vs/base/common/search.ts index 98aedcdef4a..0812df76b6e 100644 --- a/src/vs/base/common/search.ts +++ b/src/vs/base/common/search.ts @@ -12,8 +12,8 @@ export function buildReplaceStringWithCasePreserved(matches: string[] | null, pa } else if (matches[0].toLowerCase() === matches[0]) { return pattern.toLowerCase(); } else if (strings.containsUppercaseCharacter(matches[0][0])) { - if (validateHyphenPattern(matches, pattern)) { - return buildReplaceStringForHyphenPatterns(matches, pattern); + if (validateSpecificSpecialCharacter(matches, pattern, '-')) { + return buildReplaceStringForSpecificSpecialCharacter(matches, pattern, '-'); } else { return pattern[0].toUpperCase() + pattern.substr(1); } @@ -26,19 +26,19 @@ export function buildReplaceStringWithCasePreserved(matches: string[] | null, pa } } -function validateHyphenPattern(matches: string[], pattern: string): boolean { - const doesConatinHyphen = matches[0].indexOf('-') !== -1 && pattern.indexOf('-') !== -1; - const doesConatinSameNumberOfHyphens = matches[0].split('-').length === pattern.split('-').length; - return doesConatinHyphen && doesConatinSameNumberOfHyphens; +function validateSpecificSpecialCharacter(matches: string[], pattern: string, specialCharacter: string): boolean { + const doesConatinSpecialCharacter = matches[0].indexOf(specialCharacter) !== -1 && pattern.indexOf(specialCharacter) !== -1; + const doesConatinSameNumberOfSpecialCharacters = matches[0].split(specialCharacter).length === pattern.split(specialCharacter).length; + return doesConatinSpecialCharacter && doesConatinSameNumberOfSpecialCharacters; } -function buildReplaceStringForHyphenPatterns(matches: string[], pattern: string): string { - const splitPatternAtHyphen = pattern.split('-'); - const splitMatchAtHyphen = matches[0].split('-'); +function buildReplaceStringForSpecificSpecialCharacter(matches: string[], pattern: string, specialCharacter: string): string { + const splitPatternAtSpecialCharacter = pattern.split(specialCharacter); + const splitMatchAtSpecialCharacter = matches[0].split(specialCharacter); let replaceString: string = ''; - - splitPatternAtHyphen.forEach((splitValues, index) => { - replaceString += buildReplaceStringWithCasePreserved([splitMatchAtHyphen[index]], splitValues) + '-'; + splitPatternAtSpecialCharacter.forEach((splitValue, index) => { + replaceString += buildReplaceStringWithCasePreserved([splitMatchAtSpecialCharacter[index]], splitValue) + specialCharacter; }); + return replaceString.slice(0, -1); } From 6f998109d8ff8ba2bef074eea1b5986a9443316e Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 22 Aug 2019 07:06:13 -0700 Subject: [PATCH 004/163] Use void | number for onDidClose Fixes #79643 --- src/vs/vscode.proposed.d.ts | 7 ++++++- src/vs/workbench/api/node/extHostTerminalService.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 19b06c217ba..8f2d4d5cc94 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -881,6 +881,11 @@ declare module 'vscode' { /** * An event that when fired will signal that the pty is closed and dispose of the terminal. * + * A number can be used to provide an exit code for the terminal. Exit codes must be + * positive and a non-zero exit codes signals failure which shows a notification for a + * regular terminal and allows dependent tasks to proceed when used with the + * `CustomExecution2` API. + * * **Example:** Exit the terminal when "y" is pressed, otherwise show a notification. * ```typescript * const writeEmitter = new vscode.EventEmitter(); @@ -899,7 +904,7 @@ declare module 'vscode' { * }; * vscode.window.createTerminal({ name: 'Exit example', pty }); */ - onDidClose?: Event; + onDidClose?: Event; /** * Implement to handle when the pty is open and ready to start firing events. diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 5c5d76564f8..ecce50a23f3 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -738,7 +738,7 @@ class ExtHostPseudoterminal implements ITerminalChildProcess { // Attach the listeners this._pty.onDidWrite(e => this._onProcessData.fire(e)); if (this._pty.onDidClose) { - this._pty.onDidClose(e => this._onProcessExit.fire(0)); + this._pty.onDidClose(e => this._onProcessExit.fire(e || 0)); } if (this._pty.onDidOverrideDimensions) { this._pty.onDidOverrideDimensions(e => this._onProcessOverrideDimensions.fire(e ? { cols: e.columns, rows: e.rows } : e)); From d65681b1afead90dc0bdcef46c9618a32a86b400 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 22 Aug 2019 16:37:18 +0200 Subject: [PATCH 005/163] fix #79628 --- src/vs/workbench/browser/parts/editor/editorStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index e1a7d9d0fec..0d54b781fb0 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -990,7 +990,7 @@ export class ChangeModeAction extends Action { private configureFileAssociation(resource: URI): void { const extension = extname(resource); const base = basename(resource); - const currentAssociation = this.modeService.getModeIdByFilepathOrFirstLine(resource.with({ path: base })); + const currentAssociation = this.modeService.getModeIdByFilepathOrFirstLine(URI.file(base)); const languages = this.modeService.getRegisteredLanguageNames(); const picks: IQuickPickItem[] = languages.sort().map((lang, index) => { From dabeb6f4042652e508799387802f75a18325d027 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 22 Aug 2019 16:50:05 +0200 Subject: [PATCH 006/163] web urls - use absolute paths --- src/vs/workbench/services/url/browser/urlService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/url/browser/urlService.ts b/src/vs/workbench/services/url/browser/urlService.ts index f69c231457d..61c2278813d 100644 --- a/src/vs/workbench/services/url/browser/urlService.ts +++ b/src/vs/workbench/services/url/browser/urlService.ts @@ -124,7 +124,7 @@ class SelfhostURLCallbackProvider extends Disposable implements IURLCallbackProv // Start to poll on the callback being fired this.periodicFetchCallback(requestId, Date.now()); - return this.doCreateUri('callback', queryValues); + return this.doCreateUri('/callback', queryValues); } private async periodicFetchCallback(requestId: string, startTime: number): Promise { @@ -134,7 +134,7 @@ class SelfhostURLCallbackProvider extends Disposable implements IURLCallbackProv queryValues.set(SelfhostURLCallbackProvider.QUERY_KEYS.REQUEST_ID, requestId); const result = await this.requestService.request({ - url: this.doCreateUri('fetch-callback', queryValues).toString(true) + url: this.doCreateUri('/fetch-callback', queryValues).toString(true) }, CancellationToken.None); // Check for callback results From 4acba1a2dd2b84b3af789dfac33fc328b01beb23 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Thu, 22 Aug 2019 18:05:41 +0200 Subject: [PATCH 007/163] Remove layer breaker from terminalTaskSystem Fixes #79210 --- .../contrib/tasks/browser/terminalTaskSystem.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 96148b4e58f..7097c96cd89 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -44,6 +44,7 @@ import { Schemas } from 'vs/base/common/network'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; +import { env as processEnv, cwd as processCwd } from 'vs/base/common/process'; interface TerminalData { terminal: ITerminalInstance; @@ -1376,8 +1377,7 @@ export class TerminalTaskSystem implements ITaskSystem { return command; } if (cwd === undefined) { - // tslint:disable-next-line: no-nodejs-globals - cwd = process.cwd(); + cwd = processCwd(); } const dir = path.dirname(command); if (dir !== '.') { @@ -1385,10 +1385,8 @@ export class TerminalTaskSystem implements ITaskSystem { // to the current working directory. return path.join(cwd, command); } - // tslint:disable-next-line: no-nodejs-globals - if (paths === undefined && Types.isString(process.env.PATH)) { - // tslint:disable-next-line: no-nodejs-globals - paths = process.env.PATH.split(path.delimiter); + if (paths === undefined && Types.isString(processEnv.PATH)) { + paths = processEnv.PATH.split(path.delimiter); } // No PATH environment. Make path absolute to the cwd. if (paths === undefined || paths.length === 0) { From da1745d34ce6ed0020a7a5ce2b6a09b00c9d66d3 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 22 Aug 2019 09:22:12 -0700 Subject: [PATCH 008/163] xterm@3.15.0-beta101 Diff: https://github.com/xtermjs/xterm.js/compare/95ff154...2117005 Changes: - New paste API - New parser hook APIs Part of #78999 --- package.json | 2 +- remote/package.json | 2 +- remote/yarn.lock | 8 +- src/typings/xterm.d.ts | 207 +++++++++++++++++++++++++++++------------ yarn.lock | 8 +- 5 files changed, 159 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index e6a1abf6fcb..b7b3ce2bfe6 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "vscode-ripgrep": "^1.5.6", "vscode-sqlite3": "4.0.8", "vscode-textmate": "^4.2.2", - "xterm": "3.15.0-beta99", + "xterm": "3.15.0-beta101", "xterm-addon-search": "0.2.0-beta5", "xterm-addon-web-links": "0.1.0-beta10", "yauzl": "^2.9.2", diff --git a/remote/package.json b/remote/package.json index 2e8ceed0809..9fa3881681d 100644 --- a/remote/package.json +++ b/remote/package.json @@ -21,7 +21,7 @@ "vscode-proxy-agent": "0.4.0", "vscode-ripgrep": "^1.5.6", "vscode-textmate": "^4.2.2", - "xterm": "3.15.0-beta99", + "xterm": "3.15.0-beta101", "xterm-addon-search": "0.2.0-beta5", "xterm-addon-web-links": "0.1.0-beta10", "yauzl": "^2.9.2", diff --git a/remote/yarn.lock b/remote/yarn.lock index dca0e2501f0..308bf9634b7 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -1225,10 +1225,10 @@ xterm-addon-web-links@0.1.0-beta10: resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.1.0-beta10.tgz#610fa9773a2a5ccd41c1c83ba0e2dd2c9eb66a23" integrity sha512-xfpjy0V6bB4BR44qIgZQPoCMVakxb65gMscPkHpO//QxvUxKzabV3dxOsIbeZRFkUGsWTFlvz2OoaBLoNtv5gg== -xterm@3.15.0-beta99: - version "3.15.0-beta99" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.15.0-beta99.tgz#0010a7ea5d56cbb08a1e3a525b353c96a158e7a0" - integrity sha512-Vm0ZWToWwO4uk/28Kqvqt9L92h5EU2z4WR9I6xcQaPIBmkJPINIARU4LWQnvaOfgFhRbpwBMveTfh8/jM97lPg== +xterm@3.15.0-beta101: + version "3.15.0-beta101" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.15.0-beta101.tgz#38ffa0df5a3e9bdcb1818e74fe59b2f98b0fff69" + integrity sha512-HRa7+FDqQ8iWBTvb1Ni+uMGILnu6k9mF7JHMHRHfWxFoQlSoGYCyfdyXlJjk68YN8GsEQREmrII6cPLiQizdEQ== yauzl@^2.9.2: version "2.10.0" diff --git a/src/typings/xterm.d.ts b/src/typings/xterm.d.ts index 663b997022b..df7f20e233e 100644 --- a/src/typings/xterm.d.ts +++ b/src/typings/xterm.d.ts @@ -207,47 +207,47 @@ declare module 'xterm' { */ export interface ITheme { /** The default foreground color */ - foreground?: string, + foreground?: string; /** The default background color */ - background?: string, + background?: string; /** The cursor color */ - cursor?: string, + cursor?: string; /** The accent color of the cursor (fg color for a block cursor) */ - cursorAccent?: string, + cursorAccent?: string; /** The selection background color (can be transparent) */ - selection?: string, + selection?: string; /** ANSI black (eg. `\x1b[30m`) */ - black?: string, + black?: string; /** ANSI red (eg. `\x1b[31m`) */ - red?: string, + red?: string; /** ANSI green (eg. `\x1b[32m`) */ - green?: string, + green?: string; /** ANSI yellow (eg. `\x1b[33m`) */ - yellow?: string, + yellow?: string; /** ANSI blue (eg. `\x1b[34m`) */ - blue?: string, + blue?: string; /** ANSI magenta (eg. `\x1b[35m`) */ - magenta?: string, + magenta?: string; /** ANSI cyan (eg. `\x1b[36m`) */ - cyan?: string, + cyan?: string; /** ANSI white (eg. `\x1b[37m`) */ - white?: string, + white?: string; /** ANSI bright black (eg. `\x1b[1;30m`) */ - brightBlack?: string, + brightBlack?: string; /** ANSI bright red (eg. `\x1b[1;31m`) */ - brightRed?: string, + brightRed?: string; /** ANSI bright green (eg. `\x1b[1;32m`) */ - brightGreen?: string, + brightGreen?: string; /** ANSI bright yellow (eg. `\x1b[1;33m`) */ - brightYellow?: string, + brightYellow?: string; /** ANSI bright blue (eg. `\x1b[1;34m`) */ - brightBlue?: string, + brightBlue?: string; /** ANSI bright magenta (eg. `\x1b[1;35m`) */ - brightMagenta?: string, + brightMagenta?: string; /** ANSI bright cyan (eg. `\x1b[1;36m`) */ - brightCyan?: string, + brightCyan?: string; /** ANSI bright white (eg. `\x1b[1;37m`) */ - brightWhite?: string + brightWhite?: string; } /** @@ -386,6 +386,12 @@ declare module 'xterm' { */ readonly markers: ReadonlyArray; + /** + * (EXPERIMENTAL) Get the parser interface to register + * custom escape sequence handlers. + */ + readonly parser: IParser; + /** * Natural language strings that can be localized. */ @@ -500,32 +506,6 @@ declare module 'xterm' { */ attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void; - /** - * (EXPERIMENTAL) Adds a handler for CSI escape sequences. - * @param flag The flag should be one-character string, which specifies the - * final character (e.g "m" for SGR) of the CSI sequence. - * @param callback The function to handle the escape sequence. The callback - * is called with the numerical params, as well as the special characters - * (e.g. "$" for DECSCPP). If the sequence has subparams the array will - * contain subarrays with their numercial values. - * Return true if the sequence was handled; false if - * we should try a previous handler (set by addCsiHandler or setCsiHandler). - * The most recently-added handler is tried first. - * @return An IDisposable you can call to remove this handler. - */ - addCsiHandler(flag: string, callback: (params: (number | number[])[], collect: string) => boolean): IDisposable; - - /** - * (EXPERIMENTAL) Adds a handler for OSC escape sequences. - * @param ident The number (first parameter) of the sequence. - * @param callback The function to handle the escape sequence. The callback - * is called with OSC data string. Return true if the sequence was handled; - * false if we should try a previous handler (set by addOscHandler or - * setOscHandler). The most recently-added handler is tried first. - * @return An IDisposable you can call to remove this handler. - */ - addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; - /** * (EXPERIMENTAL) Registers a link matcher, allowing custom link patterns to * be matched and handled. @@ -689,6 +669,12 @@ declare module 'xterm' { */ writeUtf8(data: Uint8Array): void; + /** + * Writes text to the terminal, performing the necessary transformations for pasted text. + * @param data The text to write to the terminal. + */ + paste(data: string): void; + /** * Retrieves an option's value from the terminal. * @param key The option key. @@ -804,18 +790,10 @@ declare module 'xterm' { /** * Perform a full reset (RIS, aka '\x1bc'). */ - reset(): void + reset(): void; /** - * Applies an addon to the Terminal prototype, making it available to all - * newly created Terminals. - * @param addon The addon to apply. - * @deprecated Use the new loadAddon API/addon format. - */ - static applyAddon(addon: any): void; - - /** - * (EXPERIMENTAL) Loads an addon into this instance of xterm.js. + * Loads an addon into this instance of xterm.js. * @param addon The addon to load. */ loadAddon(addon: ITerminalAddon): void; @@ -951,6 +929,119 @@ declare module 'xterm' { */ readonly width: number; } + + /** + * (EXPERIMENTAL) Data type to register a CSI, DCS or ESC callback in the parser + * in the form: + * ESC I..I F + * CSI Prefix P..P I..I F + * DCS Prefix P..P I..I F data_bytes ST + * + * with these rules/restrictions: + * - prefix can only be used with CSI and DCS + * - only one leading prefix byte is recognized by the parser + * before any other parameter bytes (P..P) + * - intermediate bytes are recognized up to 2 + * + * For custom sequences make sure to read ECMA-48 and the resources at + * vt100.net to not clash with existing sequences or reserved address space. + * General recommendations: + * - use private address space (see ECMA-48) + * - use max one intermediate byte (technically not limited by the spec, + * in practice there are no sequences with more than one intermediate byte, + * thus parsers might get confused with more intermediates) + * - test against other common emulators to check whether they escape/ignore + * the sequence correctly + * + * Notes: OSC command registration is handled differently (see addOscHandler) + * APC, PM or SOS is currently not supported. + */ + export interface IFunctionIdentifier { + /** + * Optional prefix byte, must be in range \x3c .. \x3f. + * Usable in CSI and DCS. + */ + prefix?: string; + /** + * Optional intermediate bytes, must be in range \x20 .. \x2f. + * Usable in CSI, DCS and ESC. + */ + intermediates?: string; + /** + * Final byte, must be in range \x40 .. \x7e for CSI and DCS, + * \x30 .. \x7e for ESC. + */ + final: string; + } + + /** + * (EXPERIMENTAL) Parser interface. + */ + export interface IParser { + /** + * Adds a handler for CSI escape sequences. + * @param id Specifies the function identifier under which the callback + * gets registered, e.g. {final: 'm'} for SGR. + * @param callback The function to handle the sequence. The callback is + * called with the numerical params. If the sequence has subparams the + * array will contain subarrays with their numercial values. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addCsiHandler or setCsiHandler). + * The most recently-added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable; + + /** + * Adds a handler for DCS escape sequences. + * @param id Specifies the function identifier under which the callback + * gets registered, e.g. {intermediates: '$' final: 'q'} for DECRQSS. + * @param callback The function to handle the sequence. Note that the + * function will only be called once if the sequence finished sucessfully. + * There is currently no way to intercept smaller data chunks, data chunks + * will be stored up until the sequence is finished. Since DCS sequences + * are not limited by the amount of data this might impose a problem for + * big payloads. Currently xterm.js limits DCS payload to 10 MB + * which should give enough room for most use cases. + * The function gets the payload and numerical parameters as arguments. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addDcsHandler or setDcsHandler). + * The most recently-added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable; + + /** + * Adds a handler for ESC escape sequences. + * @param id Specifies the function identifier under which the callback + * gets registered, e.g. {intermediates: '%' final: 'G'} for + * default charset selection. + * @param callback The function to handle the sequence. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addEscHandler or setEscHandler). + * The most recently-added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + addEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable; + + /** + * Adds a handler for OSC escape sequences. + * @param ident The number (first parameter) of the sequence. + * @param callback The function to handle the sequence. Note that the + * function will only be called once if the sequence finished sucessfully. + * There is currently no way to intercept smaller data chunks, data chunks + * will be stored up until the sequence is finished. Since OSC sequences + * are not limited by the amount of data this might impose a problem for + * big payloads. Currently xterm.js limits OSC payload to 10 MB + * which should give enough room for most use cases. + * The callback is called with OSC data string. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addOscHandler or setOscHandler). + * The most recently-added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; + } } @@ -987,4 +1078,4 @@ declare module 'xterm' { interface Terminal { _core: TerminalCore; } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 90baeda9809..76486ff3f83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10002,10 +10002,10 @@ xterm-addon-web-links@0.1.0-beta10: resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.1.0-beta10.tgz#610fa9773a2a5ccd41c1c83ba0e2dd2c9eb66a23" integrity sha512-xfpjy0V6bB4BR44qIgZQPoCMVakxb65gMscPkHpO//QxvUxKzabV3dxOsIbeZRFkUGsWTFlvz2OoaBLoNtv5gg== -xterm@3.15.0-beta99: - version "3.15.0-beta99" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.15.0-beta99.tgz#0010a7ea5d56cbb08a1e3a525b353c96a158e7a0" - integrity sha512-Vm0ZWToWwO4uk/28Kqvqt9L92h5EU2z4WR9I6xcQaPIBmkJPINIARU4LWQnvaOfgFhRbpwBMveTfh8/jM97lPg== +xterm@3.15.0-beta101: + version "3.15.0-beta101" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.15.0-beta101.tgz#38ffa0df5a3e9bdcb1818e74fe59b2f98b0fff69" + integrity sha512-HRa7+FDqQ8iWBTvb1Ni+uMGILnu6k9mF7JHMHRHfWxFoQlSoGYCyfdyXlJjk68YN8GsEQREmrII6cPLiQizdEQ== y18n@^3.2.1: version "3.2.1" From 0ef277ee78a9382fa25ce77dc21078c562ec56cd Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 22 Aug 2019 09:24:03 -0700 Subject: [PATCH 009/163] Adopt new paste and addCsiHandler APIs Fixes #78999 --- src/vs/workbench/contrib/terminal/browser/terminalInstance.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 9ab3aa21384..c210bb9d05d 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -500,7 +500,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { // Force line data to be sent when the cursor is moved, the main purpose for // this is because ConPTY will often not do a line feed but instead move the // cursor, in which case we still want to send the current line's data to tasks. - xterm.addCsiHandler('H', () => { + xterm.parser.addCsiHandler({ final: 'H' }, () => { this._onCursorMove(); return false; }); @@ -865,7 +865,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { return; } this.focus(); - this._xterm._core._coreService.triggerDataEvent(await this._clipboardService.readText(), true); + this._xterm.paste(await this._clipboardService.readText()); } public write(text: string): void { From 878fe0bb9a11b65419ce898e1ccfbcd7f2999782 Mon Sep 17 00:00:00 2001 From: skprabhanjan Date: Thu, 22 Aug 2019 22:00:15 +0530 Subject: [PATCH 010/163] Fast return if doesConatinSpecialCharacter is false --- src/vs/base/common/search.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vs/base/common/search.ts b/src/vs/base/common/search.ts index 0812df76b6e..743967964b6 100644 --- a/src/vs/base/common/search.ts +++ b/src/vs/base/common/search.ts @@ -28,8 +28,7 @@ export function buildReplaceStringWithCasePreserved(matches: string[] | null, pa function validateSpecificSpecialCharacter(matches: string[], pattern: string, specialCharacter: string): boolean { const doesConatinSpecialCharacter = matches[0].indexOf(specialCharacter) !== -1 && pattern.indexOf(specialCharacter) !== -1; - const doesConatinSameNumberOfSpecialCharacters = matches[0].split(specialCharacter).length === pattern.split(specialCharacter).length; - return doesConatinSpecialCharacter && doesConatinSameNumberOfSpecialCharacters; + return doesConatinSpecialCharacter && matches[0].split(specialCharacter).length === pattern.split(specialCharacter).length; } function buildReplaceStringForSpecificSpecialCharacter(matches: string[], pattern: string, specialCharacter: string): string { From 18641cd58d5559d2c4ee3564be8b4080225faaf1 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 22 Aug 2019 09:42:32 -0700 Subject: [PATCH 011/163] Remove mention of env in automation shell Part of #78497 --- .../contrib/terminal/browser/terminal.contribution.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts index 73a8047c940..db587f13986 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts @@ -72,17 +72,17 @@ configurationRegistry.registerConfiguration({ type: 'object', properties: { 'terminal.integrated.automationShell.linux': { - markdownDescription: nls.localize('terminal.integrated.automationShell.linux', "A path that when set will override {0} and ignore {1} and {2} values for automation-related terminal usage like tasks and debug.", '`terminal.integrated.shell.linux`', '`shellArgs`', '`env`'), + markdownDescription: nls.localize('terminal.integrated.automationShell.linux', "A path that when set will override {0} and ignore {1} values for automation-related terminal usage like tasks and debug.", '`terminal.integrated.shell.linux`', '`shellArgs`'), type: ['string', 'null'], default: null }, 'terminal.integrated.automationShell.osx': { - markdownDescription: nls.localize('terminal.integrated.automationShell.osx', "A path that when set will override {0} and ignore {1} and {2} values for automation-related terminal usage like tasks and debug.", '`terminal.integrated.shell.osx`', '`shellArgs`', '`env`'), + markdownDescription: nls.localize('terminal.integrated.automationShell.osx', "A path that when set will override {0} and ignore {1} values for automation-related terminal usage like tasks and debug.", '`terminal.integrated.shell.osx`', '`shellArgs`'), type: ['string', 'null'], default: null }, 'terminal.integrated.automationShell.windows': { - markdownDescription: nls.localize('terminal.integrated.automationShell.windows', "A path that when set will override {0} and ignore {1} and {2} values for automation-related terminal usage like tasks and debug.", '`terminal.integrated.shell.windows`', '`shellArgs`', '`env`'), + markdownDescription: nls.localize('terminal.integrated.automationShell.windows', "A path that when set will override {0} and ignore {1} values for automation-related terminal usage like tasks and debug.", '`terminal.integrated.shell.windows`', '`shellArgs`'), type: ['string', 'null'], default: null }, From 3cabab6d6099e79d96e6afda9cdee81c321cd770 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 22 Aug 2019 09:47:45 -0700 Subject: [PATCH 012/163] Update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7b3ce2bfe6..aff00157a89 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "97a3da8fc0166ace25ffb8f21585fd58ba3305c8", + "distro": "5bc548e4d0a04371b933e269bf73a507e995fb02", "author": { "name": "Microsoft Corporation" }, From c445d5c408389bfda8af6e188474e77b2cb45af6 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Thu, 22 Aug 2019 10:36:11 -0700 Subject: [PATCH 013/163] Update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aff00157a89..5cc5aff8076 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "5bc548e4d0a04371b933e269bf73a507e995fb02", + "distro": "5af2b9835ba8caee9e5057d2272ba4c90fcd0d36", "author": { "name": "Microsoft Corporation" }, From ccd6d203a064efb308ca1b1043ef2c87e327a2ac Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 22 Aug 2019 20:03:55 +0200 Subject: [PATCH 014/163] tslint - also show warning when using NodeJS type --- build/lib/tslint/noNodejsGlobalsRule.js | 1 + build/lib/tslint/noNodejsGlobalsRule.ts | 1 + src/vs/workbench/contrib/logs/common/logsDataCleaner.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build/lib/tslint/noNodejsGlobalsRule.js b/build/lib/tslint/noNodejsGlobalsRule.js index 1e955a41e1b..8c36fa342c2 100644 --- a/build/lib/tslint/noNodejsGlobalsRule.js +++ b/build/lib/tslint/noNodejsGlobalsRule.js @@ -26,6 +26,7 @@ class NoNodejsGlobalsRuleWalker extends abstractGlobalsRule_1.AbstractGlobalsRul getDisallowedGlobals() { // https://nodejs.org/api/globals.html#globals_global_objects return [ + "NodeJS", "Buffer", "__dirname", "__filename", diff --git a/build/lib/tslint/noNodejsGlobalsRule.ts b/build/lib/tslint/noNodejsGlobalsRule.ts index 48b229333e9..7e5767d8570 100644 --- a/build/lib/tslint/noNodejsGlobalsRule.ts +++ b/build/lib/tslint/noNodejsGlobalsRule.ts @@ -37,6 +37,7 @@ class NoNodejsGlobalsRuleWalker extends AbstractGlobalsRuleWalker { getDisallowedGlobals(): string[] { // https://nodejs.org/api/globals.html#globals_global_objects return [ + "NodeJS", "Buffer", "__dirname", "__filename", diff --git a/src/vs/workbench/contrib/logs/common/logsDataCleaner.ts b/src/vs/workbench/contrib/logs/common/logsDataCleaner.ts index 90d328690ed..4f7faa55ebe 100644 --- a/src/vs/workbench/contrib/logs/common/logsDataCleaner.ts +++ b/src/vs/workbench/contrib/logs/common/logsDataCleaner.ts @@ -22,7 +22,7 @@ export class LogsDataCleaner extends Disposable { } private cleanUpOldLogsSoon(): void { - let handle: NodeJS.Timeout | undefined = setTimeout(async () => { + let handle: any = setTimeout(async () => { handle = undefined; const logsPath = URI.file(this.environmentService.logsPath).with({ scheme: this.environmentService.logFile.scheme }); const stat = await this.fileService.resolve(dirname(logsPath)); From 4454769affdb83e84721305835b300e943ca0d61 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Thu, 22 Aug 2019 14:26:42 -0700 Subject: [PATCH 015/163] Trust https://go.microsoft.com. Fix build --- src/vs/workbench/contrib/url/common/url.contribution.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/url/common/url.contribution.ts b/src/vs/workbench/contrib/url/common/url.contribution.ts index 7d8a5f9e8fc..9882864d0ef 100644 --- a/src/vs/workbench/contrib/url/common/url.contribution.ts +++ b/src/vs/workbench/contrib/url/common/url.contribution.ts @@ -50,14 +50,17 @@ Registry.as(ActionExtensions.WorkbenchActions).registe localize('developer', 'Developer') ); -const VSCODE_DOMAIN = 'https://code.visualstudio.com'; +const DEAFULT_TRUSTED_DOMAINS = [ + 'https://code.visualstudio.com', + 'https://go.microsoft.com' +]; const configureTrustedDomainsHandler = async ( quickInputService: IQuickInputService, storageService: IStorageService, domainToConfigure?: string ) => { - let trustedDomains: string[] = [VSCODE_DOMAIN]; + let trustedDomains: string[] = DEAFULT_TRUSTED_DOMAINS; try { const trustedDomainsSrc = storageService.get('http.trustedDomains', StorageScope.GLOBAL); @@ -158,7 +161,7 @@ class OpenerValidatorContributions implements IWorkbenchContribution { return true; } - let trustedDomains: string[] = [VSCODE_DOMAIN]; + let trustedDomains: string[] = DEAFULT_TRUSTED_DOMAINS; try { const trustedDomainsSrc = this._storageService.get('http.trustedDomains', StorageScope.GLOBAL); if (trustedDomainsSrc) { From 99970f4d12164005875d4df3a499142da84b69a7 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Thu, 22 Aug 2019 12:50:20 -0700 Subject: [PATCH 016/163] Validation for array-of-string settings. Fix #77459 --- .../browser/media/settingsEditor2.css | 4 + .../preferences/browser/settingsTree.ts | 81 +++++++++++++++---- .../preferences/common/preferencesModels.ts | 61 ++++++++++++++ .../test/common/preferencesModel.test.ts | 80 +++++++++++++++++- 4 files changed, 209 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css b/src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css index 5e8238fde91..faf363f6a3e 100644 --- a/src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css +++ b/src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css @@ -369,6 +369,10 @@ margin-top: -1px; z-index: 1; } +.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-list .setting-item-contents.invalid-input .setting-item-validation-message { + position: static; + margin-top: 1rem; +} .settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-text .setting-item-validation-message { width: 500px; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 82465a22624..0964f8ef312 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -224,8 +224,9 @@ interface ISettingComplexItemTemplate extends ISettingItemTemplate { button: Button; } -interface ISettingListItemTemplate extends ISettingItemTemplate { +interface ISettingListItemTemplate extends ISettingItemTemplate { listWidget: ListSettingWidget; + validationErrorMessageElement: HTMLElement; } interface ISettingExcludeItemTemplate extends ISettingItemTemplate { @@ -679,6 +680,9 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr renderTemplate(container: HTMLElement): ISettingListItemTemplate { const common = this.renderCommonTemplate(null, container, 'list'); + const descriptionElement = common.containerElement.querySelector('.setting-item-description')!; + const validationErrorMessageElement = $('.setting-item-validation-message'); + descriptionElement.after(validationErrorMessageElement); const listWidget = this._instantiationService.createInstance(ListSettingWidget, common.controlElement); listWidget.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); @@ -686,19 +690,40 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr const template: ISettingListItemTemplate = { ...common, - listWidget + listWidget, + validationErrorMessageElement }; this.addSettingElementFocusHandler(template); - common.toDispose.push(listWidget.onDidChangeList(e => this.onDidChangeList(template, e))); + common.toDispose.push( + listWidget.onDidChangeList(e => { + const newList = this.computeNewList(template, e); + this.onDidChangeList(template, newList); + if (newList !== null && template.onChange) { + template.onChange(newList); + } + }) + ); return template; } - private onDidChangeList(template: ISettingListItemTemplate, e: IListChangeEvent): void { + private onDidChangeList(template: ISettingListItemTemplate, newList: string[] | undefined | null): void { + if (!template.context || newList === null) { + return; + } + + this._onDidChangeSetting.fire({ + key: template.context.setting.key, + value: newList, + type: template.context.valueType + }); + } + + private computeNewList(template: ISettingListItemTemplate, e: IListChangeEvent): string[] | undefined | null { if (template.context) { - let newValue: any[] = []; + let newValue: string[] = []; if (isArray(template.context.scopeValue)) { newValue = [...template.context.scopeValue]; } else if (isArray(template.context.value)) { @@ -732,29 +757,30 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr template.context.defaultValue.length === newValue.length && template.context.defaultValue.join() === newValue.join() ) { - return this._onDidChangeSetting.fire({ - key: template.context.setting.key, - value: undefined, // reset setting - type: template.context.valueType - }); + return undefined; } - this._onDidChangeSetting.fire({ - key: template.context.setting.key, - value: newValue, - type: template.context.valueType - }); + return newValue; } + + return undefined; } renderElement(element: ITreeNode, index: number, templateData: ISettingListItemTemplate): void { super.renderSettingElement(element, index, templateData); } - protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingListItemTemplate, onChange: (value: string) => void): void { + protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingListItemTemplate, onChange: (value: string[] | undefined) => void): void { const value = getListDisplayValue(dataElement); template.listWidget.setValue(value); template.context = dataElement; + + template.onChange = (v) => { + onChange(v); + renderArrayValidations(dataElement, template, v, false); + }; + + renderArrayValidations(dataElement, template, value.map(v => v.value), true); } } @@ -1237,6 +1263,29 @@ function renderValidations(dataElement: SettingsTreeSettingElement, template: IS DOM.removeClass(template.containerElement, 'invalid-input'); } +function renderArrayValidations( + dataElement: SettingsTreeSettingElement, + template: ISettingListItemTemplate, + value: string[] | undefined, + calledOnStartup: boolean +) { + DOM.addClass(template.containerElement, 'invalid-input'); + if (dataElement.setting.validator) { + const errMsg = dataElement.setting.validator(value); + if (errMsg && errMsg !== '') { + DOM.addClass(template.containerElement, 'invalid-input'); + template.validationErrorMessageElement.innerText = errMsg; + const validationError = localize('validationError', "Validation Error."); + template.containerElement.setAttribute('aria-label', [dataElement.setting.key, validationError, errMsg].join(' ')); + if (!calledOnStartup) { ariaAlert(validationError + ' ' + errMsg); } + return; + } else { + template.containerElement.setAttribute('aria-label', dataElement.setting.key); + DOM.removeClass(template.containerElement, 'invalid-input'); + } + } +} + function cleanRenderedMarkdown(element: Node): void { for (let i = 0; i < element.childNodes.length; i++) { const child = element.childNodes.item(i); diff --git a/src/vs/workbench/services/preferences/common/preferencesModels.ts b/src/vs/workbench/services/preferences/common/preferencesModels.ts index 3e252282711..2f334c3ca5a 100644 --- a/src/vs/workbench/services/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/services/preferences/common/preferencesModels.ts @@ -1028,6 +1028,67 @@ class SettingsContentBuilder { } export function createValidator(prop: IConfigurationPropertySchema): (value: any) => (string | null) { + // Only for array of string + if (prop.type === 'array' && prop.items && !isArray(prop.items) && prop.items.type === 'string') { + const propItems = prop.items; + if (propItems && !isArray(propItems) && propItems.type === 'string') { + const withQuotes = (s: string) => `'` + s + `'`; + + return value => { + if (!value) { + return null; + } + + let message = ''; + + const stringArrayValue = value as string[]; + + if (prop.minItems && stringArrayValue.length < prop.minItems) { + message += nls.localize('validations.stringArrayMinItem', 'Array must have at least {0} items', prop.minItems); + message += '\n'; + } + + if (prop.maxItems && stringArrayValue.length > prop.maxItems) { + message += nls.localize('validations.stringArrayMaxItem', 'Array must have less than {0} items', prop.maxItems); + message += '\n'; + } + + if (typeof propItems.pattern === 'string') { + const patternRegex = new RegExp(propItems.pattern); + stringArrayValue.forEach(v => { + if (!patternRegex.test(v)) { + message += + propItems.patternErrorMessage || + nls.localize( + 'validations.stringArrayItemPattern', + 'Value {0} must match regex {1}.', + withQuotes(v), + withQuotes(propItems.pattern!) + ); + } + }); + } + + const propItemsEnum = propItems.enum; + if (propItemsEnum) { + stringArrayValue.forEach(v => { + if (propItemsEnum.indexOf(v) === -1) { + message += nls.localize( + 'validations.stringArrayItemEnum', + 'Value {0} is not one of {1}', + withQuotes(v), + '[' + propItemsEnum.map(withQuotes).join(', ') + ']' + ); + message += '\n'; + } + }); + } + + return message; + }; + } + } + return value => { let exclusiveMax: number | undefined; let exclusiveMin: number | undefined; diff --git a/src/vs/workbench/services/preferences/test/common/preferencesModel.test.ts b/src/vs/workbench/services/preferences/test/common/preferencesModel.test.ts index 555da0949aa..b02e29c0c96 100644 --- a/src/vs/workbench/services/preferences/test/common/preferencesModel.test.ts +++ b/src/vs/workbench/services/preferences/test/common/preferencesModel.test.ts @@ -250,4 +250,82 @@ suite('Preferences Model test', () => { withMessage.rejects(' ').withMessage('always error!'); withMessage.rejects('1').withMessage('always error!'); }); -}); \ No newline at end of file + + class ArrayTester { + private validator: (value: any) => string | null; + + constructor(private settings: IConfigurationPropertySchema) { + this.validator = createValidator(settings)!; + } + + public accepts(input: string[]) { + assert.equal(this.validator(input), '', `Expected ${JSON.stringify(this.settings)} to accept \`${JSON.stringify(input)}\`. Got ${this.validator(input)}.`); + } + + public rejects(input: any[]) { + assert.notEqual(this.validator(input), '', `Expected ${JSON.stringify(this.settings)} to reject \`${JSON.stringify(input)}\`.`); + return { + withMessage: + (message: string) => { + const actual = this.validator(input); + assert.ok(actual); + assert(actual!.indexOf(message) > -1, + `Expected error of ${JSON.stringify(this.settings)} on \`${input}\` to contain ${message}. Got ${this.validator(input)}.`); + } + }; + } + } + + test('simple array', () => { + { + const arr = new ArrayTester({ type: 'array', items: { type: 'string' } }); + arr.accepts([]); + arr.accepts(['foo']); + arr.accepts(['foo', 'bar']); + } + }); + + test('min-max items array', () => { + { + const arr = new ArrayTester({ type: 'array', items: { type: 'string' }, minItems: 1, maxItems: 2 }); + arr.rejects([]).withMessage('Array must have at least 1 items'); + arr.accepts(['a']); + arr.accepts(['a', 'a']); + arr.rejects(['a', 'a', 'a']).withMessage('Array must have less than 2 items'); + } + }); + + test('array of enums', () => { + { + const arr = new ArrayTester({ type: 'array', items: { type: 'string', enum: ['a', 'b'] } }); + arr.accepts(['a']); + arr.accepts(['a', 'b']); + + arr.rejects(['c']).withMessage(`Value 'c' is not one of`); + arr.rejects(['a', 'c']).withMessage(`Value 'c' is not one of`); + + arr.rejects(['c', 'd']).withMessage(`Value 'c' is not one of`); + arr.rejects(['c', 'd']).withMessage(`Value 'd' is not one of`); + } + }); + + test('min-max and enum', () => { + const arr = new ArrayTester({ type: 'array', items: { type: 'string', enum: ['a', 'b'] }, minItems: 1, maxItems: 2 }); + + arr.rejects(['a', 'b', 'c']).withMessage('Array must have less than 2 items'); + arr.rejects(['a', 'b', 'c']).withMessage(`Value 'c' is not one of`); + }); + + test('pattern', () => { + const arr = new ArrayTester({ type: 'array', items: { type: 'string', pattern: '^(hello)*$' } }); + + arr.accepts(['hello']); + arr.rejects(['a']).withMessage(`Value 'a' must match regex`); + }); + + test('pattern with error message', () => { + const arr = new ArrayTester({ type: 'array', items: { type: 'string', pattern: '^(hello)*$', patternErrorMessage: 'err: must be friendly' } }); + + arr.rejects(['a']).withMessage(`err: must be friendly`); + }); +}); From 016a400b1b49806b21ffa820ae242f24228a1862 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Thu, 22 Aug 2019 16:42:32 -0700 Subject: [PATCH 017/163] Only do workspace stats computations if telemetry is enabled --- .../contrib/stats/electron-browser/workspaceStats.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/stats/electron-browser/workspaceStats.ts b/src/vs/workbench/contrib/stats/electron-browser/workspaceStats.ts index 7457e3b6bcd..e6ca4e0869b 100644 --- a/src/vs/workbench/contrib/stats/electron-browser/workspaceStats.ts +++ b/src/vs/workbench/contrib/stats/electron-browser/workspaceStats.ts @@ -147,7 +147,9 @@ export class WorkspaceStats implements IWorkbenchContribution { @ISharedProcessService private readonly sharedProcessService: ISharedProcessService, @IWorkspaceStatsService private readonly workspaceStatsService: IWorkspaceStatsService ) { - this.report(); + if (this.telemetryService.isOptedIn) { + this.report(); + } } private report(): void { From 263312b6ddb97a464bed0d53b55b473d8a7fab1e Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Thu, 22 Aug 2019 17:06:53 -0700 Subject: [PATCH 018/163] add reconnect now button --- src/vs/platform/progress/common/progress.ts | 1 + .../remote/common/remoteAgentConnection.ts | 28 +++++-- .../electron-browser/remote.contribution.ts | 78 ++++++++++++++----- .../progress/browser/progressService.ts | 44 +++++++++-- 4 files changed, 121 insertions(+), 30 deletions(-) diff --git a/src/vs/platform/progress/common/progress.ts b/src/vs/platform/progress/common/progress.ts index 4308c72ce89..cbb0c6068e6 100644 --- a/src/vs/platform/progress/common/progress.ts +++ b/src/vs/platform/progress/common/progress.ts @@ -50,6 +50,7 @@ export interface IProgressOptions { source?: string; total?: number; cancellable?: boolean; + buttons?: string[]; } export interface IProgressNotificationOptions extends IProgressOptions { diff --git a/src/vs/platform/remote/common/remoteAgentConnection.ts b/src/vs/platform/remote/common/remoteAgentConnection.ts index 5653a6912b2..7b6e6897681 100644 --- a/src/vs/platform/remote/common/remoteAgentConnection.ts +++ b/src/vs/platform/remote/common/remoteAgentConnection.ts @@ -12,6 +12,7 @@ import { Emitter } from 'vs/base/common/event'; import { RemoteAuthorityResolverError } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { isPromiseCanceledError } from 'vs/base/common/errors'; import { ISignService } from 'vs/platform/sign/common/sign'; +import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; export const enum ConnectionType { Management = 1, @@ -245,9 +246,15 @@ export async function connectRemoteAgentTunnel(options: IConnectionOptions, tunn return protocol; } -function sleep(seconds: number): Promise { - return new Promise((resolve, reject) => { - setTimeout(resolve, seconds * 1000); +function sleep(seconds: number): CancelablePromise { + return createCancelablePromise(token => { + return new Promise((resolve, reject) => { + const timeout = setTimeout(resolve, seconds * 1000); + token.onCancellationRequested(() => { + clearTimeout(timeout); + resolve(); + }); + }); }); } @@ -264,8 +271,13 @@ export class ConnectionLostEvent { export class ReconnectionWaitEvent { public readonly type = PersistentConnectionEventType.ReconnectionWait; constructor( - public readonly durationSeconds: number + public readonly durationSeconds: number, + private readonly cancellableTimer: CancelablePromise ) { } + + public skipWait(): void { + this.cancellableTimer.cancel(); + } } export class ReconnectionRunningEvent { public readonly type = PersistentConnectionEventType.ReconnectionRunning; @@ -330,8 +342,12 @@ abstract class PersistentConnection extends Disposable { attempt++; const waitTime = (attempt < TIMES.length ? TIMES[attempt] : TIMES[TIMES.length - 1]); try { - this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime)); - await sleep(waitTime); + const sleepPromise = sleep(waitTime); + this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise)); + + try { + await sleepPromise; + } catch { } // User canceled timer // connection was lost, let's try to re-establish it this._onDidStateChange.fire(new ReconnectionRunningEvent()); diff --git a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts index 00e601638ec..4c3db2da9aa 100644 --- a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts @@ -30,7 +30,7 @@ import { ipcRenderer as ipc } from 'electron'; import { IDiagnosticInfoOptions, IRemoteDiagnosticInfo } from 'vs/platform/diagnostics/common/diagnostics'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IProgressService, IProgress, IProgressStep, ProgressLocation } from 'vs/platform/progress/common/progress'; -import { PersistentConnectionEventType } from 'vs/platform/remote/common/remoteAgentConnection'; +import { PersistentConnectionEventType, ReconnectionWaitEvent } from 'vs/platform/remote/common/remoteAgentConnection'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import Severity from 'vs/base/common/severity'; @@ -315,7 +315,58 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { if (connection) { let currentProgressPromiseResolve: (() => void) | null = null; let progressReporter: ProgressReporter | null = null; + let lastLocation: ProgressLocation | null = null; let currentTimer: ReconnectionTimer | null = null; + let reconnectWaitEvent: ReconnectionWaitEvent | null = null; + + function showProgress(location: ProgressLocation, buttons?: string[]) { + if (currentProgressPromiseResolve) { + currentProgressPromiseResolve(); + } + + const promise = new Promise((resolve) => currentProgressPromiseResolve = resolve); + lastLocation = location; + + if (location === ProgressLocation.Dialog) { + // Show dialog + progressService!.withProgress( + { location: ProgressLocation.Dialog, buttons }, + (progress) => { progressReporter = new ProgressReporter(progress); return promise; }, + (choice?) => { + // Handle choice from dialog + if (choice === 0 && buttons && reconnectWaitEvent) { + reconnectWaitEvent.skipWait(); + } else { + showProgress(ProgressLocation.Notification, buttons); + } + + progressReporter!.report(); + }); + } else { + // Show notification + progressService!.withProgress( + { location: ProgressLocation.Notification, buttons }, + (progress) => { if (progressReporter) { progressReporter.currentProgress = progress; } return promise; }, + (choice?) => { + // Handle choice from notification + if (choice === 0 && buttons && reconnectWaitEvent) { + reconnectWaitEvent.skipWait(); + progressReporter!.report(); + } else { + hideProgress(); + } + }); + } + } + + function hideProgress() { + if (currentProgressPromiseResolve) { + currentProgressPromiseResolve(); + } + + currentProgressPromiseResolve = null; + progressReporter = null; + } connection.onDidStateChange((e) => { if (currentTimer) { @@ -325,31 +376,24 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { switch (e.type) { case PersistentConnectionEventType.ConnectionLost: if (!currentProgressPromiseResolve) { - let promise = new Promise((resolve) => currentProgressPromiseResolve = resolve); - progressService!.withProgress( - { location: ProgressLocation.Dialog }, - (progress: IProgress | null) => { progressReporter = new ProgressReporter(progress!); return promise; }, - () => { - currentProgressPromiseResolve!(); - promise = new Promise((resolve) => currentProgressPromiseResolve = resolve); - progressService!.withProgress({ location: ProgressLocation.Notification }, (progress) => { if (progressReporter) { progressReporter.currentProgress = progress; } return promise; }); - progressReporter!.report(); - } - ); + showProgress(ProgressLocation.Dialog, [nls.localize('reconnectNow', "Reconnect Now")]); } progressReporter!.report(nls.localize('connectionLost', "Connection Lost")); break; case PersistentConnectionEventType.ReconnectionWait: + hideProgress(); + reconnectWaitEvent = e; + showProgress(lastLocation || ProgressLocation.Notification, [nls.localize('reconnectNow', "Reconnect Now")]); currentTimer = new ReconnectionTimer(progressReporter!, Date.now() + 1000 * e.durationSeconds); break; case PersistentConnectionEventType.ReconnectionRunning: + hideProgress(); + showProgress(lastLocation || ProgressLocation.Notification); progressReporter!.report(nls.localize('reconnectionRunning', "Attempting to reconnect...")); break; case PersistentConnectionEventType.ReconnectionPermanentFailure: - currentProgressPromiseResolve!(); - currentProgressPromiseResolve = null; - progressReporter = null; + hideProgress(); dialogService.show(Severity.Error, nls.localize('reconnectionPermanentFailure', "Cannot reconnect. Please reload the window."), [nls.localize('reloadWindow', "Reload Window"), nls.localize('cancel', "Cancel")], { cancelId: 1 }).then(choice => { // Reload the window @@ -359,9 +403,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { }); break; case PersistentConnectionEventType.ConnectionGain: - currentProgressPromiseResolve!(); - currentProgressPromiseResolve = null; - progressReporter = null; + hideProgress(); break; } }); diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index 465920cd05d..d4cef4f51f4 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -46,7 +46,7 @@ export class ProgressService extends Disposable implements IProgressService { super(); } - withProgress(options: IProgressOptions, task: (progress: IProgress) => Promise, onDidCancel?: () => void): Promise { + withProgress(options: IProgressOptions, task: (progress: IProgress) => Promise, onDidCancel?: (choice?: number) => void): Promise { const { location } = options; if (typeof location === 'string') { if (this.viewletService.getProgressIndicator(location)) { @@ -142,7 +142,7 @@ export class ProgressService extends Disposable implements IProgressService { } } - private withNotificationProgress

, R = unknown>(options: IProgressNotificationOptions, callback: (progress: IProgress<{ message?: string, increment?: number }>) => P, onDidCancel?: () => void): P { + private withNotificationProgress

, R = unknown>(options: IProgressNotificationOptions, callback: (progress: IProgress<{ message?: string, increment?: number }>) => P, onDidCancel?: (choice?: number) => void): P { const toDispose = new DisposableStore(); const createNotification = (message: string | undefined, increment?: number): INotificationHandle | undefined => { @@ -152,6 +152,29 @@ export class ProgressService extends Disposable implements IProgressService { const primaryActions = options.primaryActions ? Array.from(options.primaryActions) : []; const secondaryActions = options.secondaryActions ? Array.from(options.secondaryActions) : []; + + if (options.buttons) { + options.buttons.forEach((button, index) => { + const buttonAction = new class extends Action { + constructor() { + super(`progress.button.${button}`, button, undefined, true); + } + + run(): Promise { + if (typeof onDidCancel === 'function') { + onDidCancel(index); + } + + return Promise.resolve(undefined); + } + }; + + toDispose.add(buttonAction); + + primaryActions.push(buttonAction); + }); + } + if (options.cancellable) { const cancelAction = new class extends Action { constructor() { @@ -182,6 +205,10 @@ export class ProgressService extends Disposable implements IProgressService { updateProgress(handle, increment); Event.once(handle.onDidClose)(() => { + if (typeof onDidCancel === 'function') { + onDidCancel(); + } + toDispose.dispose(); }); @@ -317,7 +344,7 @@ export class ProgressService extends Disposable implements IProgressService { return promise; } - private withDialogProgress

, R = unknown>(options: IProgressOptions, task: (progress: IProgress) => P, onDidCancel?: () => void): P { + private withDialogProgress

, R = unknown>(options: IProgressOptions, task: (progress: IProgress) => P, onDidCancel?: (choice?: number) => void): P { const disposables = new DisposableStore(); const allowableCommands = [ 'workbench.action.quit', @@ -327,12 +354,17 @@ export class ProgressService extends Disposable implements IProgressService { let dialog: Dialog; const createDialog = (message: string) => { + + const buttons = options.buttons || []; + buttons.push(options.cancellable ? localize('cancel', "Cancel") : localize('dismiss', "Dismiss")); + dialog = new Dialog( this.layoutService.container, message, - [options.cancellable ? localize('cancel', "Cancel") : localize('dismiss', "Dismiss")], + buttons, { type: 'pending', + cancelId: buttons.length - 1, keyEventProcessor: (event: StandardKeyboardEvent) => { const resolved = this.keybindingService.softDispatch(event, this.layoutService.container); if (resolved && resolved.commandId) { @@ -347,9 +379,9 @@ export class ProgressService extends Disposable implements IProgressService { disposables.add(dialog); disposables.add(attachDialogStyler(dialog, this.themeService)); - dialog.show().then(() => { + dialog.show().then((dialogResult) => { if (typeof onDidCancel === 'function') { - onDidCancel(); + onDidCancel(dialogResult.button); } dispose(dialog); From 0f73473c08055054f317c1c94502f7f39fdbb164 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 22 Aug 2019 17:46:15 -0700 Subject: [PATCH 019/163] Add deprecation warning for rootPath #69335 --- src/vs/workbench/api/common/extHost.api.impl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 0696b5ec82d..09e2b5980b2 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -541,6 +541,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I // namespace: workspace const workspace: typeof vscode.workspace = { get rootPath() { + console.warn(`[Deprecation Warning] 'workspace.rootPath' is deprecated and should no longer be used. Please use 'workspace.workspaceFolders' instead. (${extension.publisher}.${extension.name})`); return extHostWorkspace.getPath(); }, set rootPath(value) { From 7fedec2e5d144c4071be66ed0938eb30b89b54c5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 07:27:41 +0200 Subject: [PATCH 020/163] update distro --- package.json | 2 +- src/vs/platform/product/common/product.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 5cc5aff8076..0add763ee42 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "5af2b9835ba8caee9e5057d2272ba4c90fcd0d36", + "distro": "d54cb1c81bc4458276bd38093586ee3566539d2d", "author": { "name": "Microsoft Corporation" }, diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts index 0a3b1f75c89..7122abcc6f5 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -85,7 +85,6 @@ export interface IProductConfiguration { readonly 'linux-x64': string; readonly 'darwin': string; }; - readonly logUploaderUrl: string; readonly portable?: string; readonly uiExtensions?: readonly string[]; } From 01ca032a64107ae6e6d19f06197e4efd994f85a6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 07:52:46 +0200 Subject: [PATCH 021/163] fix exploration merge --- build/azure-pipelines/exploration-build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/azure-pipelines/exploration-build.yml b/build/azure-pipelines/exploration-build.yml index 797c4b5fce0..7def5e60047 100644 --- a/build/azure-pipelines/exploration-build.yml +++ b/build/azure-pipelines/exploration-build.yml @@ -13,10 +13,20 @@ steps: inputs: versionSpec: "10.15.1" +- task: AzureKeyVault@1 + displayName: 'Azure Key Vault: Get Secrets' + inputs: + azureSubscription: 'vscode-builds-subscription' + KeyVaultName: vscode + - script: | set -e cat << EOF > ~/.netrc + machine github.com + login vscode + password $(github-distro-mixin-password) + EOF git config user.email "vscode@microsoft.com" git config user.name "VSCode" From eb2c35c562374d7cc8ae3b4de736cb6057bf52bc Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 07:56:23 +0200 Subject: [PATCH 022/163] build - merge to electron-6.0.x automatically --- build/azure-pipelines/exploration-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/exploration-build.yml b/build/azure-pipelines/exploration-build.yml index 7def5e60047..39a8f23b262 100644 --- a/build/azure-pipelines/exploration-build.yml +++ b/build/azure-pipelines/exploration-build.yml @@ -31,10 +31,10 @@ steps: git config user.email "vscode@microsoft.com" git config user.name "VSCode" - git checkout origin/ben/electron-test + git checkout origin/electron-6.0.x git merge origin/master # Push master branch into exploration branch - git push origin HEAD:ben/electron-test + git push origin HEAD:electron-6.0.x displayName: Sync & Merge Exploration From ce32c3aab877a77b239898eef6bd5a085e71bf43 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Thu, 22 Aug 2019 23:07:30 -0700 Subject: [PATCH 023/163] Add a few more trusted domains --- src/vs/workbench/contrib/url/common/url.contribution.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/url/common/url.contribution.ts b/src/vs/workbench/contrib/url/common/url.contribution.ts index 9882864d0ef..af92998139d 100644 --- a/src/vs/workbench/contrib/url/common/url.contribution.ts +++ b/src/vs/workbench/contrib/url/common/url.contribution.ts @@ -52,7 +52,10 @@ Registry.as(ActionExtensions.WorkbenchActions).registe const DEAFULT_TRUSTED_DOMAINS = [ 'https://code.visualstudio.com', - 'https://go.microsoft.com' + 'https://go.microsoft.com', + 'https://github.com', + 'https://marketplace.visualstudio.com', + 'https://vscode-auth.github.com' ]; const configureTrustedDomainsHandler = async ( From 8b0bc473cd51f38224f9e051b95c9ed869cbaca6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 08:09:34 +0200 Subject: [PATCH 024/163] CompletionItemKindModifier -> CompletionItemKindTag, #23927 --- src/vs/editor/common/modes.ts | 4 ++-- src/vs/editor/common/standalone/standaloneEnums.ts | 2 +- src/vs/editor/contrib/suggest/suggestWidget.ts | 4 ++-- .../editor/standalone/browser/standaloneLanguages.ts | 2 +- src/vs/monaco.d.ts | 4 ++-- src/vs/vscode.proposed.d.ts | 6 +++--- .../api/browser/mainThreadLanguageFeatures.ts | 2 +- src/vs/workbench/api/common/extHost.api.impl.ts | 2 +- src/vs/workbench/api/common/extHost.protocol.ts | 2 +- src/vs/workbench/api/common/extHostLanguageFeatures.ts | 4 ++-- src/vs/workbench/api/common/extHostTypeConverters.ts | 10 +++++----- src/vs/workbench/api/common/extHostTypes.ts | 4 ++-- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 7060c53fdfc..9bf53989111 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -367,7 +367,7 @@ export let completionKindFromString: { }; })(); -export const enum CompletionItemKindModifier { +export const enum CompletionItemKindTag { Deprecated = 1 } @@ -404,7 +404,7 @@ export interface CompletionItem { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindModifier?: Set; + kindTags?: Set; /** * A human-readable string with additional information * about this item, like type or symbol information. diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index 4aa60848562..a5f3bbe5802 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -581,7 +581,7 @@ export enum CompletionItemKind { Snippet = 25 } -export enum CompletionItemKindModifier { +export enum CompletionItemKindTag { Deprecated = 1 } diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index cdad5fdb234..cb0260ecc60 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -30,7 +30,7 @@ import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { TimeoutTimer, CancelablePromise, createCancelablePromise, disposableTimeout } from 'vs/base/common/async'; -import { CompletionItemKind, completionKindToCssClass, CompletionItemKindModifier } from 'vs/editor/common/modes'; +import { CompletionItemKind, completionKindToCssClass, CompletionItemKindTag } from 'vs/editor/common/modes'; import { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -193,7 +193,7 @@ class Renderer implements IListRenderer ]; } - if (suggestion.kindModifier && suggestion.kindModifier.has(CompletionItemKindModifier.Deprecated)) { + if (suggestion.kindTags && suggestion.kindTags.has(CompletionItemKindTag.Deprecated)) { labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']); labelOptions.matches = []; } diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index 0576af462b1..a8bada84fbf 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -562,7 +562,7 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages { // enums DocumentHighlightKind: standaloneEnums.DocumentHighlightKind, CompletionItemKind: standaloneEnums.CompletionItemKind, - CompletionItemKindModifier: standaloneEnums.CompletionItemKindModifier, + CompletionItemKindTag: standaloneEnums.CompletionItemKindTag, CompletionItemInsertTextRule: standaloneEnums.CompletionItemInsertTextRule, SymbolKind: standaloneEnums.SymbolKind, SymbolKindTag: standaloneEnums.SymbolKindTag, diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 1d2b95c1694..79c36b8b67e 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4786,7 +4786,7 @@ declare namespace monaco.languages { Snippet = 25 } - export enum CompletionItemKindModifier { + export enum CompletionItemKindTag { Deprecated = 1 } @@ -4822,7 +4822,7 @@ declare namespace monaco.languages { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindModifier?: Set; + kindTags?: Set; /** * A human-readable string with additional information * about this item, like type or symbol information. diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 8f2d4d5cc94..cdc3ddaeb63 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1138,9 +1138,9 @@ declare module 'vscode' { //#endregion - //#region Joh - CompletionItemKindModifier, https://github.com/microsoft/vscode/issues/23927 + //#region Joh - CompletionItemKindTag, https://github.com/microsoft/vscode/issues/23927 - export enum CompletionItemKindModifier { + export enum CompletionItemKindTag { Deprecated = 1 } @@ -1149,7 +1149,7 @@ declare module 'vscode' { /** * */ - kind2?: CompletionItemKind | { base: CompletionItemKind, modifier: ReadonlyArray }; + kind2?: CompletionItemKind | { kind: CompletionItemKind, tags: ReadonlyArray }; } //#endregion diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 0feaf4b3599..cbc61e52916 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -331,7 +331,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return { label: data.a, kind: data.b, - kindModifier: data.n && fromArray(data.n), + kindTags: data.n && fromArray(data.n), detail: data.c, documentation: data.d, sortText: data.e, diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 09e2b5980b2..752ebbb3065 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -808,7 +808,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I CommentMode: extHostTypes.CommentMode, CompletionItem: extHostTypes.CompletionItem, CompletionItemKind: extHostTypes.CompletionItemKind, - CompletionItemKindModifier: extHostTypes.CompletionItemKindModifier, + CompletionItemKindTag: extHostTypes.CompletionItemKindTag, CompletionList: extHostTypes.CompletionList, CompletionTriggerKind: extHostTypes.CompletionTriggerKind, ConfigurationTarget: extHostTypes.ConfigurationTarget, diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index d6ca16a738c..0d840a6c9db 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -935,7 +935,7 @@ export interface ISuggestDataDto { k/* commitCharacters */?: string[]; l/* additionalTextEdits */?: ISingleEditOperation[]; m/* command */?: modes.Command; - n/* kindModifier */?: modes.CompletionItemKindModifier[]; + n/* kindModifier */?: modes.CompletionItemKindTag[]; // not-standard x?: ChainedCacheId; } diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index a39d24d756a..f31350abe8c 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -741,8 +741,8 @@ class SuggestAdapter { // kind2 if (typeof item.kind2 === 'object') { - result.b = typeConvert.CompletionItemKind.from(item.kind2.base); - result.n = item.kind2.modifier.map(typeConvert.CompletionItemKindModifier.from); + result.b = typeConvert.CompletionItemKind.from(item.kind2.kind); + result.n = item.kind2.tags.map(typeConvert.CompletionItemKindTag.from); } // 'insertText'-logic diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index 0a3819ccd83..47d58850a58 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -682,17 +682,17 @@ export namespace CompletionContext { } } -export namespace CompletionItemKindModifier { +export namespace CompletionItemKindTag { - export function from(kind: types.CompletionItemKindModifier): modes.CompletionItemKindModifier { + export function from(kind: types.CompletionItemKindTag): modes.CompletionItemKindTag { switch (kind) { - case types.CompletionItemKindModifier.Deprecated: return modes.CompletionItemKindModifier.Deprecated; + case types.CompletionItemKindTag.Deprecated: return modes.CompletionItemKindTag.Deprecated; } } - export function to(kind: modes.CompletionItemKindModifier): types.CompletionItemKindModifier { + export function to(kind: modes.CompletionItemKindTag): types.CompletionItemKindTag { switch (kind) { - case modes.CompletionItemKindModifier.Deprecated: return types.CompletionItemKindModifier.Deprecated; + case modes.CompletionItemKindTag.Deprecated: return types.CompletionItemKindTag.Deprecated; } } } diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 53031ca7ca1..285bf8f69fc 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1308,7 +1308,7 @@ export enum CompletionItemKind { TypeParameter = 24 } -export enum CompletionItemKindModifier { +export enum CompletionItemKindTag { Deprecated = 1, } @@ -1317,7 +1317,7 @@ export class CompletionItem implements vscode.CompletionItem { label: string; kind?: CompletionItemKind; - kind2?: CompletionItemKind | { base: CompletionItemKind, modifier: CompletionItemKindModifier[] }; + kind2?: CompletionItemKind | { kind: CompletionItemKind, tags: CompletionItemKindTag[] }; detail?: string; documentation?: string | MarkdownString; sortText?: string; From f7fe25dcfc77582f7dc061e8467a4afa2022661a Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 08:46:25 +0200 Subject: [PATCH 025/163] use ReadonlyArray for tags, #50972 --- src/vs/base/common/map.ts | 8 -------- src/vs/editor/common/modes.ts | 4 ++-- src/vs/editor/contrib/suggest/suggestWidget.ts | 2 +- src/vs/monaco.d.ts | 4 ++-- .../workbench/api/browser/mainThreadLanguageFeatures.ts | 3 +-- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index eee70e82684..277ab50bb88 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -8,14 +8,6 @@ import { CharCode } from 'vs/base/common/charCode'; import { Iterator, IteratorResult, FIN } from './iterator'; -export function fromArray(array: readonly T[]): Set { - const result = new Set(); - for (const element of array) { - result.add(element); - } - return result; -} - export function values(set: Set): V[]; export function values(map: Map): V[]; export function values(forEachable: { forEach(callback: (value: V, ...more: any[]) => any): void }): V[] { diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 9bf53989111..b5428b88403 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -404,7 +404,7 @@ export interface CompletionItem { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindTags?: Set; + kindTags?: ReadonlyArray; /** * A human-readable string with additional information * about this item, like type or symbol information. @@ -913,7 +913,7 @@ export interface DocumentSymbol { name: string; detail: string; kind: SymbolKind; - kindTags: SymbolKindTag[]; + kindTags: ReadonlyArray; containerName?: string; range: IRange; selectionRange: IRange; diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index cb0260ecc60..8a0c10b205c 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -193,7 +193,7 @@ class Renderer implements IListRenderer ]; } - if (suggestion.kindTags && suggestion.kindTags.has(CompletionItemKindTag.Deprecated)) { + if (suggestion.kindTags && suggestion.kindTags.indexOf(CompletionItemKindTag.Deprecated) >= 0) { labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']); labelOptions.matches = []; } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 79c36b8b67e..b55c54c2aa4 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4822,7 +4822,7 @@ declare namespace monaco.languages { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindTags?: Set; + kindTags?: ReadonlyArray; /** * A human-readable string with additional information * about this item, like type or symbol information. @@ -5240,7 +5240,7 @@ declare namespace monaco.languages { name: string; detail: string; kind: SymbolKind; - kindTags: SymbolKindTag[]; + kindTags: ReadonlyArray; containerName?: string; range: IRange; selectionRange: IRange; diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index cbc61e52916..d9c397890d0 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -21,7 +21,6 @@ import { Selection } from 'vs/editor/common/core/selection'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import * as callh from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; import { mixin } from 'vs/base/common/objects'; -import { fromArray } from 'vs/base/common/map'; @extHostNamedCustomer(MainContext.MainThreadLanguageFeatures) export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesShape { @@ -331,7 +330,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return { label: data.a, kind: data.b, - kindTags: data.n && fromArray(data.n), + kindTags: data.n, detail: data.c, documentation: data.d, sortText: data.e, From 62c31b71542b996e2adc7455448ca0607420055e Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 09:03:18 +0200 Subject: [PATCH 026/163] add SymbolTag, make tag a propertiy, #23927 --- src/vs/editor/common/modes.ts | 8 ++--- .../common/standalone/standaloneEnums.ts | 4 +-- .../contrib/documentSymbols/outlineTree.ts | 4 +-- .../documentSymbols/test/outlineModel.test.ts | 2 +- src/vs/editor/contrib/quickOpen/quickOpen.ts | 2 +- .../editor/contrib/suggest/suggestWidget.ts | 4 +-- .../standalone/browser/standaloneLanguages.ts | 4 +-- src/vs/monaco.d.ts | 8 ++--- src/vs/vscode.proposed.d.ts | 17 ++++++++-- .../api/browser/mainThreadLanguageFeatures.ts | 2 +- .../workbench/api/common/extHost.api.impl.ts | 3 +- .../workbench/api/common/extHost.protocol.ts | 2 +- .../api/common/extHostLanguageFeatures.ts | 9 ++--- .../api/common/extHostTypeConverters.ts | 33 +++++++++++++++---- src/vs/workbench/api/common/extHostTypes.ts | 9 +++-- 15 files changed, 71 insertions(+), 40 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index b5428b88403..cc2adefb59e 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -367,7 +367,7 @@ export let completionKindFromString: { }; })(); -export const enum CompletionItemKindTag { +export const enum CompletionItemTag { Deprecated = 1 } @@ -404,7 +404,7 @@ export interface CompletionItem { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindTags?: ReadonlyArray; + tags?: ReadonlyArray; /** * A human-readable string with additional information * about this item, like type or symbol information. @@ -867,7 +867,7 @@ export const enum SymbolKind { TypeParameter = 25 } -export const enum SymbolKindTag { +export const enum SymbolTag { Deprecated = 1, } @@ -913,7 +913,7 @@ export interface DocumentSymbol { name: string; detail: string; kind: SymbolKind; - kindTags: ReadonlyArray; + tags: ReadonlyArray; containerName?: string; range: IRange; selectionRange: IRange; diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index a5f3bbe5802..a705c132478 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -581,7 +581,7 @@ export enum CompletionItemKind { Snippet = 25 } -export enum CompletionItemKindTag { +export enum CompletionItemTag { Deprecated = 1 } @@ -662,6 +662,6 @@ export enum SymbolKind { TypeParameter = 25 } -export enum SymbolKindTag { +export enum SymbolTag { Deprecated = 1 } \ No newline at end of file diff --git a/src/vs/editor/contrib/documentSymbols/outlineTree.ts b/src/vs/editor/contrib/documentSymbols/outlineTree.ts index 6df7d87e2ee..84ac8bb704c 100644 --- a/src/vs/editor/contrib/documentSymbols/outlineTree.ts +++ b/src/vs/editor/contrib/documentSymbols/outlineTree.ts @@ -12,7 +12,7 @@ import { createMatches, FuzzyScore } from 'vs/base/common/filters'; import 'vs/css!./media/outlineTree'; import 'vs/css!./media/symbol-icons'; import { Range } from 'vs/editor/common/core/range'; -import { SymbolKind, symbolKindToCssClass, SymbolKindTag } from 'vs/editor/common/modes'; +import { SymbolKind, symbolKindToCssClass, SymbolTag } from 'vs/editor/common/modes'; import { OutlineElement, OutlineGroup, OutlineModel } from 'vs/editor/contrib/documentSymbols/outlineModel'; import { localize } from 'vs/nls'; import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel'; @@ -127,7 +127,7 @@ export class OutlineElementRenderer implements ITreeRenderer= 0) { + if (element.symbol.tags.indexOf(SymbolTag.Deprecated) >= 0) { options.extraClasses.push(`deprecated`); options.matches = []; } diff --git a/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts b/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts index 9622de2716e..b41a7f8dd8f 100644 --- a/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts +++ b/src/vs/editor/contrib/documentSymbols/test/outlineModel.test.ts @@ -76,7 +76,7 @@ suite('OutlineModel', function () { name, detail: 'fake', kind: SymbolKind.Boolean, - kindTags: [], + tags: [], selectionRange: range, range: range }; diff --git a/src/vs/editor/contrib/quickOpen/quickOpen.ts b/src/vs/editor/contrib/quickOpen/quickOpen.ts index 919e3eae792..e1e14f108b3 100644 --- a/src/vs/editor/contrib/quickOpen/quickOpen.ts +++ b/src/vs/editor/contrib/quickOpen/quickOpen.ts @@ -51,7 +51,7 @@ function flatten(bucket: DocumentSymbol[], entries: DocumentSymbol[], overrideCo for (let entry of entries) { bucket.push({ kind: entry.kind, - kindTags: [], + tags: [], name: entry.name, detail: entry.detail, containerName: entry.containerName || overrideContainerLabel, diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index 8a0c10b205c..889b27e0bfa 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -30,7 +30,7 @@ import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { TimeoutTimer, CancelablePromise, createCancelablePromise, disposableTimeout } from 'vs/base/common/async'; -import { CompletionItemKind, completionKindToCssClass, CompletionItemKindTag } from 'vs/editor/common/modes'; +import { CompletionItemKind, completionKindToCssClass, CompletionItemTag } from 'vs/editor/common/modes'; import { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -193,7 +193,7 @@ class Renderer implements IListRenderer ]; } - if (suggestion.kindTags && suggestion.kindTags.indexOf(CompletionItemKindTag.Deprecated) >= 0) { + if (suggestion.tags && suggestion.tags.indexOf(CompletionItemTag.Deprecated) >= 0) { labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']); labelOptions.matches = []; } diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index a8bada84fbf..1818394dfdc 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -562,10 +562,10 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages { // enums DocumentHighlightKind: standaloneEnums.DocumentHighlightKind, CompletionItemKind: standaloneEnums.CompletionItemKind, - CompletionItemKindTag: standaloneEnums.CompletionItemKindTag, + CompletionItemTag: standaloneEnums.CompletionItemTag, CompletionItemInsertTextRule: standaloneEnums.CompletionItemInsertTextRule, SymbolKind: standaloneEnums.SymbolKind, - SymbolKindTag: standaloneEnums.SymbolKindTag, + SymbolTag: standaloneEnums.SymbolTag, IndentAction: standaloneEnums.IndentAction, CompletionTriggerKind: standaloneEnums.CompletionTriggerKind, SignatureHelpTriggerKind: standaloneEnums.SignatureHelpTriggerKind, diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index b55c54c2aa4..4291958ce59 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4786,7 +4786,7 @@ declare namespace monaco.languages { Snippet = 25 } - export enum CompletionItemKindTag { + export enum CompletionItemTag { Deprecated = 1 } @@ -4822,7 +4822,7 @@ declare namespace monaco.languages { * A modifier to the `kind` which affect how the item * is rendered, e.g. Deprecated is rendered with a strikeout */ - kindTags?: ReadonlyArray; + tags?: ReadonlyArray; /** * A human-readable string with additional information * about this item, like type or symbol information. @@ -5232,7 +5232,7 @@ declare namespace monaco.languages { TypeParameter = 25 } - export enum SymbolKindTag { + export enum SymbolTag { Deprecated = 1 } @@ -5240,7 +5240,7 @@ declare namespace monaco.languages { name: string; detail: string; kind: SymbolKind; - kindTags: ReadonlyArray; + tags: ReadonlyArray; containerName?: string; range: IRange; selectionRange: IRange; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index cdc3ddaeb63..42c0642ec1c 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1138,9 +1138,20 @@ declare module 'vscode' { //#endregion - //#region Joh - CompletionItemKindTag, https://github.com/microsoft/vscode/issues/23927 + //#region Joh - CompletionItemTag, https://github.com/microsoft/vscode/issues/23927 - export enum CompletionItemKindTag { + export enum SymbolTag { + Deprecated = 1 + } + + export interface DocumentSymbol { + /** + * + */ + tags?: ReadonlyArray; + } + + export enum CompletionItemTag { Deprecated = 1 } @@ -1149,7 +1160,7 @@ declare module 'vscode' { /** * */ - kind2?: CompletionItemKind | { kind: CompletionItemKind, tags: ReadonlyArray }; + tags?: ReadonlyArray; } //#endregion diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index d9c397890d0..966a740a4f1 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -330,7 +330,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return { label: data.a, kind: data.b, - kindTags: data.n, + tags: data.n, detail: data.c, documentation: data.d, sortText: data.e, diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 752ebbb3065..9b3fbf50e0b 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -808,7 +808,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I CommentMode: extHostTypes.CommentMode, CompletionItem: extHostTypes.CompletionItem, CompletionItemKind: extHostTypes.CompletionItemKind, - CompletionItemKindTag: extHostTypes.CompletionItemKindTag, + CompletionItemTag: extHostTypes.CompletionItemTag, CompletionList: extHostTypes.CompletionList, CompletionTriggerKind: extHostTypes.CompletionTriggerKind, ConfigurationTarget: extHostTypes.ConfigurationTarget, @@ -863,6 +863,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I StatusBarAlignment: extHostTypes.StatusBarAlignment, SymbolInformation: extHostTypes.SymbolInformation, SymbolKind: extHostTypes.SymbolKind, + SymbolTag: extHostTypes.SymbolTag, Task: extHostTypes.Task, Task2: extHostTypes.Task, TaskGroup: extHostTypes.TaskGroup, diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 0d840a6c9db..01955cf7dfa 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -935,7 +935,7 @@ export interface ISuggestDataDto { k/* commitCharacters */?: string[]; l/* additionalTextEdits */?: ISingleEditOperation[]; m/* command */?: modes.Command; - n/* kindModifier */?: modes.CompletionItemKindTag[]; + n/* kindModifier */?: modes.CompletionItemTag[]; // not-standard x?: ChainedCacheId; } diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index f31350abe8c..bcd098ec1b2 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -70,7 +70,7 @@ class DocumentSymbolAdapter { const element = { name: info.name || '!!MISSING: name!!', kind: typeConvert.SymbolKind.from(info.kind), - kindTags: [], + tags: [], detail: undefined!, // Strict null override — avoid changing behavior containerName: info.containerName, range: typeConvert.Range.from(info.location.range), @@ -728,6 +728,7 @@ class SuggestAdapter { // a: item.label, b: typeConvert.CompletionItemKind.from(item.kind), + n: item.tags && item.tags.map(typeConvert.CompletionItemTag.from), c: item.detail, d: typeof item.documentation === 'undefined' ? undefined : typeConvert.MarkdownString.fromStrict(item.documentation), e: item.sortText, @@ -739,12 +740,6 @@ class SuggestAdapter { m: this._commands.toInternal(item.command, disposables), }; - // kind2 - if (typeof item.kind2 === 'object') { - result.b = typeConvert.CompletionItemKind.from(item.kind2.kind); - result.n = item.kind2.tags.map(typeConvert.CompletionItemKindTag.from); - } - // 'insertText'-logic if (item.textEdit) { result.h = item.textEdit.newText; diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index 47d58850a58..7f8d0ea38b4 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -28,7 +28,7 @@ import * as marked from 'vs/base/common/marked/marked'; import { parse } from 'vs/base/common/marshalling'; import { cloneAndChange } from 'vs/base/common/objects'; import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log'; -import { coalesce } from 'vs/base/common/arrays'; +import { coalesce, isNonEmptyArray } from 'vs/base/common/arrays'; import { RenderLineNumbersType } from 'vs/editor/common/config/editorOptions'; export interface PositionLike { @@ -556,6 +556,21 @@ export namespace SymbolKind { } } +export namespace SymbolTag { + + export function from(kind: types.SymbolTag): modes.SymbolTag { + switch (kind) { + case types.SymbolTag.Deprecated: return modes.SymbolTag.Deprecated; + } + } + + export function to(kind: modes.SymbolTag): types.SymbolTag { + switch (kind) { + case modes.SymbolTag.Deprecated: return types.SymbolTag.Deprecated; + } + } +} + export namespace WorkspaceSymbol { export function from(info: vscode.SymbolInformation): search.IWorkspaceSymbol { return { @@ -583,7 +598,7 @@ export namespace DocumentSymbol { range: Range.from(info.range), selectionRange: Range.from(info.selectionRange), kind: SymbolKind.from(info.kind), - kindTags: [] + tags: info.tags ? info.tags.map(SymbolTag.from) : [] }; if (info.children) { result.children = info.children.map(from); @@ -598,6 +613,9 @@ export namespace DocumentSymbol { Range.to(info.range), Range.to(info.selectionRange), ); + if (isNonEmptyArray(info.tags)) { + result.tags = info.tags.map(SymbolTag.to); + } if (info.children) { result.children = info.children.map(to) as any; } @@ -682,17 +700,17 @@ export namespace CompletionContext { } } -export namespace CompletionItemKindTag { +export namespace CompletionItemTag { - export function from(kind: types.CompletionItemKindTag): modes.CompletionItemKindTag { + export function from(kind: types.CompletionItemTag): modes.CompletionItemTag { switch (kind) { - case types.CompletionItemKindTag.Deprecated: return modes.CompletionItemKindTag.Deprecated; + case types.CompletionItemTag.Deprecated: return modes.CompletionItemTag.Deprecated; } } - export function to(kind: modes.CompletionItemKindTag): types.CompletionItemKindTag { + export function to(kind: modes.CompletionItemTag): types.CompletionItemTag { switch (kind) { - case modes.CompletionItemKindTag.Deprecated: return types.CompletionItemKindTag.Deprecated; + case modes.CompletionItemTag.Deprecated: return types.CompletionItemTag.Deprecated; } } } @@ -768,6 +786,7 @@ export namespace CompletionItem { const result = new types.CompletionItem(suggestion.label); result.insertText = suggestion.insertText; result.kind = CompletionItemKind.to(suggestion.kind); + result.tags = suggestion.tags && suggestion.tags.map(CompletionItemTag.to); result.detail = suggestion.detail; result.documentation = htmlContent.isMarkdownString(suggestion.documentation) ? MarkdownString.to(suggestion.documentation) : suggestion.documentation; result.sortText = suggestion.sortText; diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 285bf8f69fc..e14c4117f9e 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -979,6 +979,10 @@ export enum SymbolKind { TypeParameter = 25 } +export enum SymbolTag { + Deprecated = 1, +} + @es5ClassCompat export class SymbolInformation { @@ -1041,6 +1045,7 @@ export class DocumentSymbol { name: string; detail: string; kind: SymbolKind; + tags?: SymbolTag[]; range: Range; selectionRange: Range; children: DocumentSymbol[]; @@ -1308,7 +1313,7 @@ export enum CompletionItemKind { TypeParameter = 24 } -export enum CompletionItemKindTag { +export enum CompletionItemTag { Deprecated = 1, } @@ -1317,7 +1322,7 @@ export class CompletionItem implements vscode.CompletionItem { label: string; kind?: CompletionItemKind; - kind2?: CompletionItemKind | { kind: CompletionItemKind, tags: CompletionItemKindTag[] }; + tags?: CompletionItemTag[]; detail?: string; documentation?: string | MarkdownString; sortText?: string; From cc845dc5866158ca0d51bb8bf78b58de7460684e Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 23 Aug 2019 09:28:04 +0200 Subject: [PATCH 027/163] Update dotnet tasks template --- src/vs/workbench/contrib/tasks/common/taskTemplates.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/tasks/common/taskTemplates.ts b/src/vs/workbench/contrib/tasks/common/taskTemplates.ts index a0412d55268..c367ede9ab7 100644 --- a/src/vs/workbench/contrib/tasks/common/taskTemplates.ts +++ b/src/vs/workbench/contrib/tasks/common/taskTemplates.ts @@ -27,9 +27,10 @@ const dotnetBuild: TaskEntry = { '\t"tasks": [', '\t\t{', '\t\t\t"label": "build",', - '\t\t\t"command": "dotnet build",', + '\t\t\t"command": "dotnet",', '\t\t\t"type": "shell",', '\t\t\t"args": [', + '\t\t\t\t"build",', '\t\t\t\t// Ask dotnet build to generate full paths for file names.', '\t\t\t\t"/property:GenerateFullPaths=true",', '\t\t\t\t// Do not generate summary otherwise it leads to duplicate errors in Problems panel', From 5f5fce58809fab2a3fb3e10cac191da9b76f5b87 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 10:22:17 +0200 Subject: [PATCH 028/163] web - switch back to window.onbeforeunload as otherwise the page unload can no longer be prevented --- src/vs/platform/lifecycle/browser/lifecycleService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/lifecycle/browser/lifecycleService.ts b/src/vs/platform/lifecycle/browser/lifecycleService.ts index 79301acb261..bd34fc59e8f 100644 --- a/src/vs/platform/lifecycle/browser/lifecycleService.ts +++ b/src/vs/platform/lifecycle/browser/lifecycleService.ts @@ -8,7 +8,6 @@ import { ILogService } from 'vs/platform/log/common/log'; import { AbstractLifecycleService } from 'vs/platform/lifecycle/common/lifecycleService'; import { localize } from 'vs/nls'; import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { addDisposableListener, EventType } from 'vs/base/browser/dom'; export class BrowserLifecycleService extends AbstractLifecycleService { @@ -23,7 +22,9 @@ export class BrowserLifecycleService extends AbstractLifecycleService { } private registerListeners(): void { - addDisposableListener(window, EventType.BEFORE_UNLOAD, () => this.onBeforeUnload()); + // Note: we cannot change this to window.addEventListener('beforeUnload') + // because it seems that mechanism does not allow for preventing the unload + window.onbeforeunload = () => this.onBeforeUnload(); } private onBeforeUnload(): string | null { From 87c7042e1d94dd5ed78f543fc319cf9ef48a8c89 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 10:25:39 +0200 Subject: [PATCH 029/163] web - we need to prevent unload when we detect a pending save or auto save because long running operations are not allowed --- .../workbench/services/textfile/browser/textFileService.ts | 6 +++++- .../services/textfile/common/textFileEditorModel.ts | 5 +++++ src/vs/workbench/services/textfile/common/textfiles.ts | 7 ++++++- .../services/textfile/test/textFileEditorModel.test.ts | 7 ++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/services/textfile/browser/textFileService.ts b/src/vs/workbench/services/textfile/browser/textFileService.ts index 3d2d91f5996..ed7f5273046 100644 --- a/src/vs/workbench/services/textfile/browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/browser/textFileService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { TextFileService } from 'vs/workbench/services/textfile/common/textFileService'; -import { ITextFileService, IResourceEncodings, IResourceEncoding } from 'vs/workbench/services/textfile/common/textfiles'; +import { ITextFileService, IResourceEncodings, IResourceEncoding, ModelState } from 'vs/workbench/services/textfile/common/textfiles'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; import { Schemas } from 'vs/base/common/network'; @@ -26,6 +26,10 @@ export class BrowserTextFileService extends TextFileService { } private doBeforeShutdownSync(): boolean { + if (this.models.getAll().some(model => model.hasState(ModelState.PENDING_SAVE) || model.hasState(ModelState.PENDING_AUTO_SAVE))) { + return true; // files are pending to be saved: veto + } + const dirtyResources = this.getDirty(); if (!dirtyResources.length) { return false; // no dirty: no veto diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 4fa61e19c83..bd6332610d8 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -593,6 +593,9 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // Create new save timer and store it for disposal as needed const handle = setTimeout(() => { + // Clear the timeout now that we are running + this.autoSaveDisposable.clear(); + // Only trigger save if the version id has not changed meanwhile if (versionId === this.versionId) { this.doSave(versionId, { reason: SaveReason.AUTO }); // Very important here to not return the promise because if the timeout promise is canceled it will bubble up the error otherwise - do not change @@ -941,6 +944,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil return this.inOrphanMode; case ModelState.PENDING_SAVE: return this.saveSequentializer.hasPendingSave(); + case ModelState.PENDING_AUTO_SAVE: + return !!this.autoSaveDisposable.value; case ModelState.SAVED: return !this.dirty; } diff --git a/src/vs/workbench/services/textfile/common/textfiles.ts b/src/vs/workbench/services/textfile/common/textfiles.ts index 02956fd1cdd..4f770994393 100644 --- a/src/vs/workbench/services/textfile/common/textfiles.ts +++ b/src/vs/workbench/services/textfile/common/textfiles.ts @@ -248,10 +248,15 @@ export const enum ModelState { DIRTY, /** - * A model is transitioning from dirty to saved. + * A model is currently being saved but this operation has not completed yet. */ PENDING_SAVE, + /** + * A model is marked for being saved after a specific timeout. + */ + PENDING_AUTO_SAVE, + /** * A model is in conflict mode when changes cannot be saved because the * underlying file has changed. Models in conflict mode are always dirty. diff --git a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts b/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts index b5609d42d32..629e19c6b77 100644 --- a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts @@ -52,6 +52,7 @@ suite('Files - TextFileEditorModel', () => { model.textEditorModel!.setValue('bar'); assert.ok(getLastModifiedTime(model) <= Date.now()); + assert.ok(model.hasState(ModelState.DIRTY)); let savedEvent = false; model.onDidStateChange(e => { @@ -60,9 +61,13 @@ suite('Files - TextFileEditorModel', () => { } }); - await model.save(); + const pendingSave = model.save(); + assert.ok(model.hasState(ModelState.PENDING_SAVE)); + + await pendingSave; assert.ok(model.getLastSaveAttemptTime() <= Date.now()); + assert.ok(model.hasState(ModelState.SAVED)); assert.ok(!model.isDirty()); assert.ok(savedEvent); From 043a06542d75a4ab42885cca9d3f072339105a60 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 10:25:15 +0200 Subject: [PATCH 030/163] add SymbolInformation.tags, render deprecated items in quick outline and workspace symbol search --- .../documentSymbols/media/outlineTree.css | 5 -- .../documentSymbols/media/symbol-icons.css | 5 ++ src/vs/editor/contrib/quickOpen/quickOpen.ts | 2 +- src/vs/vscode.proposed.d.ts | 7 +++ .../api/common/extHostLanguageFeatures.ts | 4 +- .../api/common/extHostTypeConverters.ts | 5 +- src/vs/workbench/api/common/extHostTypes.ts | 1 + .../quickopen/browser/gotoSymbolHandler.ts | 49 +++++++++---------- .../search/browser/openSymbolHandler.ts | 9 +++- .../workbench/contrib/search/common/search.ts | 3 +- 10 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/vs/editor/contrib/documentSymbols/media/outlineTree.css b/src/vs/editor/contrib/documentSymbols/media/outlineTree.css index 3d6454a1556..ebc2389a0e2 100644 --- a/src/vs/editor/contrib/documentSymbols/media/outlineTree.css +++ b/src/vs/editor/contrib/documentSymbols/media/outlineTree.css @@ -20,11 +20,6 @@ color: var(--outline-element-color); } -.monaco-list .outline-element .deprecated { - text-decoration: line-through; - opacity: 0.66; -} - .monaco-tree .monaco-tree-row.focused .outline-element .outline-element-detail { visibility: inherit; } diff --git a/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css b/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css index 4e312f7dfe6..0504a233a63 100644 --- a/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css +++ b/src/vs/editor/contrib/documentSymbols/media/symbol-icons.css @@ -3,6 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +.monaco-workbench .monaco-icon-label.deprecated { + text-decoration: line-through; + opacity: 0.66; +} + .monaco-workbench .symbol-icon.inline { background-position: left center; padding-left: 20px; diff --git a/src/vs/editor/contrib/quickOpen/quickOpen.ts b/src/vs/editor/contrib/quickOpen/quickOpen.ts index e1e14f108b3..fb054ae7f61 100644 --- a/src/vs/editor/contrib/quickOpen/quickOpen.ts +++ b/src/vs/editor/contrib/quickOpen/quickOpen.ts @@ -51,7 +51,7 @@ function flatten(bucket: DocumentSymbol[], entries: DocumentSymbol[], overrideCo for (let entry of entries) { bucket.push({ kind: entry.kind, - tags: [], + tags: entry.tags, name: entry.name, detail: entry.detail, containerName: entry.containerName || overrideContainerLabel, diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 42c0642ec1c..4a15411821b 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1144,6 +1144,13 @@ declare module 'vscode' { Deprecated = 1 } + export interface SymbolInformation { + /** + * + */ + tags?: ReadonlyArray; + } + export interface DocumentSymbol { /** * diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index bcd098ec1b2..6efdd4d5e85 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -70,8 +70,8 @@ class DocumentSymbolAdapter { const element = { name: info.name || '!!MISSING: name!!', kind: typeConvert.SymbolKind.from(info.kind), - tags: [], - detail: undefined!, // Strict null override — avoid changing behavior + tags: info.tags && info.tags.map(typeConvert.SymbolTag.from), + detail: '', containerName: info.containerName, range: typeConvert.Range.from(info.location.range), selectionRange: typeConvert.Range.from(info.location.range), diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index 7f8d0ea38b4..6a050937ddb 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -576,17 +576,20 @@ export namespace WorkspaceSymbol { return { name: info.name, kind: SymbolKind.from(info.kind), + tags: info.tags && info.tags.map(SymbolTag.from), containerName: info.containerName, location: location.from(info.location) }; } export function to(info: search.IWorkspaceSymbol): types.SymbolInformation { - return new types.SymbolInformation( + const result = new types.SymbolInformation( info.name, SymbolKind.to(info.kind), info.containerName, location.to(info.location) ); + result.tags = info.tags && info.tags.map(SymbolTag.to); + return result; } } diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index e14c4117f9e..4c92eddcaf7 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -995,6 +995,7 @@ export class SymbolInformation { name: string; location!: Location; kind: SymbolKind; + tags?: SymbolTag[]; containerName: string | undefined; constructor(name: string, kind: SymbolKind, containerName: string | undefined, location: Location); diff --git a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts index eef3c303d6c..bafe2fdfe61 100644 --- a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts @@ -8,7 +8,7 @@ import * as nls from 'vs/nls'; import * as types from 'vs/base/common/types'; import * as strings from 'vs/base/common/strings'; import { IEntryRunContext, Mode, IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; -import { QuickOpenModel, IHighlight } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler, EditorQuickOpenEntryGroup, QuickOpenAction } from 'vs/workbench/browser/quickopen'; import * as filters from 'vs/base/common/filters'; import { IEditor, IDiffEditorModel, IEditorViewState, ScrollType } from 'vs/editor/common/editorCommon'; @@ -16,15 +16,15 @@ import { IModelDecorationsChangeAccessor, OverviewRulerLane, IModelDeltaDecorati import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/quickOpen'; -import { DocumentSymbolProviderRegistry, DocumentSymbol, symbolKindToCssClass, SymbolKind } from 'vs/editor/common/modes'; +import { DocumentSymbolProviderRegistry, DocumentSymbol, symbolKindToCssClass, SymbolKind, SymbolTag } from 'vs/editor/common/modes'; import { IRange } from 'vs/editor/common/core/range'; import { themeColorFromId } from 'vs/platform/theme/common/themeService'; import { overviewRulerRangeHighlight } from 'vs/editor/common/view/editorColorRegistry'; import { GroupIdentifier, IEditorInput } from 'vs/workbench/common/editor'; import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { asPromise } from 'vs/base/common/async'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; +import { IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; export const GOTO_SYMBOL_PREFIX = '@'; export const SCOPE_PREFIX = ':'; @@ -235,29 +235,20 @@ class OutlineModel extends QuickOpenModel { } class SymbolEntry extends EditorQuickOpenEntryGroup { - private editorService: IEditorService; - private index: number; - private name: string; - private kind: SymbolKind; - private icon: string; - private description: string; - private range: IRange; - private revealRange: IRange; - private handler: GotoSymbolHandler; - constructor(index: number, name: string, kind: SymbolKind, description: string, icon: string, range: IRange, revealRange: IRange, highlights: IHighlight[], editorService: IEditorService, handler: GotoSymbolHandler) { + constructor( + private index: number, + private name: string, + private kind: SymbolKind, + private description: string, + private icon: string, + private deprecated: boolean, + private range: IRange, + private revealRange: IRange, + private editorService: IEditorService, + private handler: GotoSymbolHandler + ) { super(); - - this.index = index; - this.name = name; - this.kind = kind; - this.icon = icon; - this.description = description; - this.range = range; - this.revealRange = revealRange || range; - this.setHighlights(highlights); - this.editorService = editorService; - this.handler = handler; } getIndex(): number { @@ -276,6 +267,10 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { return this.icon; } + getLabelOptions(): IIconLabelValueOptions | undefined { + return this.deprecated ? { extraClasses: ['deprecated'] } : undefined; + } + getDescription(): string { return this.description; } @@ -479,8 +474,8 @@ export class GotoSymbolHandler extends QuickOpenHandler { // Add results.push(new SymbolEntry(i, - label, element.kind, description, `symbol-icon ${icon}`, - element.range, element.selectionRange, [], this.editorService, this + label, element.kind, description, `symbol-icon ${icon}`, element.tags && element.tags.indexOf(SymbolTag.Deprecated) >= 0, + element.range, element.selectionRange, this.editorService, this )); } @@ -504,7 +499,7 @@ export class GotoSymbolHandler extends QuickOpenHandler { } if (model && types.isFunction((model).getLanguageIdentifier)) { - const entries = await asPromise(() => getDocumentSymbols(model, true, this.pendingOutlineRequest!.token)); + const entries = await getDocumentSymbols(model, true, this.pendingOutlineRequest!.token); return new OutlineModel(this.toQuickOpenEntries(entries)); } diff --git a/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts b/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts index 4a0a138d83b..dfa1d48f150 100644 --- a/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts @@ -14,7 +14,7 @@ import * as filters from 'vs/base/common/filters'; import * as strings from 'vs/base/common/strings'; import { Range } from 'vs/editor/common/core/range'; import { IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; -import { symbolKindToCssClass } from 'vs/editor/common/modes'; +import { symbolKindToCssClass, SymbolTag } from 'vs/editor/common/modes'; import { IResourceInput } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -25,6 +25,7 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Schemas } from 'vs/base/common/network'; import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; class SymbolEntry extends EditorQuickOpenEntry { private bearingResolve: Promise | undefined; @@ -65,6 +66,12 @@ class SymbolEntry extends EditorQuickOpenEntry { return symbolKindToCssClass(this.bearing.kind); } + getLabelOptions(): IIconLabelValueOptions | undefined { + return this.bearing.tags && this.bearing.tags.indexOf(SymbolTag.Deprecated) >= 0 + ? { extraClasses: ['deprecated'] } + : undefined; + } + getResource(): URI { return this.bearing.location.uri; } diff --git a/src/vs/workbench/contrib/search/common/search.ts b/src/vs/workbench/contrib/search/common/search.ts index 0f87a2f56f6..10e3f093834 100644 --- a/src/vs/workbench/contrib/search/common/search.ts +++ b/src/vs/workbench/contrib/search/common/search.ts @@ -6,7 +6,7 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { IDisposable } from 'vs/base/common/lifecycle'; import { ISearchConfiguration, ISearchConfigurationProperties } from 'vs/workbench/services/search/common/search'; -import { SymbolKind, Location, ProviderResult } from 'vs/editor/common/modes'; +import { SymbolKind, Location, ProviderResult, SymbolTag } from 'vs/editor/common/modes'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { URI } from 'vs/base/common/uri'; import { toResource, SideBySideEditor } from 'vs/workbench/common/editor'; @@ -19,6 +19,7 @@ export interface IWorkspaceSymbol { name: string; containerName?: string; kind: SymbolKind; + tags?: SymbolTag[]; location: Location; } From 46993bce0607465764b170acdae73822528b15ca Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 10:28:14 +0200 Subject: [PATCH 031/163] disable failing test, #79692 --- .../terminalConfigHelper.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts index f1984496f23..0babdeccff0 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -16,14 +16,14 @@ suite('Workbench - TerminalConfigHelper', () => { fixture = document.body; }); - test('TerminalConfigHelper - getFont fontFamily', function () { - const configurationService = new TestConfigurationService(); - configurationService.setUserConfiguration('editor', { fontFamily: 'foo' }); - configurationService.setUserConfiguration('terminal', { integrated: { fontFamily: 'bar' } }); - const configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); - configHelper.panelContainer = fixture; - assert.equal(configHelper.getFont().fontFamily, 'bar', 'terminal.integrated.fontFamily should be selected over editor.fontFamily'); - }); + // test('TerminalConfigHelper - getFont fontFamily', function () { + // const configurationService = new TestConfigurationService(); + // configurationService.setUserConfiguration('editor', { fontFamily: 'foo' }); + // configurationService.setUserConfiguration('terminal', { integrated: { fontFamily: 'bar' } }); + // const configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + // configHelper.panelContainer = fixture; + // assert.equal(configHelper.getFont().fontFamily, 'bar', 'terminal.integrated.fontFamily should be selected over editor.fontFamily'); + // }); test('TerminalConfigHelper - getFont fontFamily (Linux Fedora)', function () { const configurationService = new TestConfigurationService(); @@ -233,4 +233,4 @@ suite('Workbench - TerminalConfigHelper', () => { configHelper.panelContainer = fixture; assert.equal(configHelper.configFontIsMonospace(), false, 'serif is not monospaced'); }); -}); \ No newline at end of file +}); From 722f97208c21165e0830e08580ca350ffa506c7e Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 11:01:16 +0200 Subject: [PATCH 032/163] fix #79694 --- .../contrib/codelens/codelensController.ts | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/vs/editor/contrib/codelens/codelensController.ts b/src/vs/editor/contrib/codelens/codelensController.ts index 1aed8453777..726133c3f7f 100644 --- a/src/vs/editor/contrib/codelens/codelensController.ts +++ b/src/vs/editor/contrib/codelens/codelensController.ts @@ -32,7 +32,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { private _currentCodeLensModel: CodeLensModel | undefined; private _modelChangeCounter: number = 0; private _currentResolveCodeLensSymbolsPromise: CancelablePromise | undefined; - private _detectVisibleLenses!: RunOnceScheduler; + private _detectVisibleLenses: RunOnceScheduler | undefined; constructor( private readonly _editor: editorBrowser.ICodeEditor, @@ -121,9 +121,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { } } - this._detectVisibleLenses = new RunOnceScheduler(() => { - this._onViewportChanged(); - }, 250); + const detectVisibleLenses = this._detectVisibleLenses = new RunOnceScheduler(() => this._onViewportChanged(), 250); const scheduler = new RunOnceScheduler(() => { const counterValue = ++this._modelChangeCounter; @@ -145,12 +143,12 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { // render lenses this._renderCodeLensSymbols(result); - this._detectVisibleLenses.schedule(); + detectVisibleLenses.schedule(); } }, onUnexpectedError); }, 250); this._localToDispose.add(scheduler); - this._localToDispose.add(this._detectVisibleLenses); + this._localToDispose.add(detectVisibleLenses); this._localToDispose.add(this._editor.onDidChangeModelContent(() => { this._editor.changeDecorations(decorationsAccessor => { this._editor.changeViewZones(viewZonesAccessor => { @@ -179,17 +177,17 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { }); // Compute new `visible` code lenses - this._detectVisibleLenses.schedule(); + detectVisibleLenses.schedule(); // Ask for all references again scheduler.schedule(); })); this._localToDispose.add(this._editor.onDidScrollChange(e => { if (e.scrollTopChanged && this._lenses.length > 0) { - this._detectVisibleLenses.schedule(); + detectVisibleLenses.schedule(); } })); this._localToDispose.add(this._editor.onDidLayoutChange(() => { - this._detectVisibleLenses.schedule(); + detectVisibleLenses.schedule(); })); this._localToDispose.add(toDisposable(() => { if (this._editor.getModel()) { @@ -281,7 +279,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { groupsIndex++; codeLensIndex++; } else { - this._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], this._editor, helper, viewZoneAccessor, () => this._detectVisibleLenses.schedule())); + this._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], this._editor, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); codeLensIndex++; groupsIndex++; } @@ -295,7 +293,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { // Create extra symbols while (groupsIndex < groups.length) { - this._lenses.push(new CodeLensWidget(groups[groupsIndex], this._editor, helper, viewZoneAccessor, () => this._detectVisibleLenses.schedule())); + this._lenses.push(new CodeLensWidget(groups[groupsIndex], this._editor, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); groupsIndex++; } From 21b1a576ac796e6731950a2a591e8284165c7905 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 23 Aug 2019 11:06:13 +0200 Subject: [PATCH 033/163] Always register a basic uri formatter for vscode-remote:/ --- .../remote/common/remote.contribution.ts | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/vs/workbench/contrib/remote/common/remote.contribution.ts b/src/vs/workbench/contrib/remote/common/remote.contribution.ts index 124fbfdbc9f..404f5a2a78d 100644 --- a/src/vs/workbench/contrib/remote/common/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/common/remote.contribution.ts @@ -7,8 +7,7 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as import { Registry } from 'vs/platform/registry/common/platform'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { ILabelService } from 'vs/platform/label/common/label'; -import { isWeb, OperatingSystem } from 'vs/base/common/platform'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { OperatingSystem } from 'vs/base/common/platform'; import { Schemas } from 'vs/base/common/network'; import { IRemoteAgentService, RemoteExtensionLogFileName } from 'vs/workbench/services/remote/common/remoteAgentService'; import { ILogService } from 'vs/platform/log/common/log'; @@ -49,28 +48,24 @@ export const VIEW_CONTAINER: ViewContainer = Registry.as { - if (remoteEnvironment) { - this.labelService.registerFormatter({ - scheme: Schemas.vscodeRemote, - authority: this.environmentService.configuration.remoteAuthority, - formatting: { - label: '${path}', - separator: remoteEnvironment.os === OperatingSystem.Windows ? '\\' : '/', - tildify: remoteEnvironment.os !== OperatingSystem.Windows, - normalizeDriveLetter: remoteEnvironment.os === OperatingSystem.Windows - } - }); - } - }); - } + this.remoteAgentService.getEnvironment().then(remoteEnvironment => { + if (remoteEnvironment) { + this.labelService.registerFormatter({ + scheme: Schemas.vscodeRemote, + formatting: { + label: '${path}', + separator: remoteEnvironment.os === OperatingSystem.Windows ? '\\' : '/', + tildify: remoteEnvironment.os !== OperatingSystem.Windows, + normalizeDriveLetter: remoteEnvironment.os === OperatingSystem.Windows + } + }); + } + }); } } From 202b31dc40037e82219ef1ff571d8da50f6a5eb6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 11:23:21 +0200 Subject: [PATCH 034/163] web main :lipstick: --- src/vs/code/browser/workbench/workbench.js | 8 ++++-- src/vs/workbench/browser/web.main.ts | 31 ++++++++++++---------- src/vs/workbench/workbench.web.api.ts | 2 ++ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js index 5050cb4e5b4..5687627518e 100644 --- a/src/vs/code/browser/workbench/workbench.js +++ b/src/vs/code/browser/workbench/workbench.js @@ -3,11 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +//@ts-check 'use strict'; (function () { - require.config({ + /** @type any */ + const amdLoader = require; + + amdLoader.config({ baseUrl: `${window.location.origin}/static/out`, paths: { 'vscode-textmate': `${window.location.origin}/static/node_modules/vscode-textmate/release/main`, @@ -20,7 +24,7 @@ } }); - require(['vs/workbench/workbench.web.api'], function (api) { + amdLoader(['vs/workbench/workbench.web.api'], function (api) { const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings')); api.create(document.body, options); diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts index 57192e3e1c8..04a72e9e914 100644 --- a/src/vs/workbench/browser/web.main.ts +++ b/src/vs/workbench/browser/web.main.ts @@ -90,7 +90,7 @@ class CodeRendererMain extends Disposable { // Driver if (this.configuration.driver) { - registerWindowDriver().then(d => this._register(d)); + (async () => this._register(await registerWindowDriver()))(); } // Startup @@ -153,23 +153,24 @@ class CodeRendererMain extends Disposable { // Logger const indexedDBLogProvider = new IndexedDBLogProvider(logsPath.scheme); - indexedDBLogProvider.database.then( - () => fileService.registerProvider(logsPath.scheme, indexedDBLogProvider), - e => { + (async () => { + try { + await indexedDBLogProvider.database; + + fileService.registerProvider(logsPath.scheme, indexedDBLogProvider); + } catch (error) { (logService).info('Error while creating indexedDB log provider. Falling back to in-memory log provider.'); - (logService).error(e); + (logService).error(error); + fileService.registerProvider(logsPath.scheme, new InMemoryLogProvider(logsPath.scheme)); } - ).then(() => { + const consoleLogService = new ConsoleLogService(logService.getLevel()); const fileLogService = new FileLogService('window', environmentService.logFile, logService.getLevel(), fileService); logService.logger = new MultiplexLogService([consoleLogService, fileLogService]); - }); - - // Static Extensions - const staticExtensions = new StaticExtensionsService(this.configuration.staticExtensions || []); - serviceCollection.set(IStaticExtensionsService, staticExtensions); + })(); + // User Data Provider let userDataProvider: IFileSystemProvider | undefined = this.configuration.userDataProvider; const connection = remoteAgentService.getConnection(); if (connection) { @@ -185,14 +186,16 @@ class CodeRendererMain extends Disposable { } } } - if (!userDataProvider) { userDataProvider = this._register(new InMemoryUserDataProvider()); } - - // User Data Provider fileService.registerProvider(Schemas.userData, userDataProvider); + // Static Extensions + const staticExtensions = new StaticExtensionsService(this.configuration.staticExtensions || []); + serviceCollection.set(IStaticExtensionsService, staticExtensions); + + // Long running services (workspace, config, storage) const services = await Promise.all([ this.createWorkspaceService(payload, environmentService, fileService, remoteAgentService, logService).then(service => { diff --git a/src/vs/workbench/workbench.web.api.ts b/src/vs/workbench/workbench.web.api.ts index 844ff1da56a..7f1da9f1203 100644 --- a/src/vs/workbench/workbench.web.api.ts +++ b/src/vs/workbench/workbench.web.api.ts @@ -4,6 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/workbench/workbench.web.main'; +import 'vs/nls!vs/workbench/workbench.web.main'; +import 'vs/css!vs/workbench/workbench.web.main'; import { main } from 'vs/workbench/browser/web.main'; import { UriComponents } from 'vs/base/common/uri'; import { IFileSystemProvider } from 'vs/platform/files/common/files'; From b690e2f0d1554afd8e763aca77334e2e41a2cc31 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 11:24:13 +0200 Subject: [PATCH 035/163] registerSingleton for IStaticExtensionsService --- src/vs/workbench/browser/web.main.ts | 5 ----- .../services/extensions/common/staticExtensions.ts | 12 +++++++++--- src/vs/workbench/workbench.common.main.ts | 1 + src/vs/workbench/workbench.desktop.main.ts | 2 -- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts index 04a72e9e914..b006dbd6ea0 100644 --- a/src/vs/workbench/browser/web.main.ts +++ b/src/vs/workbench/browser/web.main.ts @@ -40,7 +40,6 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { getThemeTypeSelector, DARK, HIGH_CONTRAST, LIGHT } from 'vs/platform/theme/common/themeService'; import { InMemoryUserDataProvider } from 'vs/workbench/services/userData/common/inMemoryUserDataProvider'; import { registerWindowDriver } from 'vs/platform/driver/browser/driver'; -import { StaticExtensionsService, IStaticExtensionsService } from 'vs/workbench/services/extensions/common/staticExtensions'; import { BufferLogService } from 'vs/platform/log/common/bufferLog'; import { FileLogService } from 'vs/platform/log/common/fileLogService'; import { toLocalISOString } from 'vs/base/common/date'; @@ -191,10 +190,6 @@ class CodeRendererMain extends Disposable { } fileService.registerProvider(Schemas.userData, userDataProvider); - // Static Extensions - const staticExtensions = new StaticExtensionsService(this.configuration.staticExtensions || []); - serviceCollection.set(IStaticExtensionsService, staticExtensions); - // Long running services (workspace, config, storage) const services = await Promise.all([ this.createWorkspaceService(payload, environmentService, fileService, remoteAgentService, logService).then(service => { diff --git a/src/vs/workbench/services/extensions/common/staticExtensions.ts b/src/vs/workbench/services/extensions/common/staticExtensions.ts index 06f102534d1..1d5e3f57b05 100644 --- a/src/vs/workbench/services/extensions/common/staticExtensions.ts +++ b/src/vs/workbench/services/extensions/common/staticExtensions.ts @@ -4,8 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionDescription, IExtensionManifest, ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { UriComponents, URI } from 'vs/base/common/uri'; +import { IExtensionDescription, ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; +import { URI } from 'vs/base/common/uri'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; export const IStaticExtensionsService = createDecorator('IStaticExtensionsService'); @@ -20,7 +22,9 @@ export class StaticExtensionsService implements IStaticExtensionsService { private readonly _descriptions: IExtensionDescription[] = []; - constructor(staticExtensions: { packageJSON: IExtensionManifest, extensionLocation: UriComponents }[]) { + constructor(@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService) { + const staticExtensions = environmentService.options && Array.isArray(environmentService.options.staticExtensions) ? environmentService.options.staticExtensions : []; + this._descriptions = staticExtensions.map(data => { identifier: new ExtensionIdentifier(`${data.packageJSON.publisher}.${data.packageJSON.name}`), extensionLocation: URI.revive(data.extensionLocation), @@ -32,3 +36,5 @@ export class StaticExtensionsService implements IStaticExtensionsService { return this._descriptions; } } + +registerSingleton(IStaticExtensionsService, StaticExtensionsService, true); diff --git a/src/vs/workbench/workbench.common.main.ts b/src/vs/workbench/workbench.common.main.ts index 2fdb06fe058..c2f7f1a9581 100644 --- a/src/vs/workbench/workbench.common.main.ts +++ b/src/vs/workbench/workbench.common.main.ts @@ -74,6 +74,7 @@ import 'vs/workbench/services/themes/browser/workbenchThemeService'; import 'vs/workbench/services/label/common/labelService'; import 'vs/workbench/services/extensionManagement/common/extensionEnablementService'; import 'vs/workbench/services/notification/common/notificationService'; +import 'vs/workbench/services/extensions/common/staticExtensions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; diff --git a/src/vs/workbench/workbench.desktop.main.ts b/src/vs/workbench/workbench.desktop.main.ts index a566d1d7900..27ef543f040 100644 --- a/src/vs/workbench/workbench.desktop.main.ts +++ b/src/vs/workbench/workbench.desktop.main.ts @@ -70,7 +70,6 @@ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; import { WorkspacesService } from 'vs/platform/workspaces/electron-browser/workspacesService'; import { IMenubarService } from 'vs/platform/menubar/node/menubar'; import { MenubarService } from 'vs/platform/menubar/electron-browser/menubarService'; -import { StaticExtensionsService, IStaticExtensionsService } from 'vs/workbench/services/extensions/common/staticExtensions'; registerSingleton(IClipboardService, ClipboardService, true); registerSingleton(IRequestService, RequestService, true); @@ -82,7 +81,6 @@ registerSingleton(IUpdateService, UpdateService); registerSingleton(IIssueService, IssueService); registerSingleton(IWorkspacesService, WorkspacesService); registerSingleton(IMenubarService, MenubarService); -registerSingleton(IStaticExtensionsService, class extends StaticExtensionsService { constructor() { super([]); } }); //#endregion From 4d312af6e0a5670a717ff2c7ac0a9353f8934160 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 23 Aug 2019 11:25:45 +0200 Subject: [PATCH 036/163] Normalize task problem path before replacing slashes Fixes #79578 --- src/vs/workbench/contrib/tasks/common/problemMatcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts index ec7c7bcbb96..73f8f8f218f 100644 --- a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts @@ -216,11 +216,11 @@ export async function getResource(filename: string, matcher: ProblemMatcher, fil if (fullPath === undefined) { throw new Error('FileLocationKind is not actionable. Does the matcher have a filePrefix? This should never happen.'); } + fullPath = normalize(fullPath); fullPath = fullPath.replace(/\\/g, '/'); if (fullPath[0] !== '/') { fullPath = '/' + fullPath; } - fullPath = normalize(fullPath); if (matcher.uriProvider !== undefined) { return matcher.uriProvider(fullPath); } else { From 00b43d36f9ab69fabf7b97b27459dc11c700bd2e Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 11:28:33 +0200 Subject: [PATCH 037/163] build - schedule back at 7 --- build/azure-pipelines/product-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index a2fdc9e4ec6..f38f4311826 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -143,8 +143,8 @@ trigger: none pr: none schedules: -- cron: "10 5 * * Mon-Fri" - displayName: Mon-Fri at 7:10 +- cron: "0 5 * * Mon-Fri" + displayName: Mon-Fri at 7:00 branches: include: - master From b9ccfc4b3fa4fe32991e02f5767cfe093292717b Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 23 Aug 2019 12:17:41 +0200 Subject: [PATCH 038/163] labelService: getUriBasenameLabel --- .../standalone/browser/simpleServices.ts | 6 ++++++ src/vs/platform/label/common/label.ts | 1 + .../common/editor/untitledEditorInput.ts | 3 +-- .../files/common/editors/fileEditorInput.ts | 5 ++--- .../services/label/common/labelService.ts | 11 ++++++++++ .../services/label/test/label.test.ts | 21 +++++++++++++++++++ 6 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index 54804eb3c0f..ce860a9dbac 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -45,6 +45,7 @@ import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platf import { ILayoutService, IDimension } from 'vs/platform/layout/browser/layoutService'; import { SimpleServicesNLS } from 'vs/editor/common/standaloneStrings'; import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; +import { basename } from 'vs/base/common/path'; export class SimpleModel implements IResolvedTextEditorModel { @@ -656,6 +657,7 @@ export class SimpleBulkEditService implements IBulkEditService { } export class SimpleUriLabelService implements ILabelService { + _serviceBrand: any; private readonly _onDidRegisterFormatter = new Emitter(); @@ -668,6 +670,10 @@ export class SimpleUriLabelService implements ILabelService { return resource.path; } + getUriBasenameLabel(resource: URI): string { + return basename(resource.path); + } + public getWorkspaceLabel(workspace: IWorkspaceIdentifier | URI | IWorkspace, options?: { verbose: boolean; }): string { return ''; } diff --git a/src/vs/platform/label/common/label.ts b/src/vs/platform/label/common/label.ts index ffc20e10abb..4565228e690 100644 --- a/src/vs/platform/label/common/label.ts +++ b/src/vs/platform/label/common/label.ts @@ -21,6 +21,7 @@ export interface ILabelService { * If noPrefix is passed does not tildify the label and also does not prepand the root name for relative labels in a multi root scenario. */ getUriLabel(resource: URI, options?: { relative?: boolean, noPrefix?: boolean, endWithSeparator?: boolean }): string; + getUriBasenameLabel(resource: URI): string; getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | IWorkspace), options?: { verbose: boolean }): string; getHostLabel(scheme: string, authority?: string): string; getSeparator(scheme: string, authority?: string): '/' | '\\'; diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 561b5cb6f87..1a0af06b7a7 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -7,7 +7,6 @@ import { URI } from 'vs/base/common/uri'; import { suggestFilename } from 'vs/base/common/mime'; import { memoize } from 'vs/base/common/decorators'; import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; -import { basename } from 'vs/base/common/path'; import { basenameOrAuthority, dirname } from 'vs/base/common/resources'; import { EditorInput, IEncodingSupport, EncodingMode, ConfirmResult, Verbosity, IModeSupport } from 'vs/workbench/common/editor'; import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel'; @@ -64,7 +63,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport @memoize private get shortDescription(): string { - return basename(this.labelService.getUriLabel(dirname(this.resource))); + return this.labelService.getUriBasenameLabel(dirname(this.resource)); } @memoize diff --git a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts index 3aae29a21be..b95d1949bdf 100644 --- a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts @@ -5,7 +5,6 @@ import { localize } from 'vs/nls'; import { memoize } from 'vs/base/common/decorators'; -import { basename } from 'vs/base/common/path'; import { dirname } 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'; @@ -147,14 +146,14 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { getName(): string { if (!this.name) { - this.name = basename(this.labelService.getUriLabel(this.resource)); + this.name = this.labelService.getUriBasenameLabel(this.resource); } return this.decorateLabel(this.name); } private get shortDescription(): string { - return basename(this.labelService.getUriLabel(dirname(this.resource))); + return this.labelService.getUriBasenameLabel(dirname(this.resource)); } private get mediumDescription(): string { diff --git a/src/vs/workbench/services/label/common/labelService.ts b/src/vs/workbench/services/label/common/labelService.ts index a8e2290be22..2e9e9e9a1da 100644 --- a/src/vs/workbench/services/label/common/labelService.ts +++ b/src/vs/workbench/services/label/common/labelService.ts @@ -6,6 +6,7 @@ import { localize } from 'vs/nls'; import { URI } from 'vs/base/common/uri'; import { IDisposable } from 'vs/base/common/lifecycle'; +import * as paths from 'vs/base/common/path'; import { Event, Emitter } from 'vs/base/common/event'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -159,6 +160,16 @@ export class LabelService implements ILabelService { return options.endWithSeparator ? this.appendSeparatorIfMissing(label, formatting) : label; } + getUriBasenameLabel(resource: URI): string { + const label = this.getUriLabel(resource); + const formatting = this.findFormatting(resource); + if (formatting && formatting.separator === '\\') { + return paths.win32.basename(label); + } + + return paths.posix.basename(label); + } + getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | IWorkspace), options?: { verbose: boolean }): string { if (IWorkspace.isIWorkspace(workspace)) { const identifier = toWorkspaceIdentifier(workspace); diff --git a/src/vs/workbench/services/label/test/label.test.ts b/src/vs/workbench/services/label/test/label.test.ts index ee4650f4d2b..acafcc5f3d5 100644 --- a/src/vs/workbench/services/label/test/label.test.ts +++ b/src/vs/workbench/services/label/test/label.test.ts @@ -33,9 +33,11 @@ suite('URI Label', () => { const uri1 = TestWorkspace.folders[0].uri.with({ path: TestWorkspace.folders[0].uri.path.concat('/a/b/c/d') }); assert.equal(labelService.getUriLabel(uri1, { relative: true }), isWindows ? 'a\\b\\c\\d' : 'a/b/c/d'); assert.equal(labelService.getUriLabel(uri1, { relative: false }), isWindows ? 'C:\\testWorkspace\\a\\b\\c\\d' : '/testWorkspace/a/b/c/d'); + assert.equal(labelService.getUriBasenameLabel(uri1), 'd'); const uri2 = URI.file('c:\\1/2/3'); assert.equal(labelService.getUriLabel(uri2, { relative: false }), isWindows ? 'C:\\1\\2\\3' : '/c:\\1/2/3'); + assert.equal(labelService.getUriBasenameLabel(uri2), '3'); }); test('custom scheme', function () { @@ -51,6 +53,23 @@ suite('URI Label', () => { const uri1 = URI.parse('vscode://microsoft.com/1/2/3/4/5'); assert.equal(labelService.getUriLabel(uri1, { relative: false }), 'LABEL//1/2/3/4/5/microsoft.com/END'); + assert.equal(labelService.getUriBasenameLabel(uri1), 'END'); + }); + + test.only('separator', function () { + labelService.registerFormatter({ + scheme: 'vscode', + formatting: { + label: 'LABEL\\${path}\\${authority}\\END', + separator: '\\', + tildify: true, + normalizeDriveLetter: true + } + }); + + const uri1 = URI.parse('vscode://microsoft.com/1/2/3/4/5'); + assert.equal(labelService.getUriLabel(uri1, { relative: false }), 'LABEL\\\\1\\2\\3\\4\\5\\microsoft.com\\END'); + assert.equal(labelService.getUriBasenameLabel(uri1), 'END'); }); test('custom authority', function () { @@ -65,6 +84,7 @@ suite('URI Label', () => { const uri1 = URI.parse('vscode://microsoft.com/1/2/3/4/5'); assert.equal(labelService.getUriLabel(uri1, { relative: false }), 'LABEL//1/2/3/4/5/microsoft.com/END'); + assert.equal(labelService.getUriBasenameLabel(uri1), 'END'); }); test('mulitple authority', function () { @@ -96,6 +116,7 @@ suite('URI Label', () => { // Make sure the most specific authority is picked const uri1 = URI.parse('vscode://microsoft.com/1/2/3/4/5'); assert.equal(labelService.getUriLabel(uri1, { relative: false }), 'second'); + assert.equal(labelService.getUriBasenameLabel(uri1), 'second'); }); test('custom query', function () { From 20a403c38f80615f5588a562de22be9754f83afb Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 23 Aug 2019 12:46:56 +0200 Subject: [PATCH 039/163] fixes #79693 --- .../workbench/contrib/files/browser/views/explorerViewer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts index 016249db38c..0c368120dff 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts @@ -170,7 +170,11 @@ export class FilesRenderer implements ITreeRenderer { - this.updateWidth(stat); + try { + this.updateWidth(stat); + } catch (e) { + // noop since the element might no longer be in the tree, no update of width necessery + } }); } From e17398bc339df29d47f6ff8aa26d0b1558baac4a Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 23 Aug 2019 13:12:54 +0200 Subject: [PATCH 040/163] Fix for-in loops over arrays in tasks Part of #79432 --- .../workbench/contrib/tasks/browser/terminalTaskSystem.ts | 4 +--- src/vs/workbench/contrib/tasks/common/tasks.ts | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 7097c96cd89..d56d5f1c705 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -340,9 +340,7 @@ export class TerminalTaskSystem implements ITaskSystem { private async executeTask(task: Task, resolver: ITaskResolver, trigger: string): Promise { let promises: Promise[] = []; if (task.configurationProperties.dependsOn) { - // tslint:disable-next-line: no-for-in-array - for (let index in task.configurationProperties.dependsOn) { - const dependency = task.configurationProperties.dependsOn[index]; + for (const dependency of task.configurationProperties.dependsOn) { let dependencyTask = resolver.resolve(dependency.workspaceFolder, dependency.task!); if (dependencyTask) { let key = dependencyTask.getMapKey(); diff --git a/src/vs/workbench/contrib/tasks/common/tasks.ts b/src/vs/workbench/contrib/tasks/common/tasks.ts index 49d370e71e0..24d77f427d7 100644 --- a/src/vs/workbench/contrib/tasks/common/tasks.ts +++ b/src/vs/workbench/contrib/tasks/common/tasks.ts @@ -985,15 +985,14 @@ export namespace KeyedTaskIdentifier { function sortedStringify(literal: any): string { const keys = Object.keys(literal).sort(); let result: string = ''; - // tslint:disable-next-line: no-for-in-array - for (let position in keys) { - let stringified = literal[keys[position]]; + for (const key of keys) { + let stringified = literal[key]; if (stringified instanceof Object) { stringified = sortedStringify(stringified); } else if (typeof stringified === 'string') { stringified = stringified.replace(/,/g, ',,'); } - result += keys[position] + ',' + stringified + ','; + result += key + ',' + stringified + ','; } return result; } From f610ae3f357e6e73a2095444eb330e818de650ea Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 13:09:31 +0200 Subject: [PATCH 041/163] don't highlight quick outline items, also align sorting/highlighting with IntelliSense, #50972 --- .../quickopen/browser/gotoSymbolHandler.ts | 191 +++++++----------- 1 file changed, 72 insertions(+), 119 deletions(-) diff --git a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts index bafe2fdfe61..1742ba33738 100644 --- a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts @@ -8,7 +8,7 @@ import * as nls from 'vs/nls'; import * as types from 'vs/base/common/types'; import * as strings from 'vs/base/common/strings'; import { IEntryRunContext, Mode, IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; -import { QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { QuickOpenModel, IHighlight } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler, EditorQuickOpenEntryGroup, QuickOpenAction } from 'vs/workbench/browser/quickopen'; import * as filters from 'vs/base/common/filters'; import { IEditor, IDiffEditorModel, IEditorViewState, ScrollType } from 'vs/editor/common/editorCommon'; @@ -73,10 +73,8 @@ class OutlineModel extends QuickOpenModel { applyFilter(searchValue: string): void { // Normalize search - let normalizedSearchValue = searchValue; - if (searchValue.indexOf(SCOPE_PREFIX) === 0) { - normalizedSearchValue = normalizedSearchValue.substr(SCOPE_PREFIX.length); - } + const searchValueLow = searchValue.toLowerCase(); + const searchValuePos = searchValue.indexOf(SCOPE_PREFIX) === 0 ? 1 : 0; // Check for match and update visibility and group label this.entries.forEach((entry: SymbolEntry) => { @@ -84,34 +82,24 @@ class OutlineModel extends QuickOpenModel { // Clear all state first entry.setGroupLabel(undefined); entry.setShowBorder(false); - entry.setHighlights([]); + entry.setScore(undefined); entry.setHidden(false); // Filter by search - if (normalizedSearchValue) { - const highlights = filters.matchesFuzzy2(normalizedSearchValue, entry.getLabel()); - if (highlights) { - entry.setHighlights(highlights); - entry.setHidden(false); - } else if (!entry.isHidden()) { - entry.setHidden(true); - } + if (searchValue.length > searchValuePos) { + const score = filters.fuzzyScore( + searchValue.substr(searchValuePos), searchValueLow.substr(searchValuePos), 0, + entry.getLabel(), entry.getLabel().toLowerCase(), 0, + true + ); + entry.setScore(score); + entry.setHidden(!score); } }); - // Sort properly if actually searching - if (searchValue) { - if (searchValue.indexOf(SCOPE_PREFIX) === 0) { - this.entries.sort(this.sortScoped.bind(this, searchValue.toLowerCase())); - } else { - this.entries.sort(this.sortNormal.bind(this, searchValue.toLowerCase())); - } - } + this.entries.sort(SymbolEntry.compareByRank); + - // Otherwise restore order as appearing in outline - else { - this.entries.sort((a: SymbolEntry, b: SymbolEntry) => a.getIndex() - b.getIndex()); - } // Mark all type groups const visibleResults = this.getEntries(true); @@ -156,74 +144,6 @@ class OutlineModel extends QuickOpenModel { } } - private sortNormal(searchValue: string, elementA: SymbolEntry, elementB: SymbolEntry): number { - - // Handle hidden elements - if (elementA.isHidden() && elementB.isHidden()) { - return 0; - } else if (elementA.isHidden()) { - return 1; - } else if (elementB.isHidden()) { - return -1; - } - - const elementAName = elementA.getLabel().toLowerCase(); - const elementBName = elementB.getLabel().toLowerCase(); - - // Compare by name - const r = elementAName.localeCompare(elementBName); - if (r !== 0) { - return r; - } - - // If name identical sort by range instead - const elementARange = elementA.getRange(); - const elementBRange = elementB.getRange(); - - return elementARange.startLineNumber - elementBRange.startLineNumber; - } - - private sortScoped(searchValue: string, elementA: SymbolEntry, elementB: SymbolEntry): number { - - // Handle hidden elements - if (elementA.isHidden() && elementB.isHidden()) { - return 0; - } else if (elementA.isHidden()) { - return 1; - } else if (elementB.isHidden()) { - return -1; - } - - // Remove scope char - searchValue = searchValue.substr(SCOPE_PREFIX.length); - - // Sort by type first if scoped search - const elementATypeLabel = NLS_SYMBOL_KIND_CACHE[elementA.getKind()] || FALLBACK_NLS_SYMBOL_KIND; - const elementBTypeLabel = NLS_SYMBOL_KIND_CACHE[elementB.getKind()] || FALLBACK_NLS_SYMBOL_KIND; - let r = elementATypeLabel.localeCompare(elementBTypeLabel); - if (r !== 0) { - return r; - } - - // Special sort when searching in scoped mode - if (searchValue) { - const elementAName = elementA.getLabel().toLowerCase(); - const elementBName = elementB.getLabel().toLowerCase(); - - // Compare by name - r = elementAName.localeCompare(elementBName); - if (r !== 0) { - return r; - } - } - - // Default to sort by range - const elementARange = elementA.getRange(); - const elementBRange = elementB.getRange(); - - return elementARange.startLineNumber - elementBRange.startLineNumber; - } - private renderGroupLabel(type: SymbolKind, count: number): string { let pattern = NLS_SYMBOL_KIND_CACHE[type]; if (!pattern) { @@ -236,23 +156,25 @@ class OutlineModel extends QuickOpenModel { class SymbolEntry extends EditorQuickOpenEntryGroup { + private score?: filters.FuzzyScore; + constructor( - private index: number, - private name: string, - private kind: SymbolKind, - private description: string, - private icon: string, - private deprecated: boolean, - private range: IRange, - private revealRange: IRange, - private editorService: IEditorService, - private handler: GotoSymbolHandler + private readonly index: number, + private readonly name: string, + private readonly kind: SymbolKind, + private readonly description: string, + private readonly icon: string, + private readonly deprecated: boolean, + private readonly range: IRange, + private readonly revealRange: IRange, + private readonly editorService: IEditorService, + private readonly handler: GotoSymbolHandler ) { super(); } - getIndex(): number { - return this.index; + setScore(score: filters.FuzzyScore | undefined): void { + this.score = score; } getLabel(): string { @@ -271,6 +193,14 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { return this.deprecated ? { extraClasses: ['deprecated'] } : undefined; } + getHighlights(): [IHighlight[], IHighlight[] | undefined, IHighlight[] | undefined] { + return [ + this.deprecated ? [] : filters.createMatches(this.score), + undefined, + undefined + ]; + } + getDescription(): string { return this.description; } @@ -289,7 +219,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { getOptions(pinned?: boolean): ITextEditorOptions { return { - selection: this.toSelection(), + selection: this.revealRange, pinned }; } @@ -312,7 +242,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { // Apply selection and focus else { - const range = this.toSelection(); + const range = this.revealRange; const activeTextEditorWidget = this.editorService.activeTextEditorWidget; if (activeTextEditorWidget) { activeTextEditorWidget.setSelection(range); @@ -326,7 +256,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { private runPreview(): boolean { // Select Outline Position - const range = this.toSelection(); + const range = this.revealRange; const activeTextEditorWidget = this.editorService.activeTextEditorWidget; if (activeTextEditorWidget) { activeTextEditorWidget.revealRangeInCenter(range, ScrollType.Smooth); @@ -340,13 +270,36 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { return false; } - private toSelection(): IRange { - return { - startLineNumber: this.revealRange.startLineNumber, - startColumn: this.revealRange.startColumn || 1, - endLineNumber: this.revealRange.startLineNumber, - endColumn: this.revealRange.startColumn || 1 - }; + static compareByRank(a: SymbolEntry, b: SymbolEntry): number { + if (!a.score && b.score) { + return 1; + } else if (a.score && !b.score) { + return -1; + } + if (a.score && b.score) { + if (a.score[0] > b.score[0]) { + return -1; + } else if (a.score[0] < b.score[0]) { + return 1; + } + } + if (a.index < b.index) { + return -1; + } else if (a.index > b.index) { + return 1; + } + return 0; + } + + static compareByKindAndRank(a: SymbolEntry, b: SymbolEntry): number { + // Sort by type first if scoped search + const kindA = NLS_SYMBOL_KIND_CACHE[a.getKind()] || FALLBACK_NLS_SYMBOL_KIND; + const kindB = NLS_SYMBOL_KIND_CACHE[b.getKind()] || FALLBACK_NLS_SYMBOL_KIND; + let r = kindA.localeCompare(kindB); + if (r === 0) { + r = this.compareByRank(a, b); + } + return r; } } @@ -461,11 +414,11 @@ export class GotoSymbolHandler extends QuickOpenHandler { }; } - private toQuickOpenEntries(flattened: DocumentSymbol[]): SymbolEntry[] { + private toQuickOpenEntries(symbols: DocumentSymbol[]): SymbolEntry[] { const results: SymbolEntry[] = []; - for (let i = 0; i < flattened.length; i++) { - const element = flattened[i]; + for (let i = 0; i < symbols.length; i++) { + const element = symbols[i]; const label = strings.trim(element.name); // Show parent scope as description From 5458ae72644c9cc476160fdab1f423538c6ab1f8 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 13:31:06 +0200 Subject: [PATCH 042/163] no highlights for deprecated workspace symbols, also tweak sorting, #50972 --- .../parts/quickopen/browser/quickOpenModel.ts | 35 ----------- .../search/browser/openSymbolHandler.ts | 59 +++++++++++++------ 2 files changed, 42 insertions(+), 52 deletions(-) diff --git a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts index bb9dec75605..fdd8bcbf06b 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts @@ -10,7 +10,6 @@ import { ITree, IActionProvider } from 'vs/base/parts/tree/browser/tree'; import { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; import { IQuickNavigateConfiguration, IModel, IDataSource, IFilter, IAccessiblityProvider, IRenderer, IRunner, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen'; import { IAction, IActionRunner } from 'vs/base/common/actions'; -import { compareAnything } from 'vs/base/common/comparers'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; import * as DOM from 'vs/base/browser/dom'; @@ -576,37 +575,3 @@ export class QuickOpenModel implements return entry.run(mode, context); } } - -/** - * A good default sort implementation for quick open entries respecting highlight information - * as well as associated resources. - */ -export function compareEntries(elementA: QuickOpenEntry, elementB: QuickOpenEntry, lookFor: string): number { - - // Give matches with label highlights higher priority over - // those with only description highlights - const labelHighlightsA = elementA.getHighlights()[0] || []; - const labelHighlightsB = elementB.getHighlights()[0] || []; - if (labelHighlightsA.length && !labelHighlightsB.length) { - return -1; - } - - if (!labelHighlightsA.length && labelHighlightsB.length) { - return 1; - } - - // Fallback to the full path if labels are identical and we have associated resources - let nameA = elementA.getLabel()!; - let nameB = elementB.getLabel()!; - if (nameA === nameB) { - const resourceA = elementA.getResource(); - const resourceB = elementB.getResource(); - - if (resourceA && resourceB) { - nameA = resourceA.fsPath; - nameB = resourceB.fsPath; - } - } - - return compareAnything(nameA, nameB, lookFor); -} diff --git a/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts b/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts index dfa1d48f150..c0bcedcb221 100644 --- a/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts @@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri'; import { onUnexpectedError } from 'vs/base/common/errors'; import { ThrottledDelayer } from 'vs/base/common/async'; import { QuickOpenHandler, EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen'; -import { QuickOpenModel, QuickOpenEntry, compareEntries } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { QuickOpenModel, QuickOpenEntry, IHighlight } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen'; import * as filters from 'vs/base/common/filters'; import * as strings from 'vs/base/common/strings'; @@ -28,7 +28,9 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; class SymbolEntry extends EditorQuickOpenEntry { - private bearingResolve: Promise | undefined; + + private bearingResolve?: Promise; + private score?: filters.FuzzyScore; constructor( private bearing: IWorkspaceSymbol, @@ -41,6 +43,14 @@ class SymbolEntry extends EditorQuickOpenEntry { super(editorService); } + setScore(score: filters.FuzzyScore | undefined) { + this.score = score; + } + + getHighlights(): [IHighlight[] /* Label */, IHighlight[] | undefined /* Description */, IHighlight[] | undefined /* Detail */] { + return [this.isDeprecated() ? [] : filters.createMatches(this.score), undefined, undefined]; + } + getLabel(): string { return this.bearing.name; } @@ -67,15 +77,17 @@ class SymbolEntry extends EditorQuickOpenEntry { } getLabelOptions(): IIconLabelValueOptions | undefined { - return this.bearing.tags && this.bearing.tags.indexOf(SymbolTag.Deprecated) >= 0 - ? { extraClasses: ['deprecated'] } - : undefined; + return this.isDeprecated() ? { extraClasses: ['deprecated'] } : undefined; } getResource(): URI { return this.bearing.location.uri; } + private isDeprecated(): boolean { + return this.bearing.tags ? this.bearing.tags.indexOf(SymbolTag.Deprecated) >= 0 : false; + } + run(mode: Mode, context: IEntryRunContext): boolean { // resolve this type bearing if neccessary @@ -118,18 +130,24 @@ class SymbolEntry extends EditorQuickOpenEntry { return input; } - static compare(elementA: SymbolEntry, elementB: SymbolEntry, searchValue: string): number { - - // Sort by Type if name is identical - const elementAName = elementA.getLabel().toLowerCase(); - const elementBName = elementB.getLabel().toLowerCase(); - if (elementAName === elementBName) { - let elementAType = symbolKindToCssClass(elementA.bearing.kind); - let elementBType = symbolKindToCssClass(elementB.bearing.kind); - return elementAType.localeCompare(elementBType); + static compare(a: SymbolEntry, b: SymbolEntry, searchValue: string): number { + // order: score, name, kind + if (a.score && b.score) { + if (a.score[0] > b.score[0]) { + return -1; + } else if (a.score[0] < b.score[0]) { + return 1; + } } - - return compareEntries(elementA, elementB, searchValue); + const aName = a.getLabel().toLowerCase(); + const bName = b.getLabel().toLowerCase(); + let res = aName.localeCompare(bName); + if (res !== 0) { + return res; + } + let aKind = symbolKindToCssClass(a.bearing.kind); + let bKind = symbolKindToCssClass(b.bearing.kind); + return aKind.localeCompare(bKind); } } @@ -205,6 +223,9 @@ export class OpenSymbolHandler extends QuickOpenHandler { private fillInSymbolEntries(bucket: SymbolEntry[], provider: IWorkspaceSymbolProvider, types: IWorkspaceSymbol[], searchValue: string): void { + const pattern = strings.stripWildcards(searchValue); + const patternLow = pattern.toLowerCase(); + // Convert to Entries for (let element of types) { if (this.options.skipLocalSymbols && !!element.containerName) { @@ -212,7 +233,11 @@ export class OpenSymbolHandler extends QuickOpenHandler { } const entry = this.instantiationService.createInstance(SymbolEntry, element, provider); - entry.setHighlights(filters.matchesFuzzy2(searchValue, entry.getLabel()) || []); + entry.setScore(filters.fuzzyScore( + pattern, patternLow, 0, + entry.getLabel(), entry.getLabel().toLowerCase(), 0, + true + )); bucket.push(entry); } } From 8748114548a823566f0925dd589119d0d41bc918 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 13:48:57 +0200 Subject: [PATCH 043/163] debt - quick outline using the same model cache as breadcrumbs and outline tree --- src/vs/editor/contrib/quickOpen/quickOpen.ts | 49 +++++++++----------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/src/vs/editor/contrib/quickOpen/quickOpen.ts b/src/vs/editor/contrib/quickOpen/quickOpen.ts index fb054ae7f61..2730114175b 100644 --- a/src/vs/editor/contrib/quickOpen/quickOpen.ts +++ b/src/vs/editor/contrib/quickOpen/quickOpen.ts @@ -3,44 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors'; +import { illegalArgument } from 'vs/base/common/errors'; import { URI } from 'vs/base/common/uri'; import { Range } from 'vs/editor/common/core/range'; import { ITextModel } from 'vs/editor/common/model'; import { registerLanguageCommand } from 'vs/editor/browser/editorExtensions'; -import { DocumentSymbol, DocumentSymbolProviderRegistry } from 'vs/editor/common/modes'; +import { DocumentSymbol } from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; +import { OutlineModel, OutlineElement } from 'vs/editor/contrib/documentSymbols/outlineModel'; +import { values } from 'vs/base/common/collections'; -export function getDocumentSymbols(model: ITextModel, flat: boolean, token: CancellationToken): Promise { +export async function getDocumentSymbols(document: ITextModel, flat: boolean, token: CancellationToken): Promise { - let roots: DocumentSymbol[] = []; - - let promises = DocumentSymbolProviderRegistry.all(model).map(support => { - - return Promise.resolve(support.provideDocumentSymbols(model, token)).then(result => { - if (Array.isArray(result)) { - roots.push(...result); - } - }, err => { - onUnexpectedExternalError(err); - }); - }); - - return Promise.all(promises).then(() => { - let flatEntries: DocumentSymbol[] = []; - if (token.isCancellationRequested) { - return flatEntries; - } - if (flat) { - flatten(flatEntries, roots, ''); + const model = await OutlineModel.create(document, token); + const roots: DocumentSymbol[] = []; + for (const child of values(model.children)) { + if (child instanceof OutlineElement) { + roots.push(child.symbol); } else { - flatEntries = roots; + roots.push(...values(child.children).map(child => child.symbol)); } - flatEntries.sort(compareEntriesUsingStart); + } + + let flatEntries: DocumentSymbol[] = []; + if (token.isCancellationRequested) { return flatEntries; - }); + } + if (flat) { + flatten(flatEntries, roots, ''); + } else { + flatEntries = roots; + } + + return flatEntries.sort(compareEntriesUsingStart); } function compareEntriesUsingStart(a: DocumentSymbol, b: DocumentSymbol): number { From 00d4b4817a9822469683865062dd1d44ac50cb08 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 14:07:45 +0200 Subject: [PATCH 044/163] re-enable all tests --- src/vs/workbench/services/label/test/label.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/services/label/test/label.test.ts b/src/vs/workbench/services/label/test/label.test.ts index acafcc5f3d5..a0d8af36a20 100644 --- a/src/vs/workbench/services/label/test/label.test.ts +++ b/src/vs/workbench/services/label/test/label.test.ts @@ -56,7 +56,7 @@ suite('URI Label', () => { assert.equal(labelService.getUriBasenameLabel(uri1), 'END'); }); - test.only('separator', function () { + test('separator', function () { labelService.registerFormatter({ scheme: 'vscode', formatting: { From b83d45da55cd917970777a76c181af33a0f639fb Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 23 Aug 2019 14:28:38 +0200 Subject: [PATCH 045/163] Don't disable unnecessary features when a screen reader is attached --- src/vs/editor/common/config/editorOptions.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 71b0cbb8843..997d22be614 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2185,7 +2185,7 @@ export class InternalEditorOptionsFactory { selectOnLineNumbers: opts.viewInfo.selectOnLineNumbers, glyphMargin: opts.viewInfo.glyphMargin, revealHorizontalRightPadding: opts.viewInfo.revealHorizontalRightPadding, - roundedSelection: (accessibilityIsOn ? false : opts.viewInfo.roundedSelection), // DISABLED WHEN SCREEN READER IS ATTACHED + roundedSelection: opts.viewInfo.roundedSelection, overviewRulerLanes: opts.viewInfo.overviewRulerLanes, overviewRulerBorder: opts.viewInfo.overviewRulerBorder, cursorBlinking: opts.viewInfo.cursorBlinking, @@ -2198,15 +2198,15 @@ export class InternalEditorOptionsFactory { scrollBeyondLastColumn: opts.viewInfo.scrollBeyondLastColumn, smoothScrolling: opts.viewInfo.smoothScrolling, stopRenderingLineAfter: opts.viewInfo.stopRenderingLineAfter, - renderWhitespace: (accessibilityIsOn ? 'none' : opts.viewInfo.renderWhitespace), // DISABLED WHEN SCREEN READER IS ATTACHED - renderControlCharacters: (accessibilityIsOn ? false : opts.viewInfo.renderControlCharacters), // DISABLED WHEN SCREEN READER IS ATTACHED + renderWhitespace: opts.viewInfo.renderWhitespace, + renderControlCharacters: opts.viewInfo.renderControlCharacters, fontLigatures: opts.viewInfo.fontLigatures, - renderIndentGuides: (accessibilityIsOn ? false : opts.viewInfo.renderIndentGuides), // DISABLED WHEN SCREEN READER IS ATTACHED + renderIndentGuides: opts.viewInfo.renderIndentGuides, highlightActiveIndentGuide: opts.viewInfo.highlightActiveIndentGuide, renderLineHighlight: opts.viewInfo.renderLineHighlight, scrollbar: opts.viewInfo.scrollbar, minimap: { - enabled: (accessibilityIsOn ? false : opts.viewInfo.minimap.enabled), // DISABLED WHEN SCREEN READER IS ATTACHED + enabled: opts.viewInfo.minimap.enabled, side: opts.viewInfo.minimap.side, renderCharacters: opts.viewInfo.minimap.renderCharacters, showSlider: opts.viewInfo.minimap.showSlider, @@ -2218,7 +2218,7 @@ export class InternalEditorOptionsFactory { contribInfo: { selectionClipboard: opts.contribInfo.selectionClipboard, hover: opts.contribInfo.hover, - links: (accessibilityIsOn ? false : opts.contribInfo.links), // DISABLED WHEN SCREEN READER IS ATTACHED + links: opts.contribInfo.links, contextmenu: opts.contribInfo.contextmenu, quickSuggestions: opts.contribInfo.quickSuggestions, quickSuggestionsDelay: opts.contribInfo.quickSuggestionsDelay, @@ -2235,13 +2235,13 @@ export class InternalEditorOptionsFactory { tabCompletion: opts.contribInfo.tabCompletion, suggest: opts.contribInfo.suggest, gotoLocation: opts.contribInfo.gotoLocation, - selectionHighlight: (accessibilityIsOn ? false : opts.contribInfo.selectionHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED - occurrencesHighlight: (accessibilityIsOn ? false : opts.contribInfo.occurrencesHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED - codeLens: (accessibilityIsOn ? false : opts.contribInfo.codeLens), // DISABLED WHEN SCREEN READER IS ATTACHED + selectionHighlight: opts.contribInfo.selectionHighlight, + occurrencesHighlight: opts.contribInfo.occurrencesHighlight, + codeLens: opts.contribInfo.codeLens, folding: (accessibilityIsOn ? false : opts.contribInfo.folding), // DISABLED WHEN SCREEN READER IS ATTACHED foldingStrategy: opts.contribInfo.foldingStrategy, showFoldingControls: opts.contribInfo.showFoldingControls, - matchBrackets: (accessibilityIsOn ? false : opts.contribInfo.matchBrackets), // DISABLED WHEN SCREEN READER IS ATTACHED + matchBrackets: opts.contribInfo.matchBrackets, find: opts.contribInfo.find, colorDecorators: opts.contribInfo.colorDecorators, lightbulbEnabled: opts.contribInfo.lightbulbEnabled, From 40e79350b4292235bbcf4582da99fc9d939fd46e Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 23 Aug 2019 14:56:25 +0200 Subject: [PATCH 046/163] Include userdata in configuration resolver file resolution Fixes #78247 --- .../browser/configurationResolverService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts index 4709a15555b..f5d0b60b07b 100644 --- a/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts @@ -55,7 +55,7 @@ export abstract class BaseConfigurationResolverService extends AbstractVariableR if (activeEditor instanceof DiffEditorInput) { activeEditor = activeEditor.modifiedInput; } - const fileResource = toResource(activeEditor, { filterByScheme: Schemas.file }); + const fileResource = toResource(activeEditor, { filterByScheme: [Schemas.file, Schemas.userData] }); if (!fileResource) { return undefined; } From 760df9342ba7869fcd62e29ccd17c817d5522b29 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 15:21:01 +0200 Subject: [PATCH 047/163] build - document loading approach better --- src/vs/code/electron-browser/workbench/workbench.js | 5 ++++- src/vs/workbench/workbench.web.api.ts | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/code/electron-browser/workbench/workbench.js b/src/vs/code/electron-browser/workbench/workbench.js index 98e67927fe1..22d5dbe329c 100644 --- a/src/vs/code/electron-browser/workbench/workbench.js +++ b/src/vs/code/electron-browser/workbench/workbench.js @@ -14,7 +14,10 @@ const bootstrapWindow = require('../../../../bootstrap-window'); // Setup shell environment process['lazyEnv'] = getLazyEnv(); -// Load workbench main +// Load workbench main JS, CSS and NLS all in parallel. This is an +// optimization to prevent a waterfall of loading to happen, because +// we know for a fact that workbench.desktop.main will depend on +// the related CSS and NLS counterparts. bootstrapWindow.load([ 'vs/workbench/workbench.desktop.main', 'vs/nls!vs/workbench/workbench.desktop.main', diff --git a/src/vs/workbench/workbench.web.api.ts b/src/vs/workbench/workbench.web.api.ts index 7f1da9f1203..844ff1da56a 100644 --- a/src/vs/workbench/workbench.web.api.ts +++ b/src/vs/workbench/workbench.web.api.ts @@ -4,8 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/workbench/workbench.web.main'; -import 'vs/nls!vs/workbench/workbench.web.main'; -import 'vs/css!vs/workbench/workbench.web.main'; import { main } from 'vs/workbench/browser/web.main'; import { UriComponents } from 'vs/base/common/uri'; import { IFileSystemProvider } from 'vs/platform/files/common/files'; From 00d53e96861523c96789c5242ffe78101acfe1fb Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Fri, 23 Aug 2019 15:21:24 +0200 Subject: [PATCH 048/163] Option to configure which services should be run (microsoft/vscode-remote-release#211) --- .../schemas/devContainer.schema.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extensions/configuration-editing/schemas/devContainer.schema.json b/extensions/configuration-editing/schemas/devContainer.schema.json index 55950a9021e..c24857720e6 100644 --- a/extensions/configuration-editing/schemas/devContainer.schema.json +++ b/extensions/configuration-editing/schemas/devContainer.schema.json @@ -129,6 +129,13 @@ "type": "string", "description": "The service you want to work on." }, + "runServices": { + "type": "array", + "description": "An array of services that should be started and stopped.", + "items": { + "type": "string" + } + }, "workspaceFolder": { "type": "string", "description": "The path of the workspace folder inside the container." @@ -178,4 +185,4 @@ "$ref": "#/definitions/devContainerCommon" } ] -} \ No newline at end of file +} From edee5c03241c45fc8b9c04e88ef1916e0d595909 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 23 Aug 2019 15:24:22 +0200 Subject: [PATCH 049/163] fix tests --- src/vs/editor/standalone/browser/simpleServices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index ce860a9dbac..f8c1def46a2 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -671,7 +671,7 @@ export class SimpleUriLabelService implements ILabelService { } getUriBasenameLabel(resource: URI): string { - return basename(resource.path); + return basename(this.getUriLabel(resource)); } public getWorkspaceLabel(workspace: IWorkspaceIdentifier | URI | IWorkspace, options?: { verbose: boolean; }): string { From df880b0434db1ab7889a5ffa777e8ec7ccd73f90 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Fri, 23 Aug 2019 15:36:05 +0200 Subject: [PATCH 050/163] Workaround for broken WSL2 in Win build 18947. For #77898 --- resources/win32/bin/code.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/resources/win32/bin/code.sh b/resources/win32/bin/code.sh index 4bc4677e1e4..745f2adb7aa 100644 --- a/resources/win32/bin/code.sh +++ b/resources/win32/bin/code.sh @@ -11,14 +11,9 @@ VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")" ELECTRON="$VSCODE_PATH/$NAME.exe" if grep -qi Microsoft /proc/version; then # in a wsl shell - if [ "$WSL_DISTRO_NAME" ]; then - # $WSL_DISTRO_NAME is available since WSL builds 18362, also for WSL2 - WSL_BUILD=18362 - else - WSL_BUILD=$(uname -r | sed -E 's/^.+-([0-9]+)-Microsoft/\1/') - if [ -z "$WSL_BUILD" ]; then - WSL_BUILD=0 - fi + WSL_BUILD=$(uname -r | sed -E 's/^[0-9.]+-([0-9]+)-Microsoft|([0-9]+).([0-9]+).([0-9]+)-microsoft-standard|.*/\1\2\3\4/') + if [ -z "$WSL_BUILD" ]; then + WSL_BUILD=0 fi if [ $WSL_BUILD -ge 17063 ]; then @@ -30,7 +25,18 @@ if grep -qi Microsoft /proc/version; then # use the Remote WSL extension if installed WSL_EXT_ID="ms-vscode-remote.remote-wsl" - WSL_EXT_WLOC=$(ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --locate-extension $WSL_EXT_ID) + + if [ $WSL_BUILD -ge 41955 ]; then + # WSL2 in workaround for https://github.com/microsoft/WSL/issues/4337 + CWD="$(pwd)" + cd "$VSCODE_PATH" + cmd.exe /C ".\\bin\\$APP_NAME.cmd --locate-extension $WSL_EXT_ID >remote-wsl-loc.txt" + WSL_EXT_WLOC="$(cat ./remote-wsl-loc.txt)" + rm remote-wsl-loc.txt + cd "$CWD" + else + WSL_EXT_WLOC=$(ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --locate-extension $WSL_EXT_ID) + fi if [ -n "$WSL_EXT_WLOC" ]; then # replace \r\n with \n in WSL_EXT_WLOC WSL_CODE=$(wslpath -u "${WSL_EXT_WLOC%%[[:cntrl:]]}")/scripts/wslCode.sh From 82d915c2e9fbc9055807fdc215539e423e91915b Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 23 Aug 2019 15:42:26 +0200 Subject: [PATCH 051/163] worker - block some globals from being used --- .../extensions/worker/extensionHostWorker.ts | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts b/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts index 34e3f35a624..3d6659698be 100644 --- a/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts +++ b/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts @@ -12,15 +12,31 @@ import { ExtensionHostMain } from 'vs/workbench/services/extensions/common/exten import { IHostUtils } from 'vs/workbench/api/common/extHostExtensionService'; import 'vs/workbench/services/extensions/worker/extHost.services'; -// worker-self +//#region --- Define, capture, and override some globals +//todo@joh do not allow extensions to call postMessage and other globals... + declare namespace self { - function close(): void; + let close: any; + let postMessage: any; + let addEventLister: any; + let indexedDB: any; + let caches: any; } -// do not allow extensions to call terminate const nativeClose = self.close.bind(self); -self.close = () => console.trace('An extension called terminate and this was prevented'); -let onTerminate = nativeClose; +self.close = () => console.trace(`'close' has been blocked`); + +const nativePostMessage = postMessage.bind(self); +self.postMessage = () => console.trace(`'postMessage' has been blocked`); + +const nativeAddEventLister = addEventListener.bind(self); +self.addEventLister = () => console.trace(`'addEventListener' has been blocked`); + +// readonly, cannot redefine... +// self.indexedDB = undefined; +// self.caches = undefined; + +//#endregion --- const hostUtil = new class implements IHostUtils { _serviceBrand: any; @@ -35,7 +51,6 @@ const hostUtil = new class implements IHostUtils { } }; -//todo@joh do not allow extensions to call postMessage and other globals... class ExtensionWorker { @@ -47,7 +62,8 @@ class ExtensionWorker { let emitter = new Emitter(); let terminating = false; - onmessage = event => { + + nativeAddEventLister('message', event => { const { data } = event; if (!(data instanceof ArrayBuffer)) { console.warn('UNKNOWN data received', data); @@ -64,14 +80,14 @@ class ExtensionWorker { // emit non-terminate messages to the outside emitter.fire(msg); - }; + }); this.protocol = { onMessage: emitter.event, send: vsbuf => { if (!terminating) { const data = vsbuf.buffer.buffer.slice(vsbuf.buffer.byteOffset, vsbuf.buffer.byteOffset + vsbuf.buffer.byteLength); - postMessage(data, [data]); + nativePostMessage(data, [data]); } } }; @@ -94,6 +110,8 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise Date: Fri, 23 Aug 2019 16:30:03 +0200 Subject: [PATCH 052/163] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0add763ee42..27866eca591 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "d54cb1c81bc4458276bd38093586ee3566539d2d", + "distro": "740bacd7f9f039377fb63de6d4dc85f9ae88236a", "author": { "name": "Microsoft Corporation" }, From ebe53708ac47643becdda0e11cf5fb751b3ddd0c Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 16:31:25 +0200 Subject: [PATCH 053/163] web - prevent waterfall loading --- src/vs/code/browser/workbench/workbench.html | 23 +++++++++++-------- ...nch.web.main.css => workbench.web.api.css} | 3 --- ...b.main.nls.js => workbench.web.api.nls.js} | 2 -- 3 files changed, 13 insertions(+), 15 deletions(-) rename src/vs/workbench/{workbench.web.main.css => workbench.web.api.css} (94%) rename src/vs/workbench/{workbench.web.main.nls.js => workbench.web.api.nls.js} (96%) diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 9bf87281e2c..9c7defe5af3 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -4,29 +4,32 @@ - - - + + + - + - - + + + + - + - - + diff --git a/src/vs/workbench/workbench.web.main.css b/src/vs/workbench/workbench.web.api.css similarity index 94% rename from src/vs/workbench/workbench.web.main.css rename to src/vs/workbench/workbench.web.api.css index 06ed8a197b2..3a0641938d5 100644 --- a/src/vs/workbench/workbench.web.main.css +++ b/src/vs/workbench/workbench.web.api.css @@ -4,6 +4,3 @@ *--------------------------------------------------------------------------------------------*/ /* NOTE: THIS FILE WILL BE OVERWRITTEN DURING BUILD TIME, DO NOT EDIT */ - -div.monaco.main.css { -} \ No newline at end of file diff --git a/src/vs/workbench/workbench.web.main.nls.js b/src/vs/workbench/workbench.web.api.nls.js similarity index 96% rename from src/vs/workbench/workbench.web.main.nls.js rename to src/vs/workbench/workbench.web.api.nls.js index d6a8b487eaf..6113d093d5c 100644 --- a/src/vs/workbench/workbench.web.main.nls.js +++ b/src/vs/workbench/workbench.web.api.nls.js @@ -4,5 +4,3 @@ *--------------------------------------------------------------------------------------------*/ // NOTE: THIS FILE WILL BE OVERWRITTEN DURING BUILD TIME, DO NOT EDIT - -define([], {}); \ No newline at end of file From f58c8f6a0c5b90f2503666dad5a91969ddcbb895 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 23 Aug 2019 16:37:17 +0200 Subject: [PATCH 054/163] Revert "build - add pool" This reverts commit 7125817376817d861b719619920f3b4ba0d2dca0. --- build/azure-pipelines/distro-build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/azure-pipelines/distro-build.yml b/build/azure-pipelines/distro-build.yml index 74fddcc55a8..62ee67ad1c6 100644 --- a/build/azure-pipelines/distro-build.yml +++ b/build/azure-pipelines/distro-build.yml @@ -1,6 +1,3 @@ -pool: - vmImage: 'Ubuntu-16.04' - trigger: branches: include: ['master', 'release/*'] From cf7fb7763a5dabea7356d9bee7d122753db61dfc Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 23 Aug 2019 17:28:55 +0200 Subject: [PATCH 055/163] introduce cursor word accessibilty commands --- .../common/controller/cursorWordOperations.ts | 34 ++++++- .../test/wordOperations.test.ts | 42 ++++++++- .../contrib/wordOperations/wordOperations.ts | 91 +++++++++++++++++++ 3 files changed, 164 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/common/controller/cursorWordOperations.ts b/src/vs/editor/common/controller/cursorWordOperations.ts index 1939996a242..b411d54bb49 100644 --- a/src/vs/editor/common/controller/cursorWordOperations.ts +++ b/src/vs/editor/common/controller/cursorWordOperations.ts @@ -39,7 +39,8 @@ const enum WordType { export const enum WordNavigationType { WordStart = 0, WordStartFast = 1, - WordEnd = 2 + WordEnd = 2, + WordAcessibility = 3 // Respect chrome defintion of a word } export class WordOperations { @@ -202,6 +203,19 @@ export class WordOperations { return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); } + if (wordNavigationType === WordNavigationType.WordAcessibility) { + while ( + prevWordOnLine + && prevWordOnLine.wordType === WordType.Separator + && prevWordOnLine.end - prevWordOnLine.start === 1 + ) { + // Skip over a word made up of one single separator + prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, prevWordOnLine.start + 1)); + } + + return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); + } + // We are stopping at the ending of words if (prevWordOnLine && column <= prevWordOnLine.end + 1) { @@ -275,6 +289,22 @@ export class WordOperations { } else { column = model.getLineMaxColumn(lineNumber); } + } else if (wordNavigationType === WordNavigationType.WordAcessibility) { + + while ( + nextWordOnLine + && nextWordOnLine.wordType === WordType.Separator + && nextWordOnLine.end - nextWordOnLine.start === 1 + ) { + // Skip over a word made up of one single separator + nextWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1)); + } + + if (nextWordOnLine) { + column = nextWordOnLine.start + 1; + } else { + column = model.getLineMaxColumn(lineNumber); + } } else { if (nextWordOnLine && !movedDown && column >= nextWordOnLine.start + 1) { nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1)); @@ -617,4 +647,4 @@ export class WordPartOperations extends WordOperations { function enforceDefined(arr: Array): T[] { return arr.filter(el => Boolean(el)); -} \ No newline at end of file +} diff --git a/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts b/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts index 98c22c721ef..c647e151cfe 100644 --- a/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts +++ b/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts @@ -9,7 +9,7 @@ import { EditorCommand } from 'vs/editor/browser/editorExtensions'; import { Position } from 'vs/editor/common/core/position'; import { Selection } from 'vs/editor/common/core/selection'; import { deserializePipePositions, serializePipePositions, testRepeatedActionAndExtractPositions } from 'vs/editor/contrib/wordOperations/test/wordTestUtils'; -import { CursorWordEndLeft, CursorWordEndLeftSelect, CursorWordEndRight, CursorWordEndRightSelect, CursorWordLeft, CursorWordLeftSelect, CursorWordRight, CursorWordRightSelect, CursorWordStartLeft, CursorWordStartLeftSelect, CursorWordStartRight, CursorWordStartRightSelect, DeleteWordEndLeft, DeleteWordEndRight, DeleteWordLeft, DeleteWordRight, DeleteWordStartLeft, DeleteWordStartRight } from 'vs/editor/contrib/wordOperations/wordOperations'; +import { CursorWordEndLeft, CursorWordEndLeftSelect, CursorWordEndRight, CursorWordEndRightSelect, CursorWordLeft, CursorWordLeftSelect, CursorWordRight, CursorWordRightSelect, CursorWordStartLeft, CursorWordStartLeftSelect, CursorWordStartRight, CursorWordStartRightSelect, DeleteWordEndLeft, DeleteWordEndRight, DeleteWordLeft, DeleteWordRight, DeleteWordStartLeft, DeleteWordStartRight, CursorWordAccessibilityLeft, CursorWordAccessibilityLeftSelect, CursorWordAccessibilityRight, CursorWordAccessibilityRightSelect } from 'vs/editor/contrib/wordOperations/wordOperations'; import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; suite('WordOperations', () => { @@ -26,6 +26,10 @@ suite('WordOperations', () => { const _cursorWordStartRightSelect = new CursorWordStartRightSelect(); const _cursorWordEndRightSelect = new CursorWordEndRightSelect(); const _cursorWordRightSelect = new CursorWordRightSelect(); + const _cursorWordAccessibilityLeft = new CursorWordAccessibilityLeft(); + const _cursorWordAccessibilityLeftSelect = new CursorWordAccessibilityLeftSelect(); + const _cursorWordAccessibilityRight = new CursorWordAccessibilityRight(); + const _cursorWordAccessibilityRightSelect = new CursorWordAccessibilityRightSelect(); const _deleteWordLeft = new DeleteWordLeft(); const _deleteWordStartLeft = new DeleteWordStartLeft(); const _deleteWordEndLeft = new DeleteWordEndLeft(); @@ -39,6 +43,12 @@ suite('WordOperations', () => { function cursorWordLeft(editor: ICodeEditor, inSelectionMode: boolean = false): void { runEditorCommand(editor, inSelectionMode ? _cursorWordLeftSelect : _cursorWordLeft); } + function cursorWordAccessibilityLeft(editor: ICodeEditor, inSelectionMode: boolean = false): void { + runEditorCommand(editor, inSelectionMode ? _cursorWordAccessibilityLeft : _cursorWordAccessibilityLeftSelect); + } + function cursorWordAccessibilityRight(editor: ICodeEditor, inSelectionMode: boolean = false): void { + runEditorCommand(editor, inSelectionMode ? _cursorWordAccessibilityRightSelect : _cursorWordAccessibilityRight); + } function cursorWordStartLeft(editor: ICodeEditor, inSelectionMode: boolean = false): void { runEditorCommand(editor, inSelectionMode ? _cursorWordStartLeftSelect : _cursorWordStartLeft); } @@ -326,6 +336,36 @@ suite('WordOperations', () => { assert.deepEqual(actual, EXPECTED); }); + test('cursorWordAccessibilityLeft', () => { + const EXPECTED = ['| |/* |Just |some |more |text |a|+= |3 |+|5|-|3 |+ |7 |*/| '].join('\n'); + const [text,] = deserializePipePositions(EXPECTED); + const actualStops = testRepeatedActionAndExtractPositions( + text, + new Position(1000, 1000), + ed => cursorWordAccessibilityLeft(ed), + ed => ed.getPosition()!, + ed => ed.getPosition()!.equals(new Position(1, 1)) + ); + const actual = serializePipePositions(text, actualStops); + assert.deepEqual(actual, EXPECTED); + }); + + test('cursorWordAccessibilityRight', () => { + const EXPECTED = [ + 'console|.log|(err|)|', + ].join('\n'); + const [text,] = deserializePipePositions(EXPECTED); + const actualStops = testRepeatedActionAndExtractPositions( + text, + new Position(1, 1), + ed => cursorWordAccessibilityRight(ed), + ed => ed.getPosition()!, + ed => ed.getPosition()!.equals(new Position(1, 17)) + ); + const actual = serializePipePositions(text, actualStops); + assert.deepEqual(actual, EXPECTED); + }); + test('deleteWordLeft for non-empty selection', () => { withTestCodeEditor([ ' \tMy First Line\t ', diff --git a/src/vs/editor/contrib/wordOperations/wordOperations.ts b/src/vs/editor/contrib/wordOperations/wordOperations.ts index dc4e111f962..bd305ba7103 100644 --- a/src/vs/editor/contrib/wordOperations/wordOperations.ts +++ b/src/vs/editor/contrib/wordOperations/wordOperations.ts @@ -18,6 +18,8 @@ import { ScrollType } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ITextModel } from 'vs/editor/common/model'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/common/accessibility'; +import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; export interface MoveWordOptions extends ICommandOptions { inSelectionMode: boolean; @@ -170,6 +172,49 @@ export class CursorWordLeftSelect extends WordLeftCommand { } } +const CHROME_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;",.<>/?'; +export class CursorWordAccessibilityLeft extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: WordNavigationType.WordAcessibility, + id: 'cursorWordAccessibilityLeft', + precondition: undefined, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, CONTEXT_ACCESSIBILITY_MODE_ENABLED), + primary: KeyMod.CtrlCmd | KeyCode.LeftArrow, + mac: { primary: KeyMod.Alt | KeyCode.LeftArrow }, + weight: KeybindingWeight.EditorContrib + 1 + } + }); + } + + protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { + return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + } +} + +export class CursorWordAccessibilityLeftSelect extends WordLeftCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: WordNavigationType.WordAcessibility, + id: 'cursorWordAccessibilitLeftSelecty', + precondition: undefined, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, CONTEXT_ACCESSIBILITY_MODE_ENABLED), + primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow, + mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow }, + weight: KeybindingWeight.EditorContrib + 1 + } + }); + } + + protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { + return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + } +} + export class CursorWordStartRight extends WordRightCommand { constructor() { super({ @@ -248,6 +293,48 @@ export class CursorWordRightSelect extends WordRightCommand { } } +export class CursorWordAccessibilityRight extends WordRightCommand { + constructor() { + super({ + inSelectionMode: false, + wordNavigationType: WordNavigationType.WordAcessibility, + id: 'cursorWordAccessibilityRight', + precondition: undefined, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, CONTEXT_ACCESSIBILITY_MODE_ENABLED), + primary: KeyMod.CtrlCmd | KeyCode.RightArrow, + mac: { primary: KeyMod.Alt | KeyCode.RightArrow }, + weight: KeybindingWeight.EditorContrib + 1 + } + }); + } + + protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { + return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + } +} + +export class CursorWordAccessibilityRightSelect extends WordRightCommand { + constructor() { + super({ + inSelectionMode: true, + wordNavigationType: WordNavigationType.WordAcessibility, + id: 'cursorWordAccessibilityRightSelect', + precondition: undefined, + kbOpts: { + kbExpr: ContextKeyExpr.and(EditorContextKeys.textInputFocus, CONTEXT_ACCESSIBILITY_MODE_ENABLED), + primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow, + mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow }, + weight: KeybindingWeight.EditorContrib + 1 + } + }); + } + + protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { + return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + } +} + export interface DeleteWordOptions extends ICommandOptions { whitespaceHeuristics: boolean; wordNavigationType: WordNavigationType; @@ -397,6 +484,10 @@ registerEditorCommand(new CursorWordRight()); registerEditorCommand(new CursorWordStartRightSelect()); registerEditorCommand(new CursorWordEndRightSelect()); registerEditorCommand(new CursorWordRightSelect()); +registerEditorCommand(new CursorWordAccessibilityLeft()); +registerEditorCommand(new CursorWordAccessibilityLeftSelect()); +registerEditorCommand(new CursorWordAccessibilityRight()); +registerEditorCommand(new CursorWordAccessibilityRightSelect()); registerEditorCommand(new DeleteWordStartLeft()); registerEditorCommand(new DeleteWordEndLeft()); registerEditorCommand(new DeleteWordLeft()); From 4c2f7756d20acabbff07ca70dfc0de3e43b9bd35 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 23 Aug 2019 17:30:19 +0200 Subject: [PATCH 056/163] Improve connection logic (fixes microsoft/vscode-remote-release#1224) --- src/vs/base/parts/ipc/common/ipc.net.ts | 93 +++--- .../remote/common/remoteAgentConnection.ts | 265 +++++++++++++----- src/vs/workbench/browser/web.main.ts | 2 +- .../electron-browser/desktop.main.ts | 2 +- .../configurationService.test.ts | 2 +- .../common/remoteExtensionHostClient.ts | 3 +- .../node/extensionHostProcessSetup.ts | 8 +- .../remote/browser/remoteAgentServiceImpl.ts | 6 +- .../common/abstractRemoteAgentService.ts | 7 +- .../remoteAgentServiceImpl.ts | 6 +- .../services/remote/node/tunnelService.ts | 7 +- 11 files changed, 270 insertions(+), 131 deletions(-) diff --git a/src/vs/base/parts/ipc/common/ipc.net.ts b/src/vs/base/parts/ipc/common/ipc.net.ts index 207fceb65b9..1e2fdbccec4 100644 --- a/src/vs/base/parts/ipc/common/ipc.net.ts +++ b/src/vs/base/parts/ipc/common/ipc.net.ts @@ -405,42 +405,53 @@ export class Client extends IPCClient { /** * Will ensure no messages are lost if there are no event listeners. */ -export function createBufferedEvent(source: Event): Event { - let emitter: Emitter; - let hasListeners = false; - let isDeliveringMessages = false; - let bufferedMessages: T[] = []; +export class BufferedEmitter { + private _emitter: Emitter; + public readonly event: Event; - const deliverMessages = () => { - if (isDeliveringMessages) { + private _hasListeners = false; + private _isDeliveringMessages = false; + private _bufferedMessages: T[] = []; + + constructor() { + this._emitter = new Emitter({ + onFirstListenerAdd: () => { + this._hasListeners = true; + // it is important to deliver these messages after this call, but before + // other messages have a chance to be received (to guarantee in order delivery) + // that's why we're using here nextTick and not other types of timeouts + process.nextTick(() => this._deliverMessages); + }, + onLastListenerRemove: () => { + this._hasListeners = false; + } + }); + + this.event = this._emitter.event; + } + + private _deliverMessages(): void { + if (this._isDeliveringMessages) { return; } - isDeliveringMessages = true; - while (hasListeners && bufferedMessages.length > 0) { - emitter.fire(bufferedMessages.shift()!); + this._isDeliveringMessages = true; + while (this._hasListeners && this._bufferedMessages.length > 0) { + this._emitter.fire(this._bufferedMessages.shift()!); } - isDeliveringMessages = false; - }; + this._isDeliveringMessages = false; + } - source((e: T) => { - bufferedMessages.push(e); - deliverMessages(); - }); - - emitter = new Emitter({ - onFirstListenerAdd: () => { - hasListeners = true; - // it is important to deliver these messages after this call, but before - // other messages have a chance to be received (to guarantee in order delivery) - // that's why we're using here nextTick and not other types of timeouts - process.nextTick(deliverMessages); - }, - onLastListenerRemove: () => { - hasListeners = false; + public fire(event: T): void { + if (this._hasListeners) { + this._emitter.fire(event); + } else { + this._bufferedMessages.push(event); } - }); + } - return emitter.event; + public flushBuffer(): void { + this._bufferedMessages = []; + } } class QueueElement { @@ -530,20 +541,20 @@ export class PersistentProtocol implements IMessagePassingProtocol { private _socketReader: ProtocolReader; private _socketDisposables: IDisposable[]; - private _onControlMessage = new Emitter(); - readonly onControlMessage: Event = createBufferedEvent(this._onControlMessage.event); + private readonly _onControlMessage = new BufferedEmitter(); + readonly onControlMessage: Event = this._onControlMessage.event; - private _onMessage = new Emitter(); - readonly onMessage: Event = createBufferedEvent(this._onMessage.event); + private readonly _onMessage = new BufferedEmitter(); + readonly onMessage: Event = this._onMessage.event; - private _onClose = new Emitter(); - readonly onClose: Event = createBufferedEvent(this._onClose.event); + private readonly _onClose = new BufferedEmitter(); + readonly onClose: Event = this._onClose.event; - private _onSocketClose = new Emitter(); - readonly onSocketClose: Event = createBufferedEvent(this._onSocketClose.event); + private readonly _onSocketClose = new BufferedEmitter(); + readonly onSocketClose: Event = this._onSocketClose.event; - private _onSocketTimeout = new Emitter(); - readonly onSocketTimeout: Event = createBufferedEvent(this._onSocketTimeout.event); + private readonly _onSocketTimeout = new BufferedEmitter(); + readonly onSocketTimeout: Event = this._onSocketTimeout.event; public get unacknowledgedCount(): number { return this._outgoingMsgId - this._outgoingAckId; @@ -656,6 +667,10 @@ export class PersistentProtocol implements IMessagePassingProtocol { this._isReconnecting = true; this._socketDisposables = dispose(this._socketDisposables); + this._onControlMessage.flushBuffer(); + this._onSocketClose.flushBuffer(); + this._onSocketTimeout.flushBuffer(); + this._socket.dispose(); this._socket = socket; this._socketWriter = new ProtocolWriter(this._socket); diff --git a/src/vs/platform/remote/common/remoteAgentConnection.ts b/src/vs/platform/remote/common/remoteAgentConnection.ts index 7b6e6897681..b526d149fa3 100644 --- a/src/vs/platform/remote/common/remoteAgentConnection.ts +++ b/src/vs/platform/remote/common/remoteAgentConnection.ts @@ -10,9 +10,10 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { VSBuffer } from 'vs/base/common/buffer'; import { Emitter } from 'vs/base/common/event'; import { RemoteAuthorityResolverError } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { isPromiseCanceledError } from 'vs/base/common/errors'; +import { isPromiseCanceledError, onUnexpectedError } from 'vs/base/common/errors'; import { ISignService } from 'vs/platform/sign/common/sign'; import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; +import { ILogService } from 'vs/platform/log/common/log'; export const enum ConnectionType { Management = 1, @@ -20,6 +21,17 @@ export const enum ConnectionType { Tunnel = 3, } +function connectionTypeToString(connectionType: ConnectionType): string { + switch (connectionType) { + case ConnectionType.Management: + return 'Management'; + case ConnectionType.ExtensionHost: + return 'ExtensionHost'; + case ConnectionType.Tunnel: + return 'Tunnel'; + } +} + export interface AuthRequest { type: 'auth'; auth: string; @@ -58,6 +70,7 @@ interface ISimpleConnectionOptions { reconnectionProtocol: PersistentProtocol | null; socketFactory: ISocketFactory; signService: ISignService; + logService: ILogService; } export interface IConnectCallback { @@ -68,29 +81,46 @@ export interface ISocketFactory { connect(host: string, port: number, query: string, callback: IConnectCallback): void; } -async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptions, connectionType: ConnectionType, args: any | undefined): Promise { - const protocol = await new Promise((c, e) => { +async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptions, connectionType: ConnectionType, args: any | undefined): Promise<{ protocol: PersistentProtocol; ownsProtocol: boolean; }> { + const logPrefix = connectLogPrefix(options, connectionType); + const { protocol, ownsProtocol } = await new Promise<{ protocol: PersistentProtocol; ownsProtocol: boolean; }>((c, e) => { + options.logService.trace(`${logPrefix} 1/6. invoking socketFactory.connect().`); options.socketFactory.connect( options.host, options.port, `reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, (err: any, socket: ISocket) => { if (err) { + options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`); + options.logService.error(err); e(err); return; } + options.logService.trace(`${logPrefix} 2/6. socketFactory.connect() was successful.`); if (options.reconnectionProtocol) { options.reconnectionProtocol.beginAcceptReconnection(socket, null); - c(options.reconnectionProtocol); + c({ protocol: options.reconnectionProtocol, ownsProtocol: false }); } else { - c(new PersistentProtocol(socket, null)); + c({ protocol: new PersistentProtocol(socket, null), ownsProtocol: true }); } } ); }); - return new Promise((c, e) => { + return new Promise<{ protocol: PersistentProtocol; ownsProtocol: boolean; }>((c, e) => { + + const errorTimeoutToken = setTimeout(() => { + const error: any = new Error('handshake timeout'); + error.code = 'ETIMEDOUT'; + error.syscall = 'connect'; + options.logService.error(`${logPrefix} the handshake took longer than 10 seconds. Error:`); + options.logService.error(error); + if (ownsProtocol) { + safeDisposeProtocolAndSocket(protocol); + } + e(error); + }, 10000); const messageRegistration = protocol.onControlMessage(async raw => { const msg = JSON.parse(raw.toString()); @@ -99,11 +129,16 @@ async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptio const error = getErrorFromMessage(msg); if (error) { + options.logService.error(`${logPrefix} received error control message when negotiating connection. Error:`); + options.logService.error(error); + if (ownsProtocol) { + safeDisposeProtocolAndSocket(protocol); + } return e(error); } if (msg.type === 'sign') { - + options.logService.trace(`${logPrefix} 4/6. received SignRequest control message.`); const signed = await options.signService.sign(msg.data); const connTypeRequest: ConnectionTypeRequest = { type: 'connectionType', @@ -114,17 +149,22 @@ async function connectToRemoteExtensionHostAgent(options: ISimpleConnectionOptio if (args) { connTypeRequest.args = args; } + options.logService.trace(`${logPrefix} 5/6. sending ConnectionTypeRequest control message.`); protocol.sendControl(VSBuffer.fromString(JSON.stringify(connTypeRequest))); - c(protocol); + clearTimeout(errorTimeoutToken); + c({ protocol, ownsProtocol }); } else { - e(new Error('handshake error')); + const error = new Error('handshake error'); + options.logService.error(`${logPrefix} received unexpected control message. Error:`); + options.logService.error(error); + if (ownsProtocol) { + safeDisposeProtocolAndSocket(protocol); + } + e(error); } }); - setTimeout(() => { - e(new Error('handshake timeout')); - }, 2000); - + options.logService.trace(`${logPrefix} 3/6. sending AuthRequest control message.`); // TODO@vs-remote: use real nonce here const authRequest: AuthRequest = { type: 'auth', @@ -138,24 +178,37 @@ interface IManagementConnectionResult { protocol: PersistentProtocol; } -async function doConnectRemoteAgentManagement(options: ISimpleConnectionOptions): Promise { - const protocol = await connectToRemoteExtensionHostAgent(options, ConnectionType.Management, undefined); - return new Promise((c, e) => { +async function connectToRemoteExtensionHostAgentAndReadOneMessage(options: ISimpleConnectionOptions, connectionType: ConnectionType, args: any | undefined): Promise<{ protocol: PersistentProtocol; firstMessage: any }> { + const startTime = Date.now(); + const logPrefix = connectLogPrefix(options, connectionType); + const { protocol, ownsProtocol } = await connectToRemoteExtensionHostAgent(options, connectionType, args); + return new Promise<{ protocol: PersistentProtocol; firstMessage: any }>((c, e) => { const registration = protocol.onControlMessage(raw => { registration.dispose(); const msg = JSON.parse(raw.toString()); const error = getErrorFromMessage(msg); if (error) { + options.logService.error(`${logPrefix} received error control message when negotiating connection. Error:`); + options.logService.error(error); + if (ownsProtocol) { + safeDisposeProtocolAndSocket(protocol); + } return e(error); } if (options.reconnectionProtocol) { options.reconnectionProtocol.endAcceptReconnection(); } - c({ protocol }); + options.logService.trace(`${logPrefix} 6/6. handshake finished, connection is up and running after ${logElapsed(startTime)}!`); + c({ protocol, firstMessage: msg }); }); }); } +async function doConnectRemoteAgentManagement(options: ISimpleConnectionOptions): Promise { + const { protocol } = await connectToRemoteExtensionHostAgentAndReadOneMessage(options, ConnectionType.Management, undefined); + return { protocol }; +} + export interface IRemoteExtensionHostStartParams { language: string; debugId?: string; @@ -170,22 +223,9 @@ interface IExtensionHostConnectionResult { } async function doConnectRemoteAgentExtensionHost(options: ISimpleConnectionOptions, startArguments: IRemoteExtensionHostStartParams): Promise { - const protocol = await connectToRemoteExtensionHostAgent(options, ConnectionType.ExtensionHost, startArguments); - return new Promise((c, e) => { - const registration = protocol.onControlMessage(raw => { - registration.dispose(); - const msg = JSON.parse(raw.toString()); - const error = getErrorFromMessage(msg); - if (error) { - return e(error); - } - const debugPort = msg && msg.debugPort; - if (options.reconnectionProtocol) { - options.reconnectionProtocol.endAcceptReconnection(); - } - c({ protocol, debugPort }); - }); - }); + const { protocol, firstMessage } = await connectToRemoteExtensionHostAgentAndReadOneMessage(options, ConnectionType.ExtensionHost, startArguments); + const debugPort = firstMessage && firstMessage.debugPort; + return { protocol, debugPort }; } export interface ITunnelConnectionStartParams { @@ -193,7 +233,10 @@ export interface ITunnelConnectionStartParams { } async function doConnectRemoteAgentTunnel(options: ISimpleConnectionOptions, startParams: ITunnelConnectionStartParams): Promise { - const protocol = await connectToRemoteExtensionHostAgent(options, ConnectionType.Tunnel, startParams); + const startTime = Date.now(); + const logPrefix = connectLogPrefix(options, ConnectionType.Tunnel); + const { protocol } = await connectToRemoteExtensionHostAgent(options, ConnectionType.Tunnel, startParams); + options.logService.trace(`${logPrefix} 6/6. handshake finished, connection is up and running after ${logElapsed(startTime)}!`); return protocol; } @@ -202,6 +245,7 @@ export interface IConnectionOptions { socketFactory: ISocketFactory; addressProvider: IAddressProvider; signService: ISignService; + logService: ILogService; } async function resolveConnectionOptions(options: IConnectionOptions, reconnectionToken: string, reconnectionProtocol: PersistentProtocol | null): Promise { @@ -213,7 +257,8 @@ async function resolveConnectionOptions(options: IConnectionOptions, reconnectio reconnectionToken: reconnectionToken, reconnectionProtocol: reconnectionProtocol, socketFactory: options.socketFactory, - signService: options.signService + signService: options.signService, + logService: options.logService }; } @@ -227,22 +272,36 @@ export interface IAddressProvider { } export async function connectRemoteAgentManagement(options: IConnectionOptions, remoteAuthority: string, clientId: string): Promise { - const reconnectionToken = generateUuid(); - const simpleOptions = await resolveConnectionOptions(options, reconnectionToken, null); - const { protocol } = await doConnectRemoteAgentManagement(simpleOptions); - return new ManagementPersistentConnection(options, remoteAuthority, clientId, reconnectionToken, protocol); + try { + const reconnectionToken = generateUuid(); + const simpleOptions = await resolveConnectionOptions(options, reconnectionToken, null); + const { protocol } = await connectWithTimeLimit(simpleOptions.logService, doConnectRemoteAgentManagement(simpleOptions), 30 * 1000 /*30s*/); + return new ManagementPersistentConnection(options, remoteAuthority, clientId, reconnectionToken, protocol); + } catch (err) { + options.logService.error(`[remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:`); + options.logService.error(err); + PersistentConnection.triggerPermanentFailure(); + throw err; + } } export async function connectRemoteAgentExtensionHost(options: IConnectionOptions, startArguments: IRemoteExtensionHostStartParams): Promise { - const reconnectionToken = generateUuid(); - const simpleOptions = await resolveConnectionOptions(options, reconnectionToken, null); - const { protocol, debugPort } = await doConnectRemoteAgentExtensionHost(simpleOptions, startArguments); - return new ExtensionHostPersistentConnection(options, startArguments, reconnectionToken, protocol, debugPort); + try { + const reconnectionToken = generateUuid(); + const simpleOptions = await resolveConnectionOptions(options, reconnectionToken, null); + const { protocol, debugPort } = await connectWithTimeLimit(simpleOptions.logService, doConnectRemoteAgentExtensionHost(simpleOptions, startArguments), 30 * 1000 /*30s*/); + return new ExtensionHostPersistentConnection(options, startArguments, reconnectionToken, protocol, debugPort); + } catch (err) { + options.logService.error(`[remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:`); + options.logService.error(err); + PersistentConnection.triggerPermanentFailure(); + throw err; + } } export async function connectRemoteAgentTunnel(options: IConnectionOptions, tunnelRemotePort: number): Promise { const simpleOptions = await resolveConnectionOptions(options, generateUuid(), null); - const protocol = await doConnectRemoteAgentTunnel(simpleOptions, { port: tunnelRemotePort }); + const protocol = await connectWithTimeLimit(simpleOptions.logService, doConnectRemoteAgentTunnel(simpleOptions, { port: tunnelRemotePort }), 30 * 1000 /*30s*/); return protocol; } @@ -292,6 +351,13 @@ export type PersistenConnectionEvent = ConnectionGainEvent | ConnectionLostEvent abstract class PersistentConnection extends Disposable { + public static triggerPermanentFailure(): void { + this._permanentFailure = true; + this._instances.forEach(instance => instance._gotoPermanentFailure()); + } + private static _permanentFailure: boolean = false; + private static _instances: PersistentConnection[] = []; + private readonly _onDidStateChange = this._register(new Emitter()); public readonly onDidStateChange = this._onDidStateChange.event; @@ -300,20 +366,24 @@ abstract class PersistentConnection extends Disposable { public readonly protocol: PersistentProtocol; private _isReconnecting: boolean; - private _permanentFailure: boolean; - constructor(options: IConnectionOptions, reconnectionToken: string, protocol: PersistentProtocol) { + constructor(private readonly _connectionType: ConnectionType, options: IConnectionOptions, reconnectionToken: string, protocol: PersistentProtocol) { super(); this._options = options; this.reconnectionToken = reconnectionToken; this.protocol = protocol; this._isReconnecting = false; - this._permanentFailure = false; this._onDidStateChange.fire(new ConnectionGainEvent()); this._register(protocol.onSocketClose(() => this._beginReconnecting())); this._register(protocol.onSocketTimeout(() => this._beginReconnecting())); + + PersistentConnection._instances.push(this); + + if (PersistentConnection._permanentFailure) { + this._gotoPermanentFailure(); + } } private async _beginReconnecting(): Promise { @@ -330,10 +400,12 @@ abstract class PersistentConnection extends Disposable { } private async _runReconnectingLoop(): Promise { - if (this._permanentFailure) { + if (PersistentConnection._permanentFailure) { // no more attempts! return; } + const logPrefix = commonLogPrefix(this._connectionType, this.reconnectionToken, true); + this._options.logService.info(`${logPrefix} starting reconnecting loop. You can get more information with the trace log level.`); this._onDidStateChange.fire(new ConnectionLostEvent()); const TIMES = [5, 5, 10, 10, 10, 10, 10, 30]; const disconnectStartTime = Date.now(); @@ -345,59 +417,68 @@ abstract class PersistentConnection extends Disposable { const sleepPromise = sleep(waitTime); this._onDidStateChange.fire(new ReconnectionWaitEvent(waitTime, sleepPromise)); + this._options.logService.info(`${logPrefix} waiting for ${waitTime} seconds before reconnecting...`); try { await sleepPromise; } catch { } // User canceled timer + if (PersistentConnection._permanentFailure) { + this._options.logService.error(`${logPrefix} permanent failure occurred while running the reconnecting loop.`); + break; + } + // connection was lost, let's try to re-establish it this._onDidStateChange.fire(new ReconnectionRunningEvent()); + this._options.logService.info(`${logPrefix} resolving connection...`); const simpleOptions = await resolveConnectionOptions(this._options, this.reconnectionToken, this.protocol); - await connectWithTimeLimit(this._reconnect(simpleOptions), 30 * 1000 /*30s*/); + this._options.logService.info(`${logPrefix} connecting to ${simpleOptions.host}:${simpleOptions.port}...`); + await connectWithTimeLimit(simpleOptions.logService, this._reconnect(simpleOptions), 30 * 1000 /*30s*/); + this._options.logService.info(`${logPrefix} reconnected!`); this._onDidStateChange.fire(new ConnectionGainEvent()); break; } catch (err) { if (err.code === 'VSCODE_CONNECTION_ERROR') { - console.error(`A permanent connection error occurred`); - console.error(err); - this._permanentFailure = true; - this._onDidStateChange.fire(new ReconnectionPermanentFailureEvent()); - this.protocol.acceptDisconnect(); + this._options.logService.error(`${logPrefix} A permanent error occurred in the reconnecting loop! Will give up now! Error:`); + this._options.logService.error(err); + PersistentConnection.triggerPermanentFailure(); break; } if (Date.now() - disconnectStartTime > ProtocolConstants.ReconnectionGraceTime) { - console.error(`Giving up after reconnection grace time has expired!`); - this._permanentFailure = true; - this._onDidStateChange.fire(new ReconnectionPermanentFailureEvent()); - this.protocol.acceptDisconnect(); + this._options.logService.error(`${logPrefix} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time has expired! Will give up now! Error:`); + this._options.logService.error(err); + PersistentConnection.triggerPermanentFailure(); break; } if (RemoteAuthorityResolverError.isTemporarilyNotAvailable(err)) { - console.warn(`A temporarily not available error occured while trying to reconnect:`); - console.warn(err); + this._options.logService.info(`${logPrefix} A temporarily not available error occured while trying to reconnect, will try again...`); + this._options.logService.trace(err); // try again! continue; } if ((err.code === 'ETIMEDOUT' || err.code === 'ENETUNREACH' || err.code === 'ECONNREFUSED' || err.code === 'ECONNRESET') && err.syscall === 'connect') { - console.warn(`A connect error occured while trying to reconnect:`); - console.warn(err); + this._options.logService.info(`${logPrefix} A network error occured while trying to reconnect, will try again...`); + this._options.logService.trace(err); // try again! continue; } if (isPromiseCanceledError(err)) { - console.warn(`A cancel error occured while trying to reconnect:`); - console.warn(err); + this._options.logService.info(`${logPrefix} A promise cancelation error occured while trying to reconnect, will try again...`); + this._options.logService.trace(err); // try again! continue; } - console.error(`An error occured while trying to reconnect:`); - console.error(err); - this._permanentFailure = true; - this._onDidStateChange.fire(new ReconnectionPermanentFailureEvent()); - this.protocol.acceptDisconnect(); + this._options.logService.error(`${logPrefix} An unknown error occured while trying to reconnect, since this is an unknown case, it will be treated as a permanent error! Will give up now! Error:`); + this._options.logService.error(err); + PersistentConnection.triggerPermanentFailure(); break; } - } while (!this._permanentFailure); + } while (!PersistentConnection._permanentFailure); + } + + private _gotoPermanentFailure(): void { + this._onDidStateChange.fire(new ReconnectionPermanentFailureEvent()); + safeDisposeProtocolAndSocket(this.protocol); } protected abstract _reconnect(options: ISimpleConnectionOptions): Promise; @@ -408,7 +489,7 @@ export class ManagementPersistentConnection extends PersistentConnection { public readonly client: Client; constructor(options: IConnectionOptions, remoteAuthority: string, clientId: string, reconnectionToken: string, protocol: PersistentProtocol) { - super(options, reconnectionToken, protocol); + super(ConnectionType.Management, options, reconnectionToken, protocol); this.client = this._register(new Client(protocol, { remoteAuthority: remoteAuthority, clientId: clientId @@ -426,7 +507,7 @@ export class ExtensionHostPersistentConnection extends PersistentConnection { public readonly debugPort: number | undefined; constructor(options: IConnectionOptions, startArguments: IRemoteExtensionHostStartParams, reconnectionToken: string, protocol: PersistentProtocol, debugPort: number | undefined) { - super(options, reconnectionToken, protocol); + super(ConnectionType.ExtensionHost, options, reconnectionToken, protocol); this._startArguments = startArguments; this.debugPort = debugPort; } @@ -436,17 +517,19 @@ export class ExtensionHostPersistentConnection extends PersistentConnection { } } -function connectWithTimeLimit(p: Promise, timeLimit: number): Promise { - return new Promise((resolve, reject) => { +function connectWithTimeLimit(logService: ILogService, p: Promise, timeLimit: number): Promise { + return new Promise((resolve, reject) => { let timeout = setTimeout(() => { const err: any = new Error('Time limit reached'); err.code = 'ETIMEDOUT'; err.syscall = 'connect'; + logService.error(`[remote-connection] The time limit has been reached for a connection. Error:`); + logService.error(err); reject(err); }, timeLimit); - p.then(() => { + p.then((value) => { clearTimeout(timeout); - resolve(); + resolve(value); }, (err) => { clearTimeout(timeout); reject(err); @@ -454,6 +537,17 @@ function connectWithTimeLimit(p: Promise, timeLimit: number): Promise { const diskFileSystemProvider = new DiskFileSystemProvider(new NullLogService()); fileService.registerProvider(Schemas.file, diskFileSystemProvider); fileService.registerProvider(Schemas.userData, new FileUserDataProvider(environmentService.appSettingsHome, environmentService.backupHome, new DiskFileSystemProvider(new NullLogService()), environmentService)); - workspaceContextService = new WorkspaceService({ configurationCache: new ConfigurationCache(environmentService) }, environmentService, fileService, new RemoteAgentService({}, environmentService, new RemoteAuthorityResolverService(), new SignService(undefined))); + workspaceContextService = new WorkspaceService({ configurationCache: new ConfigurationCache(environmentService) }, environmentService, fileService, new RemoteAgentService({}, environmentService, new RemoteAuthorityResolverService(), new SignService(undefined), new NullLogService())); return (workspaceContextService).initialize(convertToWorkspacePayload(URI.file(folderDir))); }); }); diff --git a/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts b/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts index 47aaf4a22bb..f2e25b99d66 100644 --- a/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts +++ b/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts @@ -79,7 +79,8 @@ export class RemoteExtensionHostClient extends Disposable implements IExtensionH return { host: authority.host, port: authority.port }; } }, - signService: this._signService + signService: this._signService, + logService: this._logService }; return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then((resolverResult) => { diff --git a/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts b/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts index 8b5028acac6..6d31b177aca 100644 --- a/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts +++ b/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts @@ -7,9 +7,9 @@ import * as nativeWatchdog from 'native-watchdog'; import * as net from 'net'; import * as minimist from 'vscode-minimist'; import { onUnexpectedError } from 'vs/base/common/errors'; -import { Event, Emitter } from 'vs/base/common/event'; +import { Event } from 'vs/base/common/event'; import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; -import { PersistentProtocol, ProtocolConstants, createBufferedEvent } from 'vs/base/parts/ipc/common/ipc.net'; +import { PersistentProtocol, ProtocolConstants, BufferedEmitter } from 'vs/base/parts/ipc/common/ipc.net'; import { NodeSocket, WebSocketNodeSocket } from 'vs/base/parts/ipc/node/ipc.net'; import product from 'vs/platform/product/node/product'; import { IInitData } from 'vs/workbench/api/common/extHost.protocol'; @@ -164,8 +164,8 @@ async function createExtHostProtocol(): Promise { return new class implements IMessagePassingProtocol { - private readonly _onMessage = new Emitter(); - readonly onMessage: Event = createBufferedEvent(this._onMessage.event); + private readonly _onMessage = new BufferedEmitter(); + readonly onMessage: Event = this._onMessage.event; private _terminating: boolean; diff --git a/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts b/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts index fd979ca094c..ea4a572bf93 100644 --- a/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts +++ b/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts @@ -11,6 +11,7 @@ import { IProductService } from 'vs/platform/product/common/product'; import { IWebSocketFactory, BrowserSocketFactory } from 'vs/platform/remote/browser/browserSocketFactory'; import { ISignService } from 'vs/platform/sign/common/sign'; import { ISocketFactory } from 'vs/platform/remote/common/remoteAgentConnection'; +import { ILogService } from 'vs/platform/log/common/log'; export class RemoteAgentService extends AbstractRemoteAgentService implements IRemoteAgentService { @@ -23,12 +24,13 @@ export class RemoteAgentService extends AbstractRemoteAgentService implements IR @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IProductService productService: IProductService, @IRemoteAuthorityResolverService remoteAuthorityResolverService: IRemoteAuthorityResolverService, - @ISignService signService: ISignService + @ISignService signService: ISignService, + @ILogService logService: ILogService ) { super(environmentService); this.socketFactory = new BrowserSocketFactory(webSocketFactory); - this._connection = this._register(new RemoteAgentConnection(environmentService.configuration.remoteAuthority!, productService.commit, this.socketFactory, remoteAuthorityResolverService, signService)); + this._connection = this._register(new RemoteAgentConnection(environmentService.configuration.remoteAuthority!, productService.commit, this.socketFactory, remoteAuthorityResolverService, signService, logService)); } getConnection(): IRemoteAgentConnection | null { diff --git a/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts b/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts index 167e7a5bf14..977a224418b 100644 --- a/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts +++ b/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts @@ -20,6 +20,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { IDiagnosticInfoOptions, IDiagnosticInfo } from 'vs/platform/diagnostics/common/diagnostics'; import { Emitter } from 'vs/base/common/event'; import { ISignService } from 'vs/platform/sign/common/sign'; +import { ILogService } from 'vs/platform/log/common/log'; export abstract class AbstractRemoteAgentService extends Disposable { @@ -86,7 +87,8 @@ export class RemoteAgentConnection extends Disposable implements IRemoteAgentCon private readonly _commit: string | undefined, private readonly _socketFactory: ISocketFactory, private readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService, - private readonly _signService: ISignService + private readonly _signService: ISignService, + private readonly _logService: ILogService ) { super(); this.remoteAuthority = remoteAuthority; @@ -124,7 +126,8 @@ export class RemoteAgentConnection extends Disposable implements IRemoteAgentCon return { host: authority.host, port: authority.port }; } }, - signService: this._signService + signService: this._signService, + logService: this._logService }; const connection = this._register(await connectRemoteAgentManagement(options, this.remoteAuthority, `renderer`)); this._register(connection.onDidStateChange(e => this._onDidStateChange.fire(e))); diff --git a/src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts b/src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts index 82d039a6c54..dc3d808786a 100644 --- a/src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts +++ b/src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts @@ -12,6 +12,7 @@ import { nodeSocketFactory } from 'vs/platform/remote/node/nodeSocketFactory'; import { AbstractRemoteAgentService, RemoteAgentConnection } from 'vs/workbench/services/remote/common/abstractRemoteAgentService'; import { ISignService } from 'vs/platform/sign/common/sign'; import { ISocketFactory } from 'vs/platform/remote/common/remoteAgentConnection'; +import { ILogService } from 'vs/platform/log/common/log'; export class RemoteAgentService extends AbstractRemoteAgentService implements IRemoteAgentService { @@ -22,12 +23,13 @@ export class RemoteAgentService extends AbstractRemoteAgentService implements IR constructor({ remoteAuthority }: IWindowConfiguration, @IEnvironmentService environmentService: IEnvironmentService, @IRemoteAuthorityResolverService remoteAuthorityResolverService: IRemoteAuthorityResolverService, - @ISignService signService: ISignService + @ISignService signService: ISignService, + @ILogService logService: ILogService ) { super(environmentService); this.socketFactory = nodeSocketFactory; if (remoteAuthority) { - this._connection = this._register(new RemoteAgentConnection(remoteAuthority, product.commit, nodeSocketFactory, remoteAuthorityResolverService, signService)); + this._connection = this._register(new RemoteAgentConnection(remoteAuthority, product.commit, nodeSocketFactory, remoteAuthorityResolverService, signService, logService)); } } diff --git a/src/vs/workbench/services/remote/node/tunnelService.ts b/src/vs/workbench/services/remote/node/tunnelService.ts index 457411cd670..1cab2997a37 100644 --- a/src/vs/workbench/services/remote/node/tunnelService.ts +++ b/src/vs/workbench/services/remote/node/tunnelService.ts @@ -15,6 +15,7 @@ import { ITunnelService, RemoteTunnel } from 'vs/platform/remote/common/tunnel'; import { nodeSocketFactory } from 'vs/platform/remote/node/nodeSocketFactory'; import { ISignService } from 'vs/platform/sign/common/sign'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { ILogService } from 'vs/platform/log/common/log'; export async function createRemoteTunnel(options: IConnectionOptions, tunnelRemotePort: number): Promise { const tunnel = new NodeRemoteTunnel(options, tunnelRemotePort); @@ -90,7 +91,8 @@ export class TunnelService implements ITunnelService { public constructor( @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, @IRemoteAuthorityResolverService private readonly remoteAuthorityResolverService: IRemoteAuthorityResolverService, - @ISignService private readonly signService: ISignService + @ISignService private readonly signService: ISignService, + @ILogService private readonly logService: ILogService ) { } @@ -109,7 +111,8 @@ export class TunnelService implements ITunnelService { return { host: authority.host, port: authority.port }; } }, - signService: this.signService + signService: this.signService, + logService: this.logService }; return createRemoteTunnel(options, remotePort); } From 0e3a3d1ead0f4da58bbbb11cd407abac31b43adf Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 23 Aug 2019 17:36:03 +0200 Subject: [PATCH 057/163] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 27866eca591..b9bbc0bef6b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "740bacd7f9f039377fb63de6d4dc85f9ae88236a", + "distro": "6d1d8ff3558559807b76a5ad90f268578c89477c", "author": { "name": "Microsoft Corporation" }, From 9acf73fbe54d4a9ebcfe9152bdaa31735aa74621 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 23 Aug 2019 17:39:14 +0200 Subject: [PATCH 058/163] fix tests second attempt --- src/vs/editor/standalone/browser/simpleServices.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index f8c1def46a2..b042afbc213 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -45,7 +45,7 @@ import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platf import { ILayoutService, IDimension } from 'vs/platform/layout/browser/layoutService'; import { SimpleServicesNLS } from 'vs/editor/common/standaloneStrings'; import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; -import { basename } from 'vs/base/common/path'; +import { basename } from 'vs/base/common/resources'; export class SimpleModel implements IResolvedTextEditorModel { @@ -671,7 +671,7 @@ export class SimpleUriLabelService implements ILabelService { } getUriBasenameLabel(resource: URI): string { - return basename(this.getUriLabel(resource)); + return basename(resource); } public getWorkspaceLabel(workspace: IWorkspaceIdentifier | URI | IWorkspace, options?: { verbose: boolean; }): string { From 0be6954e8855137045d58b9fe8354944d56a3760 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 23 Aug 2019 10:22:09 -0700 Subject: [PATCH 059/163] Tweak deprecation messag #69335 --- src/vs/workbench/api/common/extHost.api.impl.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 9b3fbf50e0b..c5fd74ffe75 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -539,9 +539,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I }; // namespace: workspace + let warnedRootPathDeprecated = false; const workspace: typeof vscode.workspace = { get rootPath() { - console.warn(`[Deprecation Warning] 'workspace.rootPath' is deprecated and should no longer be used. Please use 'workspace.workspaceFolders' instead. (${extension.publisher}.${extension.name})`); + if (extension.isUnderDevelopment && !warnedRootPathDeprecated) { + warnedRootPathDeprecated = true; + console.warn(`[Deprecation Warning] 'workspace.rootPath' is deprecated and should no longer be used. Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath`); + } + return extHostWorkspace.getPath(); }, set rootPath(value) { From cd1ed8165920bdbc127a6ac13254a254f3adacc9 Mon Sep 17 00:00:00 2001 From: Sana Ajani Date: Fri, 23 Aug 2019 11:59:56 -0700 Subject: [PATCH 060/163] distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b9bbc0bef6b..f7cc7bc934e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "6d1d8ff3558559807b76a5ad90f268578c89477c", + "distro": "9e21b46b0b313fa16ba7810134425a38b64601e2", "author": { "name": "Microsoft Corporation" }, From adbee7d26e051db1e79d8e7760dabe629dedc23a Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 23 Aug 2019 11:59:48 -0700 Subject: [PATCH 061/163] Update html/css services --- .../css-language-features/server/package.json | 2 +- .../css-language-features/server/yarn.lock | 8 ++++---- .../html-language-features/server/package.json | 4 ++-- .../html-language-features/server/yarn.lock | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index b27fb14aef7..fe8b74901ac 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -9,7 +9,7 @@ }, "main": "./out/cssServerMain", "dependencies": { - "vscode-css-languageservice": "^4.0.3-next.3", + "vscode-css-languageservice": "^4.0.3-next.4", "vscode-languageserver": "^5.3.0-next.8" }, "devDependencies": { diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index 1f3a45c0844..b440901a68c 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -781,10 +781,10 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -vscode-css-languageservice@^4.0.3-next.3: - version "4.0.3-next.3" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-4.0.3-next.3.tgz#eb7f642f2785d388d74a1a98fd14f7736a11e316" - integrity sha512-6j/y9ccecrq7/APLPEijx+uWHsEdTFH5ZQHG4ZMKjZx6euny27B1wvLCjpxKnZCWcHgmi7cMDLWpUdElvHjjPQ== +vscode-css-languageservice@^4.0.3-next.4: + version "4.0.3-next.4" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-4.0.3-next.4.tgz#3f0ccf116567650597b5cbfd8ce09846a64dec13" + integrity sha512-9eaKw6ez+l407/uzIho51ElMqGSJcOV+M5B/HmAtdBPSc/chkAfx3r7zXOqrAlLKsBzZNVpnsA3C3YDjyZbrdg== dependencies: vscode-languageserver-types "^3.15.0-next.2" vscode-nls "^4.1.1" diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index 9b26165edbd..3fa4cd14d3c 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -9,8 +9,8 @@ }, "main": "./out/htmlServerMain", "dependencies": { - "vscode-css-languageservice": "^4.0.3-next.3", - "vscode-html-languageservice": "^3.0.4-next.0", + "vscode-css-languageservice": "^4.0.3-next.4", + "vscode-html-languageservice": "^3.0.4-next.1", "vscode-languageserver": "^5.3.0-next.8", "vscode-languageserver-types": "3.15.0-next.2", "vscode-nls": "^4.1.1", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index f8687c97f63..94a2693189a 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -229,19 +229,19 @@ supports-color@5.4.0: dependencies: has-flag "^3.0.0" -vscode-css-languageservice@^4.0.3-next.3: - version "4.0.3-next.3" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-4.0.3-next.3.tgz#eb7f642f2785d388d74a1a98fd14f7736a11e316" - integrity sha512-6j/y9ccecrq7/APLPEijx+uWHsEdTFH5ZQHG4ZMKjZx6euny27B1wvLCjpxKnZCWcHgmi7cMDLWpUdElvHjjPQ== +vscode-css-languageservice@^4.0.3-next.4: + version "4.0.3-next.4" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-4.0.3-next.4.tgz#3f0ccf116567650597b5cbfd8ce09846a64dec13" + integrity sha512-9eaKw6ez+l407/uzIho51ElMqGSJcOV+M5B/HmAtdBPSc/chkAfx3r7zXOqrAlLKsBzZNVpnsA3C3YDjyZbrdg== dependencies: vscode-languageserver-types "^3.15.0-next.2" vscode-nls "^4.1.1" vscode-uri "^2.0.3" -vscode-html-languageservice@^3.0.4-next.0: - version "3.0.4-next.0" - resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-3.0.4-next.0.tgz#d4f5a103b94753a19b374158212fe734dbe670e8" - integrity sha512-5Z5ITtokWt/zuPKemKEXfC+4XHoQryBAZVAcTwpAel2qqueUwGqjd5ZrVy/2x5GZAdZAipl0BvsTTMkOBS1BFQ== +vscode-html-languageservice@^3.0.4-next.1: + version "3.0.4-next.1" + resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-3.0.4-next.1.tgz#fcab383db185cb03cfb10d9039d865a7b243c6e8" + integrity sha512-WgqGH7nDhijveDqrSp9zhcOKUGgOBn4FWO5HzfZV4LnfzaFG7hLMbtbplblJVpqLR6lhTWM8B6E4BlFg/szhWw== dependencies: vscode-languageserver-types "^3.15.0-next.2" vscode-nls "^4.1.1" From aaa794de44ca0a40dd22313e1c185b3f66d9fed8 Mon Sep 17 00:00:00 2001 From: Sana Ajani Date: Fri, 23 Aug 2019 12:05:49 -0700 Subject: [PATCH 062/163] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f7cc7bc934e..db4b8dcc298 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "9e21b46b0b313fa16ba7810134425a38b64601e2", + "distro": "b2ada6eb449d568902c07c04a2fbb73194d7bbdc", "author": { "name": "Microsoft Corporation" }, From 93ca4df136b0a9f4fdefe1fa7cdf1b7a92d2825a Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 23 Aug 2019 13:16:33 -0700 Subject: [PATCH 063/163] Update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db4b8dcc298..74fe953e155 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "b2ada6eb449d568902c07c04a2fbb73194d7bbdc", + "distro": "d2a0db67334421d01633b3bec425a9e8812d3b9a", "author": { "name": "Microsoft Corporation" }, From c9042cb5210290a9a3c88c463c10b2ea4e4923d5 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 23 Aug 2019 15:18:23 -0700 Subject: [PATCH 064/163] Hover actions on gutter in inline diff editor. --- .../editor/browser/widget/diffEditorWidget.ts | 53 ++++++-- .../widget/embeddedCodeEditorWidget.ts | 8 +- .../editor/browser/widget/inlineDiffMargin.ts | 126 ++++++++++++++++++ .../browser/standaloneCodeEditor.ts | 9 +- .../standalone/browser/standaloneEditor.ts | 5 +- 5 files changed, 183 insertions(+), 18 deletions(-) create mode 100644 src/vs/editor/browser/widget/inlineDiffMargin.ts diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index ee32431b77a..519cc25cbfd 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -40,6 +40,9 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { INotificationService } from 'vs/platform/notification/common/notification'; import { defaultInsertColor, defaultRemoveColor, diffBorder, diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; import { ITheme, IThemeService, getThemeTypeSelector, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IDiffLinesChange, InlineDiffMargin } from 'vs/editor/browser/widget/inlineDiffMargin'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; interface IEditorDiffDecorations { decorations: IModelDeltaDecoration[]; @@ -47,7 +50,7 @@ interface IEditorDiffDecorations { } interface IEditorDiffDecorationsWithZones extends IEditorDiffDecorations { - zones: editorBrowser.IViewZone[]; + zones: IMyViewZone[]; } interface IEditorsDiffDecorationsWithZones { @@ -56,8 +59,8 @@ interface IEditorsDiffDecorationsWithZones { } interface IEditorsZones { - original: editorBrowser.IViewZone[]; - modified: editorBrowser.IViewZone[]; + original: IMyViewZone[]; + modified: IMyViewZone[]; } interface IDiffEditorWidgetStyle { @@ -70,11 +73,16 @@ interface IDiffEditorWidgetStyle { class VisualEditorState { private _zones: string[]; + private inlineDiffMargins: InlineDiffMargin[]; private _zonesMap: { [zoneId: string]: boolean; }; private _decorations: string[]; - constructor() { + constructor( + private _contextMenuService: IContextMenuService, + private _clipboardService: IClipboardService + ) { this._zones = []; + this.inlineDiffMargins = []; this._zonesMap = {}; this._decorations = []; } @@ -108,13 +116,22 @@ class VisualEditorState { for (let i = 0, length = this._zones.length; i < length; i++) { viewChangeAccessor.removeZone(this._zones[i]); } + for (let i = 0, length = this.inlineDiffMargins.length; i < length; i++) { + this.inlineDiffMargins[i].dispose(); + } this._zones = []; this._zonesMap = {}; + this.inlineDiffMargins = []; for (let i = 0, length = newDecorations.zones.length; i < length; i++) { - newDecorations.zones[i].suppressMouseDown = true; - let zoneId = viewChangeAccessor.addZone(newDecorations.zones[i]); + const viewZone = newDecorations.zones[i]; + viewZone.suppressMouseDown = false; + let zoneId = viewChangeAccessor.addZone(viewZone); this._zones.push(zoneId); this._zonesMap[String(zoneId)] = true; + + if (newDecorations.zones[i].diff && viewZone.marginDomNode) { + this.inlineDiffMargins.push(new InlineDiffMargin(viewZone.marginDomNode, editor, newDecorations.zones[i].diff!, this._contextMenuService, this._clipboardService)); + } } }); @@ -202,7 +219,9 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @IThemeService themeService: IThemeService, - @INotificationService notificationService: INotificationService + @INotificationService notificationService: INotificationService, + @IContextMenuService contextMenuService: IContextMenuService, + @IClipboardService clipboardService: IClipboardService ) { super(); @@ -282,8 +301,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this._currentlyChangingViewZones = false; this._diffComputationToken = 0; - this._originalEditorState = new VisualEditorState(); - this._modifiedEditorState = new VisualEditorState(); + this._originalEditorState = new VisualEditorState(contextMenuService, clipboardService); + this._modifiedEditorState = new VisualEditorState(contextMenuService, clipboardService); this._isVisible = true; this._isHandlingScrollEvent = false; @@ -1258,6 +1277,7 @@ interface IMyViewZone { minWidthInPx?: number; domNode: HTMLElement | null; marginDomNode?: HTMLElement | null; + diff?: IDiffLinesChange; } class ForeignViewZonesIterator { @@ -1469,12 +1489,12 @@ abstract class ViewZonesComputer { }; } - private static _ensureDomNodes(zones: IMyViewZone[]): editorBrowser.IViewZone[] { + private static _ensureDomNodes(zones: IMyViewZone[]): IMyViewZone[] { return zones.map((z) => { if (!z.domNode) { z.domNode = createFakeLinesDiv(); } - return z; + return z; }); } @@ -1977,8 +1997,10 @@ class InlineViewZonesComputer extends ViewZonesComputer { let lineHeight = this.modifiedEditorConfiguration.lineHeight; const typicalHalfwidthCharacterWidth = this.modifiedEditorConfiguration.fontInfo.typicalHalfwidthCharacterWidth; let maxCharsPerLine = 0; + const originalContent: string[] = []; for (let lineNumber = lineChange.originalStartLineNumber; lineNumber <= lineChange.originalEndLineNumber; lineNumber++) { maxCharsPerLine = Math.max(maxCharsPerLine, this._renderOriginalLine(lineNumber - lineChange.originalStartLineNumber, this.originalModel, this.modifiedEditorConfiguration, this.modifiedEditorTabSize, lineNumber, decorations, sb)); + originalContent.push(this.originalModel.getLineContent(lineNumber)); if (this.renderIndicators) { let index = lineNumber - lineChange.originalStartLineNumber; @@ -2005,7 +2027,14 @@ class InlineViewZonesComputer extends ViewZonesComputer { heightInLines: lineChangeOriginalLength, minWidthInPx: (maxCharsPerLine * typicalHalfwidthCharacterWidth), domNode: domNode, - marginDomNode: marginDomNode + marginDomNode: marginDomNode, + diff: { + originalStartLineNumber: lineChange.originalStartLineNumber, + originalEndLineNumber: lineChange.originalEndLineNumber, + modifiedStartLineNumber: lineChange.modifiedStartLineNumber, + modifiedEndLineNumber: lineChange.modifiedEndLineNumber, + originalContent: originalContent + } }; } diff --git a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts index 1c6f251a3ed..2f36d8e9765 100644 --- a/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts +++ b/src/vs/editor/browser/widget/embeddedCodeEditorWidget.ts @@ -16,6 +16,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { INotificationService } from 'vs/platform/notification/common/notification'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; export class EmbeddedCodeEditorWidget extends CodeEditorWidget { @@ -74,9 +76,11 @@ export class EmbeddedDiffEditorWidget extends DiffEditorWidget { @IInstantiationService instantiationService: IInstantiationService, @ICodeEditorService codeEditorService: ICodeEditorService, @IThemeService themeService: IThemeService, - @INotificationService notificationService: INotificationService + @INotificationService notificationService: INotificationService, + @IContextMenuService contextMenuService: IContextMenuService, + @IClipboardService clipboardService: IClipboardService ) { - super(domElement, parentEditor.getRawConfiguration(), editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService); + super(domElement, parentEditor.getRawConfiguration(), editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService, clipboardService); this._parentEditor = parentEditor; this._overwriteOptions = options; diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts new file mode 100644 index 00000000000..feafa76cc94 --- /dev/null +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -0,0 +1,126 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as nls from 'vs/nls'; +import * as dom from 'vs/base/browser/dom'; +import { Action } from 'vs/base/common/actions'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { Range } from 'vs/editor/common/core/range'; +import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; + +export interface IDiffLinesChange { + readonly originalStartLineNumber: number; + readonly originalEndLineNumber: number; + readonly modifiedStartLineNumber: number; + readonly modifiedEndLineNumber: number; + readonly originalContent: string[]; +} + +export class InlineDiffMargin extends Disposable { + private readonly _lightBulb: HTMLElement; + + constructor( + marginDomNode: HTMLElement, + public editor: CodeEditorWidget, + public diff: IDiffLinesChange, + private _contextMenuService: IContextMenuService, + private _clipboardService: IClipboardService + ) { + super(); + + // make sure the diff margin shows above overlay. + marginDomNode.style.zIndex = '10'; + + this._lightBulb = document.createElement('div'); + this._lightBulb.className = 'lightbulb-glyph'; + this._lightBulb.style.position = 'absolute'; + const lineHeight = editor.getConfiguration().lineHeight; + const lineFeed = editor.getModel()!.getEOL(); + this._lightBulb.style.right = '0px'; + this._lightBulb.style.visibility = 'hidden'; + this._lightBulb.style.height = `${lineHeight}px`; + marginDomNode.appendChild(this._lightBulb); + + const actions = [ + new Action( + 'diff.clipboard.copyDeletedContent', + nls.localize('diff.clipboard.copyDeletedContent.label', "Copy deleted lines content to clipboard"), + undefined, + true, + async () => { + await this._clipboardService.writeText(diff.originalContent.join(lineFeed) + lineFeed); + } + ) + ]; + + let currentLineNumberOffset = 0; + + const copyLineAction = new Action( + 'diff.clipboard.copyDeletedLineContent', + nls.localize('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line {0} content to clipboard", diff.originalStartLineNumber), + undefined, + true, + async () => { + await this._clipboardService.writeText(diff.originalContent[currentLineNumberOffset] + lineFeed); + } + ); + + actions.push(copyLineAction); + + const readOnly = editor.getConfiguration().readOnly; + if (!readOnly) { + actions.push(new Action('diff.inline.revertChange', nls.localize('diff.inline.revertChange.label', "Revert this change"), undefined, true, async () => { + editor.executeEdits('diffEditor', [ + { + range: new Range(diff.modifiedStartLineNumber, 1, diff.modifiedEndLineNumber + 1, 1), + text: diff.originalContent.join(lineFeed) + lineFeed + } + ]); + })); + } + + this._register(dom.addStandardDisposableListener(marginDomNode, 'mouseenter', e => { + this._lightBulb.style.visibility = 'visible'; + currentLineNumberOffset = this._updateLightBulbPosition(marginDomNode, e.y, lineHeight); + })); + + this._register(dom.addStandardDisposableListener(marginDomNode, 'mouseleave', e => { + this._lightBulb.style.visibility = 'hidden'; + })); + + this._register(dom.addStandardDisposableListener(marginDomNode, 'mousemove', e => { + currentLineNumberOffset = this._updateLightBulbPosition(marginDomNode, e.y, lineHeight); + })); + + this._register(dom.addStandardDisposableListener(this._lightBulb, 'mousedown', e => { + const { top, height } = dom.getDomNodePagePosition(this._lightBulb); + let pad = Math.floor(lineHeight / 3) + lineHeight; + this._contextMenuService.showContextMenu({ + getAnchor: () => { + return { + x: e.posx, + y: top + height + pad + }; + }, + getActions: () => { + copyLineAction.label = nls.localize('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line {0} content to clipboard", diff.originalStartLineNumber + currentLineNumberOffset); + return actions; + }, + autoSelectFirstItem: true + }); + })); + } + + private _updateLightBulbPosition(marginDomNode: HTMLElement, y: number, lineHeight: number): number { + const { top } = dom.getDomNodePagePosition(marginDomNode); + const offset = y - top; + const lineNumberOffset = Math.floor(offset / lineHeight); + const newTop = lineNumberOffset * lineHeight; + this._lightBulb.style.top = `${newTop}px`; + return lineNumberOffset; + } +} diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 31a3f56b704..d64e0e6e2af 100644 --- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -21,7 +21,7 @@ import { IMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/acti import { CommandsRegistry, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; +import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; @@ -29,6 +29,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { StandaloneCodeEditorNLS } from 'vs/editor/common/standaloneStrings'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; /** * Description of an action contribution @@ -373,7 +374,9 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon @ICodeEditorService codeEditorService: ICodeEditorService, @IStandaloneThemeService themeService: IStandaloneThemeService, @INotificationService notificationService: INotificationService, - @IConfigurationService configurationService: IConfigurationService + @IConfigurationService configurationService: IConfigurationService, + @IContextMenuService contextMenuService: IContextMenuService, + @IClipboardService clipboardService: IClipboardService ) { applyConfigurationValues(configurationService, options, true); options = options || {}; @@ -381,7 +384,7 @@ export class StandaloneDiffEditor extends DiffEditorWidget implements IStandalon options.theme = themeService.setTheme(options.theme); } - super(domElement, options, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService); + super(domElement, options, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService, clipboardService); this._contextViewService = contextViewService; this._configurationService = configurationService; diff --git a/src/vs/editor/standalone/browser/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts index 8750db8f943..280e00cbdf7 100644 --- a/src/vs/editor/standalone/browser/standaloneEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneEditor.ts @@ -30,7 +30,7 @@ import { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standal import { ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; +import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IMarker, IMarkerData } from 'vs/platform/markers/common/markers'; @@ -38,6 +38,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { clearAllFontInfos } from 'vs/editor/browser/config/configuration'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; type Omit = Pick>; @@ -119,6 +120,8 @@ export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorC services.get(IStandaloneThemeService), services.get(INotificationService), services.get(IConfigurationService), + services.get(IContextMenuService), + services.get(IClipboardService) ); }); } From f664f7597b29136ab1c3ef4fc64f7873e1963dea Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 23 Aug 2019 15:39:49 -0700 Subject: [PATCH 065/163] correct code revert --- .../editor/browser/widget/inlineDiffMargin.ts | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index feafa76cc94..fa5b94f0d7d 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -74,12 +74,25 @@ export class InlineDiffMargin extends Disposable { const readOnly = editor.getConfiguration().readOnly; if (!readOnly) { actions.push(new Action('diff.inline.revertChange', nls.localize('diff.inline.revertChange.label', "Revert this change"), undefined, true, async () => { - editor.executeEdits('diffEditor', [ - { - range: new Range(diff.modifiedStartLineNumber, 1, diff.modifiedEndLineNumber + 1, 1), - text: diff.originalContent.join(lineFeed) + lineFeed - } - ]); + if (diff.modifiedEndLineNumber === 0) { + // deletion only + const column = editor.getModel()!.getLineMaxColumn(diff.modifiedStartLineNumber); + editor.executeEdits('diffEditor', [ + { + range: new Range(diff.modifiedStartLineNumber, column, diff.modifiedStartLineNumber, column), + text: lineFeed + diff.originalContent.join(lineFeed) + } + ]); + } else { + const column = editor.getModel()!.getLineMaxColumn(diff.modifiedEndLineNumber); + editor.executeEdits('diffEditor', [ + { + range: new Range(diff.modifiedStartLineNumber, 1, diff.modifiedEndLineNumber, column), + text: diff.originalContent.join(lineFeed) + } + ]); + } + })); } From 234f0eae4b2a77a73f45b97b73ca5cecc6d9b35f Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Fri, 23 Aug 2019 15:40:49 -0700 Subject: [PATCH 066/163] fix console errors when notification is removed --- .../contrib/remote/electron-browser/remote.contribution.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts index 4c3db2da9aa..9415ec4f051 100644 --- a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts @@ -331,7 +331,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { // Show dialog progressService!.withProgress( { location: ProgressLocation.Dialog, buttons }, - (progress) => { progressReporter = new ProgressReporter(progress); return promise; }, + (progress) => { if (progressReporter) { progressReporter.currentProgress = progress; } return promise; }, (choice?) => { // Handle choice from dialog if (choice === 0 && buttons && reconnectWaitEvent) { @@ -351,7 +351,6 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { // Handle choice from notification if (choice === 0 && buttons && reconnectWaitEvent) { reconnectWaitEvent.skipWait(); - progressReporter!.report(); } else { hideProgress(); } @@ -365,7 +364,6 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { } currentProgressPromiseResolve = null; - progressReporter = null; } connection.onDidStateChange((e) => { @@ -376,6 +374,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { switch (e.type) { case PersistentConnectionEventType.ConnectionLost: if (!currentProgressPromiseResolve) { + progressReporter = new ProgressReporter(null); showProgress(ProgressLocation.Dialog, [nls.localize('reconnectNow', "Reconnect Now")]); } @@ -394,6 +393,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { break; case PersistentConnectionEventType.ReconnectionPermanentFailure: hideProgress(); + progressReporter = null; dialogService.show(Severity.Error, nls.localize('reconnectionPermanentFailure', "Cannot reconnect. Please reload the window."), [nls.localize('reloadWindow', "Reload Window"), nls.localize('cancel', "Cancel")], { cancelId: 1 }).then(choice => { // Reload the window @@ -404,6 +404,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { break; case PersistentConnectionEventType.ConnectionGain: hideProgress(); + progressReporter = null; break; } }); From 3a08a39d9b18be478f38d148f5f337b67cf1763c Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Fri, 23 Aug 2019 16:59:35 -0700 Subject: [PATCH 067/163] allow quick input to dismiss modal progress --- .../electron-browser/remote.contribution.ts | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts index 9415ec4f051..857e42cd54c 100644 --- a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts @@ -309,7 +309,8 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { @IRemoteAgentService remoteAgentService: IRemoteAgentService, @IProgressService progressService: IProgressService, @IDialogService dialogService: IDialogService, - @ICommandService commandService: ICommandService + @ICommandService commandService: ICommandService, + @IContextKeyService contextKeyService: IContextKeyService ) { const connection = remoteAgentService.getConnection(); if (connection) { @@ -318,6 +319,7 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { let lastLocation: ProgressLocation | null = null; let currentTimer: ReconnectionTimer | null = null; let reconnectWaitEvent: ReconnectionWaitEvent | null = null; + let disposableListener: IDisposable | null = null; function showProgress(location: ProgressLocation, buttons?: string[]) { if (currentProgressPromiseResolve) { @@ -371,6 +373,11 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { currentTimer.dispose(); currentTimer = null; } + + if (disposableListener) { + disposableListener.dispose(); + disposableListener = null; + } switch (e.type) { case PersistentConnectionEventType.ConnectionLost: if (!currentProgressPromiseResolve) { @@ -390,6 +397,20 @@ class RemoteAgentConnectionStatusListener implements IWorkbenchContribution { hideProgress(); showProgress(lastLocation || ProgressLocation.Notification); progressReporter!.report(nls.localize('reconnectionRunning', "Attempting to reconnect...")); + + // Register to listen for quick input is opened + disposableListener = contextKeyService.onDidChangeContext((contextKeyChangeEvent) => { + const reconnectInteraction = new Set(['inQuickOpen']); + if (contextKeyChangeEvent.affectsSome(reconnectInteraction)) { + // Need to move from dialog if being shown and user needs to type in a prompt + if (lastLocation === ProgressLocation.Dialog && progressReporter !== null) { + hideProgress(); + showProgress(ProgressLocation.Notification); + progressReporter.report(); + } + } + }); + break; case PersistentConnectionEventType.ReconnectionPermanentFailure: hideProgress(); From 0f54208cfb5d4ae968e34a4188004c3349b77099 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 23 Aug 2019 17:51:36 -0700 Subject: [PATCH 068/163] copy single line without line feed. --- src/vs/editor/browser/widget/inlineDiffMargin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index fa5b94f0d7d..2bca61666b4 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -65,7 +65,7 @@ export class InlineDiffMargin extends Disposable { undefined, true, async () => { - await this._clipboardService.writeText(diff.originalContent[currentLineNumberOffset] + lineFeed); + await this._clipboardService.writeText(diff.originalContent[currentLineNumberOffset]); } ); From dbfca928e01872391cd7acebfd21011f5e0e0b4b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 21 Aug 2019 18:16:56 -0700 Subject: [PATCH 069/163] Extend dispoable --- .../editor/contrib/parameterHints/parameterHints.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/vs/editor/contrib/parameterHints/parameterHints.ts b/src/vs/editor/contrib/parameterHints/parameterHints.ts index eb846502b63..04011709292 100644 --- a/src/vs/editor/contrib/parameterHints/parameterHints.ts +++ b/src/vs/editor/contrib/parameterHints/parameterHints.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; @@ -18,7 +18,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis import * as modes from 'vs/editor/common/modes'; import { TriggerContext } from 'vs/editor/contrib/parameterHints/parameterHintsModel'; -class ParameterHintsController implements IEditorContribution { +class ParameterHintsController extends Disposable implements IEditorContribution { private static readonly ID = 'editor.controller.parameterHints'; @@ -30,8 +30,9 @@ class ParameterHintsController implements IEditorContribution { private readonly widget: ParameterHintsWidget; constructor(editor: ICodeEditor, @IInstantiationService instantiationService: IInstantiationService) { + super(); this.editor = editor; - this.widget = instantiationService.createInstance(ParameterHintsWidget, this.editor); + this.widget = this._register(instantiationService.createInstance(ParameterHintsWidget, this.editor)); } getId(): string { @@ -53,10 +54,6 @@ class ParameterHintsController implements IEditorContribution { trigger(context: TriggerContext): void { this.widget.trigger(context); } - - dispose(): void { - dispose(this.widget); - } } export class TriggerParameterHintsAction extends EditorAction { @@ -76,7 +73,7 @@ export class TriggerParameterHintsAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): void { - let controller = ParameterHintsController.get(editor); + const controller = ParameterHintsController.get(editor); if (controller) { controller.trigger({ triggerKind: modes.SignatureHelpTriggerKind.Invoke From 4b93194b76b09ce4dc122740e1373ec1d17228bc Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 22 Aug 2019 15:41:37 -0700 Subject: [PATCH 070/163] Make sure we notify webview of view state changes in a consistent order Send events in the following order: - Non-visible - Visible - Active This matches the old notification order for webviews --- src/vs/workbench/api/common/extHostWebview.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostWebview.ts b/src/vs/workbench/api/common/extHostWebview.ts index d0eea9511b9..168e49abca7 100644 --- a/src/vs/workbench/api/common/extHostWebview.ts +++ b/src/vs/workbench/api/common/extHostWebview.ts @@ -299,7 +299,24 @@ export class ExtHostWebviews implements ExtHostWebviewsShape { } public $onDidChangeWebviewPanelViewStates(newStates: WebviewPanelViewStateData): void { - for (const handle of Object.keys(newStates)) { + const handles = Object.keys(newStates); + // Notify webviews of state changes in the following order: + // - Non-visible + // - Visible + // - Active + handles.sort((a, b) => { + const stateA = newStates[a]; + const stateB = newStates[b]; + if (stateA.active) { + return 1; + } + if (stateB.active) { + return -1; + } + return (+stateA.visible) - (+stateB.visible); + }); + + for (const handle of handles) { const panel = this.getWebviewPanel(handle); if (!panel || panel._isDisposed) { continue; From dcb3f60cda959df58365360895469aa7a35d08e0 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 23 Aug 2019 20:39:16 -0700 Subject: [PATCH 071/163] Update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 74fe953e155..037a6cf41a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "d2a0db67334421d01633b3bec425a9e8812d3b9a", + "distro": "b8b5d79d26bc7b35031b45ab31961959c6c199d2", "author": { "name": "Microsoft Corporation" }, From e3b9b8eefc062d68ba8a4b6a817162d132f3b533 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 23 Aug 2019 23:05:49 -0500 Subject: [PATCH 072/163] Re-check opened files while executing refactoring Fixes #79650 --- .../src/features/refactor.ts | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/extensions/typescript-language-features/src/features/refactor.ts b/extensions/typescript-language-features/src/features/refactor.ts index 6b0d33a2bb9..f4ed0f6726f 100644 --- a/extensions/typescript-language-features/src/features/refactor.ts +++ b/extensions/typescript-language-features/src/features/refactor.ts @@ -14,7 +14,7 @@ import { VersionDependentRegistration } from '../utils/dependentRegistration'; import TelemetryReporter from '../utils/telemetry'; import * as typeConverters from '../utils/typeConverters'; import FormattingOptionsManager from './fileConfigurationManager'; -import { file } from '../utils/fileSchemes'; +import * as fileSchemes from '../utils/fileSchemes'; const localize = nls.loadMessageBundle(); @@ -30,11 +30,15 @@ class ApplyRefactoringCommand implements Command { public async execute( document: vscode.TextDocument, - file: string, refactor: string, action: string, range: vscode.Range ): Promise { + const file = this.client.toOpenedFilePath(document); + if (!file) { + return false; + } + /* __GDPR__ "refactor.execute" : { "action" : { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }, @@ -81,7 +85,7 @@ class ApplyRefactoringCommand implements Command { const workspaceEdit = new vscode.WorkspaceEdit(); for (const edit of body.edits) { const resource = this.client.toResource(edit.fileName); - if (resource.scheme === file) { + if (resource.scheme === fileSchemes.file) { workspaceEdit.createFile(resource, { ignoreIfExists: true }); } } @@ -95,15 +99,19 @@ class SelectRefactorCommand implements Command { public readonly id = SelectRefactorCommand.ID; constructor( + private readonly client: ITypeScriptServiceClient, private readonly doRefactoring: ApplyRefactoringCommand ) { } public async execute( document: vscode.TextDocument, - file: string, info: Proto.ApplicableRefactorInfo, range: vscode.Range ): Promise { + const file = this.client.toOpenedFilePath(document); + if (!file) { + return false; + } const selected = await vscode.window.showQuickPick(info.actions.map((action): vscode.QuickPickItem => ({ label: action.name, description: action.description, @@ -111,7 +119,7 @@ class SelectRefactorCommand implements Command { if (!selected) { return false; } - return this.doRefactoring.execute(document, file, info.name, selected.label, range); + return this.doRefactoring.execute(document, info.name, selected.label, range); } } @@ -130,7 +138,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { telemetryReporter: TelemetryReporter ) { const doRefactoringCommand = commandManager.register(new ApplyRefactoringCommand(this.client, telemetryReporter)); - commandManager.register(new SelectRefactorCommand(doRefactoringCommand)); + commandManager.register(new SelectRefactorCommand(this.client, doRefactoringCommand)); } public static readonly metadata: vscode.CodeActionProviderMetadata = { @@ -146,29 +154,30 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { if (!this.shouldTrigger(rangeOrSelection, context)) { return undefined; } - - const file = this.client.toOpenedFilePath(document); - if (!file) { + if (!this.client.toOpenedFilePath(document)) { return undefined; } - const args: Proto.GetApplicableRefactorsRequestArgs = typeConverters.Range.toFileRangeRequestArgs(file, rangeOrSelection); + const args: Proto.GetApplicableRefactorsRequestArgs = typeConverters.Range.toFileRangeRequestArgs(fileSchemes.file, rangeOrSelection); const response = await this.client.interruptGetErr(() => { + const file = this.client.toOpenedFilePath(document); + if (!file) { + return undefined; + } this.formattingOptionsManager.ensureConfigurationForDocument(document, token); return this.client.execute('getApplicableRefactors', args, token); }); - if (response.type !== 'response' || !response.body) { + if (!response || response.type !== 'response' || !response.body) { return undefined; } - return this.convertApplicableRefactors(response.body, document, file, rangeOrSelection); + return this.convertApplicableRefactors(response.body, document, rangeOrSelection); } private convertApplicableRefactors( body: Proto.ApplicableRefactorInfo[], document: vscode.TextDocument, - file: string, rangeOrSelection: vscode.Range | vscode.Selection ) { const actions: vscode.CodeAction[] = []; @@ -178,12 +187,12 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { codeAction.command = { title: info.description, command: SelectRefactorCommand.ID, - arguments: [document, file, info, rangeOrSelection] + arguments: [document, info, rangeOrSelection] }; actions.push(codeAction); } else { for (const action of info.actions) { - actions.push(this.refactorActionToCodeAction(action, document, file, info, rangeOrSelection)); + actions.push(this.refactorActionToCodeAction(action, document, info, rangeOrSelection)); } } } @@ -193,7 +202,6 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { private refactorActionToCodeAction( action: Proto.RefactorActionInfo, document: vscode.TextDocument, - file: string, info: Proto.ApplicableRefactorInfo, rangeOrSelection: vscode.Range | vscode.Selection ) { @@ -201,7 +209,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { codeAction.command = { title: action.description, command: ApplyRefactoringCommand.ID, - arguments: [document, file, info.name, action.name, rangeOrSelection], + arguments: [document, info.name, action.name, rangeOrSelection], }; codeAction.isPreferred = TypeScriptRefactorProvider.isPreferred(action); return codeAction; From 17807fa5bfa9bb090513bd89a86381560ad37a8b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 24 Aug 2019 08:35:01 +0200 Subject: [PATCH 073/163] fix tests --- src/vs/workbench/services/label/common/labelService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/services/label/common/labelService.ts b/src/vs/workbench/services/label/common/labelService.ts index 2e9e9e9a1da..18f17174576 100644 --- a/src/vs/workbench/services/label/common/labelService.ts +++ b/src/vs/workbench/services/label/common/labelService.ts @@ -167,7 +167,7 @@ export class LabelService implements ILabelService { return paths.win32.basename(label); } - return paths.posix.basename(label); + return paths.basename(label); } getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | IWorkspace), options?: { verbose: boolean }): string { From b8728661c4c156623325451592b1fd1880849bba Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 24 Aug 2019 16:40:33 +0200 Subject: [PATCH 074/163] labels - restore original functionality of getUriBasenameLabel() --- .../services/label/common/labelService.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/services/label/common/labelService.ts b/src/vs/workbench/services/label/common/labelService.ts index 18f17174576..f383c481e29 100644 --- a/src/vs/workbench/services/label/common/labelService.ts +++ b/src/vs/workbench/services/label/common/labelService.ts @@ -129,7 +129,10 @@ export class LabelService implements ILabelService { } getUriLabel(resource: URI, options: { relative?: boolean, noPrefix?: boolean, endWithSeparator?: boolean } = {}): string { - const formatting = this.findFormatting(resource); + return this.doGetUriLabel(resource, this.findFormatting(resource), options); + } + + private doGetUriLabel(resource: URI, formatting?: ResourceLabelFormatting, options: { relative?: boolean, noPrefix?: boolean, endWithSeparator?: boolean } = {}): string { if (!formatting) { return getPathLabel(resource.path, this.environmentService, options.relative ? this.contextService : undefined); } @@ -161,10 +164,13 @@ export class LabelService implements ILabelService { } getUriBasenameLabel(resource: URI): string { - const label = this.getUriLabel(resource); const formatting = this.findFormatting(resource); - if (formatting && formatting.separator === '\\') { - return paths.win32.basename(label); + const label = this.doGetUriLabel(resource, formatting); + if (formatting) { + switch (formatting.separator) { + case paths.win32.sep: return paths.win32.basename(label); + case paths.posix.sep: return paths.posix.basename(label); + } } return paths.basename(label); From f3d976216e6d8fb051a4a7424bf45e1c792d0a56 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 24 Aug 2019 16:53:20 +0200 Subject: [PATCH 075/163] debt - allow to use request helper from base --- src/vs/base/parts/request/browser/request.ts | 74 +++++++++++++++++++ src/vs/base/parts/request/common/request.ts | 30 ++++++++ .../common/extensionGalleryService.ts | 3 +- .../request/browser/requestService.ts | 73 ++---------------- src/vs/platform/request/common/request.ts | 26 +------ src/vs/platform/request/common/requestIpc.ts | 3 +- .../request/electron-main/requestService.ts | 2 +- .../platform/request/node/requestService.ts | 3 +- .../request/browser/requestService.ts | 2 +- 9 files changed, 120 insertions(+), 96 deletions(-) create mode 100644 src/vs/base/parts/request/browser/request.ts create mode 100644 src/vs/base/parts/request/common/request.ts diff --git a/src/vs/base/parts/request/browser/request.ts b/src/vs/base/parts/request/browser/request.ts new file mode 100644 index 00000000000..f8532bbe608 --- /dev/null +++ b/src/vs/base/parts/request/browser/request.ts @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { CancellationToken } from 'vs/base/common/cancellation'; +import { canceled } from 'vs/base/common/errors'; +import { assign } from 'vs/base/common/objects'; +import { VSBuffer, bufferToStream } from 'vs/base/common/buffer'; +import { IRequestOptions, IRequestContext } from 'vs/base/parts/request/common/request'; + +export function request(options: IRequestOptions, token: CancellationToken): Promise { + if (options.proxyAuthorization) { + options.headers = assign(options.headers || {}, { 'Proxy-Authorization': options.proxyAuthorization }); + } + + const xhr = new XMLHttpRequest(); + return new Promise((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: bufferToStream(VSBuffer.wrap(new Uint8Array(xhr.response))) + }); + }; + xhr.ontimeout = e => reject(new Error(`XHR timeout: ${options.timeout}ms`)); + + if (options.timeout) { + xhr.timeout = options.timeout; + } + + xhr.send(options.data); + + // 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; +} diff --git a/src/vs/base/parts/request/common/request.ts b/src/vs/base/parts/request/common/request.ts new file mode 100644 index 00000000000..b8f75d72cf6 --- /dev/null +++ b/src/vs/base/parts/request/common/request.ts @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { VSBufferReadableStream } from 'vs/base/common/buffer'; + +export interface IHeaders { + [header: string]: string; +} + +export interface IRequestOptions { + type?: string; + url?: string; + user?: string; + password?: string; + headers?: IHeaders; + timeout?: number; + data?: string; + followRedirects?: number; + proxyAuthorization?: string; +} + +export interface IRequestContext { + res: { + headers: IHeaders; + statusCode?: number; + }; + stream: VSBufferReadableStream; +} diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts index 2d39c512975..e33d7a5c55d 100644 --- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts @@ -9,7 +9,8 @@ import { getGalleryExtensionId, getGalleryExtensionTelemetryData, adoptToGallery import { assign, getOrDefault } from 'vs/base/common/objects'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IPager } from 'vs/base/common/paging'; -import { IRequestService, IRequestOptions, IRequestContext, asJson, asText, IHeaders } from 'vs/platform/request/common/request'; +import { IRequestService, asJson, asText } from 'vs/platform/request/common/request'; +import { IRequestOptions, IRequestContext, IHeaders } from 'vs/base/parts/request/common/request'; import { isEngineValid } from 'vs/platform/extensions/common/extensionValidator'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { generateUuid, isUUID } from 'vs/base/common/uuid'; diff --git a/src/vs/platform/request/browser/requestService.ts b/src/vs/platform/request/browser/requestService.ts index 1cae6c03b31..0e6e79acfd4 100644 --- a/src/vs/platform/request/browser/requestService.ts +++ b/src/vs/platform/request/browser/requestService.ts @@ -3,13 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRequestOptions, IRequestContext } from 'vs/platform/request/common/request'; +import { IRequestOptions, IRequestContext } from 'vs/base/parts/request/common/request'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { canceled } from 'vs/base/common/errors'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService } from 'vs/platform/log/common/log'; -import { assign } from 'vs/base/common/objects'; -import { VSBuffer, bufferToStream } from 'vs/base/common/buffer'; +import { request } from 'vs/base/parts/request/browser/request'; /** * This service exposes the `request` API, while using the global @@ -28,69 +26,10 @@ export class RequestService { request(options: IRequestOptions, token: CancellationToken): Promise { this.logService.trace('RequestService#request', options.url); - const authorization = this.configurationService.getValue('http.proxyAuthorization'); - if (authorization) { - options.headers = assign(options.headers || {}, { 'Proxy-Authorization': authorization }); + if (!options.proxyAuthorization) { + options.proxyAuthorization = this.configurationService.getValue('http.proxyAuthorization'); } - const xhr = new XMLHttpRequest(); - return new Promise((resolve, reject) => { - - xhr.open(options.type || 'GET', options.url || '', true, options.user, options.password); - this.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: this.getResponseHeaders(xhr) - }, - stream: bufferToStream(VSBuffer.wrap(new Uint8Array(xhr.response))) - }); - }; - xhr.ontimeout = e => reject(new Error(`XHR timeout: ${options.timeout}ms`)); - - if (options.timeout) { - xhr.timeout = options.timeout; - } - - xhr.send(options.data); - - // cancel - token.onCancellationRequested(() => { - xhr.abort(); - reject(canceled()); - }); - }); + return request(options, token); } - - private 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]); - - } - } - } - - private 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; - } - -} \ No newline at end of file +} diff --git a/src/vs/platform/request/common/request.ts b/src/vs/platform/request/common/request.ts index 31e3c314242..7ec2f5f3742 100644 --- a/src/vs/platform/request/common/request.ts +++ b/src/vs/platform/request/common/request.ts @@ -8,33 +8,11 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; -import { VSBufferReadableStream, streamToBuffer } from 'vs/base/common/buffer'; +import { streamToBuffer } from 'vs/base/common/buffer'; +import { IRequestOptions, IRequestContext } from 'vs/base/parts/request/common/request'; export const IRequestService = createDecorator('requestService'); -export interface IHeaders { - [header: string]: string; -} - -export interface IRequestOptions { - type?: string; - url?: string; - user?: string; - password?: string; - headers?: IHeaders; - timeout?: number; - data?: string; - followRedirects?: number; -} - -export interface IRequestContext { - res: { - headers: IHeaders; - statusCode?: number; - }; - stream: VSBufferReadableStream; -} - export interface IRequestService { _serviceBrand: any; diff --git a/src/vs/platform/request/common/requestIpc.ts b/src/vs/platform/request/common/requestIpc.ts index 8f553261707..22acbce9dee 100644 --- a/src/vs/platform/request/common/requestIpc.ts +++ b/src/vs/platform/request/common/requestIpc.ts @@ -5,7 +5,8 @@ import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; import { Event } from 'vs/base/common/event'; -import { IRequestService, IRequestOptions, IRequestContext, IHeaders } from 'vs/platform/request/common/request'; +import { IRequestService } from 'vs/platform/request/common/request'; +import { IRequestOptions, IRequestContext, IHeaders } from 'vs/base/parts/request/common/request'; import { CancellationToken } from 'vs/base/common/cancellation'; import { VSBuffer, bufferToStream, streamToBuffer } from 'vs/base/common/buffer'; diff --git a/src/vs/platform/request/electron-main/requestService.ts b/src/vs/platform/request/electron-main/requestService.ts index cd27b9fbf5d..de9eacfd447 100644 --- a/src/vs/platform/request/electron-main/requestService.ts +++ b/src/vs/platform/request/electron-main/requestService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRequestOptions, IRequestContext } from 'vs/platform/request/common/request'; +import { IRequestOptions, IRequestContext } from 'vs/base/parts/request/common/request'; import { RequestService as NodeRequestService, IRawRequestFunction } from 'vs/platform/request/node/requestService'; import { assign } from 'vs/base/common/objects'; import { net } from 'electron'; diff --git a/src/vs/platform/request/node/requestService.ts b/src/vs/platform/request/node/requestService.ts index 8ca875f6fa9..07a32d78f44 100644 --- a/src/vs/platform/request/node/requestService.ts +++ b/src/vs/platform/request/node/requestService.ts @@ -13,7 +13,8 @@ import { assign } from 'vs/base/common/objects'; import { isBoolean, isNumber } from 'vs/base/common/types'; import { canceled } from 'vs/base/common/errors'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { IRequestOptions, IRequestContext, IRequestService, IHTTPConfiguration } from 'vs/platform/request/common/request'; +import { IRequestService, IHTTPConfiguration } from 'vs/platform/request/common/request'; +import { IRequestOptions, IRequestContext } from 'vs/base/parts/request/common/request'; import { getProxyAgent, Agent } from 'vs/platform/request/node/proxy'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/services/request/browser/requestService.ts b/src/vs/workbench/services/request/browser/requestService.ts index cebf1654eca..13450f58132 100644 --- a/src/vs/workbench/services/request/browser/requestService.ts +++ b/src/vs/workbench/services/request/browser/requestService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IRequestOptions, IRequestContext } from 'vs/platform/request/common/request'; +import { IRequestOptions, IRequestContext } from 'vs/base/parts/request/common/request'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService } from 'vs/platform/log/common/log'; From b4679a37f6d67cba8aeb0522eae5f7e544bb54b1 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 24 Aug 2019 17:12:30 +0200 Subject: [PATCH 076/163] debt - move some environment to workbench --- .../environment/common/environment.ts | 15 +----------- .../environment/node/environmentService.ts | 14 ----------- .../contrib/update/electron-browser/update.ts | 2 +- .../contrib/webview/browser/webviewElement.ts | 8 +++---- .../electron-browser/gettingStarted.ts | 4 ++-- .../environment/browser/environmentService.ts | 8 ++----- .../environment/common/environmentService.ts | 16 ++++++++++--- .../environment/node/environmentService.ts | 23 +++++++++++++------ .../common/extensionHostProcessManager.ts | 4 ++-- .../common/remoteExtensionHostClient.ts | 4 ++-- .../services/search/node/searchService.ts | 7 +++--- 11 files changed, 47 insertions(+), 58 deletions(-) diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index b13a82f4447..3b45568e1b8 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -140,24 +140,15 @@ export interface IEnvironmentService { extensionTestsLocationURI?: URI; debugExtensionHost: IExtensionHostDebugParams; - debugSearch: IDebugParams; - - logExtensionHostCommunication: boolean; isBuilt: boolean; wait: boolean; status: boolean; - // logging log?: string; logsPath: string; verbose: boolean; - skipGettingStarted: boolean | undefined; - skipReleaseNotes: boolean | undefined; - - skipAddToRecentlyOpened: boolean; - mainIPCHandle: string; sharedIPCHandle: string; @@ -170,9 +161,5 @@ export interface IEnvironmentService { driverHandle?: string; driverVerbose: boolean; - webviewEndpoint?: string; - readonly webviewResourceRoot: string; - readonly webviewCspSource: string; - - readonly galleryMachineIdResource?: URI; + galleryMachineIdResource?: URI; } diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index c5c4e66272c..a07c4c8f483 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -236,26 +236,15 @@ export class EnvironmentService implements IEnvironmentService { return false; } - get skipGettingStarted(): boolean { return !!this._args['skip-getting-started']; } - - get skipReleaseNotes(): boolean { return !!this._args['skip-release-notes']; } - - get skipAddToRecentlyOpened(): boolean { return !!this._args['skip-add-to-recently-opened']; } - @memoize get debugExtensionHost(): IExtensionHostDebugParams { return parseExtensionHostPort(this._args, this.isBuilt); } - @memoize - get debugSearch(): IDebugParams { return parseSearchPort(this._args, this.isBuilt); } - get isBuilt(): boolean { return !process.env['VSCODE_DEV']; } get verbose(): boolean { return !!this._args.verbose; } get log(): string | undefined { return this._args.log; } get wait(): boolean { return !!this._args.wait; } - get logExtensionHostCommunication(): boolean { return !!this._args.logExtensionHostCommunication; } - get status(): boolean { return !!this._args.status; } @memoize @@ -276,9 +265,6 @@ export class EnvironmentService implements IEnvironmentService { get driverHandle(): string | undefined { return this._args['driver']; } get driverVerbose(): boolean { return !!this._args['driver-verbose']; } - readonly webviewResourceRoot = 'vscode-resource:{{resource}}'; - readonly webviewCspSource = 'vscode-resource:'; - constructor(private _args: ParsedArgs, private _execPath: string) { if (!process.env['VSCODE_LOGS']) { const key = toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, ''); diff --git a/src/vs/workbench/contrib/update/electron-browser/update.ts b/src/vs/workbench/contrib/update/electron-browser/update.ts index 64d43209612..d429d21347d 100644 --- a/src/vs/workbench/contrib/update/electron-browser/update.ts +++ b/src/vs/workbench/contrib/update/electron-browser/update.ts @@ -119,7 +119,7 @@ export class ProductContribution implements IWorkbenchContribution { @IStorageService storageService: IStorageService, @IInstantiationService instantiationService: IInstantiationService, @INotificationService notificationService: INotificationService, - @IEnvironmentService environmentService: IEnvironmentService, + @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IOpenerService openerService: IOpenerService, @IConfigurationService configurationService: IConfigurationService, @IWindowService windowService: IWindowService, diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts index b18f47f0f96..9364cf5c6b4 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts @@ -7,7 +7,7 @@ import { Emitter } from 'vs/base/common/event'; import { URI } from 'vs/base/common/uri'; import { Webview, WebviewContentOptions, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IFileService } from 'vs/platform/files/common/files'; import { Disposable } from 'vs/base/common/lifecycle'; import { areWebviewInputOptionsEqual } from 'vs/workbench/contrib/webview/browser/webviewEditorService'; @@ -40,14 +40,14 @@ export class IFrameWebview extends Disposable implements Webview { contentOptions: WebviewContentOptions, @IThemeService themeService: IThemeService, @ITunnelService tunnelService: ITunnelService, - @IEnvironmentService private readonly environmentService: IEnvironmentService, + @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, @IFileService private readonly fileService: IFileService, @IConfigurationService private readonly _configurationService: IConfigurationService, ) { super(); const useExternalEndpoint = this._configurationService.getValue('webview.experimental.useExternalEndpoint'); - if (typeof environmentService.webviewEndpoint !== 'string' && !useExternalEndpoint) { + if (!useExternalEndpoint && (!environmentService.options || typeof environmentService.options.webviewEndpoint !== 'string')) { throw new Error('To use iframe based webviews, you must configure `environmentService.webviewEndpoint`'); } @@ -145,7 +145,7 @@ export class IFrameWebview extends Disposable implements Webview { private get endpoint(): string { const useExternalEndpoint = this._configurationService.getValue('webview.experimental.useExternalEndpoint'); - const baseEndpoint = useExternalEndpoint ? 'https://{{uuid}}.vscode-webview-test.com/8fa811108f0f0524c473020ef57b6620f6c201e1' : this.environmentService.webviewEndpoint!; + const baseEndpoint = useExternalEndpoint ? 'https://{{uuid}}.vscode-webview-test.com/8fa811108f0f0524c473020ef57b6620f6c201e1' : this.environmentService.options!.webviewEndpoint!; const endpoint = baseEndpoint.replace('{{uuid}}', this.id); if (endpoint[endpoint.length - 1] === '/') { return endpoint.slice(0, endpoint.length - 1); diff --git a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts index 200de4fa5c9..6bcad15f718 100644 --- a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts +++ b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts @@ -6,7 +6,7 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ITelemetryService, ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import * as platform from 'vs/base/common/platform'; import product from 'vs/platform/product/node/product'; import { IOpenerService } from 'vs/platform/opener/common/opener'; @@ -21,7 +21,7 @@ export class GettingStarted implements IWorkbenchContribution { constructor( @IStorageService private readonly storageService: IStorageService, - @IEnvironmentService environmentService: IEnvironmentService, + @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @ITelemetryService private readonly telemetryService: ITelemetryService, @IOpenerService private readonly openerService: IOpenerService ) { diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts index c61e1974692..7c3b6ae53e0 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts @@ -96,11 +96,9 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment break: false }; - this.webviewEndpoint = options.webviewEndpoint; this.untitledWorkspacesHome = URI.from({ scheme: Schemas.untitled, path: 'Workspaces' }); if (document && document.location && document.location.search) { - const map = new Map(); const query = document.location.search.substring(1); const vars = query.split('&'); @@ -170,7 +168,6 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment verbose: boolean; skipGettingStarted: boolean; skipReleaseNotes: boolean; - skipAddToRecentlyOpened: boolean; mainIPCHandle: string; sharedIPCHandle: string; nodeCachedDataDir?: string; @@ -179,16 +176,15 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment disableCrashReporter: boolean; driverHandle?: string; driverVerbose: boolean; - webviewEndpoint?: string; galleryMachineIdResource?: URI; readonly logFile: URI; get webviewResourceRoot(): string { - return this.webviewEndpoint ? this.webviewEndpoint + '/vscode-resource{{resource}}' : 'vscode-resource:{{resource}}'; + return this.options.webviewEndpoint ? `${this.options.webviewEndpoint}/vscode-resource{{resource}}` : 'vscode-resource:{{resource}}'; } get webviewCspSource(): string { - return this.webviewEndpoint ? this.webviewEndpoint : 'vscode-resource:'; + return this.options.webviewEndpoint ? this.options.webviewEndpoint : 'vscode-resource:'; } } diff --git a/src/vs/workbench/services/environment/common/environmentService.ts b/src/vs/workbench/services/environment/common/environmentService.ts index 967ad5e43cf..4ed892d7b02 100644 --- a/src/vs/workbench/services/environment/common/environmentService.ts +++ b/src/vs/workbench/services/environment/common/environmentService.ts @@ -5,7 +5,7 @@ import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IEnvironmentService, IDebugParams } from 'vs/platform/environment/common/environment'; import { IWorkbenchConstructionOptions } from 'vs/workbench/workbench.web.api'; import { URI } from 'vs/base/common/uri'; @@ -17,7 +17,17 @@ export interface IWorkbenchEnvironmentService extends IEnvironmentService { readonly configuration: IWindowConfiguration; - readonly logFile: URI; - readonly options?: IWorkbenchConstructionOptions; + + readonly logFile: URI; + readonly logExtensionHostCommunication: boolean; + + readonly debugSearch: IDebugParams; + + readonly webviewResourceRoot: string; + readonly webviewCspSource: string; + + readonly skipGettingStarted: boolean | undefined; + readonly skipReleaseNotes: boolean | undefined; + } diff --git a/src/vs/workbench/services/environment/node/environmentService.ts b/src/vs/workbench/services/environment/node/environmentService.ts index 0a46f3fa8e5..bedcfdc9995 100644 --- a/src/vs/workbench/services/environment/node/environmentService.ts +++ b/src/vs/workbench/services/environment/node/environmentService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; +import { EnvironmentService, parseSearchPort } from 'vs/platform/environment/node/environmentService'; import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { memoize } from 'vs/base/common/decorators'; @@ -12,27 +12,36 @@ import { Schemas } from 'vs/base/common/network'; import { toBackupWorkspaceResource } from 'vs/workbench/services/backup/common/backup'; import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { join } from 'vs/base/common/path'; +import { IDebugParams } from 'vs/platform/environment/common/environment'; export class WorkbenchEnvironmentService extends EnvironmentService implements IWorkbenchEnvironmentService { _serviceBrand!: ServiceIdentifier; + readonly webviewResourceRoot = 'vscode-resource:{{resource}}'; + readonly webviewCspSource = 'vscode-resource:'; + constructor( - private _configuration: IWindowConfiguration, + readonly configuration: IWindowConfiguration, execPath: string ) { - super(_configuration, execPath); + super(configuration, execPath); - this._configuration.backupWorkspaceResource = this._configuration.backupPath ? toBackupWorkspaceResource(this._configuration.backupPath, this) : undefined; + this.configuration.backupWorkspaceResource = this.configuration.backupPath ? toBackupWorkspaceResource(this.configuration.backupPath, this) : undefined; } - get configuration(): IWindowConfiguration { - return this._configuration; - } + get skipGettingStarted(): boolean { return !!this.args['skip-getting-started']; } + + get skipReleaseNotes(): boolean { return !!this.args['skip-release-notes']; } @memoize get userRoamingDataHome(): URI { return this.appSettingsHome.with({ scheme: Schemas.userData }); } @memoize get logFile(): URI { return URI.file(join(this.logsPath, `renderer${this.configuration.windowId}.log`)); } + + get logExtensionHostCommunication(): boolean { return !!this.args.logExtensionHostCommunication; } + + @memoize + get debugSearch(): IDebugParams { return parseSearchPort(this.args, this.isBuilt); } } diff --git a/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts b/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts index f8067e33e0d..44f76d95fd0 100644 --- a/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts +++ b/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts @@ -8,7 +8,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import * as strings from 'vs/base/common/strings'; import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ExtHostCustomersRegistry } from 'vs/workbench/api/common/extHostCustomers'; import { ExtHostContext, ExtHostExtensionServiceShape, IExtHostContext, MainContext } from 'vs/workbench/api/common/extHost.protocol'; @@ -59,7 +59,7 @@ export class ExtensionHostProcessManager extends Disposable { private readonly _remoteAuthority: string, initialActivationEvents: string[], @IInstantiationService private readonly _instantiationService: IInstantiationService, - @IEnvironmentService private readonly _environmentService: IEnvironmentService, + @IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService, ) { super(); this._extensionHostProcessFinishedActivateEvents = Object.create(null); diff --git a/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts b/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts index f2e25b99d66..bcb46463c2c 100644 --- a/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts +++ b/src/vs/workbench/services/extensions/common/remoteExtensionHostClient.ts @@ -5,7 +5,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { ILabelService } from 'vs/platform/label/common/label'; import { ILogService } from 'vs/platform/log/common/log'; import { connectRemoteAgentExtensionHost, IRemoteExtensionHostStartParams, IConnectionOptions, ISocketFactory } from 'vs/platform/remote/common/remoteAgentConnection'; @@ -49,7 +49,7 @@ export class RemoteExtensionHostClient extends Disposable implements IExtensionH private readonly _initDataProvider: IInitDataProvider, private readonly _socketFactory: ISocketFactory, @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, - @IEnvironmentService private readonly _environmentService: IEnvironmentService, + @IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService, @ITelemetryService private readonly _telemetryService: ITelemetryService, @ILifecycleService private readonly _lifecycleService: ILifecycleService, @ILogService private readonly _logService: ILogService, diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index 53de732e011..9b00ee68b63 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -12,7 +12,8 @@ import { URI as uri } from 'vs/base/common/uri'; import { getNextTickChannel } from 'vs/base/parts/ipc/common/ipc'; import { Client, IIPCOptions } from 'vs/base/parts/ipc/node/ipc.cp'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IDebugParams, IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IDebugParams } from 'vs/platform/environment/common/environment'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IFileService } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; import { FileMatch, IFileMatch, IFileQuery, IProgressMessage, IRawSearchService, ISearchComplete, ISearchConfiguration, ISearchProgressItem, ISearchResultProvider, ISerializedFileMatch, ISerializedSearchComplete, ISerializedSearchProgressItem, isSerializedSearchComplete, isSerializedSearchSuccess, ITextQuery, ISearchService } from 'vs/workbench/services/search/common/search'; @@ -35,7 +36,7 @@ export class LocalSearchService extends SearchService { @ILogService logService: ILogService, @IExtensionService extensionService: IExtensionService, @IFileService fileService: IFileService, - @IEnvironmentService readonly environmentService: IEnvironmentService, + @IWorkbenchEnvironmentService readonly environmentService: IWorkbenchEnvironmentService, @IInstantiationService readonly instantiationService: IInstantiationService ) { super(modelService, untitledEditorService, editorService, telemetryService, logService, extensionService, fileService); @@ -204,4 +205,4 @@ export class DiskSearch implements ISearchResultProvider { } } -registerSingleton(ISearchService, LocalSearchService, true); \ No newline at end of file +registerSingleton(ISearchService, LocalSearchService, true); From 21ce78cf25a7a3b82502f0fc9e764e7840b315b3 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 24 Aug 2019 17:14:14 +0200 Subject: [PATCH 077/163] web - lift product config to be proper API --- src/vs/code/browser/workbench/workbench.html | 3 +- src/vs/workbench/browser/web.main.ts | 98 +++++++++++--------- src/vs/workbench/workbench.web.api.ts | 6 ++ 3 files changed, 59 insertions(+), 48 deletions(-) diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 9c7defe5af3..663cc643f97 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -16,9 +16,8 @@ - + - diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts index 6deb0926954..f5944ce974a 100644 --- a/src/vs/workbench/browser/web.main.ts +++ b/src/vs/workbench/browser/web.main.ts @@ -18,7 +18,7 @@ import { RemoteAgentService } from 'vs/workbench/services/remote/browser/remoteA import { RemoteAuthorityResolverService } from 'vs/platform/remote/browser/remoteAuthorityResolverService'; import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { IFileService, IFileSystemProvider } from 'vs/platform/files/common/files'; +import { IFileService } from 'vs/platform/files/common/files'; import { FileService } from 'vs/platform/files/common/fileService'; import { Schemas } from 'vs/base/common/network'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -124,7 +124,7 @@ class CodeRendererMain extends Disposable { const logService = new BufferLogService(); serviceCollection.set(ILogService, logService); - const payload = await this.resolveWorkspaceInitializationPayload(); + const payload = this.resolveWorkspaceInitializationPayload(); // Environment const environmentService = new BrowserWorkbenchEnvironmentService({ workspaceId: payload.id, logsPath, ...this.configuration }); @@ -149,46 +149,7 @@ class CodeRendererMain extends Disposable { // Files const fileService = this._register(new FileService(logService)); serviceCollection.set(IFileService, fileService); - - // Logger - const indexedDBLogProvider = new IndexedDBLogProvider(logsPath.scheme); - (async () => { - try { - await indexedDBLogProvider.database; - - fileService.registerProvider(logsPath.scheme, indexedDBLogProvider); - } catch (error) { - (logService).info('Error while creating indexedDB log provider. Falling back to in-memory log provider.'); - (logService).error(error); - - fileService.registerProvider(logsPath.scheme, new InMemoryLogProvider(logsPath.scheme)); - } - - const consoleLogService = new ConsoleLogService(logService.getLevel()); - const fileLogService = new FileLogService('window', environmentService.logFile, logService.getLevel(), fileService); - logService.logger = new MultiplexLogService([consoleLogService, fileLogService]); - })(); - - // User Data Provider - let userDataProvider: IFileSystemProvider | undefined = this.configuration.userDataProvider; - const connection = remoteAgentService.getConnection(); - if (connection) { - const channel = connection.getChannel(REMOTE_FILE_SYSTEM_CHANNEL_NAME); - const remoteFileSystemProvider = this._register(new RemoteExtensionsFileSystemProvider(channel, remoteAgentService.getEnvironment())); - - fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider); - - if (!userDataProvider) { - const remoteUserDataUri = this.getRemoteUserDataUri(); - if (remoteUserDataUri) { - userDataProvider = this._register(new FileUserDataProvider(remoteUserDataUri, joinPath(remoteUserDataUri, BACKUPS), remoteFileSystemProvider, environmentService)); - } - } - } - if (!userDataProvider) { - userDataProvider = this._register(new InMemoryUserDataProvider()); - } - fileService.registerProvider(Schemas.userData, userDataProvider); + this.registerFileSystemProviders(environmentService, fileService, remoteAgentService, logService, logsPath); // Long running services (workspace, config, storage) const services = await Promise.all([ @@ -215,15 +176,59 @@ class CodeRendererMain extends Disposable { return { serviceCollection, logService, storageService: services[1] }; } + private registerFileSystemProviders(environmentService: IWorkbenchEnvironmentService, fileService: IFileService, remoteAgentService: IRemoteAgentService, logService: BufferLogService, logsPath: URI): void { + + // Logger + const indexedDBLogProvider = new IndexedDBLogProvider(logsPath.scheme); + (async () => { + try { + await indexedDBLogProvider.database; + + fileService.registerProvider(logsPath.scheme, indexedDBLogProvider); + } catch (error) { + (logService).info('Error while creating indexedDB log provider. Falling back to in-memory log provider.'); + (logService).error(error); + + fileService.registerProvider(logsPath.scheme, new InMemoryLogProvider(logsPath.scheme)); + } + + const consoleLogService = new ConsoleLogService(logService.getLevel()); + const fileLogService = new FileLogService('window', environmentService.logFile, logService.getLevel(), fileService); + logService.logger = new MultiplexLogService([consoleLogService, fileLogService]); + })(); + + const connection = remoteAgentService.getConnection(); + if (connection) { + + // Remote file system + const channel = connection.getChannel(REMOTE_FILE_SYSTEM_CHANNEL_NAME); + const remoteFileSystemProvider = this._register(new RemoteExtensionsFileSystemProvider(channel, remoteAgentService.getEnvironment())); + fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider); + + if (!this.configuration.userDataProvider) { + const remoteUserDataUri = this.getRemoteUserDataUri(); + if (remoteUserDataUri) { + this.configuration.userDataProvider = this._register(new FileUserDataProvider(remoteUserDataUri, joinPath(remoteUserDataUri, BACKUPS), remoteFileSystemProvider, environmentService)); + } + } + } + + // User data + if (!this.configuration.userDataProvider) { + this.configuration.userDataProvider = this._register(new InMemoryUserDataProvider()); + } + fileService.registerProvider(Schemas.userData, this.configuration.userDataProvider); + } + private createProductService(): IProductService { - const element = document.getElementById('vscode-remote-product-configuration'); - const productConfiguration: IProductConfiguration = { - ...element ? JSON.parse(element.getAttribute('data-settings')!) : { + const productConfiguration = { + ...this.configuration.productConfiguration ? this.configuration.productConfiguration : { version: '1.38.0-unknown', nameLong: 'Unknown', extensionAllowedProposedApi: [], }, ...{ urlProtocol: '' } - }; + } as IProductConfiguration; + return { _serviceBrand: undefined, ...productConfiguration }; } @@ -280,6 +285,7 @@ class CodeRendererMain extends Disposable { return joinPath(URI.revive(JSON.parse(remoteUserDataPath)), 'User'); } } + return null; } } diff --git a/src/vs/workbench/workbench.web.api.ts b/src/vs/workbench/workbench.web.api.ts index 844ff1da56a..4bdfb542d9f 100644 --- a/src/vs/workbench/workbench.web.api.ts +++ b/src/vs/workbench/workbench.web.api.ts @@ -11,6 +11,7 @@ import { IWebSocketFactory } from 'vs/platform/remote/browser/browserSocketFacto import { ICredentialsProvider } from 'vs/workbench/services/credentials/browser/credentialsService'; import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; import { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService'; +import { IProductConfiguration } from 'vs/platform/product/common/product'; export interface IWorkbenchConstructionOptions { @@ -71,6 +72,11 @@ export interface IWorkbenchConstructionOptions { * Experimental: Support for URL callbacks. */ urlCallbackProvider?: IURLCallbackProvider; + + /** + * Experimental: Support for product configuration. + */ + productConfiguration?: IProductConfiguration; } /** From 2b37012c475314879e9980a2cc85e4cd1a1a58ac Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 24 Aug 2019 17:23:18 +0200 Subject: [PATCH 078/163] :up: distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 037a6cf41a6..e489e9b0631 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "b8b5d79d26bc7b35031b45ab31961959c6c199d2", + "distro": "30060f8ffc31f3de68146de3df305a71973ae1db", "author": { "name": "Microsoft Corporation" }, From aa02f856bfce711dd2aa83309b97de0cf2b5722f Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 24 Aug 2019 17:51:24 +0200 Subject: [PATCH 079/163] fix tests --- .../configurationResolverService.test.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts index dd668c74f6d..66236f88de8 100644 --- a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts @@ -20,7 +20,6 @@ import * as Types from 'vs/base/common/types'; import { EditorType } from 'vs/editor/common/editorCommon'; import { Selection } from 'vs/editor/common/core/selection'; import { WorkbenchEnvironmentService } from 'vs/workbench/services/environment/node/environmentService'; -import { parseArgs } from 'vs/platform/environment/node/argv'; import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -632,11 +631,7 @@ class MockInputsConfigurationService extends TestConfigurationService { class MockWorkbenchEnvironmentService extends WorkbenchEnvironmentService { - constructor(private env: platform.IProcessEnvironment) { - super(parseArgs(process.argv) as IWindowConfiguration, process.execPath); - } - - get configuration(): IWindowConfiguration { - return { userEnv: this.env } as IWindowConfiguration; + constructor(env: platform.IProcessEnvironment) { + super({ userEnv: env } as IWindowConfiguration, process.execPath); } } From 33e53ee72bcbabefb1f8bfcc70e8c2c229a97d0d Mon Sep 17 00:00:00 2001 From: Jonathan Mannancheril Date: Fri, 16 Aug 2019 20:42:23 -0500 Subject: [PATCH 080/163] Allow goToLine to work backwards --- .../workbench/contrib/quickopen/browser/gotoLineHandler.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts index 724509b2d05..abde827728c 100644 --- a/src/vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts @@ -87,8 +87,10 @@ class GotoLineEntry extends EditorQuickOpenEntry { private parseInput(line: string) { const numbers = line.split(/,|:|#/).map(part => parseInt(part, 10)).filter(part => !isNaN(part)); - this.line = numbers[0]; + const endLine = this.getMaxLineNumber() + 1; + this.column = numbers[1]; + this.line = numbers[0] > 0 ? numbers[0] : endLine + numbers[0]; } getLabel(): string { @@ -114,7 +116,7 @@ class GotoLineEntry extends EditorQuickOpenEntry { } private invalidRange(maxLineNumber: number = this.getMaxLineNumber()): boolean { - return !this.line || !types.isNumber(this.line) || (maxLineNumber > 0 && types.isNumber(this.line) && this.line > maxLineNumber); + return !this.line || !types.isNumber(this.line) || (maxLineNumber > 0 && types.isNumber(this.line) && this.line > maxLineNumber) || this.line < 0; } private getMaxLineNumber(): number { From 453aed2249ea3c730f639770147cd8d2b1681a91 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 08:07:52 +0200 Subject: [PATCH 081/163] fix #79784 --- .../contrib/files/browser/views/openEditorsView.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 96be5e2659b..774d54ef626 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -28,7 +28,7 @@ import { IListVirtualDelegate, IListRenderer, IListContextMenuEvent, IListDragAn import { ResourceLabels, IResourceLabel } from 'vs/workbench/browser/labels'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; +import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions'; @@ -349,9 +349,9 @@ export class OpenEditorsView extends ViewletPanel { const preserveActivateGroup = options.sideBySide && options.preserveFocus; // needed for https://github.com/Microsoft/vscode/issues/42399 if (!preserveActivateGroup) { - this.editorGroupService.activateGroup(element.groupId); // needed for https://github.com/Microsoft/vscode/issues/6672 + this.editorGroupService.activateGroup(element.group); // needed for https://github.com/Microsoft/vscode/issues/6672 } - this.editorService.openEditor(element.editor, options, options.sideBySide ? SIDE_GROUP : ACTIVE_GROUP).then(editor => { + this.editorService.openEditor(element.editor, options, options.sideBySide ? SIDE_GROUP : element.group).then(editor => { if (editor && !preserveActivateGroup && editor.group) { this.editorGroupService.activateGroup(editor.group); } From fc0e2e23528c098a77cd47afbfda0d89a644de7d Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 08:10:06 +0200 Subject: [PATCH 082/163] fix #79633 --- .../workbench/browser/parts/editor/editor.ts | 1 + .../browser/parts/editor/editorGroupView.ts | 33 ++++++----- .../browser/parts/editor/editorPart.ts | 29 +++++++--- .../services/editor/browser/editorService.ts | 56 ++++++++----------- .../preferences/browser/preferencesService.ts | 2 +- .../workbench/test/workbenchTestServices.ts | 4 ++ 6 files changed, 67 insertions(+), 58 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editor.ts b/src/vs/workbench/browser/parts/editor/editor.ts index 634812bfa84..b2e46d001d6 100644 --- a/src/vs/workbench/browser/parts/editor/editor.ts +++ b/src/vs/workbench/browser/parts/editor/editor.ts @@ -94,6 +94,7 @@ export interface IEditorGroupsAccessor { getGroups(order: GroupsOrder): IEditorGroupView[]; activateGroup(identifier: IEditorGroupView | GroupIdentifier): IEditorGroupView; + restoreGroup(identifier: IEditorGroupView | GroupIdentifier): IEditorGroupView; addGroup(location: IEditorGroupView | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroupView; mergeGroup(group: IEditorGroupView | GroupIdentifier, target: IEditorGroupView | GroupIdentifier, options?: IMergeGroupOptions): IEditorGroupView; diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index dcfc2b8e358..fb1e07119c7 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -481,7 +481,6 @@ export class EditorGroupView extends Themable implements IEditorGroupView { private onDidEditorOpen(editor: EditorInput): void { - // Telemetry /* __GDPR__ "editorOpened" : { "${include}": [ @@ -520,14 +519,13 @@ export class EditorGroupView extends Themable implements IEditorGroupView { } }); - // Telemetry /* __GDPR__ - "editorClosed" : { - "${include}": [ - "${EditorTelemetryDescriptor}" - ] - } - */ + "editorClosed" : { + "${include}": [ + "${EditorTelemetryDescriptor}" + ] + } + */ this.telemetryService.publicLog('editorClosed', this.toEditorTelemetryDescriptor(event.editor)); // Update container @@ -833,12 +831,19 @@ export class EditorGroupView extends Themable implements IEditorGroupView { openEditorOptions.active = true; } - // Set group active unless we open inactive or preserve focus - // Do this before we open the editor in the group to prevent a false - // active editor change event before the editor is loaded - // (see https://github.com/Microsoft/vscode/issues/51679) - if (openEditorOptions.active && (!options || !options.preserveFocus)) { - this.accessor.activateGroup(this); + if (openEditorOptions.active) { + // Set group active unless we are instructed to preserveFocus. Always + // make sure to restore a minimized group though in order to fix + // https://github.com/microsoft/vscode/issues/79633 + // + // Do this before we open the editor in the group to prevent a false + // active editor change event before the editor is loaded + // (see https://github.com/Microsoft/vscode/issues/51679) + if (options && options.preserveFocus) { + this.accessor.restoreGroup(this); + } else { + this.accessor.activateGroup(this); + } } // Actually move the editor if a specific index is provided and we figure diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 8bb14cc38a3..5607b641184 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -325,6 +325,13 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro return groupView; } + restoreGroup(group: IEditorGroupView | GroupIdentifier): IEditorGroupView { + const groupView = this.assertGroupView(group); + this.doRestoreGroup(groupView); + + return groupView; + } + getSize(group: IEditorGroupView | GroupIdentifier): { width: number, height: number } { const groupView = this.assertGroupView(group); @@ -337,7 +344,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro this.gridWidget.resizeView(groupView, size); } - arrangeGroups(arrangement: GroupsArrangement): void { + arrangeGroups(arrangement: GroupsArrangement, target = this.activeGroup): void { if (this.count < 2) { return; // require at least 2 groups to show } @@ -351,10 +358,10 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro this.gridWidget.distributeViewSizes(); break; case GroupsArrangement.MINIMIZE_OTHERS: - this.gridWidget.maximizeViewSize(this.activeGroup); + this.gridWidget.maximizeViewSize(target); break; case GroupsArrangement.TOGGLE: - if (this.isGroupMaximized(this.activeGroup)) { + if (this.isGroupMaximized(target)) { this.arrangeGroups(GroupsArrangement.EVEN); } else { this.arrangeGroups(GroupsArrangement.MINIMIZE_OTHERS); @@ -576,17 +583,21 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro group.setActive(true); // Maximize the group if it is currently minimized - if (this.gridWidget) { - const viewSize = this.gridWidget.getViewSize(group); - if (viewSize.width === group.minimumWidth || viewSize.height === group.minimumHeight) { - this.arrangeGroups(GroupsArrangement.MINIMIZE_OTHERS); - } - } + this.doRestoreGroup(group); // Event this._onDidActiveGroupChange.fire(group); } + private doRestoreGroup(group: IEditorGroupView): void { + if (this.gridWidget) { + const viewSize = this.gridWidget.getViewSize(group); + if (viewSize.width === group.minimumWidth || viewSize.height === group.minimumHeight) { + this.arrangeGroups(GroupsArrangement.MINIMIZE_OTHERS, group); + } + } + } + private doUpdateMostRecentActive(group: IEditorGroupView, makeMostRecentlyActive?: boolean): void { const index = this.mostRecentActiveGroups.indexOf(group.id); diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 22375af730e..78422237936 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -19,7 +19,7 @@ import { basename } from 'vs/base/common/resources'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { localize } from 'vs/nls'; import { IEditorGroupsService, IEditorGroup, GroupsOrder, IEditorReplacement, GroupChangeKind, preferredSideBySideGroupDirection } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IResourceEditor, ACTIVE_GROUP_TYPE, SIDE_GROUP_TYPE, SIDE_GROUP, IResourceEditorReplacement, IOpenEditorOverrideHandler, IVisibleEditor, IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IResourceEditor, SIDE_GROUP, IResourceEditorReplacement, IOpenEditorOverrideHandler, IVisibleEditor, IEditorService, SIDE_GROUP_TYPE, ACTIVE_GROUP_TYPE } from 'vs/workbench/services/editor/common/editorService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Disposable, IDisposable, dispose, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; import { coalesce } from 'vs/base/common/arrays'; @@ -29,13 +29,14 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { withNullAsUndefined } from 'vs/base/common/types'; -type ICachedEditorInput = ResourceEditorInput | IFileEditorInput | DataUriEditorInput; +type CachedEditorInput = ResourceEditorInput | IFileEditorInput | DataUriEditorInput; +type OpenInEditorGroup = IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE; export class EditorService extends Disposable implements EditorServiceImpl { _serviceBrand!: ServiceIdentifier; - private static CACHE: ResourceMap = new ResourceMap(); + private static CACHE: ResourceMap = new ResourceMap(); //#region events @@ -216,11 +217,11 @@ export class EditorService extends Disposable implements EditorServiceImpl { //#region openEditor() - openEditor(editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; - openEditor(editor: IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; - openEditor(editor: IResourceDiffInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; - openEditor(editor: IResourceSideBySideInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; - openEditor(editor: IEditorInput | IResourceEditor, optionsOrGroup?: IEditorOptions | ITextEditorOptions | IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE, group?: GroupIdentifier): Promise { + openEditor(editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions, group?: OpenInEditorGroup): Promise; + openEditor(editor: IResourceInput | IUntitledResourceInput, group?: OpenInEditorGroup): Promise; + openEditor(editor: IResourceDiffInput, group?: OpenInEditorGroup): Promise; + openEditor(editor: IResourceSideBySideInput, group?: OpenInEditorGroup): Promise; + async openEditor(editor: IEditorInput | IResourceEditor, optionsOrGroup?: IEditorOptions | ITextEditorOptions | OpenInEditorGroup, group?: OpenInEditorGroup): Promise { // Typed Editor Support if (editor instanceof EditorInput) { @@ -240,14 +241,14 @@ export class EditorService extends Disposable implements EditorServiceImpl { return this.doOpenEditor(targetGroup, typedInput, editorOptions); } - return Promise.resolve(undefined); + return undefined; } - protected doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise { - return group.openEditor(editor, options).then(withNullAsUndefined); + protected async doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise { + return withNullAsUndefined(await group.openEditor(editor, options)); } - private findTargetGroup(input: IEditorInput, options?: IEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): IEditorGroup { + private findTargetGroup(input: IEditorInput, options?: IEditorOptions, group?: OpenInEditorGroup): IEditorGroup { let targetGroup: IEditorGroup | undefined; // Group: Instance of Group @@ -344,9 +345,9 @@ export class EditorService extends Disposable implements EditorServiceImpl { //#region openEditors() - openEditors(editors: IEditorInputWithOptions[], group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; - openEditors(editors: IResourceEditor[], group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; - async openEditors(editors: Array, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise { + openEditors(editors: IEditorInputWithOptions[], group?: OpenInEditorGroup): Promise; + openEditors(editors: IResourceEditor[], group?: OpenInEditorGroup): Promise; + async openEditors(editors: Array, group?: OpenInEditorGroup): Promise { // Convert to typed editors and options const typedEditors: IEditorInputWithOptions[] = []; @@ -391,7 +392,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { //#region isOpen() - isOpen(editor: IEditorInput | IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): boolean { + isOpen(editor: IEditorInput | IResourceInput | IUntitledResourceInput): boolean { return !!this.doGetOpened(editor); } @@ -399,11 +400,11 @@ export class EditorService extends Disposable implements EditorServiceImpl { //#region getOpend() - getOpened(editor: IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): IEditorInput | undefined { + getOpened(editor: IResourceInput | IUntitledResourceInput): IEditorInput | undefined { return this.doGetOpened(editor); } - private doGetOpened(editor: IEditorInput | IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): IEditorInput | undefined { + private doGetOpened(editor: IEditorInput | IResourceInput | IUntitledResourceInput): IEditorInput | undefined { if (!(editor instanceof EditorInput)) { const resourceInput = editor as IResourceInput | IUntitledResourceInput; if (!resourceInput.resource) { @@ -411,20 +412,8 @@ export class EditorService extends Disposable implements EditorServiceImpl { } } - let groups: IEditorGroup[] = []; - if (typeof group === 'number') { - const groupView = this.editorGroupService.getGroup(group); - if (groupView) { - groups.push(groupView); - } - } else if (group) { - groups.push(group); - } else { - groups = [...this.editorGroupService.groups]; - } - // For each editor group - for (const group of groups) { + for (const group of this.editorGroupService.groups) { // Typed editor if (editor instanceof EditorInput) { @@ -566,7 +555,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { throw new Error('Unknown input type'); } - private createOrGet(resource: URI, instantiationService: IInstantiationService, label: string | undefined, description: string | undefined, encoding: string | undefined, mode: string | undefined, forceFile: boolean | undefined): ICachedEditorInput { + private createOrGet(resource: URI, instantiationService: IInstantiationService, label: string | undefined, description: string | undefined, encoding: string | undefined, mode: string | undefined, forceFile: boolean | undefined): CachedEditorInput { if (EditorService.CACHE.has(resource)) { const input = EditorService.CACHE.get(resource)!; if (input instanceof ResourceEditorInput) { @@ -594,9 +583,8 @@ export class EditorService extends Disposable implements EditorServiceImpl { return input; } - let input: ICachedEditorInput; - // File + let input: CachedEditorInput; if (forceFile /* fix for https://github.com/Microsoft/vscode/issues/48275 */ || this.fileService.canHandleResource(resource)) { input = this.fileInputFactory.createFileInput(resource, encoding, mode, instantiationService); } diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index 1e579f2968b..c95a6138545 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -214,7 +214,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic private openSettings2(options?: ISettingsEditorOptions): Promise { const input = this.settingsEditor2Input; - return this.editorGroupService.activeGroup.openEditor(input, options) + return this.editorService.openEditor(input, options) .then(() => this.editorGroupService.activeGroup.activeControl!); } diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index d182e4ca73c..e25eccdd4ad 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -710,6 +710,10 @@ export class TestEditorGroupsService implements IEditorGroupsService { throw new Error('not implemented'); } + restoreGroup(_group: number | IEditorGroup): IEditorGroup { + throw new Error('not implemented'); + } + getSize(_group: number | IEditorGroup): { width: number, height: number } { return { width: 100, height: 100 }; } From b032304497183709c76861b19bf405b17afc992a Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 08:21:03 +0200 Subject: [PATCH 083/163] workaround #79786 --- .../contrib/files/browser/views/openEditorsView.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 774d54ef626..1aa98445d91 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -263,15 +263,21 @@ export class OpenEditorsView extends ViewletPanel { let openToSide = false; let isSingleClick = false; let isDoubleClick = false; + let isMiddleClick = false; if (browserEvent instanceof MouseEvent) { isSingleClick = browserEvent.detail === 1; isDoubleClick = browserEvent.detail === 2; + isMiddleClick = browserEvent.button === 1; openToSide = this.list.useAltAsMultipleSelectionModifier ? (browserEvent.ctrlKey || browserEvent.metaKey) : browserEvent.altKey; } const focused = this.list.getFocusedElements(); const element = focused.length ? focused[0] : undefined; if (element instanceof OpenEditor) { + if (isMiddleClick) { + return; // already handled above: closes the editor + } + this.openEditor(element, { preserveFocus: isSingleClick, pinned: isDoubleClick, sideBySide: openToSide }); } else if (element) { this.editorGroupService.activateGroup(element); From 8b96058c1fdccd506d895461ea93b5a009698600 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 08:42:56 +0200 Subject: [PATCH 084/163] fix #79763 (also fixes #79787) --- .../browser/parts/editor/editorActions.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index 0464d3131be..7b4cab33ed8 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -618,12 +618,24 @@ export abstract class BaseCloseAllAction extends Action { async run(): Promise { - // Just close all if there are no or one dirty editor - if (this.textFileService.getDirty().length < 2) { + // Just close all if there are no dirty editors + if (!this.textFileService.isDirty()) { return this.doCloseAll(); } - // Otherwise ask for combined confirmation + // Otherwise ask for combined confirmation and make sure + // to bring each dirty editor to the front so that the user + // can review if the files should be changed or not. + await Promise.all(this.groupsToClose.map(async groupToClose => { + for (const editor of groupToClose.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE)) { + if (editor.isDirty()) { + return groupToClose.openEditor(editor); + } + } + + return undefined; + })); + const confirm = await this.textFileService.confirmSave(); if (confirm === ConfirmResult.CANCEL) { return; From 1b2bf898b16a699e4d9cb6805f75799046d23289 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 08:58:08 +0200 Subject: [PATCH 085/163] fix #78825 --- src/vs/workbench/browser/parts/editor/editor.contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 31daf2483f5..162e7f25cb8 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -442,7 +442,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCo MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.SPLIT_EDITOR_RIGHT, title: nls.localize('splitRight', "Split Right") }, group: '5_split', order: 40 }); // Editor Title Menu -MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: editorCommands.TOGGLE_DIFF_SIDE_BY_SIDE, title: nls.localize('toggleSideBySideView', "Toggle Side By Side View") }, group: '1_diff', order: 10, when: ContextKeyExpr.has('isInDiffEditor') }); +MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: editorCommands.TOGGLE_DIFF_SIDE_BY_SIDE, title: nls.localize('toggleInlineView', "Toggle Inline View") }, group: '1_diff', order: 10, when: ContextKeyExpr.has('isInDiffEditor') }); MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: editorCommands.SHOW_EDITORS_IN_GROUP, title: nls.localize('showOpenedEditors', "Show Opened Editors") }, group: '3_open', order: 10, when: ContextKeyExpr.has('config.workbench.editor.showTabs') }); MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID, title: nls.localize('closeAll', "Close All") }, group: '5_close', order: 10, when: ContextKeyExpr.has('config.workbench.editor.showTabs') }); MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: editorCommands.CLOSE_SAVED_EDITORS_COMMAND_ID, title: nls.localize('closeAllSaved', "Close Saved") }, group: '5_close', order: 20, when: ContextKeyExpr.has('config.workbench.editor.showTabs') }); From fc4fd26b1293fca68ecf41f35b5933fb9ff91e63 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 09:05:18 +0200 Subject: [PATCH 086/163] fix #78888 --- src/vs/workbench/browser/parts/editor/editorControl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/editorControl.ts b/src/vs/workbench/browser/parts/editor/editorControl.ts index 70d57bba5ad..9b59e8e38f7 100644 --- a/src/vs/workbench/browser/parts/editor/editorControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorControl.ts @@ -112,7 +112,7 @@ export class EditorControl extends Disposable { if (!control.getContainer()) { const controlInstanceContainer = document.createElement('div'); addClass(controlInstanceContainer, 'editor-instance'); - controlInstanceContainer.id = descriptor.getId(); + controlInstanceContainer.setAttribute('data-editor-id', descriptor.getId()); control.create(controlInstanceContainer); } From f60b7b84b1d2e8f53e7927fff5c4013e78126550 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 10:02:34 +0200 Subject: [PATCH 087/163] web - add manifest to support PWA installation --- package.json | 2 +- src/vs/code/browser/workbench/workbench.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e489e9b0631..2427358b7d4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "30060f8ffc31f3de68146de3df305a71973ae1db", + "distro": "c7b813651b7b055ee605ecaaa442abc6dbf14d44", "author": { "name": "Microsoft Corporation" }, diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 663cc643f97..44f67f0a0bb 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -10,7 +10,7 @@ @@ -19,8 +19,9 @@ - + + From 0cf92dcf52c62c3db0627cfb71464bc3a0571100 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 26 Aug 2019 11:10:07 +0200 Subject: [PATCH 088/163] worker tweaks --- .../services/extensions/worker/extensionHostWorker.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts b/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts index 3d6659698be..7f30bf8d7b2 100644 --- a/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts +++ b/src/vs/workbench/services/extensions/worker/extensionHostWorker.ts @@ -19,8 +19,8 @@ declare namespace self { let close: any; let postMessage: any; let addEventLister: any; - let indexedDB: any; - let caches: any; + let indexedDB: { open: any, [k: string]: any }; + let caches: { open: any, [k: string]: any }; } const nativeClose = self.close.bind(self); @@ -32,9 +32,8 @@ self.postMessage = () => console.trace(`'postMessage' has been blocked`); const nativeAddEventLister = addEventListener.bind(self); self.addEventLister = () => console.trace(`'addEventListener' has been blocked`); -// readonly, cannot redefine... -// self.indexedDB = undefined; -// self.caches = undefined; +self.indexedDB.open = () => console.trace(`'indexedDB.open' has been blocked`); +self.caches.open = () => console.trace(`'indexedDB.caches' has been blocked`); //#endregion --- From 185308c0dd317d73fe4c19dea347582dee9650de Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 11:18:40 +0200 Subject: [PATCH 089/163] Fix issue where BufferedEmitter would not deliver buffered events --- src/vs/base/parts/ipc/common/ipc.net.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/base/parts/ipc/common/ipc.net.ts b/src/vs/base/parts/ipc/common/ipc.net.ts index 1e2fdbccec4..71ffef3a0ad 100644 --- a/src/vs/base/parts/ipc/common/ipc.net.ts +++ b/src/vs/base/parts/ipc/common/ipc.net.ts @@ -420,7 +420,7 @@ export class BufferedEmitter { // it is important to deliver these messages after this call, but before // other messages have a chance to be received (to guarantee in order delivery) // that's why we're using here nextTick and not other types of timeouts - process.nextTick(() => this._deliverMessages); + process.nextTick(() => this._deliverMessages()); }, onLastListenerRemove: () => { this._hasListeners = false; @@ -443,7 +443,11 @@ export class BufferedEmitter { public fire(event: T): void { if (this._hasListeners) { - this._emitter.fire(event); + if (this._bufferedMessages.length > 0) { + this._bufferedMessages.push(event); + } else { + this._emitter.fire(event); + } } else { this._bufferedMessages.push(event); } From e02ccd0715c8d8ada53eac2c83160e90f66d2b53 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 11:32:19 +0200 Subject: [PATCH 090/163] fix #79798 --- .../contrib/files/browser/explorerViewlet.ts | 10 +-- .../files/browser/views/openEditorsView.ts | 6 +- .../contrib/search/browser/searchView.ts | 6 -- .../services/editor/browser/editorService.ts | 75 ++++++++++++++++--- .../editor/test/browser/editorService.test.ts | 2 +- 5 files changed, 69 insertions(+), 30 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts index c9713c80989..d85d35b9bcf 100644 --- a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts @@ -26,10 +26,9 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { DelegatingEditorService } from 'vs/workbench/services/editor/browser/editorService'; -import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorOptions } from 'vs/platform/editor/common/editor'; -import { IEditorInput, IEditor } from 'vs/workbench/common/editor'; +import { IEditor } from 'vs/workbench/common/editor'; import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet'; import { KeyChord, KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -158,7 +157,6 @@ export class ExplorerViewlet extends ViewContainerViewlet { @ITelemetryService telemetryService: ITelemetryService, @IWorkspaceContextService protected contextService: IWorkspaceContextService, @IStorageService protected storageService: IStorageService, - @IEditorService private readonly editorService: IEditorService, @IEditorGroupsService private readonly editorGroupService: IEditorGroupsService, @IConfigurationService configurationService: IConfigurationService, @IInstantiationService protected instantiationService: IInstantiationService, @@ -187,7 +185,7 @@ export class ExplorerViewlet extends ViewContainerViewlet { // We try to be smart and only use the delay if we recognize that the user action is likely to cause // a new entry in the opened editors view. const delegatingEditorService = this.instantiationService.createInstance(DelegatingEditorService); - delegatingEditorService.setEditorOpenHandler(async (group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise => { + delegatingEditorService.setEditorOpenHandler(async (delegate, group, editor, options): Promise => { let openEditorsView = this.getOpenEditorsView(); if (openEditorsView) { let delay = 0; @@ -205,7 +203,7 @@ export class ExplorerViewlet extends ViewContainerViewlet { let openedEditor: IEditor | undefined; try { - openedEditor = await this.editorService.openEditor(editor, options, group); + openedEditor = await delegate(group, editor, options); } catch (error) { // ignore } finally { diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 1aa98445d91..362a5add5ed 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -357,11 +357,7 @@ export class OpenEditorsView extends ViewletPanel { if (!preserveActivateGroup) { this.editorGroupService.activateGroup(element.group); // needed for https://github.com/Microsoft/vscode/issues/6672 } - this.editorService.openEditor(element.editor, options, options.sideBySide ? SIDE_GROUP : element.group).then(editor => { - if (editor && !preserveActivateGroup && editor.group) { - this.editorGroupService.activateGroup(editor.group); - } - }); + this.editorService.openEditor(element.editor, options, options.sideBySide ? SIDE_GROUP : element.group); } } diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 33e16e9f22d..975a14cf7b7 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -52,7 +52,6 @@ import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; import { getOutOfWorkspaceEditorResources } from 'vs/workbench/contrib/search/common/search'; import { FileMatch, FileMatchOrMatch, FolderMatch, IChangeEvent, ISearchWorkbenchService, Match, RenderableMatch, searchMatchComparer, SearchModel, SearchResult, BaseFolderMatch } from 'vs/workbench/contrib/search/common/searchModel'; import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IPreferencesService, ISettingsEditorOptions } from 'vs/workbench/services/preferences/common/preferences'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { relativePath } from 'vs/base/common/resources'; @@ -148,7 +147,6 @@ export class SearchView extends ViewletPanel { @IPreferencesService private readonly preferencesService: IPreferencesService, @IThemeService protected themeService: IThemeService, @ISearchHistoryService private readonly searchHistoryService: ISearchHistoryService, - @IEditorGroupsService private readonly editorGroupsService: IEditorGroupsService, @IContextMenuService contextMenuService: IContextMenuService, @IMenuService private readonly menuService: IMenuService, @IAccessibilityService private readonly accessibilityService: IAccessibilityService, @@ -1570,10 +1568,6 @@ export class SearchView extends ViewletPanel { } else { this.viewModel.searchResult.rangeHighlightDecorations.removeHighlightRange(); } - - if (editor) { - this.editorGroupsService.activateGroup(editor.group!); - } }, errors.onUnexpectedError); } diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 78422237936..4e64d758145 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -222,28 +222,59 @@ export class EditorService extends Disposable implements EditorServiceImpl { openEditor(editor: IResourceDiffInput, group?: OpenInEditorGroup): Promise; openEditor(editor: IResourceSideBySideInput, group?: OpenInEditorGroup): Promise; async openEditor(editor: IEditorInput | IResourceEditor, optionsOrGroup?: IEditorOptions | ITextEditorOptions | OpenInEditorGroup, group?: OpenInEditorGroup): Promise { + let resolvedGroup: IEditorGroup | undefined; + let candidateGroup: OpenInEditorGroup | undefined; + + let typedEditor: IEditorInput | undefined; + let typedOptions: IEditorOptions | undefined; // Typed Editor Support if (editor instanceof EditorInput) { - const editorOptions = this.toOptions(optionsOrGroup as IEditorOptions); - const targetGroup = this.findTargetGroup(editor, editorOptions, group); + typedEditor = editor; + typedOptions = this.toOptions(optionsOrGroup as IEditorOptions); - return this.doOpenEditor(targetGroup, editor, editorOptions); + candidateGroup = group; + resolvedGroup = this.findTargetGroup(typedEditor, typedOptions, candidateGroup); } // Untyped Text Editor Support - const textInput = editor; - const typedInput = this.createInput(textInput); - if (typedInput) { - const editorOptions = TextEditorOptions.from(textInput); - const targetGroup = this.findTargetGroup(typedInput, editorOptions, optionsOrGroup as IEditorGroup | GroupIdentifier); + else { + const textInput = editor; + typedEditor = this.createInput(textInput); + if (typedEditor) { + typedOptions = TextEditorOptions.from(textInput); - return this.doOpenEditor(targetGroup, typedInput, editorOptions); + candidateGroup = optionsOrGroup as OpenInEditorGroup; + resolvedGroup = this.findTargetGroup(typedEditor, typedOptions, candidateGroup); + } + } + + if (typedEditor && resolvedGroup) { + const control = await this.doOpenEditor(resolvedGroup, typedEditor, typedOptions); + + this.ensureGroupActive(resolvedGroup, candidateGroup); + + return control; } return undefined; } + private ensureGroupActive(resolvedGroup: IEditorGroup, candidateGroup?: OpenInEditorGroup): void { + + // Ensure we activate the group the editor opens in unless already active. Typically + // an editor always opens in the active group, but there are some cases where the + // target group is not the active one. If `preserveFocus: true` we do not activate + // the target group and as such have to do this manually. + // There is one exception: opening to the side with `preserveFocus: true` will keep + // the current behaviour for historic reasons. The scenario is that repeated Alt-clicking + // of files in the explorer always open into the same side group and not cause a group + // to be created each time. + if (this.editorGroupService.activeGroup !== resolvedGroup && candidateGroup !== SIDE_GROUP) { + this.editorGroupService.activateGroup(resolvedGroup); + } + } + protected async doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise { return withNullAsUndefined(await group.openEditor(editor, options)); } @@ -377,14 +408,23 @@ export class EditorService extends Disposable implements EditorServiceImpl { }); } - // Open in targets + // Open in target groups const result: Promise[] = []; + let firstGroup: IEditorGroup | undefined; mapGroupToEditors.forEach((editorsWithOptions, group) => { + if (!firstGroup) { + firstGroup = group; + } + result.push(group.openEditors(editorsWithOptions)); }); const openedEditors = await Promise.all(result); + if (firstGroup) { + this.ensureGroupActive(firstGroup, group); + } + return coalesce(openedEditors); } @@ -625,7 +665,12 @@ export class EditorService extends Disposable implements EditorServiceImpl { } export interface IEditorOpenHandler { - (group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions): Promise; + ( + delegate: (group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions) => Promise, + group: IEditorGroup, + editor: IEditorInput, + options?: IEditorOptions | ITextEditorOptions + ): Promise; } /** @@ -662,7 +707,13 @@ export class DelegatingEditorService extends EditorService { return super.doOpenEditor(group, editor, options); } - const control = await this.editorOpenHandler(group, editor, options); + const control = await this.editorOpenHandler( + (group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions) => super.doOpenEditor(group, editor, options), + group, + editor, + options + ); + if (control) { return control; // the opening was handled, so return early } diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 712b8f922b4..d2fa3c6025b 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -330,7 +330,7 @@ suite('EditorService', () => { const inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.parse('my://resource-delegate'), undefined); const delegate = instantiationService.createInstance(DelegatingEditorService); - delegate.setEditorOpenHandler((group: IEditorGroup, input: IEditorInput, options?: EditorOptions) => { + delegate.setEditorOpenHandler((delegate, group: IEditorGroup, input: IEditorInput, options?: EditorOptions) => { assert.strictEqual(input, inp); done(); From f127867e938d42a4a87f9ae12f6a5ec1b724914a Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 26 Aug 2019 12:09:14 +0200 Subject: [PATCH 091/163] fixes #79696 --- src/vs/workbench/contrib/debug/browser/repl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index 96bb2f8da9d..9a9b0337176 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -768,7 +768,7 @@ class ReplDelegate implements IListVirtualDelegate { return (nameRows + 1) * rowHeight; } - let valueRows = countNumberOfLines(value) + Math.floor(value.length / 150); + let valueRows = value ? (countNumberOfLines(value) + Math.floor(value.length / 150)) : 0; return rowHeight * (nameRows + valueRows); } From bf8f01a41f1a33fa5c7b483e5f6d409d5f18c0da Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 26 Aug 2019 12:14:28 +0200 Subject: [PATCH 092/163] wsl extension id should come from product.json --- .../terminal/browser/terminalConfigHelper.ts | 47 +++++++++++++++---- .../terminalConfigHelper.test.ts | 34 +++++++------- 2 files changed, 56 insertions(+), 25 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts index e4a307e4059..79138f8545a 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts @@ -17,6 +17,10 @@ import { Emitter, Event } from 'vs/base/common/event'; import { basename } from 'vs/base/common/path'; import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { InstallRecommendedExtensionAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; +import { IProductService } from 'vs/platform/product/common/product'; const MINIMUM_FONT_SIZE = 6; const MAXIMUM_FONT_SIZE = 25; @@ -40,7 +44,10 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { @IConfigurationService private readonly _configurationService: IConfigurationService, @IExtensionManagementService private readonly _extensionManagementService: IExtensionManagementService, @INotificationService private readonly _notificationService: INotificationService, - @IStorageService private readonly _storageService: IStorageService + @IStorageService private readonly _storageService: IStorageService, + @ITelemetryService private readonly telemetryService: ITelemetryService, + @IInstantiationService private readonly instantiationService: IInstantiationService, + @IProductService private readonly productService: IProductService ) { this._updateConfig(); this._configurationService.onDidChangeConfiguration(e => { @@ -263,18 +270,42 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper { this.recommendationsShown = true; if (platform.isWindows && shellLaunchConfig.executable && basename(shellLaunchConfig.executable).toLowerCase() === 'wsl.exe') { - if (! await this.isExtensionInstalled('ms-vscode-remote.remote-wsl')) { + const exeBasedExtensionTips = this.productService.exeBasedExtensionTips; + if (!exeBasedExtensionTips || !exeBasedExtensionTips.wsl) { + return; + } + const extId = exeBasedExtensionTips.wsl.recommendations[0]; + if (extId && ! await this.isExtensionInstalled(extId)) { this._notificationService.prompt( Severity.Info, nls.localize( - 'useWslExtension.title', - "Check out the 'Visual Studio Code Remote - WSL' extension for a great development experience in WSL. Click [here]({0}) to learn more.", - 'https://go.microsoft.com/fwlink/?linkid=2097212' - ), - [], + 'useWslExtension.title', "The '{0}' extension is recommended for opening a terminal in WSL.", exeBasedExtensionTips.wsl.friendlyName), + [ + { + label: nls.localize('install', 'Install'), + run: () => { + /* __GDPR__ + "terminalLaunchRecommendation:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('terminalLaunchRecommendation:popup', { userReaction: 'install', extId }); + this.instantiationService.createInstance(InstallRecommendedExtensionAction, extId).run(); + } + } + ], { sticky: true, - neverShowAgain: { id: 'terminalConfigHelper/launchRecommendationsIgnore', scope: NeverShowAgainScope.WORKSPACE } + neverShowAgain: { id: 'terminalConfigHelper/launchRecommendationsIgnore', scope: NeverShowAgainScope.WORKSPACE }, + onCancel: () => { + /* __GDPR__ + "terminalLaunchRecommendation:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('terminalLaunchRecommendation:popup', { userReaction: 'cancelled' }); + } } ); } diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts index 0babdeccff0..139d6ea06d7 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -29,7 +29,7 @@ suite('Workbench - TerminalConfigHelper', () => { const configurationService = new TestConfigurationService(); configurationService.setUserConfiguration('editor', { fontFamily: 'foo' }); configurationService.setUserConfiguration('terminal', { integrated: { fontFamily: null } }); - const configHelper = new TerminalConfigHelper(LinuxDistro.Fedora, configurationService, null!, null!, null!); + const configHelper = new TerminalConfigHelper(LinuxDistro.Fedora, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontFamily, '\'DejaVu Sans Mono\', monospace', 'Fedora should have its font overridden when terminal.integrated.fontFamily not set'); }); @@ -38,7 +38,7 @@ suite('Workbench - TerminalConfigHelper', () => { const configurationService = new TestConfigurationService(); configurationService.setUserConfiguration('editor', { fontFamily: 'foo' }); configurationService.setUserConfiguration('terminal', { integrated: { fontFamily: null } }); - const configHelper = new TerminalConfigHelper(LinuxDistro.Ubuntu, configurationService, null!, null!, null!); + const configHelper = new TerminalConfigHelper(LinuxDistro.Ubuntu, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontFamily, '\'Ubuntu Mono\', monospace', 'Ubuntu should have its font overridden when terminal.integrated.fontFamily not set'); }); @@ -47,7 +47,7 @@ suite('Workbench - TerminalConfigHelper', () => { const configurationService = new TestConfigurationService(); configurationService.setUserConfiguration('editor', { fontFamily: 'foo' }); configurationService.setUserConfiguration('terminal', { integrated: { fontFamily: null } }); - const configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + const configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontFamily, 'foo', 'editor.fontFamily should be the fallback when terminal.integrated.fontFamily not set'); }); @@ -65,7 +65,7 @@ suite('Workbench - TerminalConfigHelper', () => { fontSize: 10 } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, 10, 'terminal.integrated.fontSize should be selected over editor.fontSize'); @@ -78,11 +78,11 @@ suite('Workbench - TerminalConfigHelper', () => { fontSize: 0 } }); - configHelper = new TerminalConfigHelper(LinuxDistro.Ubuntu, configurationService, null!, null!, null!); + configHelper = new TerminalConfigHelper(LinuxDistro.Ubuntu, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, 8, 'The minimum terminal font size (with adjustment) should be used when terminal.integrated.fontSize less than it'); - configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, 6, 'The minimum terminal font size should be used when terminal.integrated.fontSize less than it'); @@ -95,7 +95,7 @@ suite('Workbench - TerminalConfigHelper', () => { fontSize: 1500 } }); - configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, 25, 'The maximum terminal font size should be used when terminal.integrated.fontSize more than it'); @@ -108,11 +108,11 @@ suite('Workbench - TerminalConfigHelper', () => { fontSize: null } }); - configHelper = new TerminalConfigHelper(LinuxDistro.Ubuntu, configurationService, null!, null!, null!); + configHelper = new TerminalConfigHelper(LinuxDistro.Ubuntu, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, EDITOR_FONT_DEFAULTS.fontSize + 2, 'The default editor font size (with adjustment) should be used when terminal.integrated.fontSize is not set'); - configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().fontSize, EDITOR_FONT_DEFAULTS.fontSize, 'The default editor font size should be used when terminal.integrated.fontSize is not set'); }); @@ -130,7 +130,7 @@ suite('Workbench - TerminalConfigHelper', () => { lineHeight: 2 } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().lineHeight, 2, 'terminal.integrated.lineHeight should be selected over editor.lineHeight'); @@ -144,7 +144,7 @@ suite('Workbench - TerminalConfigHelper', () => { lineHeight: 0 } }); - configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.getFont().lineHeight, 1, 'editor.lineHeight should be 1 when terminal.integrated.lineHeight not set'); }); @@ -157,7 +157,7 @@ suite('Workbench - TerminalConfigHelper', () => { } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.configFontIsMonospace(), true, 'monospace is monospaced'); }); @@ -169,7 +169,7 @@ suite('Workbench - TerminalConfigHelper', () => { fontFamily: 'sans-serif' } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.configFontIsMonospace(), false, 'sans-serif is not monospaced'); }); @@ -181,7 +181,7 @@ suite('Workbench - TerminalConfigHelper', () => { fontFamily: 'serif' } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.configFontIsMonospace(), false, 'serif is not monospaced'); }); @@ -197,7 +197,7 @@ suite('Workbench - TerminalConfigHelper', () => { } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.configFontIsMonospace(), true, 'monospace is monospaced'); }); @@ -213,7 +213,7 @@ suite('Workbench - TerminalConfigHelper', () => { } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.configFontIsMonospace(), false, 'sans-serif is not monospaced'); }); @@ -229,7 +229,7 @@ suite('Workbench - TerminalConfigHelper', () => { } }); - let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!); + let configHelper = new TerminalConfigHelper(LinuxDistro.Unknown, configurationService, null!, null!, null!, null!, null!, null!); configHelper.panelContainer = fixture; assert.equal(configHelper.configFontIsMonospace(), false, 'serif is not monospaced'); }); From 528806232a8282ef9d343340ed557c683a19705a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 12:34:31 +0200 Subject: [PATCH 093/163] Run OSS tool --- ThirdPartyNotices.txt | 114 ++++++++++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 44 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 64f72e53be0..aa56c32d53d 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -23,50 +23,51 @@ This project incorporates components from the projects listed below. The origina 16. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift) 17. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/) 18. Ikuyadeu/vscode-R version 0.5.5 (https://github.com/Ikuyadeu/vscode-R) -19. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site) -20. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar) -21. jeff-hykin/cpp-textmate-grammar version 1.12.11 (https://github.com/jeff-hykin/cpp-textmate-grammar) -22. jeff-hykin/cpp-textmate-grammar version 1.12.18 (https://github.com/jeff-hykin/cpp-textmate-grammar) -23. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) -24. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) -25. language-docker (https://github.com/moby/moby) -26. language-go version 0.44.3 (https://github.com/atom/language-go) -27. language-less version 0.34.2 (https://github.com/atom/language-less) -28. language-php version 0.44.1 (https://github.com/atom/language-php) -29. language-rust version 0.4.12 (https://github.com/zargony/atom-language-rust) -30. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython) -31. marked version 0.6.2 (https://github.com/markedjs/marked) -32. mdn-data version 1.1.12 (https://github.com/mdn/data) -33. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage) -34. Microsoft/vscode-JSON.tmLanguage (https://github.com/Microsoft/vscode-JSON.tmLanguage) -35. Microsoft/vscode-mssql version 1.6.0 (https://github.com/Microsoft/vscode-mssql) -36. mmims/language-batchfile version 0.7.5 (https://github.com/mmims/language-batchfile) -37. octicons version 8.3.0 (https://github.com/primer/octicons) -38. octref/language-css version 0.42.11 (https://github.com/octref/language-css) -39. PowerShell/EditorSyntax (https://github.com/powershell/editorsyntax) -40. promise-polyfill version 8.0.0 (https://github.com/taylorhakes/promise-polyfill) -41. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui) -42. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage) -43. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle) -44. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle) -45. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle) -46. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle) -47. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle) -48. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle) -49. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle) -50. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle) -51. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle) -52. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle) -53. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle) -54. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle) -55. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle) -56. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage) -57. TypeScript-TmLanguage version 1.0.0 (https://github.com/Microsoft/TypeScript-TmLanguage) -58. Unicode version 12.0.0 (http://www.unicode.org/) -59. vscode-logfile-highlighter version 2.4.1 (https://github.com/emilast/vscode-logfile-highlighter) -60. vscode-octicons-font version 1.3.1 (https://github.com/Microsoft/vscode-octicons-font) -61. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) -62. Web Background Synchronization (https://github.com/WICG/BackgroundSync) +19. insane version 2.6.2 (https://github.com/bevacqua/insane) +20. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site) +21. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar) +22. jeff-hykin/cpp-textmate-grammar version 1.12.11 (https://github.com/jeff-hykin/cpp-textmate-grammar) +23. jeff-hykin/cpp-textmate-grammar version 1.13.2 (https://github.com/jeff-hykin/cpp-textmate-grammar) +24. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) +25. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) +26. language-docker (https://github.com/moby/moby) +27. language-go version 0.44.3 (https://github.com/atom/language-go) +28. language-less version 0.34.2 (https://github.com/atom/language-less) +29. language-php version 0.44.1 (https://github.com/atom/language-php) +30. language-rust version 0.4.12 (https://github.com/zargony/atom-language-rust) +31. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython) +32. marked version 0.6.2 (https://github.com/markedjs/marked) +33. mdn-data version 1.1.12 (https://github.com/mdn/data) +34. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage) +35. Microsoft/vscode-JSON.tmLanguage (https://github.com/Microsoft/vscode-JSON.tmLanguage) +36. Microsoft/vscode-mssql version 1.6.0 (https://github.com/Microsoft/vscode-mssql) +37. mmims/language-batchfile version 0.7.5 (https://github.com/mmims/language-batchfile) +38. octicons version 8.3.0 (https://github.com/primer/octicons) +39. octref/language-css version 0.42.11 (https://github.com/octref/language-css) +40. PowerShell/EditorSyntax version 1.0.0 (https://github.com/PowerShell/EditorSyntax) +41. promise-polyfill version 8.0.0 (https://github.com/taylorhakes/promise-polyfill) +42. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui) +43. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage) +44. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle) +45. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle) +46. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle) +47. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle) +48. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle) +49. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle) +50. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle) +51. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle) +52. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle) +53. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle) +54. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle) +55. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle) +56. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle) +57. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage) +58. TypeScript-TmLanguage version 1.0.0 (https://github.com/Microsoft/TypeScript-TmLanguage) +59. Unicode version 12.0.0 (http://www.unicode.org/) +60. vscode-logfile-highlighter version 2.4.1 (https://github.com/emilast/vscode-logfile-highlighter) +61. vscode-octicons-font version 1.3.1 (https://github.com/Microsoft/vscode-octicons-font) +62. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) +63. Web Background Synchronization (https://github.com/WICG/BackgroundSync) %% atom/language-clojure NOTICES AND INFORMATION BEGIN HERE @@ -611,6 +612,31 @@ SOFTWARE. ========================================= END OF Ikuyadeu/vscode-R NOTICES AND INFORMATION +%% insane NOTICES AND INFORMATION BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright © 2015 Nicolas Bevacqua + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF insane NOTICES AND INFORMATION + %% Ionic documentation NOTICES AND INFORMATION BEGIN HERE ========================================= Copyright Drifty Co. http://drifty.com/. From 5e13837b56c428bcfde2e6871fe640eeaa7bd88d Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 12:34:52 +0200 Subject: [PATCH 094/163] Adopt new OSS tool format for cglicenses.json --- .vscode/cglicenses.schema.json | 70 ++++++++++++++++++++++++++-------- cglicenses.json | 18 ++++----- 2 files changed, 63 insertions(+), 25 deletions(-) diff --git a/.vscode/cglicenses.schema.json b/.vscode/cglicenses.schema.json index 238f4803f74..8c0ee740102 100644 --- a/.vscode/cglicenses.schema.json +++ b/.vscode/cglicenses.schema.json @@ -1,23 +1,61 @@ { "type": "array", "items": { - "type": "object", - "required": [ - "name", - "licenseDetail" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the dependency" + "oneOf": [ + { + "type": "object", + "required": [ + "name", + "prependLicenseText" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the dependency" + }, + "fullLicenseText": { + "type": "array", + "description": "The complete license text of the dependency", + "items": { + "type": "string" + } + }, + "prependLicenseText": { + "type": "array", + "description": "A piece of text to prepend to the auto-detected license text of the dependency", + "items": { + "type": "string" + } + } + } }, - "licenseDetail": { - "type": "array", - "description": "The complete license text of the dependency", - "items": { - "type": "string" + { + "type": "object", + "required": [ + "name", + "fullLicenseText" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the dependency" + }, + "fullLicenseText": { + "type": "array", + "description": "The complete license text of the dependency", + "items": { + "type": "string" + } + }, + "prependLicenseText": { + "type": "array", + "description": "A piece of text to prepend to the auto-detected license text of the dependency", + "items": { + "type": "string" + } + } } } - } + ] } -} \ No newline at end of file +} diff --git a/cglicenses.json b/cglicenses.json index b7f408109bf..bfe01fff8dc 100644 --- a/cglicenses.json +++ b/cglicenses.json @@ -10,7 +10,7 @@ // Reason: The license at https://github.com/aadsm/jschardet/blob/master/LICENSE // does not include a clear Copyright statement and does not credit authors. "name": "jschardet", - "licenseDetail": [ + "fullLicenseText": [ "Chardet was originally ported from C++ by Mark Pilgrim. It is now maintained", " by Dan Blanchard and Ian Cordasco, and was formerly maintained by Erik Rose.", " JSChardet was ported from python to JavaScript by António Afonso ", @@ -530,7 +530,7 @@ // The module `parse5` is shipped via the `extension-editing` built-in extension. // The module `parse5` does not want to remove it https://github.com/inikulin/parse5/issues/225 "name": "@types/node", - "licenseDetail": [ + "fullLicenseText": [ "This project is licensed under the MIT license.", "Copyrights are respective of each contributor listed at the beginning of each definition file.", "", @@ -546,7 +546,7 @@ // https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt // because it does not contain a Copyright statement "name": "typescript", - "licenseDetail": [ + "fullLicenseText": [ "Copyright (c) Microsoft Corporation. All rights reserved.", "", "Apache License", @@ -609,7 +609,7 @@ { // This module comes in from https://github.com/Microsoft/vscode-node-debug2/blob/master/package-lock.json "name": "@types/source-map", - "licenseDetail": [ + "fullLicenseText": [ "This project is licensed under the MIT license.", "Copyrights are respective of each contributor listed at the beginning of each definition file.", "", @@ -622,7 +622,7 @@ }, { "name": "tunnel-agent", - "licenseDetail": [ + "fullLicenseText": [ "Copyright (c) tunnel-agent authors", "", "Apache License", @@ -685,7 +685,7 @@ { // Waiting for https://github.com/segmentio/noop-logger/issues/2 "name": "noop-logger", - "licenseDetail": [ + "fullLicenseText": [ "This project is licensed under the MIT license.", "Copyrights are respective of each contributor listed at the beginning of each definition file.", "", @@ -698,7 +698,7 @@ }, { "name": "xterm-addon-search", - "licenseDetail": [ + "fullLicenseText": [ "Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)", "", "Permission is hereby granted, free of charge, to any person obtaining a copy", @@ -722,7 +722,7 @@ }, { "name": "xterm-addon-web-links", - "licenseDetail": [ + "fullLicenseText": [ "Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)", "", "Permission is hereby granted, free of charge, to any person obtaining a copy", @@ -746,7 +746,7 @@ }, { "name": "atob", - "licenseDetail": [ + "fullLicenseText": [ "The MIT License (MIT)", "", "Copyright (c) 2015 AJ ONeal", From 9cf35b4eff0ff1d8bb11b55e99e3d332e98ede7e Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 26 Aug 2019 12:35:29 +0200 Subject: [PATCH 095/163] Fix #79404 --- .../preferences/browser/keybindingsEditor.ts | 20 ++++++++++++++----- .../common/keybindingsEditorModel.ts | 10 +++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts index eb7ff5278a6..34c80e2f823 100644 --- a/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts @@ -46,6 +46,7 @@ import { attachStylerCallback, attachInputBoxStyler } from 'vs/platform/theme/co import { IStorageService } from 'vs/platform/storage/common/storage'; import { InputBox, MessageType } from 'vs/base/browser/ui/inputbox/inputBox'; import { Emitter, Event } from 'vs/base/common/event'; +import { MenuRegistry, MenuId, isIMenuItem } from 'vs/platform/actions/common/actions'; const $ = DOM.$; @@ -489,11 +490,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor if (this.input) { const input: KeybindingsEditorInput = this.input as KeybindingsEditorInput; this.keybindingsEditorModel = await input.resolve(); - const editorActionsLabels: Map = EditorExtensionsRegistry.getEditorActions().reduce((editorActions, editorAction) => { - editorActions.set(editorAction.id, editorAction.label); - return editorActions; - }, new Map()); - await this.keybindingsEditorModel.resolve(editorActionsLabels); + await this.keybindingsEditorModel.resolve(this.getActionsLabels()); this.renderKeybindingsEntries(false, preserveFocus); if (input.searchOptions) { this.recordKeysAction.checked = input.searchOptions.recordKeybindings; @@ -505,6 +502,19 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor } } + private getActionsLabels(): Map { + const actionsLabels: Map = new Map(); + EditorExtensionsRegistry.getEditorActions().forEach(editorAction => actionsLabels.set(editorAction.id, editorAction.label)); + for (const menuItem of MenuRegistry.getMenuItems(MenuId.CommandPalette)) { + if (isIMenuItem(menuItem)) { + const title = typeof menuItem.command.title === 'string' ? menuItem.command.title : menuItem.command.title.value; + const category = menuItem.command.category ? typeof menuItem.command.category === 'string' ? menuItem.command.category : menuItem.command.category.value : undefined; + actionsLabels.set(menuItem.command.id, category ? `${category}: ${title}` : title); + } + } + return actionsLabels; + } + private filterKeybindings(): void { this.renderKeybindingsEntries(this.searchWidget.hasFocus()); this.delayedFilterLogging.trigger(() => this.reportFilteringUsed(this.searchWidget.getValue())); diff --git a/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts b/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts index 01bf60c346a..847b67a5bcd 100644 --- a/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts +++ b/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts @@ -160,14 +160,14 @@ export class KeybindingsEditorModel extends EditorModel { return result; } - resolve(editorActionsLabels: Map): Promise { + resolve(actionLabels: Map): Promise { const workbenchActionsRegistry = Registry.as(ActionExtensions.WorkbenchActions); this._keybindingItemsSortedByPrecedence = []; const boundCommands: Map = new Map(); for (const keybinding of this.keybindingsService.getKeybindings()) { if (keybinding.command) { // Skip keybindings without commands - this._keybindingItemsSortedByPrecedence.push(KeybindingsEditorModel.toKeybindingEntry(keybinding.command, keybinding, workbenchActionsRegistry, editorActionsLabels)); + this._keybindingItemsSortedByPrecedence.push(KeybindingsEditorModel.toKeybindingEntry(keybinding.command, keybinding, workbenchActionsRegistry, actionLabels)); boundCommands.set(keybinding.command, true); } } @@ -175,7 +175,7 @@ export class KeybindingsEditorModel extends EditorModel { const commandsWithDefaultKeybindings = this.keybindingsService.getDefaultKeybindings().map(keybinding => keybinding.command); for (const command of KeybindingResolver.getAllUnboundCommands(boundCommands)) { const keybindingItem = new ResolvedKeybindingItem(undefined, command, null, undefined, commandsWithDefaultKeybindings.indexOf(command) === -1); - this._keybindingItemsSortedByPrecedence.push(KeybindingsEditorModel.toKeybindingEntry(command, keybindingItem, workbenchActionsRegistry, editorActionsLabels)); + this._keybindingItemsSortedByPrecedence.push(KeybindingsEditorModel.toKeybindingEntry(command, keybindingItem, workbenchActionsRegistry, actionLabels)); } this._keybindingItems = this._keybindingItemsSortedByPrecedence.slice(0).sort((a, b) => KeybindingsEditorModel.compareKeybindingData(a, b)); return Promise.resolve(this); @@ -209,9 +209,9 @@ export class KeybindingsEditorModel extends EditorModel { return a.command.localeCompare(b.command); } - private static toKeybindingEntry(command: string, keybindingItem: ResolvedKeybindingItem, workbenchActionsRegistry: IWorkbenchActionRegistry, editorActions: Map): IKeybindingItem { + private static toKeybindingEntry(command: string, keybindingItem: ResolvedKeybindingItem, workbenchActionsRegistry: IWorkbenchActionRegistry, actions: Map): IKeybindingItem { const menuCommand = MenuRegistry.getCommand(command)!; - const editorActionLabel = editorActions.get(command)!; + const editorActionLabel = actions.get(command)!; return { keybinding: keybindingItem.resolvedKeybinding, keybindingItem, From 3cb1da6f6e43214c09a408db28ee1b8ebaf072a5 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 26 Aug 2019 13:08:57 +0200 Subject: [PATCH 096/163] :lipstick: --- .../workbench/contrib/preferences/browser/keybindingsEditor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts index 34c80e2f823..99cf2aa9a1a 100644 --- a/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts @@ -726,7 +726,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor private createCopyCommandAction(keybinding: IKeybindingItemEntry): IAction { return { - label: localize('copyCommandLabel', "Copy Command"), + label: localize('copyCommandLabel', "Copy Command ID"), enabled: true, id: KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, run: () => this.copyKeybindingCommand(keybinding) From daaf263d00e3e9ba10dab439ab357e2cb8eee84b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 13:14:37 +0200 Subject: [PATCH 097/163] better fix for #79798 --- src/vs/platform/editor/common/editor.ts | 6 + .../browser/parts/editor/editorGroupView.ts | 35 +++--- src/vs/workbench/common/editor.ts | 109 ++++++++++-------- .../services/editor/browser/editorService.ts | 46 +++----- 4 files changed, 105 insertions(+), 91 deletions(-) diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index c061f0eea6a..a2bafd91dca 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -87,6 +87,12 @@ export interface IEditorOptions { */ readonly preserveFocus?: boolean; + /** + * Tells the group the editor opens in to become active. By default, an editor group will not + * become active if either `preserveFocus: true` or `inactive: true`. + */ + readonly forceActive?: boolean; + /** * Tells the editor to reload the editor input in the editor even if it is identical to the one * already showing. By default, the editor will not reload the input if it is identical to the diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index fb1e07119c7..d9df1ba5b50 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -831,19 +831,28 @@ export class EditorGroupView extends Themable implements IEditorGroupView { openEditorOptions.active = true; } - if (openEditorOptions.active) { - // Set group active unless we are instructed to preserveFocus. Always - // make sure to restore a minimized group though in order to fix - // https://github.com/microsoft/vscode/issues/79633 - // - // Do this before we open the editor in the group to prevent a false - // active editor change event before the editor is loaded - // (see https://github.com/Microsoft/vscode/issues/51679) - if (options && options.preserveFocus) { - this.accessor.restoreGroup(this); - } else { - this.accessor.activateGroup(this); - } + let activateGroup = false; + let restoreGroup = false; + + if (options && options.forceActive) { + // Always respect option to force activate an editor group. + activateGroup = true; + } else if (openEditorOptions.active) { + // Otherwise, we only activate/restore an editor which is + // opening as active editor. + // If preserveFocus is enabled, we only restore but never + // activate the group. + activateGroup = !options || !options.preserveFocus; + restoreGroup = !activateGroup; + } + + // Do this before we open the editor in the group to prevent a false + // active editor change event before the editor is loaded + // (see https://github.com/Microsoft/vscode/issues/51679) + if (activateGroup) { + this.accessor.activateGroup(this); + } else if (restoreGroup) { + this.accessor.restoreGroup(this); } // Actually move the editor if a specific index is provided and we figure diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 97f5aa1e79d..3b2647c3c97 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -707,15 +707,7 @@ export class EditorOptions implements IEditorOptions { */ static create(settings: IEditorOptions): EditorOptions { const options = new EditorOptions(); - - options.preserveFocus = settings.preserveFocus; - options.forceReload = settings.forceReload; - options.revealIfVisible = settings.revealIfVisible; - options.revealIfOpened = settings.revealIfOpened; - options.pinned = settings.pinned; - options.index = settings.index; - options.inactive = settings.inactive; - options.ignoreError = settings.ignoreError; + options.overwrite(settings); return options; } @@ -726,6 +718,12 @@ export class EditorOptions implements IEditorOptions { */ preserveFocus: boolean | undefined; + /** + * Tells the group the editor opens in to become active. By default, an editor group will not + * become active if either `preserveFocus: true` or `inactive: true`. + */ + forceActive: boolean | undefined; + /** * Tells the editor to reload the editor input in the editor even if it is identical to the one * already showing. By default, the editor will not reload the input if it is identical to the @@ -765,6 +763,49 @@ export class EditorOptions implements IEditorOptions { * message as needed. By default, an error will be presented as notification if opening was not possible. */ ignoreError: boolean | undefined; + + /** + * Overwrites option values from the provided bag. + */ + overwrite(options: IEditorOptions): EditorOptions { + if (options.forceReload) { + this.forceReload = true; + } + + if (options.revealIfVisible) { + this.revealIfVisible = true; + } + + if (options.revealIfOpened) { + this.revealIfOpened = true; + } + + if (options.preserveFocus) { + this.preserveFocus = true; + } + + if (options.forceActive) { + this.forceActive = true; + } + + if (options.pinned) { + this.pinned = true; + } + + if (options.inactive) { + this.inactive = true; + } + + if (options.ignoreError) { + this.ignoreError = true; + } + + if (typeof options.index === 'number') { + this.index = options.index; + } + + return this; + } } /** @@ -792,53 +833,31 @@ export class TextEditorOptions extends EditorOptions { */ static create(options: ITextEditorOptions = Object.create(null)): TextEditorOptions { const textEditorOptions = new TextEditorOptions(); + textEditorOptions.overwrite(options); + + return textEditorOptions; + } + + /** + * Overwrites option values from the provided bag. + */ + overwrite(options: ITextEditorOptions): TextEditorOptions { + super.overwrite(options); if (options.selection) { const selection = options.selection; - textEditorOptions.selection(selection.startLineNumber, selection.startColumn, selection.endLineNumber, selection.endColumn); + this.selection(selection.startLineNumber, selection.startColumn, selection.endLineNumber, selection.endColumn); } if (options.viewState) { - textEditorOptions.editorViewState = options.viewState as IEditorViewState; - } - - if (options.forceReload) { - textEditorOptions.forceReload = true; - } - - if (options.revealIfVisible) { - textEditorOptions.revealIfVisible = true; - } - - if (options.revealIfOpened) { - textEditorOptions.revealIfOpened = true; - } - - if (options.preserveFocus) { - textEditorOptions.preserveFocus = true; + this.editorViewState = options.viewState as IEditorViewState; } if (options.revealInCenterIfOutsideViewport) { - textEditorOptions.revealInCenterIfOutsideViewport = true; + this.revealInCenterIfOutsideViewport = true; } - if (options.pinned) { - textEditorOptions.pinned = true; - } - - if (options.inactive) { - textEditorOptions.inactive = true; - } - - if (options.ignoreError) { - textEditorOptions.ignoreError = true; - } - - if (typeof options.index === 'number') { - textEditorOptions.index = options.index; - } - - return textEditorOptions; + return this; } /** diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 4e64d758145..20b9aac8069 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -225,8 +225,8 @@ export class EditorService extends Disposable implements EditorServiceImpl { let resolvedGroup: IEditorGroup | undefined; let candidateGroup: OpenInEditorGroup | undefined; - let typedEditor: IEditorInput | undefined; - let typedOptions: IEditorOptions | undefined; + let typedEditor: EditorInput | undefined; + let typedOptions: EditorOptions | undefined; // Typed Editor Support if (editor instanceof EditorInput) { @@ -250,31 +250,22 @@ export class EditorService extends Disposable implements EditorServiceImpl { } if (typedEditor && resolvedGroup) { - const control = await this.doOpenEditor(resolvedGroup, typedEditor, typedOptions); + // Unless the editor opens as inactive editor or we are instructed to open a side group, + // ensure that the group gets activated even if preserveFocus: true. + // + // Not enforcing this for side groups supports a historic scenario we have: repeated + // Alt-clicking of files in the explorer always open into the same side group and not + // cause a group to be created each time. + if (typedOptions && !typedOptions.inactive && typedOptions.preserveFocus && candidateGroup !== SIDE_GROUP) { + typedOptions.overwrite({ forceActive: true }); + } - this.ensureGroupActive(resolvedGroup, candidateGroup); - - return control; + return this.doOpenEditor(resolvedGroup, typedEditor, typedOptions); } return undefined; } - private ensureGroupActive(resolvedGroup: IEditorGroup, candidateGroup?: OpenInEditorGroup): void { - - // Ensure we activate the group the editor opens in unless already active. Typically - // an editor always opens in the active group, but there are some cases where the - // target group is not the active one. If `preserveFocus: true` we do not activate - // the target group and as such have to do this manually. - // There is one exception: opening to the side with `preserveFocus: true` will keep - // the current behaviour for historic reasons. The scenario is that repeated Alt-clicking - // of files in the explorer always open into the same side group and not cause a group - // to be created each time. - if (this.editorGroupService.activeGroup !== resolvedGroup && candidateGroup !== SIDE_GROUP) { - this.editorGroupService.activateGroup(resolvedGroup); - } - } - protected async doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise { return withNullAsUndefined(await group.openEditor(editor, options)); } @@ -410,22 +401,11 @@ export class EditorService extends Disposable implements EditorServiceImpl { // Open in target groups const result: Promise[] = []; - let firstGroup: IEditorGroup | undefined; mapGroupToEditors.forEach((editorsWithOptions, group) => { - if (!firstGroup) { - firstGroup = group; - } - result.push(group.openEditors(editorsWithOptions)); }); - const openedEditors = await Promise.all(result); - - if (firstGroup) { - this.ensureGroupActive(firstGroup, group); - } - - return coalesce(openedEditors); + return coalesce(await Promise.all(result)); } //#endregion From a00fb70b037e3953c6f0fdf603580279600c3acb Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 12:55:17 +0200 Subject: [PATCH 098/163] Adopt prependLicenseText support in OSS tool --- cglicenses.json | 672 +----------------------------------------------- 1 file changed, 13 insertions(+), 659 deletions(-) diff --git a/cglicenses.json b/cglicenses.json index bfe01fff8dc..fb61006b4fa 100644 --- a/cglicenses.json +++ b/cglicenses.json @@ -10,680 +10,30 @@ // Reason: The license at https://github.com/aadsm/jschardet/blob/master/LICENSE // does not include a clear Copyright statement and does not credit authors. "name": "jschardet", - "fullLicenseText": [ + "prependLicenseText": [ "Chardet was originally ported from C++ by Mark Pilgrim. It is now maintained", " by Dan Blanchard and Ian Cordasco, and was formerly maintained by Erik Rose.", " JSChardet was ported from python to JavaScript by António Afonso ", " (https://github.com/aadsm/jschardet) and transformed into an npm package by ", - "Markus Ast (https://github.com/brainafk)", - "", - "GNU LESSER GENERAL PUBLIC LICENSE", - "\t\t Version 2.1, February 1999", - "", - " Copyright (C) 1991,", - "1999 Free Software Foundation, Inc.", - " 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA", - " Everyone is permitted to copy and distribute verbatim copies", - " of this license document, but changing it is not allowed.", - "", - "[This is the first released version of the Lesser GPL. It also counts", - " as the successor of the GNU Library Public License, version 2, hence", - " the version number 2.1.", - "]", - "", - "\t\t\t Preamble", - "", - " The licenses for most software are designed to take away your", - "freedom to share and change it. By contrast, the GNU General Public", - "Licenses are intended to guarantee your freedom to share and change", - "free software--to make sure the software is free for all its users.", - "", - " This license, the Lesser General Public License, applies to some", - "specially designated software packages--typically libraries--of the", - "Free Software Foundation and other authors who decide to use it. You", - "can use it too, but we suggest you first think carefully about whether", - "this license or the ordinary General Public License is the better", - "strategy to use in any particular case, based on the explanations below.", - "", - " When we speak of free software, we are referring to freedom of use,", - "not price. Our General Public Licenses are designed to make sure that", - "you have the freedom to distribute copies of free software (and charge", - "for this service if you wish); that you receive source code or can get", - "it if you want it; that you can change the software and use pieces of", - "it in new free programs; and that you are informed that you can do", - "these things.", - "", - " To protect your rights, we need to make restrictions that forbid", - "distributors to deny you these rights or to ask you to surrender these", - "rights. These restrictions translate to certain responsibilities for", - "you if you distribute copies of the library or if you modify it.", - "", - " For example, if you distribute copies of the library, whether gratis", - "or for a fee, you must give the recipients all the rights that we gave", - "you. You must make sure that they, too, receive or can get the source", - "code. If you link other code with the library, you must provide", - "complete object files to the recipients, so that they can relink them", - "with the library after making changes to the library and recompiling", - "it. And you must show them these terms so they know their rights.", - "", - " We protect your rights with a two-step method: (1) we copyright the", - "library, and (2) we offer you this license, which gives you legal", - "permission to copy, distribute and/or modify the library.", - "", - " To protect each distributor, we want to make it very clear that", - "there is no warranty for the free library. Also, if the library is", - "modified by someone else and passed on, the recipients should know", - "that what they have is not the original version, so that the original", - "author's reputation will not be affected by problems that might be", - "introduced by others.", - "", - " Finally, software patents pose a constant threat to the existence of", - "any free program. We wish to make sure that a company cannot", - "effectively restrict the users of a free program by obtaining a", - "restrictive license from a patent holder. Therefore, we insist that", - "any patent license obtained for a version of the library must be", - "consistent with the full freedom of use specified in this license.", - "", - " Most GNU software, including some libraries, is covered by the", - "ordinary GNU General Public License. This license, the GNU Lesser", - "General Public License, applies to certain designated libraries, and", - "is quite different from the ordinary General Public License. We use", - "this license for certain libraries in order to permit linking those", - "libraries into non-free programs.", - "", - " When a program is linked with a library, whether statically or using", - "a shared library, the combination of the two is legally speaking a", - "combined work, a derivative of the original library. The ordinary", - "General Public License therefore permits such linking only if the", - "entire combination fits its criteria of freedom. The Lesser General", - "Public License permits more lax criteria for linking other code with", - "the library.", - "", - " We call this license the \"Lesser\" General Public License because it", - "does Less to protect the user's freedom than the ordinary General", - "Public License. It also provides other free software developers Less", - "of an advantage over competing non-free programs. These disadvantages", - "are the reason we use the ordinary General Public License for many", - "libraries. However, the Lesser license provides advantages in certain", - "special circumstances.", - "", - " For example, on rare occasions, there may be a special need to", - "encourage the widest possible use of a certain library, so that it becomes", - "a de-facto standard. To achieve this, non-free programs must be", - "allowed to use the library. A more frequent case is that a free", - "library does the same job as widely used non-free libraries. In this", - "case, there is little to gain by limiting the free library to free", - "software only, so we use the Lesser General Public License.", - "", - " In other cases, permission to use a particular library in non-free", - "programs enables a greater number of people to use a large body of", - "free software. For example, permission to use the GNU C Library in", - "non-free programs enables many more people to use the whole GNU", - "operating system, as well as its variant, the GNU/Linux operating", - "system.", - "", - " Although the Lesser General Public License is Less protective of the", - "users' freedom, it does ensure that the user of a program that is", - "linked with the Library has the freedom and the wherewithal to run", - "that program using a modified version of the Library.", - "", - " The precise terms and conditions for copying, distribution and", - "modification follow. Pay close attention to the difference between a", - "\"work based on the library\" and a \"work that uses the library\". The", - "former contains code derived from the library, whereas the latter must", - "be combined with the library in order to run.", - "", - "\t\t GNU LESSER GENERAL PUBLIC LICENSE", - " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION", - "", - " 0. This License Agreement applies to any software library or other", - "program which contains a notice placed by the copyright holder or", - "other authorized party saying it may be distributed under the terms of", - "this Lesser General Public License (also called \"this License\").", - "Each licensee is addressed as \"you\".", - "", - " A \"library\" means a collection of software functions and/or data", - "prepared so as to be conveniently linked with application programs", - "(which use some of those functions and data) to form executables.", - "", - " The \"Library\", below, refers to any such software library or work", - "which has been distributed under these terms. A \"work based on the", - "Library\" means either the Library or any derivative work under", - "copyright law: that is to say, a work containing the Library or a", - "portion of it, either verbatim or with modifications and/or translated", - "straightforwardly into another language. (Hereinafter, translation is", - "included without limitation in the term \"modification\".)", - "", - " \"Source code\" for a work means the preferred form of the work for", - "making modifications to it. For a library, complete source code means", - "all the source code for all modules it contains, plus any associated", - "interface definition files, plus the scripts used to control compilation", - "and installation of the library.", - "", - " Activities other than copying, distribution and modification are not", - "covered by this License; they are outside its scope. The act of", - "running a program using the Library is not restricted, and output from", - "such a program is covered only if its contents constitute a work based", - "on the Library (independent of the use of the Library in a tool for", - "writing it). Whether that is true depends on what the Library does", - "and what the program that uses the Library does.", - "", - " 1. You may copy and distribute verbatim copies of the Library's", - "complete source code as you receive it, in any medium, provided that", - "you conspicuously and appropriately publish on each copy an", - "appropriate copyright notice and disclaimer of warranty; keep intact", - "all the notices that refer to this License and to the absence of any", - "warranty; and distribute a copy of this License along with the", - "Library.", - "", - " You may charge a fee for the physical act of transferring a copy,", - "and you may at your option offer warranty protection in exchange for a", - "fee.", - "", - " 2. You may modify your copy or copies of the Library or any portion", - "of it, thus forming a work based on the Library, and copy and", - "distribute such modifications or work under the terms of Section 1", - "above, provided that you also meet all of these conditions:", - "", - " a) The modified work must itself be a software library.", - "", - " b) You must cause the files modified to carry prominent notices", - " stating that you changed the files and the date of any change.", - "", - " c) You must cause the whole of the work to be licensed at no", - " charge to all third parties under the terms of this License.", - "", - " d) If a facility in the modified Library refers to a function or a", - " table of data to be supplied by an application program that uses", - " the facility, other than as an argument passed when the facility", - " is invoked, then you must make a good faith effort to ensure that,", - " in the event an application does not supply such function or", - " table, the facility still operates, and performs whatever part of", - " its purpose remains meaningful.", - "", - " (For example, a function in a library to compute square roots has", - " a purpose that is entirely well-defined independent of the", - " application. Therefore, Subsection 2d requires that any", - " application-supplied function or table used by this function must", - " be optional: if the application does not supply it, the square", - " root function must still compute square roots.)", - "", - "These requirements apply to the modified work as a whole. If", - "identifiable sections of that work are not derived from the Library,", - "and can be reasonably considered independent and separate works in", - "themselves, then this License, and its terms, do not apply to those", - "sections when you distribute them as separate works. But when you", - "distribute the same sections as part of a whole which is a work based", - "on the Library, the distribution of the whole must be on the terms of", - "this License, whose permissions for other licensees extend to the", - "entire whole, and thus to each and every part regardless of who wrote", - "it.", - "", - "Thus, it is not the intent of this section to claim rights or contest", - "your rights to work written entirely by you; rather, the intent is to", - "exercise the right to control the distribution of derivative or", - "collective works based on the Library.", - "", - "In addition, mere aggregation of another work not based on the Library", - "with the Library (or with a work based on the Library) on a volume of", - "a storage or distribution medium does not bring the other work under", - "the scope of this License.", - "", - " 3. You may opt to apply the terms of the ordinary GNU General Public", - "License instead of this License to a given copy of the Library. To do", - "this, you must alter all the notices that refer to this License, so", - "that they refer to the ordinary GNU General Public License, version 2,", - "instead of to this License. (If a newer version than version 2 of the", - "ordinary GNU General Public License has appeared, then you can specify", - "that version instead if you wish.) Do not make any other change in", - "these notices.", - "", - " Once this change is made in a given copy, it is irreversible for", - "that copy, so the ordinary GNU General Public License applies to all", - "subsequent copies and derivative works made from that copy.", - "", - " This option is useful when you wish to copy part of the code of", - "the Library into a program that is not a library.", - "", - " 4. You may copy and distribute the Library (or a portion or", - "derivative of it, under Section 2) in object code or executable form", - "under the terms of Sections 1 and 2 above provided that you accompany", - "it with the complete corresponding machine-readable source code, which", - "must be distributed under the terms of Sections 1 and 2 above on a", - "medium customarily used for software interchange.", - "", - " If distribution of object code is made by offering access to copy", - "from a designated place, then offering equivalent access to copy the", - "source code from the same place satisfies the requirement to", - "distribute the source code, even though third parties are not", - "compelled to copy the source along with the object code.", - "", - " 5. A program that contains no derivative of any portion of the", - "Library, but is designed to work with the Library by being compiled or", - "linked with it, is called a \"work that uses the Library\". Such a", - "work, in isolation, is not a derivative work of the Library, and", - "therefore falls outside the scope of this License.", - "", - " However, linking a \"work that uses the Library\" with the Library", - "creates an executable that is a derivative of the Library (because it", - "contains portions of the Library), rather than a \"work that uses the", - "library\". The executable is therefore covered by this License.", - "Section 6 states terms for distribution of such executables.", - "", - " When a \"work that uses the Library\" uses material from a header file", - "that is part of the Library, the object code for the work may be a", - "derivative work of the Library even though the source code is not.", - "Whether this is true is especially significant if the work can be", - "linked without the Library, or if the work is itself a library. The", - "threshold for this to be true is not precisely defined by law.", - "", - " If such an object file uses only numerical parameters, data", - "structure layouts and accessors, and small macros and small inline", - "functions (ten lines or less in length), then the use of the object", - "file is unrestricted, regardless of whether it is legally a derivative", - "work. (Executables containing this object code plus portions of the", - "Library will still fall under Section 6.)", - "", - " Otherwise, if the work is a derivative of the Library, you may", - "distribute the object code for the work under the terms of Section 6.", - "Any executables containing that work also fall under Section 6,", - "whether or not they are linked directly with the Library itself.", - "", - " 6. As an exception to the Sections above, you may also combine or", - "link a \"work that uses the Library\" with the Library to produce a", - "work containing portions of the Library, and distribute that work", - "under terms of your choice, provided that the terms permit", - "modification of the work for the customer's own use and reverse", - "engineering for debugging such modifications.", - "", - " You must give prominent notice with each copy of the work that the", - "Library is used in it and that the Library and its use are covered by", - "this License. You must supply a copy of this License. If the work", - "during execution displays copyright notices, you must include the", - "copyright notice for the Library among them, as well as a reference", - "directing the user to the copy of this License. Also, you must do one", - "of these things:", - "", - " a) Accompany the work with the complete corresponding", - " machine-readable source code for the Library including whatever", - " changes were used in the work (which must be distributed under", - " Sections 1 and 2 above); and, if the work is an executable linked", - " with the Library, with the complete machine-readable \"work that", - " uses the Library\", as object code and/or source code, so that the", - " user can modify the Library and then relink to produce a modified", - " executable containing the modified Library. (It is understood", - " that the user who changes the contents of definitions files in the", - " Library will not necessarily be able to recompile the application", - " to use the modified definitions.)", - "", - " b) Use a suitable shared library mechanism for linking with the", - " Library. A suitable mechanism is one that (1) uses at run time a", - " copy of the library already present on the user's computer system,", - " rather than copying library functions into the executable, and (2)", - " will operate properly with a modified version of the library, if", - " the user installs one, as long as the modified version is", - " interface-compatible with the version that the work was made with.", - "", - " c) Accompany the work with a written offer, valid for at", - " least three years, to give the same user the materials", - " specified in Subsection 6a, above, for a charge no more", - " than the cost of performing this distribution.", - "", - " d) If distribution of the work is made by offering access to copy", - " from a designated place, offer equivalent access to copy the above", - " specified materials from the same place.", - "", - " e) Verify that the user has already received a copy of these", - " materials or that you have already sent this user a copy.", - "", - " For an executable, the required form of the \"work that uses the", - "Library\" must include any data and utility programs needed for", - "reproducing the executable from it. However, as a special exception,", - "the materials to be distributed need not include anything that is", - "normally distributed (in either source or binary form) with the major", - "components (compiler, kernel, and so on) of the operating system on", - "which the executable runs, unless that component itself accompanies", - "the executable.", - "", - " It may happen that this requirement contradicts the license", - "restrictions of other proprietary libraries that do not normally", - "accompany the operating system. Such a contradiction means you cannot", - "use both them and the Library together in an executable that you", - "distribute.", - "", - " 7. You may place library facilities that are a work based on the", - "Library side-by-side in a single library together with other library", - "facilities not covered by this License, and distribute such a combined", - "library, provided that the separate distribution of the work based on", - "the Library and of the other library facilities is otherwise", - "permitted, and provided that you do these two things:", - "", - " a) Accompany the combined library with a copy of the same work", - " based on the Library, uncombined with any other library", - " facilities. This must be distributed under the terms of the", - " Sections above.", - "", - " b) Give prominent notice with the combined library of the fact", - " that part of it is a work based on the Library, and explaining", - " where to find the accompanying uncombined form of the same work.", - "", - " 8. You may not copy, modify, sublicense, link with, or distribute", - "the Library except as expressly provided under this License. Any", - "attempt otherwise to copy, modify, sublicense, link with, or", - "distribute the Library is void, and will automatically terminate your", - "rights under this License. However, parties who have received copies,", - "or rights, from you under this License will not have their licenses", - "terminated so long as such parties remain in full compliance.", - "", - " 9. You are not required to accept this License, since you have not", - "signed it. However, nothing else grants you permission to modify or", - "distribute the Library or its derivative works. These actions are", - "prohibited by law if you do not accept this License. Therefore, by", - "modifying or distributing the Library (or any work based on the", - "Library), you indicate your acceptance of this License to do so, and", - "all its terms and conditions for copying, distributing or modifying", - "the Library or works based on it.", - "", - " 10. Each time you redistribute the Library (or any work based on the", - "Library), the recipient automatically receives a license from the", - "original licensor to copy, distribute, link with or modify the Library", - "subject to these terms and conditions. You may not impose any further", - "restrictions on the recipients' exercise of the rights granted herein.", - "You are not responsible for enforcing compliance by third parties with", - "this License.", - "", - " 11. If, as a consequence of a court judgment or allegation of patent", - "infringement or for any other reason (not limited to patent issues),", - "conditions are imposed on you (whether by court order, agreement or", - "otherwise) that contradict the conditions of this License, they do not", - "excuse you from the conditions of this License. If you cannot", - "distribute so as to satisfy simultaneously your obligations under this", - "License and any other pertinent obligations, then as a consequence you", - "may not distribute the Library at all. For example, if a patent", - "license would not permit royalty-free redistribution of the Library by", - "all those who receive copies directly or indirectly through you, then", - "the only way you could satisfy both it and this License would be to", - "refrain entirely from distribution of the Library.", - "", - "If any portion of this section is held invalid or unenforceable under any", - "particular circumstance, the balance of the section is intended to apply,", - "and the section as a whole is intended to apply in other circumstances.", - "", - "It is not the purpose of this section to induce you to infringe any", - "patents or other property right claims or to contest validity of any", - "such claims; this section has the sole purpose of protecting the", - "integrity of the free software distribution system which is", - "implemented by public license practices. Many people have made", - "generous contributions to the wide range of software distributed", - "through that system in reliance on consistent application of that", - "system; it is up to the author/donor to decide if he or she is willing", - "to distribute software through any other system and a licensee cannot", - "impose that choice.", - "", - "This section is intended to make thoroughly clear what is believed to", - "be a consequence of the rest of this License.", - "", - " 12. If the distribution and/or use of the Library is restricted in", - "certain countries either by patents or by copyrighted interfaces, the", - "original copyright holder who places the Library under this License may add", - "an explicit geographical distribution limitation excluding those countries,", - "so that distribution is permitted only in or among countries not thus", - "excluded. In such case, this License incorporates the limitation as if", - "written in the body of this License.", - "", - " 13. The Free Software Foundation may publish revised and/or new", - "versions of the Lesser General Public License from time to time.", - "Such new versions will be similar in spirit to the present version,", - "but may differ in detail to address new problems or concerns.", - "", - "Each version is given a distinguishing version number. If the Library", - "specifies a version number of this License which applies to it and", - "\"any later version\", you have the option of following the terms and", - "conditions either of that version or of any later version published by", - "the Free Software Foundation. If the Library does not specify a", - "license version number, you may choose any version ever published by", - "the Free Software Foundation.", - "", - " 14. If you wish to incorporate parts of the Library into other free", - "programs whose distribution conditions are incompatible with these,", - "write to the author to ask for permission. For software which is", - "copyrighted by the Free Software Foundation, write to the Free", - "Software Foundation; we sometimes make exceptions for this. Our", - "decision will be guided by the two goals of preserving the free status", - "of all derivatives of our free software and of promoting the sharing", - "and reuse of software generally.", - "", - "\t\t\t NO WARRANTY", - "", - " 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO", - "WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.", - "EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR", - "OTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY", - "KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE", - "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR", - "PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE", - "LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME", - "THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.", - "", - " 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN", - "WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY", - "AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU", - "FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR", - "CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE", - "LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING", - "RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A", - "FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF", - "SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH", - "DAMAGES.", - "", - "\t\t END OF TERMS AND CONDITIONS", - "", - " How to Apply These Terms to Your New Libraries", - "", - " If you develop a new library, and you want it to be of the greatest", - "possible use to the public, we recommend making it free software that", - "everyone can redistribute and change. You can do so by permitting", - "redistribution under these terms (or, alternatively, under the terms of the", - "ordinary General Public License).", - "", - " To apply these terms, attach the following notices to the library. It is", - "safest to attach them to the start of each source file to most effectively", - "convey the exclusion of warranty; and each file should have at least the", - "\"copyright\" line and a pointer to where the full notice is found.", - "", - " ", - " Copyright (C) ", - "", - " This library is free software; you can redistribute it and/or", - " modify it under the terms of the GNU Lesser General Public", - " License as published by the Free Software Foundation; either", - " version 2.1 of the License, or (at your option) any later version.", - "", - " This library is distributed in the hope that it will be useful,", - " but WITHOUT ANY WARRANTY; without even the implied warranty of", - " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU", - " Lesser General Public License for more details.", - "", - " You should have received a copy of the GNU Lesser General Public", - " License along with this library; if not, write to the Free Software", - " Foundation, Inc.,", - "51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA", - "", - "Also add information on how to contact you by electronic and paper mail.", - "", - "You should also get your employer (if you work as a programmer) or your", - "school, if any, to sign a \"copyright disclaimer\" for the library, if", - "necessary. Here is a sample; alter the names:", - "", - " Yoyodyne, Inc., hereby disclaims all copyright interest in the", - " library `Frob' (a library for tweaking knobs) written by James Random Hacker.", - "", - " ,", - "1 April 1990", - " Ty Coon, President of Vice", - "", - "That's all there is to it!" + "Markus Ast (https://github.com/brainafk)" ] }, { - // Added here because the module `parse5` has a dependency to it. - // The module `parse5` is shipped via the `extension-editing` built-in extension. - // The module `parse5` does not want to remove it https://github.com/inikulin/parse5/issues/225 - "name": "@types/node", - "fullLicenseText": [ - "This project is licensed under the MIT license.", - "Copyrights are respective of each contributor listed at the beginning of each definition file.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - ] - }, - { - // We override the license that gets discovered at - // https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt - // because it does not contain a Copyright statement + // Reason: The license at https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt + // does not include a clear Copyright statement. "name": "typescript", - "fullLicenseText": [ - "Copyright (c) Microsoft Corporation. All rights reserved.", - "", - "Apache License", - "", - "Version 2.0, January 2004", - "", - "http://www.apache.org/licenses/", - "", - "TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION", - "", - "1. Definitions.", - "", - "\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.", - "", - "\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.", - "", - "\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.", - "", - "\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.", - "", - "\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.", - "", - "\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.", - "", - "\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).", - "", - "\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.", - "", - "\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"", - "", - "\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.", - "", - "2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.", - "", - "3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.", - "", - "4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:", - "", - "You must give any other recipients of the Work or Derivative Works a copy of this License; and", - "", - "You must cause any modified files to carry prominent notices stating that You changed the files; and", - "", - "You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and", - "", - "If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.", - "", - "5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.", - "", - "6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.", - "", - "7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.", - "", - "8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.", - "", - "9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.", - "", - "END OF TERMS AND CONDITIONS" - ] - }, - { - // This module comes in from https://github.com/Microsoft/vscode-node-debug2/blob/master/package-lock.json - "name": "@types/source-map", - "fullLicenseText": [ - "This project is licensed under the MIT license.", - "Copyrights are respective of each contributor listed at the beginning of each definition file.", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + "prependLicenseText": [ + "Copyright (c) Microsoft Corporation. All rights reserved." ] }, { "name": "tunnel-agent", - "fullLicenseText": [ - "Copyright (c) tunnel-agent authors", - "", - "Apache License", - "", - "Version 2.0, January 2004", - "", - "http://www.apache.org/licenses/", - "", - "TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION", - "", - "1. Definitions.", - "", - "\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.", - "", - "\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.", - "", - "\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.", - "", - "\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.", - "", - "\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.", - "", - "\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.", - "", - "\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).", - "", - "\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.", - "", - "\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"", - "", - "\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.", - "", - "2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.", - "", - "3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.", - "", - "4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:", - "", - "You must give any other recipients of the Work or Derivative Works a copy of this License; and", - "", - "You must cause any modified files to carry prominent notices stating that You changed the files; and", - "", - "You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and", - "", - "If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.", - "", - "5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.", - "", - "6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.", - "", - "7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.", - "", - "8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.", - "", - "9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.", - "", - "END OF TERMS AND CONDITIONS" + "prependLicenseText": [ + "Copyright (c) tunnel-agent authors" ] }, { - // Waiting for https://github.com/segmentio/noop-logger/issues/2 + // Reason: Waiting for https://github.com/segmentio/noop-logger/issues/2 "name": "noop-logger", "fullLicenseText": [ "This project is licensed under the MIT license.", @@ -697,6 +47,7 @@ ] }, { + // Reason: The npm module does not contain a repository field. "name": "xterm-addon-search", "fullLicenseText": [ "Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)", @@ -721,6 +72,7 @@ ] }, { + // Reason: The npm module does not contain a repository field. "name": "xterm-addon-web-links", "fullLicenseText": [ "Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)", @@ -745,6 +97,8 @@ ] }, { + // Reason: The license at https://git.coolaj86.com/coolaj86/atob.js/src/branch/master/LICENSE + // cannot be found by the OSS tool automatically. "name": "atob", "fullLicenseText": [ "The MIT License (MIT)", From 5974d06ea478ee3eedf66041f74f3fbc808999d9 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 14:09:53 +0200 Subject: [PATCH 099/163] run oss tool --- cglicenses.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cglicenses.json b/cglicenses.json index fb61006b4fa..15b30362685 100644 --- a/cglicenses.json +++ b/cglicenses.json @@ -123,5 +123,13 @@ "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", "SOFTWARE." ] + }, + { + // Reason: The license at https://github.com/microsoft/tslib/blob/master/LICENSE.txt + // does not include a clear Copyright statement. + "name": "tslib", + "prependLicenseText": [ + "Copyright (c) Microsoft Corporation. All rights reserved." + ] } ] From edcae85fd6a16807183ed2c8582c2d8cceace224 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 26 Aug 2019 15:50:13 +0200 Subject: [PATCH 100/163] fix #26012 --- .../contrib/suggest/suggestController.ts | 50 +++++++++++++++++-- src/vs/editor/contrib/suggest/suggestModel.ts | 5 +- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/vs/editor/contrib/suggest/suggestController.ts b/src/vs/editor/contrib/suggest/suggestController.ts index 7fd1f0f8497..8fe391eec0a 100644 --- a/src/vs/editor/contrib/suggest/suggestController.ts +++ b/src/vs/editor/contrib/suggest/suggestController.ts @@ -7,7 +7,7 @@ import { alert } from 'vs/base/browser/ui/aria/aria'; import { isNonEmptyArray } from 'vs/base/common/arrays'; import { onUnexpectedError } from 'vs/base/common/errors'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { dispose, IDisposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; +import { dispose, IDisposable, DisposableStore, toDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { EditOperation } from 'vs/editor/common/core/editOperation'; @@ -33,9 +33,49 @@ import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerServ import { IdleValue } from 'vs/base/common/async'; import { isObject } from 'vs/base/common/types'; import { CommitCharacterController } from './suggestCommitCharacters'; +import { IPosition } from 'vs/editor/common/core/position'; +import { TrackedRangeStickiness, ITextModel } from 'vs/editor/common/model'; const _sticky = false; // for development purposes only +class LineSuffix { + + private readonly _marker: string[] | undefined; + + constructor(private readonly _model: ITextModel, private readonly _position: IPosition) { + // spy on what's happening right of the cursor. two cases: + // 1. end of line -> check that it's still end of line + // 2. mid of line -> add a marker and compute the delta + const maxColumn = _model.getLineMaxColumn(_position.lineNumber); + if (maxColumn !== _position.column) { + const offset = _model.getOffsetAt(_position); + const end = _model.getPositionAt(offset + 1); + this._marker = _model.deltaDecorations([], [{ + range: Range.fromPositions(_position, end), + options: { stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } + }]); + } + } + + dispose(): void { + if (this._marker) { + this._model.deltaDecorations(this._marker, []); + } + } + + delta(position: IPosition): number { + if (this._position.lineNumber !== position.lineNumber) { + return 0; + } else if (this._marker) { + const range = this._model.getDecorationRange(this._marker[0]); + const end = this._model.getOffsetAt(range!.getStartPosition()); + return end - this._model.getOffsetAt(position); + } else { + return this._model.getLineMaxColumn(position.lineNumber) - position.column; + } + } +} + export class SuggestController implements IEditorContribution { private static readonly ID: string = 'editor.contrib.suggestController'; @@ -47,9 +87,9 @@ export class SuggestController implements IEditorContribution { private readonly _model: SuggestModel; private readonly _widget: IdleValue; private readonly _alternatives: IdleValue; + private readonly _lineSuffix = new MutableDisposable(); private readonly _toDispose = new DisposableStore(); - constructor( private _editor: ICodeEditor, @IEditorWorkerService editorWorker: IEditorWorkerService, @@ -115,6 +155,7 @@ export class SuggestController implements IEditorContribution { this._toDispose.add(this._model.onDidTrigger(e => { this._widget.getValue().showTriggered(e.auto, e.shy ? 250 : 50); + this._lineSuffix.value = new LineSuffix(this._editor.getModel()!, e.position); })); this._toDispose.add(this._model.onDidSuggest(e => { if (!e.shy) { @@ -123,7 +164,7 @@ export class SuggestController implements IEditorContribution { } })); this._toDispose.add(this._model.onDidCancel(e => { - if (this._widget && !e.retrigger) { + if (!e.retrigger) { this._widget.getValue().hideWidget(); } })); @@ -154,6 +195,7 @@ export class SuggestController implements IEditorContribution { this._toDispose.dispose(); this._widget.dispose(); this._model.dispose(); + this._lineSuffix.dispose(); } protected _insertSuggestion(event: ISelectedSuggestion | undefined, keepAlternativeSuggestions: boolean, undoStops: boolean): void { @@ -192,7 +234,7 @@ export class SuggestController implements IEditorContribution { } const overwriteBefore = position.column - suggestion.range.startColumn; - const overwriteAfter = suggestion.range.endColumn - position.column; + const overwriteAfter = (suggestion.range.endColumn - position.column) + this._lineSuffix.value!.delta(this._editor.getPosition()); SnippetController2.get(this._editor).insert(insertText, { overwriteBefore: overwriteBefore + columnDelta, diff --git a/src/vs/editor/contrib/suggest/suggestModel.ts b/src/vs/editor/contrib/suggest/suggestModel.ts index cabf449d896..d34f911cea8 100644 --- a/src/vs/editor/contrib/suggest/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/suggestModel.ts @@ -10,7 +10,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { IDisposable, dispose, DisposableStore, isDisposable } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { Position } from 'vs/editor/common/core/position'; +import { Position, IPosition } from 'vs/editor/common/core/position'; import { Selection } from 'vs/editor/common/core/selection'; import { ITextModel, IWordAtPosition } from 'vs/editor/common/model'; import { CompletionItemProvider, StandardTokenType, CompletionContext, CompletionProviderRegistry, CompletionTriggerKind, CompletionItemKind, completionKindFromString } from 'vs/editor/common/modes'; @@ -28,6 +28,7 @@ export interface ICancelEvent { export interface ITriggerEvent { readonly auto: boolean; readonly shy: boolean; + readonly position: IPosition; } export interface ISuggestEvent { @@ -365,7 +366,7 @@ export class SuggestModel implements IDisposable { // Cancel previous requests, change state & update UI this.cancel(retrigger); this._state = auto ? State.Auto : State.Manual; - this._onDidTrigger.fire({ auto, shy: context.shy }); + this._onDidTrigger.fire({ auto, shy: context.shy, position: this._editor.getPosition() }); // Capture context when request was sent this._context = ctx; From 6f253951fb1ce20d73ef0b882736a02005e67092 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 15:58:25 +0200 Subject: [PATCH 101/163] Fixes #78833: Introduce `editor.autoClosingOvertype` option --- .../common/config/commonEditorConfig.ts | 11 ++++++ src/vs/editor/common/config/editorOptions.ts | 20 +++++++++++ .../editor/common/controller/cursorCommon.ts | 5 ++- .../common/controller/cursorTypeOperations.ts | 34 +++++++++---------- .../test/browser/controller/cursor.test.ts | 31 +++++++++++++++++ src/vs/monaco.d.ts | 11 ++++++ 6 files changed, 94 insertions(+), 18 deletions(-) diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 65f579a296e..1fd0db269f4 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -558,6 +558,17 @@ const editorConfiguration: IConfigurationNode = { 'default': EDITOR_DEFAULTS.autoClosingQuotes, 'description': nls.localize('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.") }, + 'editor.autoClosingOvertype': { + type: 'string', + enum: ['always', 'auto', 'never'], + enumDescriptions: [ + nls.localize('editor.autoClosingOvertype.always', "Always type over closing quotes or brackets."), + nls.localize('editor.autoClosingOvertype.auto', "Type over closing quotes or brackets only if they were automatically inserted."), + nls.localize('editor.autoClosingOvertype.never', "Never type over closing quotes or brackets."), + ], + 'default': EDITOR_DEFAULTS.autoClosingOvertype, + 'description': nls.localize('autoClosingOvertype', "Controls whether the editor should type over closing quotes or brackets.") + }, 'editor.autoSurround': { type: 'string', enum: ['languageDefined', 'brackets', 'quotes', 'never'], diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 997d22be614..dbc5521a5da 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -108,6 +108,11 @@ export type EditorAutoClosingStrategy = 'always' | 'languageDefined' | 'beforeWh */ export type EditorAutoSurroundStrategy = 'languageDefined' | 'quotes' | 'brackets' | 'never'; +/** + * Configuration options for typing over closing quotes or brackets + */ +export type EditorAutoClosingOvertypeStrategy = 'always' | 'auto' | 'never'; + /** * Configuration options for editor minimap */ @@ -544,6 +549,10 @@ export interface IEditorOptions { * Defaults to language defined behavior. */ autoClosingQuotes?: EditorAutoClosingStrategy; + /** + * Options for typing over closing quotes or brackets. + */ + autoClosingOvertype?: EditorAutoClosingOvertypeStrategy; /** * Options for auto surrounding. * Defaults to always allowing auto surrounding. @@ -1073,6 +1082,7 @@ export interface IValidatedEditorOptions { readonly wordWrapBreakObtrusiveCharacters: string; readonly autoClosingBrackets: EditorAutoClosingStrategy; readonly autoClosingQuotes: EditorAutoClosingStrategy; + readonly autoClosingOvertype: EditorAutoClosingOvertypeStrategy; readonly autoSurround: EditorAutoSurroundStrategy; readonly autoIndent: boolean; readonly dragAndDrop: boolean; @@ -1111,6 +1121,7 @@ export class InternalEditorOptions { readonly wordSeparators: string; readonly autoClosingBrackets: EditorAutoClosingStrategy; readonly autoClosingQuotes: EditorAutoClosingStrategy; + readonly autoClosingOvertype: EditorAutoClosingOvertypeStrategy; readonly autoSurround: EditorAutoSurroundStrategy; readonly autoIndent: boolean; readonly useTabStops: boolean; @@ -1141,6 +1152,7 @@ export class InternalEditorOptions { wordSeparators: string; autoClosingBrackets: EditorAutoClosingStrategy; autoClosingQuotes: EditorAutoClosingStrategy; + autoClosingOvertype: EditorAutoClosingOvertypeStrategy; autoSurround: EditorAutoSurroundStrategy; autoIndent: boolean; useTabStops: boolean; @@ -1166,6 +1178,7 @@ export class InternalEditorOptions { this.wordSeparators = source.wordSeparators; this.autoClosingBrackets = source.autoClosingBrackets; this.autoClosingQuotes = source.autoClosingQuotes; + this.autoClosingOvertype = source.autoClosingOvertype; this.autoSurround = source.autoSurround; this.autoIndent = source.autoIndent; this.useTabStops = source.useTabStops; @@ -1197,6 +1210,7 @@ export class InternalEditorOptions { && this.wordSeparators === other.wordSeparators && this.autoClosingBrackets === other.autoClosingBrackets && this.autoClosingQuotes === other.autoClosingQuotes + && this.autoClosingOvertype === other.autoClosingOvertype && this.autoSurround === other.autoSurround && this.autoIndent === other.autoIndent && this.useTabStops === other.useTabStops @@ -1229,6 +1243,7 @@ export class InternalEditorOptions { wordSeparators: (this.wordSeparators !== newOpts.wordSeparators), autoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets), autoClosingQuotes: (this.autoClosingQuotes !== newOpts.autoClosingQuotes), + autoClosingOvertype: (this.autoClosingOvertype !== newOpts.autoClosingOvertype), autoSurround: (this.autoSurround !== newOpts.autoSurround), autoIndent: (this.autoIndent !== newOpts.autoIndent), useTabStops: (this.useTabStops !== newOpts.useTabStops), @@ -1634,6 +1649,7 @@ export interface IConfigurationChangedEvent { readonly wordSeparators: boolean; readonly autoClosingBrackets: boolean; readonly autoClosingQuotes: boolean; + readonly autoClosingOvertype: boolean; readonly autoSurround: boolean; readonly autoIndent: boolean; readonly useTabStops: boolean; @@ -1846,6 +1862,7 @@ export class EditorOptionsValidator { wordWrapBreakObtrusiveCharacters: _string(opts.wordWrapBreakObtrusiveCharacters, defaults.wordWrapBreakObtrusiveCharacters), autoClosingBrackets, autoClosingQuotes, + autoClosingOvertype: _stringSet(opts.autoClosingOvertype, defaults.autoClosingOvertype, ['always', 'auto', 'never']), autoSurround, autoIndent: _boolean(opts.autoIndent, defaults.autoIndent), dragAndDrop: _boolean(opts.dragAndDrop, defaults.dragAndDrop), @@ -2162,6 +2179,7 @@ export class InternalEditorOptionsFactory { wordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters, autoClosingBrackets: opts.autoClosingBrackets, autoClosingQuotes: opts.autoClosingQuotes, + autoClosingOvertype: opts.autoClosingOvertype, autoSurround: opts.autoSurround, autoIndent: opts.autoIndent, dragAndDrop: opts.dragAndDrop, @@ -2390,6 +2408,7 @@ export class InternalEditorOptionsFactory { wordSeparators: opts.wordSeparators, autoClosingBrackets: opts.autoClosingBrackets, autoClosingQuotes: opts.autoClosingQuotes, + autoClosingOvertype: opts.autoClosingOvertype, autoSurround: opts.autoSurround, autoIndent: opts.autoIndent, useTabStops: opts.useTabStops, @@ -2627,6 +2646,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { wordWrapBreakObtrusiveCharacters: '.', autoClosingBrackets: 'languageDefined', autoClosingQuotes: 'languageDefined', + autoClosingOvertype: 'auto', autoSurround: 'languageDefined', autoIndent: true, dragAndDrop: true, diff --git a/src/vs/editor/common/controller/cursorCommon.ts b/src/vs/editor/common/controller/cursorCommon.ts index f459e61735f..87c3878b61c 100644 --- a/src/vs/editor/common/controller/cursorCommon.ts +++ b/src/vs/editor/common/controller/cursorCommon.ts @@ -6,7 +6,7 @@ import { CharCode } from 'vs/base/common/charCode'; import { onUnexpectedError } from 'vs/base/common/errors'; import * as strings from 'vs/base/common/strings'; -import { EditorAutoClosingStrategy, EditorAutoSurroundStrategy, IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; +import { EditorAutoClosingStrategy, EditorAutoSurroundStrategy, IConfigurationChangedEvent, EditorAutoClosingOvertypeStrategy } from 'vs/editor/common/config/editorOptions'; import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; @@ -99,6 +99,7 @@ export class CursorConfiguration { public readonly multiCursorMergeOverlapping: boolean; public readonly autoClosingBrackets: EditorAutoClosingStrategy; public readonly autoClosingQuotes: EditorAutoClosingStrategy; + public readonly autoClosingOvertype: EditorAutoClosingOvertypeStrategy; public readonly autoSurround: EditorAutoSurroundStrategy; public readonly autoIndent: boolean; public readonly autoClosingPairsOpen2: Map; @@ -117,6 +118,7 @@ export class CursorConfiguration { || e.multiCursorMergeOverlapping || e.autoClosingBrackets || e.autoClosingQuotes + || e.autoClosingOvertype || e.autoSurround || e.useTabStops || e.lineHeight @@ -146,6 +148,7 @@ export class CursorConfiguration { this.multiCursorMergeOverlapping = c.multiCursorMergeOverlapping; this.autoClosingBrackets = c.autoClosingBrackets; this.autoClosingQuotes = c.autoClosingQuotes; + this.autoClosingOvertype = c.autoClosingOvertype; this.autoSurround = c.autoSurround; this.autoIndent = c.autoIndent; diff --git a/src/vs/editor/common/controller/cursorTypeOperations.ts b/src/vs/editor/common/controller/cursorTypeOperations.ts index aa6b5747420..bcf4d3ef83a 100644 --- a/src/vs/editor/common/controller/cursorTypeOperations.ts +++ b/src/vs/editor/common/controller/cursorTypeOperations.ts @@ -431,10 +431,8 @@ export class TypeOperations { return null; } - private static _isAutoClosingCloseCharType(config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): boolean { - const autoCloseConfig = isQuote(ch) ? config.autoClosingQuotes : config.autoClosingBrackets; - - if (autoCloseConfig === 'never') { + private static _isAutoClosingOvertype(config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): boolean { + if (config.autoClosingOvertype === 'never') { return false; } @@ -458,23 +456,25 @@ export class TypeOperations { } // Must over-type a closing character typed by the editor - let found = false; - for (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) { - const autoClosedCharacter = autoClosedCharacters[j]; - if (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) { - found = true; - break; + if (config.autoClosingOvertype === 'auto') { + let found = false; + for (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) { + const autoClosedCharacter = autoClosedCharacters[j]; + if (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) { + found = true; + break; + } + } + if (!found) { + return false; } - } - if (!found) { - return false; } } return true; } - private static _runAutoClosingCloseCharType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): EditOperationResult { + private static _runAutoClosingOvertype(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], ch: string): EditOperationResult { let commands: ICommand[] = []; for (let i = 0, len = selections.length; i < len; i++) { const selection = selections[i]; @@ -765,7 +765,7 @@ export class TypeOperations { return null; } - if (this._isAutoClosingCloseCharType(config, model, selections, autoClosedCharacters, ch)) { + if (this._isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) { // Unfortunately, the close character is at this point "doubled", so we need to delete it... const commands = selections.map(s => new ReplaceCommand(new Range(s.positionLineNumber, s.positionColumn, s.positionLineNumber, s.positionColumn + 1), '', false)); return new EditOperationResult(EditOperationType.Typing, commands, { @@ -813,8 +813,8 @@ export class TypeOperations { } } - if (this._isAutoClosingCloseCharType(config, model, selections, autoClosedCharacters, ch)) { - return this._runAutoClosingCloseCharType(prevEditOperationType, config, model, selections, ch); + if (this._isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) { + return this._runAutoClosingOvertype(prevEditOperationType, config, model, selections, ch); } const autoClosingPairOpenCharType = this._isAutoClosingOpenCharType(config, model, selections, ch, true); diff --git a/src/vs/editor/test/browser/controller/cursor.test.ts b/src/vs/editor/test/browser/controller/cursor.test.ts index 59e221a8c2f..eff8a24373f 100644 --- a/src/vs/editor/test/browser/controller/cursor.test.ts +++ b/src/vs/editor/test/browser/controller/cursor.test.ts @@ -4740,6 +4740,37 @@ suite('autoClosingPairs', () => { mode.dispose(); }); + test('issue #78833 - Add config to use old brackets/quotes overtyping', () => { + let mode = new AutoClosingMode(); + usingCursor({ + text: [ + '', + 'y=();' + ], + languageIdentifier: mode.getLanguageIdentifier(), + editorOpts: { + autoClosingOvertype: 'always' + } + }, (model, cursor) => { + assertCursor(cursor, new Position(1, 1)); + + cursorCommand(cursor, H.Type, { text: 'x=(' }, 'keyboard'); + assert.strictEqual(model.getLineContent(1), 'x=()'); + + cursorCommand(cursor, H.Type, { text: ')' }, 'keyboard'); + assert.strictEqual(model.getLineContent(1), 'x=()'); + + cursor.setSelections('test', [new Selection(1, 4, 1, 4)]); + cursorCommand(cursor, H.Type, { text: ')' }, 'keyboard'); + assert.strictEqual(model.getLineContent(1), 'x=()'); + + cursor.setSelections('test', [new Selection(2, 4, 2, 4)]); + cursorCommand(cursor, H.Type, { text: ')' }, 'keyboard'); + assert.strictEqual(model.getLineContent(2), 'y=();'); + }); + mode.dispose(); + }); + test('issue #15825: accents on mac US intl keyboard', () => { let mode = new AutoClosingMode(); usingCursor({ diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 4291958ce59..6e0b1286ef0 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2494,6 +2494,11 @@ declare namespace monaco.editor { */ export type EditorAutoSurroundStrategy = 'languageDefined' | 'quotes' | 'brackets' | 'never'; + /** + * Configuration options for typing over closing quotes or brackets + */ + export type EditorAutoClosingOvertypeStrategy = 'always' | 'auto' | 'never'; + /** * Configuration options for editor minimap */ @@ -2922,6 +2927,10 @@ declare namespace monaco.editor { * Defaults to language defined behavior. */ autoClosingQuotes?: EditorAutoClosingStrategy; + /** + * Options for typing over closing quotes or brackets. + */ + autoClosingOvertype?: EditorAutoClosingOvertypeStrategy; /** * Options for auto surrounding. * Defaults to always allowing auto surrounding. @@ -3385,6 +3394,7 @@ declare namespace monaco.editor { readonly wordSeparators: string; readonly autoClosingBrackets: EditorAutoClosingStrategy; readonly autoClosingQuotes: EditorAutoClosingStrategy; + readonly autoClosingOvertype: EditorAutoClosingOvertypeStrategy; readonly autoSurround: EditorAutoSurroundStrategy; readonly autoIndent: boolean; readonly useTabStops: boolean; @@ -3526,6 +3536,7 @@ declare namespace monaco.editor { readonly wordSeparators: boolean; readonly autoClosingBrackets: boolean; readonly autoClosingQuotes: boolean; + readonly autoClosingOvertype: boolean; readonly autoSurround: boolean; readonly autoIndent: boolean; readonly useTabStops: boolean; From 2a7f5b422436a353e6ab7807be9ab0e413464e03 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 16:07:59 +0200 Subject: [PATCH 102/163] :lipstick: --- src/vs/platform/editor/common/editor.ts | 14 +++++++++----- src/vs/workbench/common/editor.ts | 14 +++++++++----- .../services/editor/browser/editorService.ts | 11 ++++++++--- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index a2bafd91dca..222e4d655ac 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -82,14 +82,17 @@ export interface IResourceInput extends IBaseResourceInput { export interface IEditorOptions { /** - * Tells the editor to not receive keyboard focus when the editor is being opened. By default, - * the editor will receive keyboard focus on open. + * Tells the editor to not receive keyboard focus when the editor is being opened. This + * will also prevent the group the editor opens in to become active. This can be overridden + * via the `forceActive` option. + * + * By default, the editor will receive keyboard focus on open. */ readonly preserveFocus?: boolean; /** - * Tells the group the editor opens in to become active. By default, an editor group will not - * become active if either `preserveFocus: true` or `inactive: true`. + * Tells the group the editor opens in to become active even if either `preserveFocus: true` + * or `inactive: true` are specified. */ readonly forceActive?: boolean; @@ -129,7 +132,8 @@ export interface IEditorOptions { /** * An active editor that is opened will show its contents directly. Set to true to open an editor - * in the background. + * in the background. This will also prevent the group the editor opens in to become active. This + * can be overridden via the `forceActive` option. */ readonly inactive?: boolean; diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 3b2647c3c97..7ecd3c81830 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -713,14 +713,17 @@ export class EditorOptions implements IEditorOptions { } /** - * Tells the editor to not receive keyboard focus when the editor is being opened. By default, - * the editor will receive keyboard focus on open. + * Tells the editor to not receive keyboard focus when the editor is being opened. This + * will also prevent the group the editor opens in to become active. This can be overridden + * via the `forceActive` option. + * + * By default, the editor will receive keyboard focus on open. */ preserveFocus: boolean | undefined; /** - * Tells the group the editor opens in to become active. By default, an editor group will not - * become active if either `preserveFocus: true` or `inactive: true`. + * Tells the group the editor opens in to become active even if either `preserveFocus: true` + * or `inactive: true` are specified. */ forceActive: boolean | undefined; @@ -754,7 +757,8 @@ export class EditorOptions implements IEditorOptions { /** * An active editor that is opened will show its contents directly. Set to true to open an editor - * in the background. + * in the background. This will also prevent the group the editor opens in to become active. This + * can be overridden via the `forceActive` option. */ inactive: boolean | undefined; diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 20b9aac8069..d0c6380708e 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -256,7 +256,12 @@ export class EditorService extends Disposable implements EditorServiceImpl { // Not enforcing this for side groups supports a historic scenario we have: repeated // Alt-clicking of files in the explorer always open into the same side group and not // cause a group to be created each time. - if (typedOptions && !typedOptions.inactive && typedOptions.preserveFocus && candidateGroup !== SIDE_GROUP) { + if ( + typedOptions && !typedOptions.inactive && // never for inactive editors + typedOptions.preserveFocus && // only if preserveFocus + typeof typedOptions.forceActive !== 'boolean' && // only if forceActive is not already defined (either true or false) + candidateGroup !== SIDE_GROUP // never for the SIDE_GROUP + ) { typedOptions.overwrite({ forceActive: true }); } @@ -275,11 +280,11 @@ export class EditorService extends Disposable implements EditorServiceImpl { // Group: Instance of Group if (group && typeof group !== 'number') { - return group; + targetGroup = group; } // Group: Side by Side - if (group === SIDE_GROUP) { + else if (group === SIDE_GROUP) { targetGroup = this.findSideBySideGroup(); } From 56bc908d42790841af0810269af91665bd1086a1 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 26 Aug 2019 16:18:19 +0200 Subject: [PATCH 103/163] Fix #79557 --- .../services/preferences/common/keybindingsEditorModel.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts b/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts index 847b67a5bcd..39a4fca36bc 100644 --- a/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts +++ b/src/vs/workbench/services/preferences/common/keybindingsEditorModel.ts @@ -264,13 +264,13 @@ class KeybindingItemMatches { this.commandLabelMatches = keybindingItem.commandLabel ? this.matches(searchValue, keybindingItem.commandLabel, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.commandLabel, true), words) : null; this.commandDefaultLabelMatches = keybindingItem.commandDefaultLabel ? this.matches(searchValue, keybindingItem.commandDefaultLabel, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.commandDefaultLabel, true), words) : null; this.sourceMatches = this.matches(searchValue, keybindingItem.source, (word, wordToMatchAgainst) => matchesWords(word, keybindingItem.source, true), words); - this.whenMatches = keybindingItem.when ? this.matches(searchValue, keybindingItem.when, or(matchesWords, matchesCamelCase), words) : null; + this.whenMatches = keybindingItem.when ? this.matches(null, keybindingItem.when, or(matchesWords, matchesCamelCase), words) : null; } this.keybindingMatches = keybindingItem.keybinding ? this.matchesKeybinding(keybindingItem.keybinding, searchValue, keybindingWords, completeMatch) : null; } - private matches(searchValue: string, wordToMatchAgainst: string, wordMatchesFilter: IFilter, words: string[]): IMatch[] | null { - let matches = wordFilter(searchValue, wordToMatchAgainst); + private matches(searchValue: string | null, wordToMatchAgainst: string, wordMatchesFilter: IFilter, words: string[]): IMatch[] | null { + let matches = searchValue ? wordFilter(searchValue, wordToMatchAgainst) : null; if (!matches) { matches = this.matchesWords(words, wordToMatchAgainst, wordMatchesFilter); } From ea04f588093856d36f612f277a0fdc8e8422bcb9 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 16:20:50 +0200 Subject: [PATCH 104/163] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2427358b7d4..abd4295af8d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "c7b813651b7b055ee605ecaaa442abc6dbf14d44", + "distro": "9e9dfcce5e5fa0a30c1521e12c0d48a94f01b193", "author": { "name": "Microsoft Corporation" }, From d7f2e68ceba3ff4e03322576978906ecb8494a35 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 26 Aug 2019 16:28:27 +0200 Subject: [PATCH 105/163] fix tests --- src/vs/editor/contrib/suggest/suggestController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/suggest/suggestController.ts b/src/vs/editor/contrib/suggest/suggestController.ts index 8fe391eec0a..d0e569822bb 100644 --- a/src/vs/editor/contrib/suggest/suggestController.ts +++ b/src/vs/editor/contrib/suggest/suggestController.ts @@ -234,11 +234,12 @@ export class SuggestController implements IEditorContribution { } const overwriteBefore = position.column - suggestion.range.startColumn; - const overwriteAfter = (suggestion.range.endColumn - position.column) + this._lineSuffix.value!.delta(this._editor.getPosition()); + const overwriteAfter = suggestion.range.endColumn - position.column; + const suffixDelta = this._lineSuffix.value ? this._lineSuffix.value.delta(this._editor.getPosition()) : 0; SnippetController2.get(this._editor).insert(insertText, { overwriteBefore: overwriteBefore + columnDelta, - overwriteAfter, + overwriteAfter: overwriteAfter + suffixDelta, undoStopBefore: false, undoStopAfter: false, adjustWhitespace: !(suggestion.insertTextRules! & CompletionItemInsertTextRule.KeepWhitespace) From f4ff74a511940e0f7555bcaa8982bdf356107c5d Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 26 Aug 2019 16:38:12 +0200 Subject: [PATCH 106/163] fix range vs postion regression in quick outline --- .../contrib/quickopen/browser/gotoSymbolHandler.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts index 1742ba33738..badaffd29e4 100644 --- a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts @@ -17,7 +17,7 @@ import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/quickOpen'; import { DocumentSymbolProviderRegistry, DocumentSymbol, symbolKindToCssClass, SymbolKind, SymbolTag } from 'vs/editor/common/modes'; -import { IRange } from 'vs/editor/common/core/range'; +import { IRange, Range } from 'vs/editor/common/core/range'; import { themeColorFromId } from 'vs/platform/theme/common/themeService'; import { overviewRulerRangeHighlight } from 'vs/editor/common/view/editorColorRegistry'; import { GroupIdentifier, IEditorInput } from 'vs/workbench/common/editor'; @@ -219,7 +219,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { getOptions(pinned?: boolean): ITextEditorOptions { return { - selection: this.revealRange, + selection: Range.collapseToStart(this.revealRange), pinned }; } @@ -242,7 +242,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { // Apply selection and focus else { - const range = this.revealRange; + const range = Range.collapseToStart(this.revealRange); const activeTextEditorWidget = this.editorService.activeTextEditorWidget; if (activeTextEditorWidget) { activeTextEditorWidget.setSelection(range); @@ -256,7 +256,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { private runPreview(): boolean { // Select Outline Position - const range = this.revealRange; + const range = Range.collapseToStart(this.revealRange); const activeTextEditorWidget = this.editorService.activeTextEditorWidget; if (activeTextEditorWidget) { activeTextEditorWidget.revealRangeInCenter(range, ScrollType.Smooth); From 2e26a4f252cc7aa98fa6fefe3c49f37d193a66cb Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 16:39:54 +0200 Subject: [PATCH 107/163] options - better overwrite() --- src/vs/workbench/common/editor.ts | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 7ecd3c81830..0727e96d1ca 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -772,36 +772,36 @@ export class EditorOptions implements IEditorOptions { * Overwrites option values from the provided bag. */ overwrite(options: IEditorOptions): EditorOptions { - if (options.forceReload) { - this.forceReload = true; + if (typeof options.forceReload === 'boolean') { + this.forceReload = options.forceReload; } - if (options.revealIfVisible) { - this.revealIfVisible = true; + if (typeof options.revealIfVisible === 'boolean') { + this.revealIfVisible = options.revealIfVisible; } - if (options.revealIfOpened) { - this.revealIfOpened = true; + if (typeof options.revealIfOpened === 'boolean') { + this.revealIfOpened = options.revealIfOpened; } - if (options.preserveFocus) { - this.preserveFocus = true; + if (typeof options.preserveFocus === 'boolean') { + this.preserveFocus = options.preserveFocus; } - if (options.forceActive) { - this.forceActive = true; + if (typeof options.forceActive === 'boolean') { + this.forceActive = options.forceActive; } - if (options.pinned) { - this.pinned = true; + if (typeof options.pinned === 'boolean') { + this.pinned = options.pinned; } - if (options.inactive) { - this.inactive = true; + if (typeof options.inactive === 'boolean') { + this.inactive = options.inactive; } - if (options.ignoreError) { - this.ignoreError = true; + if (typeof options.ignoreError === 'boolean') { + this.ignoreError = options.ignoreError; } if (typeof options.index === 'number') { @@ -857,8 +857,8 @@ export class TextEditorOptions extends EditorOptions { this.editorViewState = options.viewState as IEditorViewState; } - if (options.revealInCenterIfOutsideViewport) { - this.revealInCenterIfOutsideViewport = true; + if (typeof options.revealInCenterIfOutsideViewport === 'boolean') { + this.revealInCenterIfOutsideViewport = options.revealInCenterIfOutsideViewport; } return this; From 96af1d44cef908813601c605445f467b0e19ecaf Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 26 Aug 2019 16:48:19 +0200 Subject: [PATCH 108/163] fix accessibility word operatoins and tests --- .../common/controller/cursorWordOperations.ts | 14 ++++++-------- .../wordOperations/test/wordOperations.test.ts | 8 +++----- .../contrib/wordOperations/wordOperations.ts | 8 ++++---- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/vs/editor/common/controller/cursorWordOperations.ts b/src/vs/editor/common/controller/cursorWordOperations.ts index b411d54bb49..300174e613a 100644 --- a/src/vs/editor/common/controller/cursorWordOperations.ts +++ b/src/vs/editor/common/controller/cursorWordOperations.ts @@ -40,7 +40,7 @@ export const enum WordNavigationType { WordStart = 0, WordStartFast = 1, WordEnd = 2, - WordAcessibility = 3 // Respect chrome defintion of a word + WordAccessibility = 3 // Respect chrome defintion of a word } export class WordOperations { @@ -203,13 +203,12 @@ export class WordOperations { return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); } - if (wordNavigationType === WordNavigationType.WordAcessibility) { + if (wordNavigationType === WordNavigationType.WordAccessibility) { while ( prevWordOnLine && prevWordOnLine.wordType === WordType.Separator - && prevWordOnLine.end - prevWordOnLine.start === 1 ) { - // Skip over a word made up of one single separator + // Skip over words made up of only separators prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, prevWordOnLine.start + 1)); } @@ -289,19 +288,18 @@ export class WordOperations { } else { column = model.getLineMaxColumn(lineNumber); } - } else if (wordNavigationType === WordNavigationType.WordAcessibility) { + } else if (wordNavigationType === WordNavigationType.WordAccessibility) { while ( nextWordOnLine && nextWordOnLine.wordType === WordType.Separator - && nextWordOnLine.end - nextWordOnLine.start === 1 ) { // Skip over a word made up of one single separator - nextWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1)); + nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new Position(lineNumber, nextWordOnLine.end + 1)); } if (nextWordOnLine) { - column = nextWordOnLine.start + 1; + column = nextWordOnLine.end + 1; } else { column = model.getLineMaxColumn(lineNumber); } diff --git a/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts b/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts index c647e151cfe..baacaf2b445 100644 --- a/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts +++ b/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts @@ -337,7 +337,7 @@ suite('WordOperations', () => { }); test('cursorWordAccessibilityLeft', () => { - const EXPECTED = ['| |/* |Just |some |more |text |a|+= |3 |+|5|-|3 |+ |7 |*/| '].join('\n'); + const EXPECTED = ['| /* |Just |some |more |text |a+= |3 +|5-|3 + |7 */ '].join('\n'); const [text,] = deserializePipePositions(EXPECTED); const actualStops = testRepeatedActionAndExtractPositions( text, @@ -351,16 +351,14 @@ suite('WordOperations', () => { }); test('cursorWordAccessibilityRight', () => { - const EXPECTED = [ - 'console|.log|(err|)|', - ].join('\n'); + const EXPECTED = [' /* Just| some| more| text| a|+= 3| +5|-3| + 7| */ |'].join('\n'); const [text,] = deserializePipePositions(EXPECTED); const actualStops = testRepeatedActionAndExtractPositions( text, new Position(1, 1), ed => cursorWordAccessibilityRight(ed), ed => ed.getPosition()!, - ed => ed.getPosition()!.equals(new Position(1, 17)) + ed => ed.getPosition()!.equals(new Position(1, 50)) ); const actual = serializePipePositions(text, actualStops); assert.deepEqual(actual, EXPECTED); diff --git a/src/vs/editor/contrib/wordOperations/wordOperations.ts b/src/vs/editor/contrib/wordOperations/wordOperations.ts index bd305ba7103..3f330238e9e 100644 --- a/src/vs/editor/contrib/wordOperations/wordOperations.ts +++ b/src/vs/editor/contrib/wordOperations/wordOperations.ts @@ -177,7 +177,7 @@ export class CursorWordAccessibilityLeft extends WordLeftCommand { constructor() { super({ inSelectionMode: false, - wordNavigationType: WordNavigationType.WordAcessibility, + wordNavigationType: WordNavigationType.WordAccessibility, id: 'cursorWordAccessibilityLeft', precondition: undefined, kbOpts: { @@ -198,7 +198,7 @@ export class CursorWordAccessibilityLeftSelect extends WordLeftCommand { constructor() { super({ inSelectionMode: true, - wordNavigationType: WordNavigationType.WordAcessibility, + wordNavigationType: WordNavigationType.WordAccessibility, id: 'cursorWordAccessibilitLeftSelecty', precondition: undefined, kbOpts: { @@ -297,7 +297,7 @@ export class CursorWordAccessibilityRight extends WordRightCommand { constructor() { super({ inSelectionMode: false, - wordNavigationType: WordNavigationType.WordAcessibility, + wordNavigationType: WordNavigationType.WordAccessibility, id: 'cursorWordAccessibilityRight', precondition: undefined, kbOpts: { @@ -318,7 +318,7 @@ export class CursorWordAccessibilityRightSelect extends WordRightCommand { constructor() { super({ inSelectionMode: true, - wordNavigationType: WordNavigationType.WordAcessibility, + wordNavigationType: WordNavigationType.WordAccessibility, id: 'cursorWordAccessibilityRightSelect', precondition: undefined, kbOpts: { From 11268173649c22b27fbec9919867aaffdb87910c Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 26 Aug 2019 17:00:52 +0200 Subject: [PATCH 109/163] simple change for #79815 --- src/vs/base/common/filters.ts | 6 ++++++ src/vs/base/test/common/filters.test.ts | 5 +++++ .../contrib/quickopen/browser/gotoSymbolHandler.ts | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/vs/base/common/filters.ts b/src/vs/base/common/filters.ts index fe233f874bf..471423eba7e 100644 --- a/src/vs/base/common/filters.ts +++ b/src/vs/base/common/filters.ts @@ -532,6 +532,12 @@ export interface FuzzyScorer { export function fuzzyScore(pattern: string, patternLow: string, patternPos: number, word: string, wordLow: string, wordPos: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined { + if (patternPos > 0) { + pattern = pattern.substr(patternPos); + patternLow = patternLow.substr(patternPos); + patternPos = 0; + } + const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length; const wordLen = word.length > _maxLen ? _maxLen : word.length; diff --git a/src/vs/base/test/common/filters.test.ts b/src/vs/base/test/common/filters.test.ts index 42b74143661..1dad7328006 100644 --- a/src/vs/base/test/common/filters.test.ts +++ b/src/vs/base/test/common/filters.test.ts @@ -389,6 +389,11 @@ suite('Filters', () => { assertMatches('g', 'zzGroup', 'zz^Group', fuzzyScore); }); + test('patternPos isn\'t working correctly #79815', function () { + assertMatches(':p'.substr(1), 'prop', '^prop', fuzzyScore, { patternPos: 0 }); + assertMatches(':p', 'prop', '^prop', fuzzyScore, { patternPos: 1 }); + }); + function assertTopScore(filter: typeof fuzzyScore, pattern: string, expected: number, ...words: string[]) { let topScore = -(100 * 10); let topIdx = 0; diff --git a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts index badaffd29e4..85362cb1aa9 100644 --- a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts @@ -88,7 +88,7 @@ class OutlineModel extends QuickOpenModel { // Filter by search if (searchValue.length > searchValuePos) { const score = filters.fuzzyScore( - searchValue.substr(searchValuePos), searchValueLow.substr(searchValuePos), 0, + searchValue, searchValueLow, searchValuePos, entry.getLabel(), entry.getLabel().toLowerCase(), 0, true ); From 61c52d0dda808abddd5a97a143c4ecdde78f174b Mon Sep 17 00:00:00 2001 From: SteVen Batten <6561887+sbatten@users.noreply.github.com> Date: Mon, 26 Aug 2019 08:12:00 -0700 Subject: [PATCH 110/163] GridLayout perf improvements (#79614) * add deserialization to splitview * add new grid deserialization test to index.html * working mostly * branchnode should invert orthogonality in splitview * fix issue with sidebar snapping * cleanup and make splitview api more explicit * hook up children sash reset * adopt single deserialize (PR feedback) --- src/vs/base/browser/ui/grid/grid.ts | 111 ++----- src/vs/base/browser/ui/grid/gridview.ts | 131 ++++++++- src/vs/base/browser/ui/splitview/splitview.ts | 233 ++++++++------- src/vs/base/test/browser/ui/grid/grid.test.ts | 8 +- src/vs/workbench/browser/layout.ts | 3 +- test/splitview/public/index.html | 272 +++++++++++++----- 6 files changed, 480 insertions(+), 278 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 4586d752d0b..5007dd5c618 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -7,7 +7,7 @@ import 'vs/css!./gridview'; import { Orientation } from 'vs/base/browser/ui/sash/sash'; import { Disposable } from 'vs/base/common/lifecycle'; import { tail2 as tail, equals } from 'vs/base/common/arrays'; -import { orthogonal, IView as IGridViewView, GridView, Sizing as GridViewSizing, Box, IGridViewStyles, IViewSize, LayoutController, IGridViewOptions } from './gridview'; +import { orthogonal, IView as IGridViewView, GridView, Sizing as GridViewSizing, Box, IGridViewStyles, IViewSize, IGridViewOptions } from './gridview'; import { Event } from 'vs/base/common/event'; import { InvisibleSizing } from 'vs/base/browser/ui/splitview/splitview'; @@ -217,9 +217,17 @@ export class Grid extends Disposable { private didLayout = false; - constructor(view: T, options: IGridOptions = {}) { + constructor(gridview: GridView, options?: IGridOptions); + constructor(view: T, options?: IGridOptions); + constructor(view: T | GridView, options: IGridOptions = {}) { super(); - this.gridview = new GridView(options); + + if (view instanceof GridView) { + this.gridview = view; + this.gridview.getViewMap(this.views); + } else { + this.gridview = new GridView(options); + } this._register(this.gridview); this._register(this.gridview.onDidSashReset(this.onDidSashReset, this)); @@ -228,7 +236,9 @@ export class Grid extends Disposable { ? GridViewSizing.Invisible(options.firstViewVisibleCachedSize) : 0; - this._addView(view, size, [0]); + if (!(view instanceof GridView)) { + this._addView(view, size, [0]); + } } style(styles: IGridStyles): void { @@ -469,12 +479,6 @@ export interface IViewDeserializer { fromJSON(json: any): T; } -interface InitialLayoutContext { - width: number; - height: number; - root: GridBranchNode; -} - export interface ISerializedLeafNode { type: 'leaf'; data: any; @@ -567,31 +571,9 @@ export class SerializableGrid extends Grid { throw new Error('Invalid JSON: \'height\' property must be a number.'); } - const orientation = json.orientation; - const width = json.width; - const height = json.height; - const box: Box = { top: 0, left: 0, width, height }; + const gridview = GridView.deserialize(json, deserializer, options); + const result = new SerializableGrid(gridview, options); - const root = SerializableGrid.deserializeNode(json.root, orientation, box, deserializer) as GridBranchNode; - const firstLeaf = SerializableGrid.getFirstLeaf(root); - - if (!firstLeaf) { - throw new Error('Invalid serialized state, first leaf not found'); - } - - const layoutController = new LayoutController(false); - options = { ...options, layoutController }; - - if (typeof firstLeaf.cachedVisibleSize === 'number') { - options = { ...options, firstViewVisibleCachedSize: firstLeaf.cachedVisibleSize }; - } - - const result = new SerializableGrid(firstLeaf.view, options); - result.orientation = orientation; - result.restoreViews(firstLeaf.view, orientation, root); - result.initialLayoutContext = { width, height, root }; - - layoutController.isLayoutEnabled = true; return result; } @@ -599,7 +581,7 @@ export class SerializableGrid extends Grid { * Useful information in order to proportionally restore view sizes * upon the very first layout call. */ - private initialLayoutContext: InitialLayoutContext | undefined; + private initialLayoutContext: boolean = true; serialize(): ISerializedGrid { return { @@ -614,65 +596,8 @@ export class SerializableGrid extends Grid { super.layout(width, height); if (this.initialLayoutContext) { - const widthScale = width / this.initialLayoutContext.width; - const heightScale = height / this.initialLayoutContext.height; - - this.restoreViewsSize([], this.initialLayoutContext.root, this.orientation, widthScale, heightScale); - this.initialLayoutContext = undefined; - this.gridview.trySet2x2(); - } - } - - /** - * Recursively restores views which were just deserialized. - */ - private restoreViews(referenceView: T, orientation: Orientation, node: GridNode): void { - if (!isGridBranchNode(node)) { - return; - } - - const direction = orientation === Orientation.VERTICAL ? Direction.Down : Direction.Right; - const firstLeaves = node.children.map(c => SerializableGrid.getFirstLeaf(c)); - - for (let i = 1; i < firstLeaves.length; i++) { - const node = firstLeaves[i]; - const size: number | InvisibleSizing = typeof node.cachedVisibleSize === 'number' - ? GridViewSizing.Invisible(node.cachedVisibleSize) - : (orientation === Orientation.VERTICAL ? node.box.height : node.box.width); - this.addView(node.view, size, referenceView, direction); - referenceView = node.view; - } - - for (let i = 0; i < node.children.length; i++) { - this.restoreViews(firstLeaves[i].view, orthogonal(orientation), node.children[i]); - } - } - - /** - * Recursively restores view sizes. - * This should be called only after the very first layout call. - */ - private restoreViewsSize(location: number[], node: GridNode, orientation: Orientation, widthScale: number, heightScale: number): void { - if (!isGridBranchNode(node)) { - return; - } - - const scale = orientation === Orientation.VERTICAL ? heightScale : widthScale; - - for (let i = 0; i < node.children.length; i++) { - const child = node.children[i]; - const childLocation = [...location, i]; - - if (i < node.children.length - 1) { - const size = orientation === Orientation.VERTICAL - ? { height: Math.floor(child.box.height * scale) } - : { width: Math.floor(child.box.width * scale) }; - - this.gridview.resizeView(childLocation, size); - } - - this.restoreViewsSize(childLocation, child, orthogonal(orientation), widthScale, heightScale); + this.initialLayoutContext = false; } } } diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index 934601cf17c..c9be5a37eaa 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -34,6 +34,36 @@ export interface IView { setVisible?(visible: boolean): void; } +export interface ISerializableView extends IView { + toJSON(): object; +} + +export interface IViewDeserializer { + fromJSON(json: any): T; +} + +export interface ISerializedLeafNode { + type: 'leaf'; + data: any; + size: number; + visible?: boolean; +} + +export interface ISerializedBranchNode { + type: 'branch'; + data: ISerializedNode[]; + size: number; +} + +export type ISerializedNode = ISerializedLeafNode | ISerializedBranchNode; + +export interface ISerializedGridView { + root: ISerializedNode; + orientation: Orientation; + width: number; + height: number; +} + export function orthogonal(orientation: Orientation): Orientation { return orientation === Orientation.VERTICAL ? Orientation.HORIZONTAL : Orientation.VERTICAL; } @@ -179,18 +209,49 @@ class BranchNode implements ISplitView, IDisposable { styles: IGridViewStyles, readonly proportionalLayout: boolean, size: number = 0, - orthogonalSize: number = 0 + orthogonalSize: number = 0, + childDescriptors?: INodeDescriptor[] ) { this._styles = styles; this._size = size; this._orthogonalSize = orthogonalSize; this.element = $('.monaco-grid-branch-node'); - this.splitview = new SplitView(this.element, { orientation, styles, proportionalLayout }); - this.splitview.layout(size, orthogonalSize); + + if (!childDescriptors) { + // Normal behavior, we have no children yet, just set up the splitview + this.splitview = new SplitView(this.element, { orientation, styles, proportionalLayout }); + this.splitview.layout(size, orthogonalSize); + } else { + // Reconstruction behavior, we want to reconstruct a splitview + const descriptor = { + views: childDescriptors.map(childDescriptor => { + return { + view: childDescriptor.node, + size: childDescriptor.node.size, + visible: childDescriptor.node instanceof LeafNode && childDescriptor.visible !== undefined ? childDescriptor.visible : true + }; + }), + size: this.orthogonalSize + }; + + const options = { proportionalLayout, orientation, styles }; + + this.children = childDescriptors.map(c => c.node); + this.splitview = new SplitView(this.element, { ...options, descriptor }); + + this.children.forEach((node, index) => { + // Set up orthogonal sashes for children + node.orthogonalStartSash = this.splitview.sashes[index - 1]; + node.orthogonalEndSash = this.splitview.sashes[index]; + }); + } const onDidSashReset = Event.map(this.splitview.onDidSashReset, i => [i]); this.splitviewSashResetDisposable = onDidSashReset(this._onDidSashReset.fire, this._onDidSashReset); + + const onDidChildrenSashReset = Event.any(...this.children.map((c, i) => Event.map(c.onDidSashReset, location => [i, ...location]))); + this.childrenSashResetDisposable = onDidChildrenSashReset(this._onDidSashReset.fire, this._onDidSashReset); } style(styles: IGridViewStyles): void { @@ -226,7 +287,7 @@ class BranchNode implements ISplitView, IDisposable { } } - addChild(node: Node, size: number | Sizing, index: number): void { + addChild(node: Node, size: number | Sizing, index: number, skipLayout?: boolean): void { if (index < 0 || index > this.children.length) { throw new Error('Invalid index'); } @@ -484,9 +545,11 @@ class LeafNode implements ISplitView, IDisposable { readonly view: IView, readonly orientation: Orientation, readonly layoutController: ILayoutController, - orthogonalSize: number + orthogonalSize: number, + size: number = 0 ) { this._orthogonalSize = orthogonalSize; + this._size = size; this._onDidViewChange = Event.map(this.view.onDidChange, e => e && (this.orientation === Orientation.VERTICAL ? e.width : e.height)); this.onDidChange = Event.any(this._onDidViewChange, this._onDidSetLinkedNode.event, this._onDidLinkedWidthNodeChange.event, this._onDidLinkedHeightNodeChange.event); @@ -577,6 +640,11 @@ class LeafNode implements ISplitView, IDisposable { type Node = BranchNode | LeafNode; +export interface INodeDescriptor { + node: Node; + visible?: boolean; +} + function flipNode(node: T, size: number, orthogonalSize: number): T { if (node instanceof BranchNode) { const result = new BranchNode(orthogonal(node.orientation), node.layoutController, node.styles, node.proportionalLayout, size, orthogonalSize); @@ -680,6 +748,18 @@ export class GridView implements IDisposable { this.root = new BranchNode(Orientation.VERTICAL, this.layoutController, this.styles, this.proportionalLayout); } + getViewMap(map: Map, node?: Node): void { + if (!node) { + node = this.root; + } + + if (node instanceof BranchNode) { + node.children.forEach(child => this.getViewMap(map, child)); + } else { + map.set(node.view, node.element); + } + } + style(styles: IGridViewStyles): void { this.styles = styles; this.root.style(styles); @@ -953,6 +1033,47 @@ export class GridView implements IDisposable { return this._getViews(node, this.orientation, { top: 0, left: 0, width: this.width, height: this.height }); } + static deserialize(json: ISerializedGridView, deserializer: IViewDeserializer, options: IGridViewOptions = {}): GridView { + if (typeof json.orientation !== 'number') { + throw new Error('Invalid JSON: \'orientation\' property must be a number.'); + } else if (typeof json.width !== 'number') { + throw new Error('Invalid JSON: \'width\' property must be a number.'); + } else if (typeof json.height !== 'number') { + throw new Error('Invalid JSON: \'height\' property must be a number.'); + } + + const orientation = json.orientation; + const height = json.height; + + const result = new GridView(options); + result._deserialize(json.root as ISerializedBranchNode, orientation, deserializer, height); + + return result; + } + + private _deserialize(root: ISerializedBranchNode, orientation: Orientation, deserializer: IViewDeserializer, orthogonalSize: number): void { + this.root = this._deserializeNode(root, orientation, deserializer, orthogonalSize) as BranchNode; + } + + private _deserializeNode(node: ISerializedNode, orientation: Orientation, deserializer: IViewDeserializer, orthogonalSize: number): Node { + let result: Node; + if (node.type === 'branch') { + const serializedChildren = node.data as ISerializedNode[]; + const children = serializedChildren.map(serializedChild => { + return { + node: this._deserializeNode(serializedChild, orthogonal(orientation), deserializer, node.size), + visible: (serializedChild as { visible?: boolean }).visible + } as INodeDescriptor; + }); + + result = new BranchNode(orientation, this.layoutController, this.styles, this.proportionalLayout, node.size, orthogonalSize, children); + } else { + result = new LeafNode(deserializer.fromJSON(node.data), orientation, this.layoutController, orthogonalSize, node.size); + } + + return result; + } + private _getViews(node: Node, orientation: Orientation, box: Box, cachedVisibleSize?: number): GridNode { if (node instanceof LeafNode) { return { view: node.view, box, cachedVisibleSize }; diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 81090f39c2c..4998d82fff3 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -29,7 +29,8 @@ export interface ISplitViewOptions { readonly orthogonalStartSash?: Sash; readonly orthogonalEndSash?: Sash; readonly inverseAltBehavior?: boolean; - readonly proportionalLayout?: boolean; // default true + readonly proportionalLayout?: boolean; // default true, + readonly descriptor?: ISplitViewDescriptor; } /** @@ -197,6 +198,15 @@ export namespace Sizing { export function Invisible(cachedVisibleSize: number): InvisibleSizing { return { type: 'invisible', cachedVisibleSize }; } } +export interface ISplitViewDescriptor { + size: number; + views: { + visible?: boolean; + size: number; + view: IView; + }[]; +} + export class SplitView extends Disposable { readonly orientation: Orientation; @@ -272,6 +282,21 @@ export class SplitView extends Disposable { this.viewContainer = dom.append(this.el, dom.$('.split-view-container')); this.style(options.styles || defaultStyles); + + // We have an existing set of view, add them now + if (options.descriptor) { + this.size = options.descriptor.size; + options.descriptor.views.forEach((viewDescriptor, index) => { + const sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } as InvisibleSizing; + + const view = viewDescriptor.view; + this.doAddView(view, sizing, index, true); + }); + + // Initialize content size and proportions for first layout + this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); + this.saveProportions(); + } } style(styles: ISplitViewStyles): void { @@ -285,102 +310,7 @@ export class SplitView extends Disposable { } 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); - - let viewSize: ViewItemSize; - - if (typeof size === 'number') { - viewSize = size; - } else if (size.type === 'split') { - viewSize = this.getViewSize(size.index) / 2; - } else if (size.type === 'invisible') { - viewSize = { cachedVisibleSize: size.cachedVisibleSize }; - } else { - viewSize = view.minimumSize; - } - - const item = this.orientation === Orientation.VERTICAL - ? new VerticalViewItem(container, view, viewSize, disposable) - : new HorizontalViewItem(container, view, viewSize, 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: Sash) => this.getSashPosition(sash) } : { getVerticalSashLeft: (sash: 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 }) - : (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey }); - - const onStart = Event.map(sash.onDidStart, sashEventMapper); - const onStartDisposable = onStart(this.onSashStart, this); - const onChange = Event.map(sash.onDidChange, sashEventMapper); - const onChangeDisposable = onChange(this.onSashChange, this); - const onEnd = Event.map(sash.onDidEnd, () => firstIndex(this.sashItems, item => item.sash === sash)); - const onEndDisposable = onEnd(this.onSashEnd, this); - - const onDidResetDisposable = sash.onDidReset(() => { - const index = firstIndex(this.sashItems, item => item.sash === sash); - const upIndexes = range(index, -1); - const downIndexes = range(index + 1, this.viewItems.length); - const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); - const snapAfterIndex = this.findFirstSnapIndex(downIndexes); - - if (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) { - return; - } - - if (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) { - return; - } - - this._onDidSashReset.fire(index); - }); - - 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 highPriorityIndexes: number[] | undefined; - - if (typeof size !== 'number' && size.type === 'split') { - highPriorityIndexes = [size.index]; - } - - this.relayout([index], highPriorityIndexes); - this.state = State.Idle; - - if (typeof size !== 'number' && size.type === 'distribute') { - this.distributeViewSizes(); - } + this.doAddView(view, size, index, false); } removeView(index: number, sizing?: Sizing): IView { @@ -689,6 +619,108 @@ export class SplitView extends Disposable { return this.viewItems[index].size; } + private doAddView(view: IView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): 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); + + let viewSize: ViewItemSize; + + if (typeof size === 'number') { + viewSize = size; + } else if (size.type === 'split') { + viewSize = this.getViewSize(size.index) / 2; + } else if (size.type === 'invisible') { + viewSize = { cachedVisibleSize: size.cachedVisibleSize }; + } else { + viewSize = view.minimumSize; + } + + const item = this.orientation === Orientation.VERTICAL + ? new VerticalViewItem(container, view, viewSize, disposable) + : new HorizontalViewItem(container, view, viewSize, 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: Sash) => this.getSashPosition(sash) } : { getVerticalSashLeft: (sash: 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 }) + : (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey }); + + const onStart = Event.map(sash.onDidStart, sashEventMapper); + const onStartDisposable = onStart(this.onSashStart, this); + const onChange = Event.map(sash.onDidChange, sashEventMapper); + const onChangeDisposable = onChange(this.onSashChange, this); + const onEnd = Event.map(sash.onDidEnd, () => firstIndex(this.sashItems, item => item.sash === sash)); + const onEndDisposable = onEnd(this.onSashEnd, this); + + const onDidResetDisposable = sash.onDidReset(() => { + const index = firstIndex(this.sashItems, item => item.sash === sash); + const upIndexes = range(index, -1); + const downIndexes = range(index + 1, this.viewItems.length); + const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); + const snapAfterIndex = this.findFirstSnapIndex(downIndexes); + + if (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) { + return; + } + + if (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) { + return; + } + + this._onDidSashReset.fire(index); + }); + + 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 highPriorityIndexes: number[] | undefined; + + if (typeof size !== 'number' && size.type === 'split') { + highPriorityIndexes = [size.index]; + } + + if (!skipLayout) { + this.relayout([index], highPriorityIndexes); + } + + this.state = State.Idle; + + if (!skipLayout && typeof size !== 'number' && size.type === 'distribute') { + this.distributeViewSizes(); + } + } + private relayout(lowPriorityIndexes?: number[], highPriorityIndexes?: number[]): void { const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); @@ -850,9 +882,12 @@ export class SplitView extends Disposable { const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); const snapAfterIndex = this.findFirstSnapIndex(downIndexes); - if (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) { + const snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible; + const snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible; + + if (snappedBefore && collapsesUp[index]) { sash.state = SashState.Minimum; - } else if (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) { + } else if (snappedAfter && collapsesDown[index]) { sash.state = SashState.Maximum; } else { sash.state = SashState.Disabled; diff --git a/src/vs/base/test/browser/ui/grid/grid.test.ts b/src/vs/base/test/browser/ui/grid/grid.test.ts index d8dbad25721..1e484c619c9 100644 --- a/src/vs/base/test/browser/ui/grid/grid.test.ts +++ b/src/vs/base/test/browser/ui/grid/grid.test.ts @@ -688,10 +688,10 @@ suite('SerializableGrid', function () { grid2.layout(400, 800); // [/2, *4/3] assert.deepEqual(view1Copy.size, [300, 400]); - assert.deepEqual(view2Copy.size, [300, 266]); - assert.deepEqual(view3Copy.size, [100, 534]); - assert.deepEqual(view4Copy.size, [100, 266]); - assert.deepEqual(view5Copy.size, [300, 134]); + assert.deepEqual(view2Copy.size, [300, 267]); + assert.deepEqual(view3Copy.size, [100, 533]); + assert.deepEqual(view4Copy.size, [100, 267]); + assert.deepEqual(view5Copy.size, [300, 133]); }); test('deserialize 4 view layout (ben issue #2)', function () { diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 92ef4ff66f8..5d474803a0f 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -1239,7 +1239,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi const editorNode: ISerializedLeafNode = { type: 'leaf', data: { type: Parts.EDITOR_PART }, - size: this.state.panel.position === Position.BOTTOM ? middleSectionHeight - (this.state.panel.hidden ? 0 : panelSize) : editorSectionWidth - (this.state.panel.hidden ? 0 : panelSize) + size: this.state.panel.position === Position.BOTTOM ? middleSectionHeight - (this.state.panel.hidden ? 0 : panelSize) : editorSectionWidth - (this.state.panel.hidden ? 0 : panelSize), + visible: true }; const panelNode: ISerializedLeafNode = { diff --git a/test/splitview/public/index.html b/test/splitview/public/index.html index 602682d6aab..2df71316146 100644 --- a/test/splitview/public/index.html +++ b/test/splitview/public/index.html @@ -31,51 +31,131 @@ - \ No newline at end of file + From b7996ed7c5225f828b49bfad37be570b2d3d5812 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 17:49:58 +0200 Subject: [PATCH 111/163] editors - tweak options around group activation more --- src/vs/platform/editor/common/editor.ts | 34 +++++++++++++---- .../browser/parts/editor/editorGroupView.ts | 7 +++- .../browser/parts/editor/textDiffEditor.ts | 6 +++ src/vs/workbench/common/editor.ts | 38 +++++++++++++++---- .../browser/editors/fileEditorTracker.ts | 2 +- .../files/browser/editors/textFileEditor.ts | 7 ++++ .../contrib/files/browser/fileCommands.ts | 14 +++---- .../files/browser/views/explorerView.ts | 3 +- .../contrib/files/common/dirtyFilesTracker.ts | 5 +-- .../services/editor/browser/editorService.ts | 25 +++++++----- .../preferences/browser/preferencesService.ts | 2 +- .../textfile/common/textFileService.ts | 2 +- 12 files changed, 102 insertions(+), 43 deletions(-) diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index 222e4d655ac..d0185c9ddca 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -82,17 +82,33 @@ export interface IResourceInput extends IBaseResourceInput { export interface IEditorOptions { /** - * Tells the editor to not receive keyboard focus when the editor is being opened. This - * will also prevent the group the editor opens in to become active. This can be overridden - * via the `forceActive` option. + * Tells the editor to not receive keyboard focus when the editor is being opened. * - * By default, the editor will receive keyboard focus on open. + * Will also not activate the group the editor opens in unless the group is already the active one. + * This behaviour can be overridden via the `forceActive` option. */ readonly preserveFocus?: boolean; /** - * Tells the group the editor opens in to become active even if either `preserveFocus: true` - * or `inactive: true` are specified. + * This option is only relevant if an editor is opened into a group that is not active. In + * most cases opening an editor into an inactive group will cause it to become active. With + * `preserveActive: true` in combination with `preserveFocus: true` an editor can be opened + * while keeping the current group active. + * + * Other options like `preserveFocus`, `inactive` and `forceActive` can have an impact on + * whether a group gets activated or not. + * + * Note: `forceActive: true` will always win over `preserveActive: true`. + */ + readonly preserveActive?: boolean; + + /** + * This option is only relevant if an editor is opened into a group that is not active. In + * most cases opening an editor into an inactive group will cause it to become active. With + * `forceActive` the inactive group will become active independent of other options such as + * `preserveFocus` or `inactive`. + * + * Note: `forceActive: true` will always win over `preserveActive: true`. */ readonly forceActive?: boolean; @@ -132,8 +148,10 @@ export interface IEditorOptions { /** * An active editor that is opened will show its contents directly. Set to true to open an editor - * in the background. This will also prevent the group the editor opens in to become active. This - * can be overridden via the `forceActive` option. + * in the background without loading its contents. + * + * Will also not activate the group the editor opens in unless the group is already the active one. + * This behaviour can be overridden via the `forceActive` option. */ readonly inactive?: boolean; diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index d9df1ba5b50..fc268f7916d 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -835,10 +835,13 @@ export class EditorGroupView extends Themable implements IEditorGroupView { let restoreGroup = false; if (options && options.forceActive) { - // Always respect option to force activate an editor group. + // First, respect option to force activate an editor group. activateGroup = true; + } else if (options && options.preserveActive) { + // Second, respect option to preserve active editor group. + activateGroup = false; } else if (openEditorOptions.active) { - // Otherwise, we only activate/restore an editor which is + // Third, we only activate/restore an editor which is // opening as active editor. // If preserveFocus is enabled, we only restore but never // activate the group. diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index ac833ec7818..6f6cabf2c43 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -172,6 +172,12 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor { modifiedInput.setForceOpenAsBinary(); } + // Make sure to not steal away the currently active group + // because we are triggering another openEditor() call + // and do not control the initial intent that resulted + // in us now opening as binary. + options.overwrite({ preserveActive: true, forceActive: false }); + this.editorService.openEditor(binaryDiffInput, options, this.group); return true; diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 0727e96d1ca..851c1ec4fb8 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -713,17 +713,33 @@ export class EditorOptions implements IEditorOptions { } /** - * Tells the editor to not receive keyboard focus when the editor is being opened. This - * will also prevent the group the editor opens in to become active. This can be overridden - * via the `forceActive` option. + * Tells the editor to not receive keyboard focus when the editor is being opened. * - * By default, the editor will receive keyboard focus on open. + * Will also not activate the group the editor opens in unless the group is already the active one. + * This behaviour can be overridden via the `forceActive` option. */ preserveFocus: boolean | undefined; /** - * Tells the group the editor opens in to become active even if either `preserveFocus: true` - * or `inactive: true` are specified. + * This option is only relevant if an editor is opened into a group that is not active. In + * most cases opening an editor into an inactive group will cause it to become active. With + * `preserveActive: true` in combination with `preserveFocus: true` an editor can be opened + * while keeping the current group active. + * + * Other options like `preserveFocus`, `inactive` and `forceActive` can have an impact on + * whether a group gets activated or not. + * + * Note: `forceActive: true` will always win over `preserveActive: true`. + */ + preserveActive: boolean | undefined; + + /** + * This option is only relevant if an editor is opened into a group that is not active. In + * most cases opening an editor into an inactive group will cause it to become active. With + * `forceActive` the inactive group will become active independent of other options such as + * `preserveFocus` or `inactive`. + * + * Note: `forceActive: true` will always win over `preserveActive: true`. */ forceActive: boolean | undefined; @@ -757,8 +773,10 @@ export class EditorOptions implements IEditorOptions { /** * An active editor that is opened will show its contents directly. Set to true to open an editor - * in the background. This will also prevent the group the editor opens in to become active. This - * can be overridden via the `forceActive` option. + * in the background without loading its contents. + * + * Will also not activate the group the editor opens in unless the group is already the active one. + * This behaviour can be overridden via the `forceActive` option. */ inactive: boolean | undefined; @@ -788,6 +806,10 @@ export class EditorOptions implements IEditorOptions { this.preserveFocus = options.preserveFocus; } + if (typeof options.preserveActive === 'boolean') { + this.preserveActive = options.preserveActive; + } + if (typeof options.forceActive === 'boolean') { this.forceActive = options.forceActive; } diff --git a/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts b/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts index 76c18cda35c..f1356db429d 100644 --- a/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts +++ b/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts @@ -326,7 +326,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut // Binary editor that should reload from event if (resource && editor.input && isBinaryEditor && (e.contains(resource, FileChangeType.UPDATED) || e.contains(resource, FileChangeType.ADDED))) { - this.editorService.openEditor(editor.input, { forceReload: true, preserveFocus: true }, editor.group); + this.editorService.openEditor(editor.input, { forceReload: true, preserveFocus: true, preserveActive: true }, editor.group); } }); } diff --git a/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts b/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts index c52724a2e64..5771bb42259 100644 --- a/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts @@ -225,6 +225,13 @@ export class TextFileEditor extends BaseTextEditor { private openAsBinary(input: FileEditorInput, options: EditorOptions): void { input.setForceOpenAsBinary(); + + // Make sure to not steal away the currently active group + // because we are triggering another openEditor() call + // and do not control the initial intent that resulted + // in us now opening as binary. + options.overwrite({ preserveActive: true, forceActive: false }); + this.editorService.openEditor(input, options, this.group); } diff --git a/src/vs/workbench/contrib/files/browser/fileCommands.ts b/src/vs/workbench/contrib/files/browser/fileCommands.ts index 384d6735830..2ee93fec213 100644 --- a/src/vs/workbench/contrib/files/browser/fileCommands.ts +++ b/src/vs/workbench/contrib/files/browser/fileCommands.ts @@ -225,23 +225,23 @@ async function saveAll(saveAllArguments: any, editorService: IEditorService, unt // Store some properties per untitled file to restore later after save is completed const groupIdToUntitledResourceInput = new Map(); - editorGroupService.groups.forEach(g => { - const activeEditorResource = g.activeEditor && g.activeEditor.getResource(); - g.editors.forEach(e => { + editorGroupService.groups.forEach(group => { + const activeEditorResource = group.activeEditor && group.activeEditor.getResource(); + group.editors.forEach(e => { const resource = e.getResource(); if (resource && untitledEditorService.isDirty(resource)) { - if (!groupIdToUntitledResourceInput.has(g.id)) { - groupIdToUntitledResourceInput.set(g.id, []); + if (!groupIdToUntitledResourceInput.has(group.id)) { + groupIdToUntitledResourceInput.set(group.id, []); } - groupIdToUntitledResourceInput.get(g.id)!.push({ + groupIdToUntitledResourceInput.get(group.id)!.push({ encoding: untitledEditorService.getEncoding(resource), resource, options: { inactive: activeEditorResource ? activeEditorResource.toString() !== resource.toString() : true, pinned: true, preserveFocus: true, - index: g.getIndexOfEditor(e) + index: group.getIndexOfEditor(e) } }); } diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index 5a2c00e5786..14e88d533fc 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -241,8 +241,7 @@ export class ExplorerView extends ViewletPanel { const activeFile = this.getActiveFile(); if (!activeFile && !focused[0].isDirectory) { // Open the focused element in the editor if there is currently no file opened #67708 - this.editorService.openEditor({ resource: focused[0].resource, options: { preserveFocus: true, revealIfVisible: true } }) - .then(undefined, onUnexpectedError); + this.editorService.openEditor({ resource: focused[0].resource, options: { preserveFocus: true, revealIfVisible: true } }); } } } diff --git a/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts b/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts index 20c46e13777..01da7d6eff1 100644 --- a/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts +++ b/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts @@ -15,7 +15,7 @@ import { URI } from 'vs/base/common/uri'; import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import * as arrays from 'vs/base/common/arrays'; -import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; +import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; export class DirtyFilesTracker extends Disposable implements IWorkbenchContribution { private isDocumentedEdited: boolean; @@ -88,7 +88,6 @@ export class DirtyFilesTracker extends Disposable implements IWorkbenchContribut } private doOpenDirtyResources(resources: URI[]): void { - const activeEditor = this.editorService.activeControl; // Open this.editorService.openEditors(resources.map(resource => { @@ -96,7 +95,7 @@ export class DirtyFilesTracker extends Disposable implements IWorkbenchContribut resource, options: { inactive: true, pinned: true, preserveFocus: true } }; - }), activeEditor ? activeEditor.group : ACTIVE_GROUP); + })); } private onTextFilesSaved(e: TextFileModelChangeEvent[]): void { diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index d0c6380708e..7fd4b47583e 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -250,18 +250,23 @@ export class EditorService extends Disposable implements EditorServiceImpl { } if (typedEditor && resolvedGroup) { - // Unless the editor opens as inactive editor or we are instructed to open a side group, - // ensure that the group gets activated even if preserveFocus: true. - // - // Not enforcing this for side groups supports a historic scenario we have: repeated - // Alt-clicking of files in the explorer always open into the same side group and not - // cause a group to be created each time. if ( - typedOptions && !typedOptions.inactive && // never for inactive editors - typedOptions.preserveFocus && // only if preserveFocus - typeof typedOptions.forceActive !== 'boolean' && // only if forceActive is not already defined (either true or false) - candidateGroup !== SIDE_GROUP // never for the SIDE_GROUP + this.editorGroupService.activeGroup !== resolvedGroup && // only if target group is not already active + typedOptions && !typedOptions.inactive && // never for inactive editors + typedOptions.preserveFocus && // only if preserveFocus + typeof typedOptions.forceActive !== 'boolean' && // only if forceActive is not already defined (either true or false) + typeof typedOptions.preserveActive !== 'boolean' && // only if preserveActive is not already defined (either true or false) + candidateGroup !== SIDE_GROUP // never for the SIDE_GROUP ) { + // If the resolved group is not the active one, we typically + // want the group to become active. There are a few cases + // where we stay away from encorcing this, e.g. if the caller + // is already providing `forceActive` or `preserveActive`. + // + // Specifically for historic reasons we do not activate a + // group is it is opened as `SIDE_GROUP` with `preserveFocus:true`. + // repeated Alt-clicking of files in the explorer always open + // into the same side group and not cause a group to be created each time. typedOptions.overwrite({ forceActive: true }); } diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index c95a6138545..2d0f5ec0bdd 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -364,7 +364,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic const activeEditorGroup = this.editorGroupService.activeGroup; const sideEditorGroup = this.editorGroupService.addGroup(activeEditorGroup.id, GroupDirection.RIGHT); return Promise.all([ - this.editorService.openEditor({ resource: this.defaultSettingsRawResource, options: { pinned: true, preserveFocus: true, revealIfOpened: true }, label: nls.localize('defaultSettings', "Default Settings"), description: '' }), + this.editorService.openEditor({ resource: this.defaultSettingsRawResource, options: { pinned: true, preserveFocus: true, preserveActive: true, revealIfOpened: true }, label: nls.localize('defaultSettings', "Default Settings"), description: '' }), this.editorService.openEditor(editableSettingsEditorInput, { pinned: true, revealIfOpened: true }, sideEditorGroup.id) ]).then(([defaultEditor, editor]) => withNullAsUndefined(editor)); } else { diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index f9147e602e8..74ebec020c7 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -685,7 +685,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer protected async promptForPath(resource: URI, defaultUri: URI, availableFileSystems?: string[]): Promise { // Help user to find a name for the file by opening it first - await this.editorService.openEditor({ resource, options: { revealIfOpened: true, preserveFocus: true, } }); + await this.editorService.openEditor({ resource, options: { revealIfOpened: true, preserveFocus: true } }); return this.fileDialogService.pickFileToSave(this.getSaveDialogOptions(defaultUri, availableFileSystems)); } From b2d9cd2264f6f421be1e3a2cd16094824e7f4ed9 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 17:52:26 +0200 Subject: [PATCH 112/163] Fixes #79695 --- .../extensions/electron-browser/extensionService.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index b8c267ab590..32a6d126e73 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -484,7 +484,14 @@ export class ExtensionService extends AbstractExtensionService implements IExten } // fetch the remote environment - const remoteEnv = (await this._remoteAgentService.getEnvironment())!; + const remoteEnv = (await this._remoteAgentService.getEnvironment()); + + if (!remoteEnv) { + this._notificationService.notify({ severity: Severity.Error, message: nls.localize('getEnvironmentFailure', "Could not fetch remote environment") }); + // Proceed with the local extension host + await this._startLocalExtensionHost(extensionHost, localExtensions, localExtensions.map(extension => extension.identifier)); + return; + } // enable or disable proposed API per extension this._checkEnableProposedApi(remoteEnv.extensions); From 404478e9a3e80e4a7cebee3b7fc16d8916523ea1 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 26 Aug 2019 17:58:50 +0200 Subject: [PATCH 113/163] Do not disable folding when screen reader is attached (#43262) --- src/vs/editor/common/config/editorOptions.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index dbc5521a5da..43c568a191f 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2159,7 +2159,6 @@ export class EditorOptionsValidator { export class InternalEditorOptionsFactory { private static _tweakValidatedOptions(opts: IValidatedEditorOptions, accessibilitySupport: AccessibilitySupport): IValidatedEditorOptions { - const accessibilityIsOn = (accessibilitySupport === AccessibilitySupport.Enabled); const accessibilityIsOff = (accessibilitySupport === AccessibilitySupport.Disabled); return { inDiffEditor: opts.inDiffEditor, @@ -2256,7 +2255,7 @@ export class InternalEditorOptionsFactory { selectionHighlight: opts.contribInfo.selectionHighlight, occurrencesHighlight: opts.contribInfo.occurrencesHighlight, codeLens: opts.contribInfo.codeLens, - folding: (accessibilityIsOn ? false : opts.contribInfo.folding), // DISABLED WHEN SCREEN READER IS ATTACHED + folding: opts.contribInfo.folding, foldingStrategy: opts.contribInfo.foldingStrategy, showFoldingControls: opts.contribInfo.showFoldingControls, matchBrackets: opts.contribInfo.matchBrackets, From bf3779f18f8d49818f0a75bdeb78f6ce2cc97ce5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 18:04:09 +0200 Subject: [PATCH 114/163] exploration - only merge before nightly build --- build/azure-pipelines/exploration-build.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build/azure-pipelines/exploration-build.yml b/build/azure-pipelines/exploration-build.yml index 39a8f23b262..b1cce331c4c 100644 --- a/build/azure-pipelines/exploration-build.yml +++ b/build/azure-pipelines/exploration-build.yml @@ -1,13 +1,6 @@ pool: vmImage: 'Ubuntu-16.04' -trigger: - branches: - include: ['master'] -pr: - branches: - include: ['master'] - steps: - task: NodeTool@0 inputs: @@ -38,3 +31,13 @@ steps: git push origin HEAD:electron-6.0.x displayName: Sync & Merge Exploration + +trigger: none +pr: none + +schedules: +- cron: "0 5 * * Mon-Fri" + displayName: Mon-Fri at 7:00 + branches: + include: + - master From a55c0a89ae71ff4cfa0e04e2986cf930ee29fd7d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 26 Aug 2019 09:37:57 -0700 Subject: [PATCH 115/163] Add `data` to trusted schemes in rendered markdown Fixes #79781 --- src/vs/base/browser/markdownRenderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/markdownRenderer.ts b/src/vs/base/browser/markdownRenderer.ts index fa6956fdac0..31d645fe271 100644 --- a/src/vs/base/browser/markdownRenderer.ts +++ b/src/vs/base/browser/markdownRenderer.ts @@ -172,7 +172,7 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende renderer }; - const allowedSchemes = ['http', 'https', 'mailto']; + const allowedSchemes = ['http', 'https', 'mailto', 'data']; if (markdown.isTrusted) { allowedSchemes.push('command'); } From 0f659c90eba931a64d1b1eb01ec95f5fe6bd8c2d Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 18:42:41 +0200 Subject: [PATCH 116/163] editors - merge activation options into one --- src/vs/platform/editor/common/editor.ts | 45 +++++++++---------- .../browser/parts/editor/editorGroupView.ts | 11 ++--- .../browser/parts/editor/textDiffEditor.ts | 3 +- src/vs/workbench/common/editor.ts | 42 +++++------------ .../browser/editors/fileEditorTracker.ts | 3 +- .../files/browser/editors/textFileEditor.ts | 3 +- .../services/editor/browser/editorService.ts | 9 ++-- .../preferences/browser/preferencesService.ts | 2 +- 8 files changed, 51 insertions(+), 67 deletions(-) diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index d0185c9ddca..10618336e13 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -79,38 +79,37 @@ export interface IResourceInput extends IBaseResourceInput { readonly mode?: string; } +export enum EditorActivation { + + /** + * Activate the editor after it opened. + */ + ACTIVATE, + + /** + * Preserve the current active editor. + */ + PRESERVE +} + export interface IEditorOptions { /** * Tells the editor to not receive keyboard focus when the editor is being opened. * - * Will also not activate the group the editor opens in unless the group is already the active one. - * This behaviour can be overridden via the `forceActive` option. + * Will also not activate the group the editor opens in unless the group is already + * the active one. This behaviour can be overridden via the `activation` option. */ readonly preserveFocus?: boolean; /** - * This option is only relevant if an editor is opened into a group that is not active. In - * most cases opening an editor into an inactive group will cause it to become active. With - * `preserveActive: true` in combination with `preserveFocus: true` an editor can be opened - * while keeping the current group active. + * This option is only relevant if an editor is opened into a group that is not active + * already and allows to control if the inactive group should become active or not. * - * Other options like `preserveFocus`, `inactive` and `forceActive` can have an impact on - * whether a group gets activated or not. - * - * Note: `forceActive: true` will always win over `preserveActive: true`. + * By default, the editor group will become active unless `preserveFocus` or `inactive` + * is specified. */ - readonly preserveActive?: boolean; - - /** - * This option is only relevant if an editor is opened into a group that is not active. In - * most cases opening an editor into an inactive group will cause it to become active. With - * `forceActive` the inactive group will become active independent of other options such as - * `preserveFocus` or `inactive`. - * - * Note: `forceActive: true` will always win over `preserveActive: true`. - */ - readonly forceActive?: boolean; + readonly activation?: EditorActivation; /** * Tells the editor to reload the editor input in the editor even if it is identical to the one @@ -150,8 +149,8 @@ export interface IEditorOptions { * An active editor that is opened will show its contents directly. Set to true to open an editor * in the background without loading its contents. * - * Will also not activate the group the editor opens in unless the group is already the active one. - * This behaviour can be overridden via the `forceActive` option. + * Will also not activate the group the editor opens in unless the group is already + * the active one. This behaviour can be overridden via the `activation` option. */ readonly inactive?: boolean; diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index fc268f7916d..6746bb5a1a7 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -49,6 +49,7 @@ import { hash } from 'vs/base/common/hash'; import { guessMimeTypes } from 'vs/base/common/mime'; import { extname } from 'vs/base/common/resources'; import { Schemas } from 'vs/base/common/network'; +import { EditorActivation } from 'vs/platform/editor/common/editor'; export class EditorGroupView extends Themable implements IEditorGroupView { @@ -834,14 +835,14 @@ export class EditorGroupView extends Themable implements IEditorGroupView { let activateGroup = false; let restoreGroup = false; - if (options && options.forceActive) { - // First, respect option to force activate an editor group. + if (options && options.activation === EditorActivation.ACTIVATE) { + // Respect option to force activate an editor group. activateGroup = true; - } else if (options && options.preserveActive) { - // Second, respect option to preserve active editor group. + } else if (options && options.activation === EditorActivation.PRESERVE) { + // Respect option to preserve active editor group. activateGroup = false; } else if (openEditorOptions.active) { - // Third, we only activate/restore an editor which is + // Finally, we only activate/restore an editor which is // opening as active editor. // If preserveFocus is enabled, we only restore but never // activate the group. diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 6f6cabf2c43..7b791423c5e 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -31,6 +31,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { CancellationToken } from 'vs/base/common/cancellation'; import { EditorMemento } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IWindowService } from 'vs/platform/windows/common/windows'; +import { EditorActivation } from 'vs/platform/editor/common/editor'; /** * The text editor that leverages the diff text editor for the editing experience. @@ -176,7 +177,7 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor { // because we are triggering another openEditor() call // and do not control the initial intent that resulted // in us now opening as binary. - options.overwrite({ preserveActive: true, forceActive: false }); + options.overwrite({ activation: EditorActivation.PRESERVE }); this.editorService.openEditor(binaryDiffInput, options, this.group); diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 851c1ec4fb8..891ad635a7c 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -9,7 +9,7 @@ import { isUndefinedOrNull } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { IEditor as ICodeEditor, IEditorViewState, ScrollType, IDiffEditor } from 'vs/editor/common/editorCommon'; -import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, IResourceInput } from 'vs/platform/editor/common/editor'; +import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, IResourceInput, EditorActivation } from 'vs/platform/editor/common/editor'; import { IInstantiationService, IConstructorSignature0, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { RawContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -715,33 +715,19 @@ export class EditorOptions implements IEditorOptions { /** * Tells the editor to not receive keyboard focus when the editor is being opened. * - * Will also not activate the group the editor opens in unless the group is already the active one. - * This behaviour can be overridden via the `forceActive` option. + * Will also not activate the group the editor opens in unless the group is already + * the active one. This behaviour can be overridden via the `activation` option. */ preserveFocus: boolean | undefined; /** - * This option is only relevant if an editor is opened into a group that is not active. In - * most cases opening an editor into an inactive group will cause it to become active. With - * `preserveActive: true` in combination with `preserveFocus: true` an editor can be opened - * while keeping the current group active. + * This option is only relevant if an editor is opened into a group that is not active + * already and allows to control if the inactive group should become active or not. * - * Other options like `preserveFocus`, `inactive` and `forceActive` can have an impact on - * whether a group gets activated or not. - * - * Note: `forceActive: true` will always win over `preserveActive: true`. + * By default, the editor group will become active unless `preserveFocus` or `inactive` + * is specified. */ - preserveActive: boolean | undefined; - - /** - * This option is only relevant if an editor is opened into a group that is not active. In - * most cases opening an editor into an inactive group will cause it to become active. With - * `forceActive` the inactive group will become active independent of other options such as - * `preserveFocus` or `inactive`. - * - * Note: `forceActive: true` will always win over `preserveActive: true`. - */ - forceActive: boolean | undefined; + activation: EditorActivation | undefined; /** * Tells the editor to reload the editor input in the editor even if it is identical to the one @@ -775,8 +761,8 @@ export class EditorOptions implements IEditorOptions { * An active editor that is opened will show its contents directly. Set to true to open an editor * in the background without loading its contents. * - * Will also not activate the group the editor opens in unless the group is already the active one. - * This behaviour can be overridden via the `forceActive` option. + * Will also not activate the group the editor opens in unless the group is already + * the active one. This behaviour can be overridden via the `activation` option. */ inactive: boolean | undefined; @@ -806,12 +792,8 @@ export class EditorOptions implements IEditorOptions { this.preserveFocus = options.preserveFocus; } - if (typeof options.preserveActive === 'boolean') { - this.preserveActive = options.preserveActive; - } - - if (typeof options.forceActive === 'boolean') { - this.forceActive = options.forceActive; + if (typeof options.activation === 'number') { + this.activation = options.activation; } if (typeof options.pinned === 'boolean') { diff --git a/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts b/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts index f1356db429d..eac306be109 100644 --- a/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts +++ b/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts @@ -27,6 +27,7 @@ import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/editor import { ResourceQueue, timeout } from 'vs/base/common/async'; import { onUnexpectedError } from 'vs/base/common/errors'; import { withNullAsUndefined } from 'vs/base/common/types'; +import { EditorActivation } from 'vs/platform/editor/common/editor'; export class FileEditorTracker extends Disposable implements IWorkbenchContribution { @@ -326,7 +327,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut // Binary editor that should reload from event if (resource && editor.input && isBinaryEditor && (e.contains(resource, FileChangeType.UPDATED) || e.contains(resource, FileChangeType.ADDED))) { - this.editorService.openEditor(editor.input, { forceReload: true, preserveFocus: true, preserveActive: true }, editor.group); + this.editorService.openEditor(editor.input, { forceReload: true, preserveFocus: true, activation: EditorActivation.PRESERVE }, editor.group); } }); } diff --git a/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts b/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts index 5771bb42259..4b025393c19 100644 --- a/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts @@ -32,6 +32,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'; import { createErrorWithActions } from 'vs/base/common/errorsWithActions'; import { MutableDisposable } from 'vs/base/common/lifecycle'; +import { EditorActivation } from 'vs/platform/editor/common/editor'; /** * An implementation of editor for file system resources. @@ -230,7 +231,7 @@ export class TextFileEditor extends BaseTextEditor { // because we are triggering another openEditor() call // and do not control the initial intent that resulted // in us now opening as binary. - options.overwrite({ preserveActive: true, forceActive: false }); + options.overwrite({ activation: EditorActivation.PRESERVE }); this.editorService.openEditor(input, options, this.group); } diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 7fd4b47583e..98bf63fcd3c 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IInstantiationService, ServicesAccessor, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { IResourceInput, ITextEditorOptions, IEditorOptions } from 'vs/platform/editor/common/editor'; +import { IResourceInput, ITextEditorOptions, IEditorOptions, EditorActivation } from 'vs/platform/editor/common/editor'; import { IEditorInput, IEditor, GroupIdentifier, IFileEditorInput, IUntitledResourceInput, IResourceDiffInput, IResourceSideBySideInput, IEditorInputFactoryRegistry, Extensions as EditorExtensions, IFileInputFactory, EditorInput, SideBySideEditorInput, IEditorInputWithOptions, isEditorInputWithOptions, EditorOptions, TextEditorOptions, IEditorIdentifier, IEditorCloseEvent, ITextEditor, ITextDiffEditor, ITextSideBySideEditor, toResource, SideBySideEditor } from 'vs/workbench/common/editor'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { DataUriEditorInput } from 'vs/workbench/common/editor/dataUriEditorInput'; @@ -254,20 +254,19 @@ export class EditorService extends Disposable implements EditorServiceImpl { this.editorGroupService.activeGroup !== resolvedGroup && // only if target group is not already active typedOptions && !typedOptions.inactive && // never for inactive editors typedOptions.preserveFocus && // only if preserveFocus - typeof typedOptions.forceActive !== 'boolean' && // only if forceActive is not already defined (either true or false) - typeof typedOptions.preserveActive !== 'boolean' && // only if preserveActive is not already defined (either true or false) + typeof typedOptions.activation !== 'number' && // only if activation is not already defined (either true or false) candidateGroup !== SIDE_GROUP // never for the SIDE_GROUP ) { // If the resolved group is not the active one, we typically // want the group to become active. There are a few cases // where we stay away from encorcing this, e.g. if the caller - // is already providing `forceActive` or `preserveActive`. + // is already providing `activation`. // // Specifically for historic reasons we do not activate a // group is it is opened as `SIDE_GROUP` with `preserveFocus:true`. // repeated Alt-clicking of files in the explorer always open // into the same side group and not cause a group to be created each time. - typedOptions.overwrite({ forceActive: true }); + typedOptions.overwrite({ activation: EditorActivation.ACTIVATE }); } return this.doOpenEditor(resolvedGroup, typedEditor, typedOptions); diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index 2d0f5ec0bdd..c95a6138545 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -364,7 +364,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic const activeEditorGroup = this.editorGroupService.activeGroup; const sideEditorGroup = this.editorGroupService.addGroup(activeEditorGroup.id, GroupDirection.RIGHT); return Promise.all([ - this.editorService.openEditor({ resource: this.defaultSettingsRawResource, options: { pinned: true, preserveFocus: true, preserveActive: true, revealIfOpened: true }, label: nls.localize('defaultSettings', "Default Settings"), description: '' }), + this.editorService.openEditor({ resource: this.defaultSettingsRawResource, options: { pinned: true, preserveFocus: true, revealIfOpened: true }, label: nls.localize('defaultSettings', "Default Settings"), description: '' }), this.editorService.openEditor(editableSettingsEditorInput, { pinned: true, revealIfOpened: true }, sideEditorGroup.id) ]).then(([defaultEditor, editor]) => withNullAsUndefined(editor)); } else { From 32190475c75a5a98a4d492baa46098b1848c6f5a Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 09:44:50 -0700 Subject: [PATCH 117/163] Resize find widget on double click --- src/vs/editor/contrib/find/findWidget.css | 1 + src/vs/editor/contrib/find/findWidget.ts | 35 ++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/find/findWidget.css b/src/vs/editor/contrib/find/findWidget.css index 693157f51f6..20d486d1000 100644 --- a/src/vs/editor/contrib/find/findWidget.css +++ b/src/vs/editor/contrib/find/findWidget.css @@ -38,6 +38,7 @@ line-height: 19px; transition: top 200ms linear; padding: 0 4px; + box-sizing: border-box; } .monaco-editor .find-widget.hiddenEditor { diff --git a/src/vs/editor/contrib/find/findWidget.ts b/src/vs/editor/contrib/find/findWidget.ts index 2bfbe8388d3..70fc36df649 100644 --- a/src/vs/editor/contrib/find/findWidget.ts +++ b/src/vs/editor/contrib/find/findWidget.ts @@ -57,7 +57,7 @@ const NLS_MATCHES_COUNT_LIMIT_TITLE = nls.localize('title.matchesCountLimit', "O const NLS_MATCHES_LOCATION = nls.localize('label.matchesLocation', "{0} of {1}"); const NLS_NO_RESULTS = nls.localize('label.noResults', "No Results"); -const FIND_WIDGET_INITIAL_WIDTH = 411; +const FIND_WIDGET_INITIAL_WIDTH = 419; const PART_WIDTH = 275; const FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54; @@ -1172,6 +1172,39 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas this._findInput.inputBox.layout(); this._tryUpdateHeight(); })); + + this._register(this._resizeSash.onDidReset(() => { + // users double click on the sash + const currentWidth = dom.getTotalWidth(this._domNode); + + if (currentWidth < FIND_WIDGET_INITIAL_WIDTH) { + // The editor is narrow and the width of the find widget is controlled fully by CSS. + return; + } + + let width = FIND_WIDGET_INITIAL_WIDTH; + + if (!this._resized || currentWidth === FIND_WIDGET_INITIAL_WIDTH) { + // 1. never resized before, double click should maximizes it + // 2. users resized it already but its width is the same as default + width = this._codeEditor.getConfiguration().layoutInfo.width - 28 - this._codeEditor.getConfiguration().layoutInfo.minimapWidth - 15; + this._resized = true; + } else { + /** + * no op, the find widget should be shrinked to its default size. + */ + } + + const inputBoxWidth = width - FIND_ALL_CONTROLS_WIDTH; + + this._domNode.style.width = `${width}px`; + this._findInput.inputBox.width = inputBoxWidth; + if (this._isReplaceVisible) { + this._replaceInput.width = dom.getTotalWidth(this._findInput.domNode); + } + + this._findInput.inputBox.layout(); + })); } private updateAccessibilitySupport(): void { From 977fac4c1432b915068b54215a3dbfd5e00b5339 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Aug 2019 18:53:04 +0200 Subject: [PATCH 118/163] :lipstick: --- src/vs/platform/editor/common/editor.ts | 3 +++ .../services/preferences/common/preferences.ts | 10 +--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index 10618336e13..8ab806c05e4 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -88,6 +88,9 @@ export enum EditorActivation { /** * Preserve the current active editor. + * + * Note: will only work in combination with the + * `preserveFocus: true` option. */ PRESERVE } diff --git a/src/vs/workbench/services/preferences/common/preferences.ts b/src/vs/workbench/services/preferences/common/preferences.ts index 195631aa108..239a7409001 100644 --- a/src/vs/workbench/services/preferences/common/preferences.ts +++ b/src/vs/workbench/services/preferences/common/preferences.ts @@ -167,20 +167,12 @@ export class SettingsEditorOptions extends EditorOptions implements ISettingsEdi static create(settings: ISettingsEditorOptions): SettingsEditorOptions { const options = new SettingsEditorOptions(); + options.overwrite(settings); options.target = settings.target; options.folderUri = settings.folderUri; options.query = settings.query; - // IEditorOptions - options.preserveFocus = settings.preserveFocus; - options.forceReload = settings.forceReload; - options.revealIfVisible = settings.revealIfVisible; - options.revealIfOpened = settings.revealIfOpened; - options.pinned = settings.pinned; - options.index = settings.index; - options.inactive = settings.inactive; - return options; } } From bf20f93a9acb95b0d0ec0b2b863945ba33c4abe5 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 10:17:14 -0700 Subject: [PATCH 119/163] zap for inline diff actions icon. --- .../editor/browser/widget/inlineDiffMargin.ts | 27 ++++++++++--------- .../browser/widget/media/diffEditor.css | 8 ++++++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index 2bca61666b4..c565c2c3531 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -21,7 +21,7 @@ export interface IDiffLinesChange { } export class InlineDiffMargin extends Disposable { - private readonly _lightBulb: HTMLElement; + private readonly _diffActions: HTMLElement; constructor( marginDomNode: HTMLElement, @@ -35,15 +35,16 @@ export class InlineDiffMargin extends Disposable { // make sure the diff margin shows above overlay. marginDomNode.style.zIndex = '10'; - this._lightBulb = document.createElement('div'); - this._lightBulb.className = 'lightbulb-glyph'; - this._lightBulb.style.position = 'absolute'; + this._diffActions = document.createElement('div'); + this._diffActions.className = 'octicon octicon-zap'; + this._diffActions.style.position = 'absolute'; const lineHeight = editor.getConfiguration().lineHeight; const lineFeed = editor.getModel()!.getEOL(); - this._lightBulb.style.right = '0px'; - this._lightBulb.style.visibility = 'hidden'; - this._lightBulb.style.height = `${lineHeight}px`; - marginDomNode.appendChild(this._lightBulb); + this._diffActions.style.right = '0px'; + this._diffActions.style.visibility = 'hidden'; + this._diffActions.style.height = `${lineHeight}px`; + this._diffActions.style.lineHeight = `${lineHeight}px`; + marginDomNode.appendChild(this._diffActions); const actions = [ new Action( @@ -97,20 +98,20 @@ export class InlineDiffMargin extends Disposable { } this._register(dom.addStandardDisposableListener(marginDomNode, 'mouseenter', e => { - this._lightBulb.style.visibility = 'visible'; + this._diffActions.style.visibility = 'visible'; currentLineNumberOffset = this._updateLightBulbPosition(marginDomNode, e.y, lineHeight); })); this._register(dom.addStandardDisposableListener(marginDomNode, 'mouseleave', e => { - this._lightBulb.style.visibility = 'hidden'; + this._diffActions.style.visibility = 'hidden'; })); this._register(dom.addStandardDisposableListener(marginDomNode, 'mousemove', e => { currentLineNumberOffset = this._updateLightBulbPosition(marginDomNode, e.y, lineHeight); })); - this._register(dom.addStandardDisposableListener(this._lightBulb, 'mousedown', e => { - const { top, height } = dom.getDomNodePagePosition(this._lightBulb); + this._register(dom.addStandardDisposableListener(this._diffActions, 'mousedown', e => { + const { top, height } = dom.getDomNodePagePosition(this._diffActions); let pad = Math.floor(lineHeight / 3) + lineHeight; this._contextMenuService.showContextMenu({ getAnchor: () => { @@ -133,7 +134,7 @@ export class InlineDiffMargin extends Disposable { const offset = y - top; const lineNumberOffset = Math.floor(offset / lineHeight); const newTop = lineNumberOffset * lineHeight; - this._lightBulb.style.top = `${newTop}px`; + this._diffActions.style.top = `${newTop}px`; return lineNumberOffset; } } diff --git a/src/vs/editor/browser/widget/media/diffEditor.css b/src/vs/editor/browser/widget/media/diffEditor.css index d70b8b88043..34bb9ff391e 100644 --- a/src/vs/editor/browser/widget/media/diffEditor.css +++ b/src/vs/editor/browser/widget/media/diffEditor.css @@ -93,3 +93,11 @@ .monaco-editor .view-zones .view-lines .view-line span { display: inline-block; } + +.monaco-editor .margin-view-zones .octicon-zap { + opacity: 0.7; +} + +.monaco-editor .margin-view-zones .octicon-zap:hover { + cursor: pointer; +} From 74f7fee9a3ae8686f364632a5104e7868864171a Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 10:54:23 -0700 Subject: [PATCH 120/163] Allow hover on deleted text. --- .../editor/browser/widget/diffEditorWidget.ts | 2 +- .../editor/browser/widget/inlineDiffMargin.ts | 54 +++++++++++++------ 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 519cc25cbfd..fa0e688d696 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -130,7 +130,7 @@ class VisualEditorState { this._zonesMap[String(zoneId)] = true; if (newDecorations.zones[i].diff && viewZone.marginDomNode) { - this.inlineDiffMargins.push(new InlineDiffMargin(viewZone.marginDomNode, editor, newDecorations.zones[i].diff!, this._contextMenuService, this._clipboardService)); + this.inlineDiffMargins.push(new InlineDiffMargin(zoneId, viewZone.marginDomNode, editor, newDecorations.zones[i].diff!, this._contextMenuService, this._clipboardService)); } } }); diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index c565c2c3531..a4ade1fa094 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -9,6 +9,7 @@ import { Action } from 'vs/base/common/actions'; import { Disposable } from 'vs/base/common/lifecycle'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import * as editorBrowser from 'vs/editor/browser/editorBrowser'; import { Range } from 'vs/editor/common/core/range'; import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; @@ -23,8 +24,27 @@ export interface IDiffLinesChange { export class InlineDiffMargin extends Disposable { private readonly _diffActions: HTMLElement; + private _visibility: boolean = false; + + get visibility(): boolean { + return this._visibility; + } + + set visibility(_visibility: boolean) { + if (this._visibility !== _visibility) { + this._visibility = _visibility; + + if (_visibility) { + this._diffActions.style.visibility = 'visible'; + } else { + this._diffActions.style.visibility = 'hidden'; + } + } + } + constructor( - marginDomNode: HTMLElement, + private _viewZoneId: string, + private _marginDomNode: HTMLElement, public editor: CodeEditorWidget, public diff: IDiffLinesChange, private _contextMenuService: IContextMenuService, @@ -33,7 +53,7 @@ export class InlineDiffMargin extends Disposable { super(); // make sure the diff margin shows above overlay. - marginDomNode.style.zIndex = '10'; + this._marginDomNode.style.zIndex = '10'; this._diffActions = document.createElement('div'); this._diffActions.className = 'octicon octicon-zap'; @@ -44,7 +64,7 @@ export class InlineDiffMargin extends Disposable { this._diffActions.style.visibility = 'hidden'; this._diffActions.style.height = `${lineHeight}px`; this._diffActions.style.lineHeight = `${lineHeight}px`; - marginDomNode.appendChild(this._diffActions); + this._marginDomNode.appendChild(this._diffActions); const actions = [ new Action( @@ -97,19 +117,6 @@ export class InlineDiffMargin extends Disposable { })); } - this._register(dom.addStandardDisposableListener(marginDomNode, 'mouseenter', e => { - this._diffActions.style.visibility = 'visible'; - currentLineNumberOffset = this._updateLightBulbPosition(marginDomNode, e.y, lineHeight); - })); - - this._register(dom.addStandardDisposableListener(marginDomNode, 'mouseleave', e => { - this._diffActions.style.visibility = 'hidden'; - })); - - this._register(dom.addStandardDisposableListener(marginDomNode, 'mousemove', e => { - currentLineNumberOffset = this._updateLightBulbPosition(marginDomNode, e.y, lineHeight); - })); - this._register(dom.addStandardDisposableListener(this._diffActions, 'mousedown', e => { const { top, height } = dom.getDomNodePagePosition(this._diffActions); let pad = Math.floor(lineHeight / 3) + lineHeight; @@ -127,6 +134,21 @@ export class InlineDiffMargin extends Disposable { autoSelectFirstItem: true }); })); + + this._register(editor.onMouseMove((e: editorBrowser.IEditorMouseEvent) => { + if (e.target.type === editorBrowser.MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === editorBrowser.MouseTargetType.GUTTER_VIEW_ZONE) { + const viewZoneId = e.target.detail.viewZoneId; + + if (viewZoneId === this._viewZoneId) { + this.visibility = true; + currentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight); + } else { + this.visibility = false; + } + } else { + this.visibility = false; + } + })); } private _updateLightBulbPosition(marginDomNode: HTMLElement, y: number, lineHeight: number): number { From 237b9f34879531cef30cef379c366c3263fb9e84 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 11:16:04 -0700 Subject: [PATCH 121/163] Fix #79677. nsbp; --- .../common/modes/textToHtmlTokenizer.ts | 2 +- .../common/modes/textToHtmlTokenizer.test.ts | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/vs/editor/common/modes/textToHtmlTokenizer.ts b/src/vs/editor/common/modes/textToHtmlTokenizer.ts index 4b1afa955ea..af5a682bc37 100644 --- a/src/vs/editor/common/modes/textToHtmlTokenizer.ts +++ b/src/vs/editor/common/modes/textToHtmlTokenizer.ts @@ -78,7 +78,7 @@ export function tokenizeLineToHTML(text: string, viewLineTokens: IViewLineTokens break; case CharCode.Space: - partContent += ' '; + partContent += ' '; break; default: diff --git a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts index 56dda979b62..a8c5071cb9e 100644 --- a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts +++ b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts @@ -109,9 +109,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => { [ '

', 'Ciao', - ' ', + ' ', 'hello', - ' ', + ' ', 'world!', '
' ].join('') @@ -122,9 +122,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => { [ '
', 'Ciao', - ' ', + ' ', 'hello', - ' ', + ' ', 'w', '
' ].join('') @@ -135,9 +135,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => { [ '
', 'Ciao', - ' ', + ' ', 'hello', - ' ', + ' ', '
' ].join('') ); @@ -147,9 +147,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => { [ '
', 'iao', - ' ', + ' ', 'hello', - ' ', + ' ', '
' ].join('') ); @@ -158,9 +158,9 @@ suite('Editor Modes - textToHtmlTokenizer', () => { tokenizeLineToHTML(text, lineTokens, colorMap, 4, 11, 4), [ '
', - ' ', + ' ', 'hello', - ' ', + ' ', '
' ].join('') ); @@ -170,7 +170,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => { [ '
', 'hello', - ' ', + ' ', '
' ].join('') ); @@ -241,11 +241,11 @@ suite('Editor Modes - textToHtmlTokenizer', () => { tokenizeLineToHTML(text, lineTokens, colorMap, 0, 21, 4), [ '
', - '  ', + '  ', 'Ciao', - '   ', + '   ', 'hello', - ' ', + ' ', 'world!', '
' ].join('') @@ -255,11 +255,11 @@ suite('Editor Modes - textToHtmlTokenizer', () => { tokenizeLineToHTML(text, lineTokens, colorMap, 0, 17, 4), [ '
', - '  ', + '  ', 'Ciao', - '   ', + '   ', 'hello', - ' ', + ' ', 'wo', '
' ].join('') @@ -269,7 +269,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => { tokenizeLineToHTML(text, lineTokens, colorMap, 0, 3, 4), [ '
', - '  ', + '  ', 'C', '
' ].join('') From 355be5e7d3393eb6eb057722c4919e6c0d572f1a Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 26 Aug 2019 11:23:08 -0700 Subject: [PATCH 122/163] Fix #79725 --- .../ui/octiconLabel/octicons/octicons.css | 8 ++++---- .../ui/octiconLabel/octicons/octicons.svg | 4 ++-- .../ui/octiconLabel/octicons/octicons.ttf | Bin 37448 -> 37484 bytes .../ui/octiconLabel/octicons/octicons2.css | 8 ++++---- .../ui/octiconLabel/octicons/octicons2.ttf | Bin 35564 -> 35564 bytes 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css index 29ed93db1b1..381ae0fd1c1 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css @@ -1,7 +1,7 @@ @font-face { font-family: "octicons"; - src: url("./octicons.ttf?dda6b6d46f87b1fa91a76fc0389eeb1d") format("truetype"), -url("./octicons.svg?dda6b6d46f87b1fa91a76fc0389eeb1d#octicons") format("svg"); + src: url("./octicons.ttf?759e9adce5213a11e27cd79af7448e2e") format("truetype"), +url("./octicons.svg?759e9adce5213a11e27cd79af7448e2e#octicons") format("svg"); } .octicon, .mega-octicon { @@ -233,8 +233,8 @@ url("./octicons.svg?dda6b6d46f87b1fa91a76fc0389eeb1d#octicons") format("svg"); .octicon-watch:before { content: "\f0e0" } .octicon-x:before { content: "\f081" } .octicon-zap:before { content: "\26a1" } -.octicon-error:before { content: "\26a2" } -.octicon-eye-closed:before { content: "\26a3" } +.octicon-error:before { content: "\26b1" } +.octicon-eye-closed:before { content: "\26b0" } .octicon-fold-down:before { content: "\26a4" } .octicon-fold-up:before { content: "\26a5" } .octicon-github-action:before { content: "\26a6" } diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg index 48f7d1b2220..8eca48d0e17 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg @@ -167,10 +167,10 @@ unicode="" horiz-adv-x="750" d=" M687.5 507.5H62.5C28.125 507.5 0 479.375 0 445V195C0 160.625 28.125 132.5 62.5 132.5H687.5C721.875 132.5 750 160.625 750 195V445C750 479.375 721.875 507.5 687.5 507.5zM250 257.5H125V382.5H250V257.5zM437.5 257.5H312.5V382.5H437.5V257.5zM625 257.5H500V382.5H625V257.5z" /> c@`4Er3`}AL`NbuVln3G5acz&C&4BX5w7=Ykr=cR8jdNT{- zduClN21bwovkC($f%{Nty0@KS&lV^No~XAD%SP& z3_#^EK$yo+z)-@_282@>rZLQ5n8R>~;Ss|VMh->+Mj=KCMioXiMh!+SAk+auJw^jY zBSsrAbYO%)Cq_3Q3}6gljA4vpOkgZyECX5`!my8_nxTQgg~62}fFX*ZnV}bGzBz*# zLmJSgiJKR&r803o04fB5J(Kx3m3gZf7}OR+Fhj#+JI*jMwGBWn5CiowsBMH`2D8nR IIJb2G0FL2Q1ONa4 delta 330 zcmaE}gz3Z*rU?cr(-j4z85md|Ffi~uOV6oHEB5}9%D^D(!N5@bB_lO4Mdri0BNIc6 z8Ba{?kQcOJU|G;tm5DGd8R9@%%Pl8Mv8WFaW{LYSVQvdNT{- zduDAp21bwovjhV(n56@xxqz0+F|aVb0ZK$MI54m>NU5c&t(vUB8Z)_$b$vY}P&A4m zhoOL>2?!@JOk$YAFoWR+!##!vj4X^ijC_nDj0%iOj4F(3K&SzPT8ui3dW;reXu}AB zc8pFy=))Mm7{M6D7{ge^SOl~$gkc|p8G|{43xg{|0MM3ZhF*qg3~4|cCNfM0+QiRL owRsC$EEDGmkh6hc*JLS9WnQ3<)fPiAgZX4H&allpIJa~F0Jnom?*IS* diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css b/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css index 2e45f180521..aa31d3d92b1 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css @@ -1,7 +1,7 @@ @font-face { font-family: "octicons2"; - src: url("./octicons2.ttf?dee9935d8deb764a470d194d9f0d07f7") format("truetype"), -url("./octicons2.svg?dee9935d8deb764a470d194d9f0d07f7#octicons2") format("svg"); + src: url("./octicons2.ttf?e9cbaa049a291f47ea2a38815e18222e") format("truetype"), +url("./octicons2.svg?e9cbaa049a291f47ea2a38815e18222e#octicons2") format("svg"); } .octicon, .mega-octicon { @@ -157,7 +157,7 @@ url("./octicons2.svg?dee9935d8deb764a470d194d9f0d07f7#octicons2") format("svg"); .octicon-note:before { content: "\f289" } .octicon-octoface:before { content: "\f008" } .octicon-organization:before { content: "\f037" } -.octicon-organization-filled:before { content: "\26a2" } +.octicon-organization-filled:before { content: "\f037" } .octicon-organization-outline:before { content: "\f037" } .octicon-package:before { content: "\f0c4" } .octicon-paintcan:before { content: "\f0d1" } @@ -165,7 +165,7 @@ url("./octicons2.svg?dee9935d8deb764a470d194d9f0d07f7#octicons2") format("svg"); .octicon-person-add:before { content: "\f018" } .octicon-person-follow:before { content: "\f018" } .octicon-person:before { content: "\f018" } -.octicon-person-filled:before { content: "\26a3" } +.octicon-person-filled:before { content: "\f018" } .octicon-person-outline:before { content: "\f018" } .octicon-pin:before { content: "\f041" } .octicon-plug:before { content: "\f0d4" } diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.ttf b/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.ttf index daa9a772ad2ea0963483e58ae0f3d30c2d558cc9..2f462482ad5b0dae13f8b7f2f281cfedd699d10d 100644 GIT binary patch delta 48 xcmaDemFdk?rU`+}QqOHBhD?<%_^>jb-{va=H}eYyAh_9i@g0ob%)7t+p|q-{va=H}eYyAh=oYk^`eRvoOBs1OT$M5Xk@l From 845202c59ee061846428ad834830f7fb79eb9a1a Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Mon, 26 Aug 2019 11:52:26 -0700 Subject: [PATCH 123/163] allow select/copy on dialogs fixes #71407 --- src/vs/base/browser/ui/dialog/dialog.ts | 7 ------- .../platform/dialogs/browser/dialogService.ts | 20 ++++++++++++++++--- .../dialogs/electron-browser/dialogService.ts | 8 +++++--- .../progress/browser/progressService.ts | 4 +++- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/vs/base/browser/ui/dialog/dialog.ts b/src/vs/base/browser/ui/dialog/dialog.ts index f6b707d975d..a587602b606 100644 --- a/src/vs/base/browser/ui/dialog/dialog.ts +++ b/src/vs/base/browser/ui/dialog/dialog.ts @@ -109,13 +109,6 @@ export class Dialog extends Disposable { return; } - if (this.modal) { - this._register(domEvent(this.modal, 'mousedown')(e => { - // Used to stop focusing of modal with mouse - EventHelper.stop(e, true); - })); - } - clearNode(this.buttonsContainer); let focusedButton = 0; diff --git a/src/vs/platform/dialogs/browser/dialogService.ts b/src/vs/platform/dialogs/browser/dialogService.ts index 347e242dd6d..c3abeb610f4 100644 --- a/src/vs/platform/dialogs/browser/dialogService.ts +++ b/src/vs/platform/dialogs/browser/dialogService.ts @@ -14,14 +14,18 @@ import { attachDialogStyler } from 'vs/platform/theme/common/styler'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { EventHelper } from 'vs/base/browser/dom'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; export class DialogService implements IDialogService { _serviceBrand: any; + private allowableCommands = ['copy', 'cut']; + constructor( @ILogService private readonly logService: ILogService, @ILayoutService private readonly layoutService: ILayoutService, - @IThemeService private readonly themeService: IThemeService + @IThemeService private readonly themeService: IThemeService, + @IKeybindingService private readonly keybindingService: IKeybindingService ) { } async confirm(confirmation: IConfirmation): Promise { @@ -50,7 +54,12 @@ export class DialogService implements IDialogService { cancelId: 1, type: confirmation.type, keyEventProcessor: (event: StandardKeyboardEvent) => { - EventHelper.stop(event, true); + const resolved = this.keybindingService.softDispatch(event, this.layoutService.container); + if (resolved && resolved.commandId) { + if (this.allowableCommands.indexOf(resolved.commandId) === -1) { + EventHelper.stop(event, true); + } + } }, checkboxChecked: confirmation.checkbox ? confirmation.checkbox.checked : undefined, checkboxLabel: confirmation.checkbox ? confirmation.checkbox.label : undefined @@ -82,7 +91,12 @@ export class DialogService implements IDialogService { cancelId: options ? options.cancelId : undefined, type: this.getDialogType(severity), keyEventProcessor: (event: StandardKeyboardEvent) => { - EventHelper.stop(event, true); + const resolved = this.keybindingService.softDispatch(event, this.layoutService.container); + if (resolved && resolved.commandId) { + if (this.allowableCommands.indexOf(resolved.commandId) === -1) { + EventHelper.stop(event, true); + } + } } }); diff --git a/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts b/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts index 02c36b66e4c..aa507c8c7c8 100644 --- a/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts +++ b/src/vs/workbench/services/dialogs/electron-browser/dialogService.ts @@ -18,6 +18,7 @@ import { DialogChannel } from 'vs/platform/dialogs/node/dialogIpc'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; interface IMassagedMessageBoxOptions { @@ -45,12 +46,13 @@ export class DialogService implements IDialogService { @ILayoutService layoutService: ILayoutService, @IThemeService themeService: IThemeService, @IWindowService windowService: IWindowService, - @ISharedProcessService sharedProcessService: ISharedProcessService + @ISharedProcessService sharedProcessService: ISharedProcessService, + @IKeybindingService keybindingService: IKeybindingService ) { // Use HTML based dialogs if (configurationService.getValue('workbench.dialogs.customEnabled') === true) { - this.impl = new HTMLDialogService(logService, layoutService, themeService); + this.impl = new HTMLDialogService(logService, layoutService, themeService, keybindingService); } // Electron dialog service else { @@ -187,4 +189,4 @@ class NativeDialogService implements IDialogService { } } -registerSingleton(IDialogService, DialogService, true); \ No newline at end of file +registerSingleton(IDialogService, DialogService, true); diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index d4cef4f51f4..ce204f1c0f6 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -348,7 +348,9 @@ export class ProgressService extends Disposable implements IProgressService { const disposables = new DisposableStore(); const allowableCommands = [ 'workbench.action.quit', - 'workbench.action.reloadWindow' + 'workbench.action.reloadWindow', + 'copy', + 'cut' ]; let dialog: Dialog; From f5407658656814d3f508b263da8bd511d6df2700 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 26 Aug 2019 11:55:59 -0700 Subject: [PATCH 124/163] Disable new Octicons for endgame More info: https://github.com/microsoft/vscode/issues/76909#issuecomment-524976250 --- src/vs/workbench/browser/workbench.contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index 5504ef50307..46ce4c1a57c 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -242,7 +242,7 @@ import { isMacintosh, isWindows, isLinux, isWeb } from 'vs/base/common/platform' }, 'workbench.octiconsUpdate.enabled': { 'type': 'boolean', - 'default': true, + 'default': false, 'description': nls.localize('workbench.octiconsUpdate.enabled', "Controls the visibility of the new Octicons style in the workbench.") } } From fcd92d81da0c4ab145f4ffa721b40640e640727f Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 13:17:28 -0700 Subject: [PATCH 125/163] Revert zap. --- src/vs/editor/browser/widget/inlineDiffMargin.ts | 2 +- src/vs/editor/browser/widget/media/diffEditor.css | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index a4ade1fa094..8f71c93fce0 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -56,7 +56,7 @@ export class InlineDiffMargin extends Disposable { this._marginDomNode.style.zIndex = '10'; this._diffActions = document.createElement('div'); - this._diffActions.className = 'octicon octicon-zap'; + this._diffActions.className = 'octicon octicon-light-bulb'; this._diffActions.style.position = 'absolute'; const lineHeight = editor.getConfiguration().lineHeight; const lineFeed = editor.getModel()!.getEOL(); diff --git a/src/vs/editor/browser/widget/media/diffEditor.css b/src/vs/editor/browser/widget/media/diffEditor.css index 34bb9ff391e..bb1ee7ad0b8 100644 --- a/src/vs/editor/browser/widget/media/diffEditor.css +++ b/src/vs/editor/browser/widget/media/diffEditor.css @@ -94,10 +94,10 @@ display: inline-block; } -.monaco-editor .margin-view-zones .octicon-zap { - opacity: 0.7; +.monaco-editor .margin-view-zones .octicon-light-bulb { + opacity: 0.6; } -.monaco-editor .margin-view-zones .octicon-zap:hover { +.monaco-editor .margin-view-zones .octicon-light-bulb:hover { cursor: pointer; } From 12a9da7c5ddc071ea5e71e54caf43dc4f480e795 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 13:17:50 -0700 Subject: [PATCH 126/163] Do no show line action when the deletion is one line. --- .../editor/browser/widget/inlineDiffMargin.ts | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index 8f71c93fce0..cd7bdfe36be 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -80,17 +80,21 @@ export class InlineDiffMargin extends Disposable { let currentLineNumberOffset = 0; - const copyLineAction = new Action( - 'diff.clipboard.copyDeletedLineContent', - nls.localize('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line {0} content to clipboard", diff.originalStartLineNumber), - undefined, - true, - async () => { - await this._clipboardService.writeText(diff.originalContent[currentLineNumberOffset]); - } - ); + let copyLineAction: Action | undefined = undefined; - actions.push(copyLineAction); + if (diff.originalEndLineNumber > diff.modifiedStartLineNumber) { + copyLineAction = new Action( + 'diff.clipboard.copyDeletedLineContent', + nls.localize('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line {0} content to clipboard", diff.originalStartLineNumber), + undefined, + true, + async () => { + await this._clipboardService.writeText(diff.originalContent[currentLineNumberOffset]); + } + ); + + actions.push(copyLineAction); + } const readOnly = editor.getConfiguration().readOnly; if (!readOnly) { @@ -128,7 +132,9 @@ export class InlineDiffMargin extends Disposable { }; }, getActions: () => { - copyLineAction.label = nls.localize('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line {0} content to clipboard", diff.originalStartLineNumber + currentLineNumberOffset); + if (copyLineAction) { + copyLineAction.label = nls.localize('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line {0} content to clipboard", diff.originalStartLineNumber + currentLineNumberOffset); + } return actions; }, autoSelectFirstItem: true From 4eef1c0dfb46822807b83797cd1386c857500a44 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 13:36:02 -0700 Subject: [PATCH 127/163] svg is necessary in monaco. --- src/vs/editor/browser/widget/inlineDiffMargin.ts | 2 +- src/vs/editor/browser/widget/media/diffEditor.css | 11 ++++++++--- src/vs/editor/browser/widget/media/lightbulb-dark.svg | 3 +++ .../editor/browser/widget/media/lightbulb-light.svg | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/vs/editor/browser/widget/media/lightbulb-dark.svg create mode 100644 src/vs/editor/browser/widget/media/lightbulb-light.svg diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index cd7bdfe36be..2b3b53035c2 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -56,7 +56,7 @@ export class InlineDiffMargin extends Disposable { this._marginDomNode.style.zIndex = '10'; this._diffActions = document.createElement('div'); - this._diffActions.className = 'octicon octicon-light-bulb'; + this._diffActions.className = 'lightbulb-glyph'; this._diffActions.style.position = 'absolute'; const lineHeight = editor.getConfiguration().lineHeight; const lineFeed = editor.getModel()!.getEOL(); diff --git a/src/vs/editor/browser/widget/media/diffEditor.css b/src/vs/editor/browser/widget/media/diffEditor.css index bb1ee7ad0b8..d1d0e48f366 100644 --- a/src/vs/editor/browser/widget/media/diffEditor.css +++ b/src/vs/editor/browser/widget/media/diffEditor.css @@ -94,10 +94,15 @@ display: inline-block; } -.monaco-editor .margin-view-zones .octicon-light-bulb { - opacity: 0.6; +.monaco-editor .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph { + background: url('lightbulb-light.svg') center center no-repeat; } -.monaco-editor .margin-view-zones .octicon-light-bulb:hover { +.monaco-editor.vs-dark .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph, +.monaco-editor.hc-dark .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph { + background: url('lightbulb-dark.svg') center center no-repeat; +} + +.monaco-editor .margin-view-zones .lightbulb-glyph:hover { cursor: pointer; } diff --git a/src/vs/editor/browser/widget/media/lightbulb-dark.svg b/src/vs/editor/browser/widget/media/lightbulb-dark.svg new file mode 100644 index 00000000000..5fe8931a815 --- /dev/null +++ b/src/vs/editor/browser/widget/media/lightbulb-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/editor/browser/widget/media/lightbulb-light.svg b/src/vs/editor/browser/widget/media/lightbulb-light.svg new file mode 100644 index 00000000000..191c566fd2c --- /dev/null +++ b/src/vs/editor/browser/widget/media/lightbulb-light.svg @@ -0,0 +1,4 @@ + + + + From a66e9d483503850e2f66f0f3d05060b99dfd851c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 26 Aug 2019 13:39:56 -0700 Subject: [PATCH 128/163] Don't dispose markdown preview emitters before firing events Fixes #79827 --- extensions/markdown-language-features/src/features/preview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index 3ee4d26f4f2..b77d62b339c 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -271,7 +271,6 @@ export class MarkdownPreview extends Disposable { } public dispose() { - super.dispose(); if (this._disposed) { return; } @@ -282,6 +281,7 @@ export class MarkdownPreview extends Disposable { this._onDidChangeViewStateEmitter.dispose(); this.editor.dispose(); + super.dispose(); } public update(resource: vscode.Uri) { From 9f49056ec7ece19d69507dfe956fb3aae8fc355c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 26 Aug 2019 13:42:41 -0700 Subject: [PATCH 129/163] Only allow protocol links in webview on desktop VS Code Fixes #79647 --- src/vs/workbench/api/browser/mainThreadWebview.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/browser/mainThreadWebview.ts b/src/vs/workbench/api/browser/mainThreadWebview.ts index d657e9d0d96..efa62bc5c75 100644 --- a/src/vs/workbench/api/browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/browser/mainThreadWebview.ts @@ -5,6 +5,7 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; +import { isWeb } from 'vs/base/common/platform'; import { startsWith } from 'vs/base/common/strings'; import { URI, UriComponents } from 'vs/base/common/uri'; import * as modes from 'vs/editor/common/modes'; @@ -314,7 +315,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews if (MainThreadWebviews.standardSupportedLinkSchemes.has(link.scheme)) { return true; } - if (this._productService.urlProtocol === link.scheme) { + if (!isWeb && this._productService.urlProtocol === link.scheme) { return true; } return !!webview.webview.contentOptions.enableCommandUris && link.scheme === 'command'; From 6d170734ab1985494002ecc7d9089b7b17bfbf50 Mon Sep 17 00:00:00 2001 From: Aminadav Glickshtein Date: Mon, 26 Aug 2019 23:56:19 +0300 Subject: [PATCH 130/163] Fix typo in tasks jsonSchema --- src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts index f21b1b2bbc2..2bc975f1cf4 100644 --- a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts +++ b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts @@ -98,7 +98,7 @@ const presentation: IJSONSchema = { showReuseMessage: true, clear: false, }, - description: nls.localize('JsonSchema.tasks.presentation', 'Configures the panel that is used to present the task\'s ouput and reads its input.'), + description: nls.localize('JsonSchema.tasks.presentation', 'Configures the panel that is used to present the task\'s output and reads its input.'), additionalProperties: false, properties: { echo: { From c5c750332c1efe476a9c0ef67283ad39f7e99dab Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 26 Aug 2019 23:34:23 +0200 Subject: [PATCH 131/163] no need to list chrome separtors, default editor ones are just fine --- src/vs/editor/contrib/wordOperations/wordOperations.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/contrib/wordOperations/wordOperations.ts b/src/vs/editor/contrib/wordOperations/wordOperations.ts index 3f330238e9e..e104f52a534 100644 --- a/src/vs/editor/contrib/wordOperations/wordOperations.ts +++ b/src/vs/editor/contrib/wordOperations/wordOperations.ts @@ -20,6 +20,7 @@ import { ITextModel } from 'vs/editor/common/model'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vs/platform/accessibility/common/accessibility'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +import { EDITOR_DEFAULTS } from 'vs/editor/common/config/editorOptions'; export interface MoveWordOptions extends ICommandOptions { inSelectionMode: boolean; @@ -172,7 +173,6 @@ export class CursorWordLeftSelect extends WordLeftCommand { } } -const CHROME_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;",.<>/?'; export class CursorWordAccessibilityLeft extends WordLeftCommand { constructor() { super({ @@ -190,7 +190,7 @@ export class CursorWordAccessibilityLeft extends WordLeftCommand { } protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { - return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + return super._move(getMapForWordSeparators(EDITOR_DEFAULTS.wordSeparators), model, position, wordNavigationType); } } @@ -211,7 +211,7 @@ export class CursorWordAccessibilityLeftSelect extends WordLeftCommand { } protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { - return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + return super._move(getMapForWordSeparators(EDITOR_DEFAULTS.wordSeparators), model, position, wordNavigationType); } } @@ -310,7 +310,7 @@ export class CursorWordAccessibilityRight extends WordRightCommand { } protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { - return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + return super._move(getMapForWordSeparators(EDITOR_DEFAULTS.wordSeparators), model, position, wordNavigationType); } } @@ -331,7 +331,7 @@ export class CursorWordAccessibilityRightSelect extends WordRightCommand { } protected _move(_: WordCharacterClassifier, model: ITextModel, position: Position, wordNavigationType: WordNavigationType): Position { - return super._move(getMapForWordSeparators(CHROME_SEPARATORS), model, position, wordNavigationType); + return super._move(getMapForWordSeparators(EDITOR_DEFAULTS.wordSeparators), model, position, wordNavigationType); } } From 91e99652cd5fcfc072387c64e151b435e39e8dcf Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 26 Aug 2019 14:51:18 -0700 Subject: [PATCH 132/163] Fix js/ts refactorings --- .../typescript-language-features/src/features/refactor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/features/refactor.ts b/extensions/typescript-language-features/src/features/refactor.ts index f4ed0f6726f..9b7bd258280 100644 --- a/extensions/typescript-language-features/src/features/refactor.ts +++ b/extensions/typescript-language-features/src/features/refactor.ts @@ -158,7 +158,6 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { return undefined; } - const args: Proto.GetApplicableRefactorsRequestArgs = typeConverters.Range.toFileRangeRequestArgs(fileSchemes.file, rangeOrSelection); const response = await this.client.interruptGetErr(() => { const file = this.client.toOpenedFilePath(document); if (!file) { @@ -166,6 +165,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { } this.formattingOptionsManager.ensureConfigurationForDocument(document, token); + const args: Proto.GetApplicableRefactorsRequestArgs = typeConverters.Range.toFileRangeRequestArgs(file, rangeOrSelection); return this.client.execute('getApplicableRefactors', args, token); }); if (!response || response.type !== 'response' || !response.body) { From 0b974776ddd74148c5f84727ab9f36a44d45a87e Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 26 Aug 2019 15:38:16 -0700 Subject: [PATCH 133/163] avoid focus steal when show context menu. --- src/vs/editor/browser/widget/inlineDiffMargin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index 2b3b53035c2..a22ba9975f8 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -123,7 +123,8 @@ export class InlineDiffMargin extends Disposable { this._register(dom.addStandardDisposableListener(this._diffActions, 'mousedown', e => { const { top, height } = dom.getDomNodePagePosition(this._diffActions); - let pad = Math.floor(lineHeight / 3) + lineHeight; + let pad = Math.floor(lineHeight / 3); + e.preventDefault(); this._contextMenuService.showContextMenu({ getAnchor: () => { return { From f3e9e7c3e459563fdf3bcdba62ca7f6c80aa270c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 26 Aug 2019 15:18:42 -0700 Subject: [PATCH 134/163] Spell --- src/vs/vscode.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index e047c9c2d95..4dc574405a2 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5927,7 +5927,7 @@ declare module 'vscode' { /** * Convert a uri for the local file system to one that can be used inside webviews. * - * Webviews cannot directly load resoruces from the workspace or local file system using `file:` uris. The + * Webviews cannot directly load resources from the workspace or local file system using `file:` uris. The * `asWebviewUri` function takes a local `file:` uri and converts it into a uri that can be used inside of * a webview to load the same resource: * From 78879b6a8116e5ecee3f95809ac49fb1ab0bb206 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 26 Aug 2019 15:42:04 -0700 Subject: [PATCH 135/163] Log missing csp on extension host instead of main window --- src/vs/workbench/api/browser/mainThreadWebview.ts | 1 + src/vs/workbench/api/common/extHost.protocol.ts | 1 + src/vs/workbench/api/common/extHostWebview.ts | 7 +++++++ .../webview/browser/dynamicWebviewEditorOverlay.ts | 7 ++++++- src/vs/workbench/contrib/webview/browser/webview.ts | 1 + .../contrib/webview/electron-browser/webviewElement.ts | 8 ++++++-- 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadWebview.ts b/src/vs/workbench/api/browser/mainThreadWebview.ts index efa62bc5c75..18e94e7f297 100644 --- a/src/vs/workbench/api/browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/browser/mainThreadWebview.ts @@ -271,6 +271,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews } webview.webview.state = newState; }); + input.webview.onMissingCsp((extension: ExtensionIdentifier) => this._proxy.$onMissingCsp(handle, extension.value)); } private updateWebviewViewStates() { diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 01955cf7dfa..4157cf87e78 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -559,6 +559,7 @@ export interface WebviewPanelViewStateData { export interface ExtHostWebviewsShape { $onMessage(handle: WebviewPanelHandle, message: any): void; + $onMissingCsp(handle: WebviewPanelHandle, extensionId: string): void; $onDidChangeWebviewPanelViewStates(newState: WebviewPanelViewStateData): void; $onDidDisposeWebviewPanel(handle: WebviewPanelHandle): Promise; $deserializeWebviewPanel(newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise; diff --git a/src/vs/workbench/api/common/extHostWebview.ts b/src/vs/workbench/api/common/extHostWebview.ts index 168e49abca7..d4b554e00cc 100644 --- a/src/vs/workbench/api/common/extHostWebview.ts +++ b/src/vs/workbench/api/common/extHostWebview.ts @@ -298,6 +298,13 @@ export class ExtHostWebviews implements ExtHostWebviewsShape { } } + public $onMissingCsp( + _handle: WebviewPanelHandle, + extensionId: string + ): void { + console.warn(`${extensionId} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`); + } + public $onDidChangeWebviewPanelViewStates(newStates: WebviewPanelViewStateData): void { const handles = Object.keys(newStates); // Notify webviews of state changes in the following order: diff --git a/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts b/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts index ead4c72d910..01aa54b6ba2 100644 --- a/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts +++ b/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts @@ -3,12 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { memoize } from 'vs/base/common/decorators'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable, DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; +import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IWebviewService, Webview, WebviewContentOptions, WebviewEditorOverlay, WebviewElement, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview'; import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; -import { memoize } from 'vs/base/common/decorators'; /** * Webview editor overlay that creates and destroys the underlying webview as needed. @@ -76,6 +77,7 @@ export class DynamicWebviewEditorOverlay extends Disposable implements WebviewEd webview.onDidFocus(() => { this._onDidFocus.fire(); }, undefined, this._webviewEvents); webview.onDidClickLink(x => { this._onDidClickLink.fire(x); }, undefined, this._webviewEvents); webview.onMessage(x => { this._onMessage.fire(x); }, undefined, this._webviewEvents); + webview.onMissingCsp(x => { this._onMissingCsp.fire(x); }, undefined, this._webviewEvents); webview.onDidScroll(x => { this._initialScrollProgress = x.scrollYPercentage; @@ -132,6 +134,9 @@ export class DynamicWebviewEditorOverlay extends Disposable implements WebviewEd private readonly _onMessage = this._register(new Emitter()); public readonly onMessage: Event = this._onMessage.event; + private readonly _onMissingCsp = this._register(new Emitter()); + public readonly onMissingCsp: Event = this._onMissingCsp.event; + sendMessage(data: any): void { if (this._webview.value) { this._webview.value.sendMessage(data); diff --git a/src/vs/workbench/contrib/webview/browser/webview.ts b/src/vs/workbench/contrib/webview/browser/webview.ts index e7ef6086eaf..13d66c71fea 100644 --- a/src/vs/workbench/contrib/webview/browser/webview.ts +++ b/src/vs/workbench/contrib/webview/browser/webview.ts @@ -70,6 +70,7 @@ export interface Webview extends IDisposable { readonly onDidScroll: Event<{ scrollYPercentage: number }>; readonly onDidUpdateState: Event; readonly onMessage: Event; + readonly onMissingCsp: Event; sendMessage(data: any): void; update( diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index ac65e4df36a..a52dc525f08 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -13,14 +13,15 @@ import { URI } from 'vs/base/common/uri'; import * as modes from 'vs/editor/common/modes'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITunnelService } from 'vs/platform/remote/common/tunnel'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; +import { Webview, WebviewContentOptions, WebviewOptions, WebviewResourceScheme } from 'vs/workbench/contrib/webview/browser/webview'; import { WebviewPortMappingManager } from 'vs/workbench/contrib/webview/common/portMapping'; import { getWebviewThemeData } from 'vs/workbench/contrib/webview/common/themeing'; -import { Webview, WebviewContentOptions, WebviewOptions, WebviewResourceScheme } from 'vs/workbench/contrib/webview/browser/webview'; import { registerFileProtocol } from 'vs/workbench/contrib/webview/electron-browser/webviewProtocols'; import { areWebviewInputOptionsEqual } from '../browser/webviewEditorService'; import { WebviewFindWidget } from '../browser/webviewFindWidget'; @@ -426,6 +427,9 @@ export class ElectronWebviewBasedWebview extends Disposable implements Webview { private readonly _onMessage = this._register(new Emitter()); public readonly onMessage = this._onMessage.event; + private readonly _onMissingCsp = this._register(new Emitter()); + public readonly onMissingCsp = this._onMissingCsp.event; + private _send(channel: string, data?: any): void { this._ready .then(() => { @@ -522,7 +526,7 @@ export class ElectronWebviewBasedWebview extends Disposable implements Webview { if (this._options.extension && this._options.extension.id) { if (this._environementService.isExtensionDevelopment) { - console.warn(`${this._options.extension.id.value} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`); + this._onMissingCsp.fire(this._options.extension.id); } type TelemetryClassification = { From e4ea93b8fd8697e92510adf14723172361ae3f7c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 26 Aug 2019 16:01:19 -0700 Subject: [PATCH 136/163] Fix browser build --- .../contrib/webview/browser/webviewElement.ts | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts index 9364cf5c6b4..a7b1d1bd42a 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts @@ -3,20 +3,21 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { addClass, addDisposableListener } from 'vs/base/browser/dom'; import { Emitter } from 'vs/base/common/event'; -import { URI } from 'vs/base/common/uri'; -import { Webview, WebviewContentOptions, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview'; -import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IFileService } from 'vs/platform/files/common/files'; import { Disposable } from 'vs/base/common/lifecycle'; -import { areWebviewInputOptionsEqual } from 'vs/workbench/contrib/webview/browser/webviewEditorService'; -import { addDisposableListener, addClass } from 'vs/base/browser/dom'; -import { getWebviewThemeData } from 'vs/workbench/contrib/webview/common/themeing'; +import { URI } from 'vs/base/common/uri'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { loadLocalResource } from 'vs/workbench/contrib/webview/common/resourceLoader'; -import { WebviewPortMappingManager } from 'vs/workbench/contrib/webview/common/portMapping'; +import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; +import { IFileService } from 'vs/platform/files/common/files'; import { ITunnelService } from 'vs/platform/remote/common/tunnel'; +import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; +import { Webview, WebviewContentOptions, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview'; +import { areWebviewInputOptionsEqual } from 'vs/workbench/contrib/webview/browser/webviewEditorService'; +import { WebviewPortMappingManager } from 'vs/workbench/contrib/webview/common/portMapping'; +import { loadLocalResource } from 'vs/workbench/contrib/webview/common/resourceLoader'; +import { getWebviewThemeData } from 'vs/workbench/contrib/webview/common/themeing'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; interface WebviewContent { readonly html: string; @@ -231,6 +232,10 @@ export class IFrameWebview extends Disposable implements Webview { private readonly _onMessage = this._register(new Emitter()); public readonly onMessage = this._onMessage.event; + private readonly _onMissingCsp = this._register(new Emitter()); + public readonly onMissingCsp = this._onMissingCsp.event; + + sendMessage(data: any): void { this._send('message', data); } From 383b36f714e304ec6e4e5f5989f1b0b194ee364d Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Fri, 23 Aug 2019 19:30:58 -0700 Subject: [PATCH 137/163] Improve link protection --- src/vs/platform/product/common/product.ts | 1 + .../contrib/url/common/url.contribution.ts | 60 ++++++++++++------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts index 7122abcc6f5..460ce163168 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -87,6 +87,7 @@ export interface IProductConfiguration { }; readonly portable?: string; readonly uiExtensions?: readonly string[]; + readonly linkProtectionTrustedDomains?: readonly string[]; } export interface IExeBasedExtensionTip { diff --git a/src/vs/workbench/contrib/url/common/url.contribution.ts b/src/vs/workbench/contrib/url/common/url.contribution.ts index af92998139d..afc5e18dfab 100644 --- a/src/vs/workbench/contrib/url/common/url.contribution.ts +++ b/src/vs/workbench/contrib/url/common/url.contribution.ts @@ -50,29 +50,20 @@ Registry.as(ActionExtensions.WorkbenchActions).registe localize('developer', 'Developer') ); -const DEAFULT_TRUSTED_DOMAINS = [ - 'https://code.visualstudio.com', - 'https://go.microsoft.com', - 'https://github.com', - 'https://marketplace.visualstudio.com', - 'https://vscode-auth.github.com' -]; - const configureTrustedDomainsHandler = async ( quickInputService: IQuickInputService, storageService: IStorageService, + linkProtectionTrustedDomains: string[], domainToConfigure?: string ) => { - let trustedDomains: string[] = DEAFULT_TRUSTED_DOMAINS; - try { - const trustedDomainsSrc = storageService.get('http.trustedDomains', StorageScope.GLOBAL); + const trustedDomainsSrc = storageService.get('http.linkProtectionTrustedDomains', StorageScope.GLOBAL); if (trustedDomainsSrc) { - trustedDomains = JSON.parse(trustedDomainsSrc); + linkProtectionTrustedDomains = JSON.parse(trustedDomainsSrc); } } catch (err) { } - const domainQuickPickItems: IQuickPickItem[] = trustedDomains + const domainQuickPickItems: IQuickPickItem[] = linkProtectionTrustedDomains .filter(d => d !== '*') .map(d => { return { @@ -88,12 +79,12 @@ const configureTrustedDomainsHandler = async ( type: 'item', label: localize('openAllLinksWithoutPrompt', 'Open all links without prompt'), id: '*', - picked: trustedDomains.indexOf('*') !== -1 + picked: linkProtectionTrustedDomains.indexOf('*') !== -1 } ]; let domainToConfigureItem: IQuickPickItem | undefined = undefined; - if (domainToConfigure && trustedDomains.indexOf(domainToConfigure) === -1) { + if (domainToConfigure && linkProtectionTrustedDomains.indexOf(domainToConfigure) === -1) { domainToConfigureItem = { type: 'item', label: domainToConfigure, @@ -116,7 +107,7 @@ const configureTrustedDomainsHandler = async ( if (pickedResult) { const pickedDomains: string[] = pickedResult.map(r => r.id!); - storageService.store('http.trustedDomains', JSON.stringify(pickedDomains), StorageScope.GLOBAL); + storageService.store('http.linkProtectionTrustedDomains', JSON.stringify(pickedDomains), StorageScope.GLOBAL); return pickedDomains; } @@ -125,16 +116,26 @@ const configureTrustedDomainsHandler = async ( }; const configureTrustedDomainCommand = { - id: 'workbench.action.configureTrustedDomains', + id: 'workbench.action.configureLinkProtectionTrustedDomains', description: { - description: localize('configureTrustedDomains', 'Configure Trusted Domains'), + description: localize('configureLinkProtectionTrustedDomains', 'Configure Trusted Domains for Link Protection'), args: [{ name: 'domainToConfigure', schema: { type: 'string' } }] }, handler: (accessor: ServicesAccessor, domainToConfigure?: string) => { const quickInputService = accessor.get(IQuickInputService); const storageService = accessor.get(IStorageService); + const productService = accessor.get(IProductService); - return configureTrustedDomainsHandler(quickInputService, storageService, domainToConfigure); + const trustedDomains = productService.linkProtectionTrustedDomains + ? [...productService.linkProtectionTrustedDomains] + : []; + + return configureTrustedDomainsHandler( + quickInputService, + storageService, + trustedDomains, + domainToConfigure + ); } }; @@ -164,9 +165,12 @@ class OpenerValidatorContributions implements IWorkbenchContribution { return true; } - let trustedDomains: string[] = DEAFULT_TRUSTED_DOMAINS; + let trustedDomains: string[] = this._productService.linkProtectionTrustedDomains + ? [...this._productService.linkProtectionTrustedDomains] + : []; + try { - const trustedDomainsSrc = this._storageService.get('http.trustedDomains', StorageScope.GLOBAL); + const trustedDomainsSrc = this._storageService.get('http.linkProtectionTrustedDomains', StorageScope.GLOBAL); if (trustedDomainsSrc) { trustedDomains = JSON.parse(trustedDomainsSrc); } @@ -174,7 +178,9 @@ class OpenerValidatorContributions implements IWorkbenchContribution { const domainToOpen = `${scheme}://${authority}`; - if (isDomainTrusted(domainToOpen, trustedDomains)) { + if (isLocalhostAuthority(authority)) { + return true; + } else if (isDomainTrusted(domainToOpen, trustedDomains)) { return true; } else { const choice = await this._dialogService.show( @@ -201,7 +207,7 @@ class OpenerValidatorContributions implements IWorkbenchContribution { } // Configure Trusted Domains else if (choice === 2) { - const pickedDomains = await configureTrustedDomainsHandler(this._quickInputService, this._storageService, domainToOpen); + const pickedDomains = await configureTrustedDomainsHandler(this._quickInputService, this._storageService, trustedDomains, domainToOpen); if (pickedDomains.indexOf(domainToOpen) !== -1) { return true; } @@ -218,6 +224,13 @@ Registry.as(WorkbenchExtensions.Workbench).regi LifecyclePhase.Restored ); +const rLocalhost = /^localhost:\d+$/i; +const r127 = /^127.0.0.1:\d+$/; + +function isLocalhostAuthority(authority: string) { + return rLocalhost.test(authority) || r127.test(authority); +} + /** * Check whether a domain like https://www.microsoft.com matches * the list of trusted domains. @@ -235,3 +248,4 @@ function isDomainTrusted(domain: string, trustedDomains: string[]) { return false; } + From 1727cc2de99d6db5886baac4bccc7f0d0fae0f6f Mon Sep 17 00:00:00 2001 From: SteVen Batten <6561887+sbatten@users.noreply.github.com> Date: Mon, 26 Aug 2019 16:43:39 -0700 Subject: [PATCH 138/163] add msft internal identification logic (#79616) --- .../issue/issueReporterMain.ts | 2 +- .../sharedProcess/sharedProcessMain.ts | 2 +- src/vs/code/electron-main/app.ts | 2 +- src/vs/code/node/cliProcessMain.ts | 2 +- src/vs/platform/product/common/product.ts | 1 + src/vs/platform/telemetry/common/telemetry.ts | 3 ++- .../telemetry/common/telemetryService.ts | 3 ++- .../telemetry/node/commonProperties.ts | 25 +++++++++++++++++-- .../node/workbenchCommonProperties.ts | 4 +-- .../electron-browser/commonProperties.test.ts | 8 +++--- .../electron-browser/telemetryService.ts | 2 +- 11 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/vs/code/electron-browser/issue/issueReporterMain.ts b/src/vs/code/electron-browser/issue/issueReporterMain.ts index 591cbed96f3..55d0e6099a4 100644 --- a/src/vs/code/electron-browser/issue/issueReporterMain.ts +++ b/src/vs/code/electron-browser/issue/issueReporterMain.ts @@ -311,7 +311,7 @@ export class IssueReporter extends Disposable { if (!this.environmentService.isExtensionDevelopment && !this.environmentService.args['disable-telemetry'] && !!product.enableTelemetry) { const channel = getDelayedChannel(sharedProcess.then(c => c.getChannel('telemetryAppender'))); const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(logService)); - const commonProperties = resolveCommonProperties(product.commit || 'Commit unknown', pkg.version, configuration.machineId, this.environmentService.installSourcePath); + const commonProperties = resolveCommonProperties(product.commit || 'Commit unknown', pkg.version, configuration.machineId, product.msftInternalDomains, this.environmentService.installSourcePath); const piiPaths = this.environmentService.extensionsPath ? [this.environmentService.appRoot, this.environmentService.extensionsPath] : [this.environmentService.appRoot]; const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths }; diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index c5514f4eff7..1ac605dd7e5 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -156,7 +156,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat } const config: ITelemetryServiceConfig = { appender: combinedAppender(appInsightsAppender, new LogAppender(logService)), - commonProperties: resolveCommonProperties(product.commit, pkg.version, configuration.machineId, installSourcePath), + commonProperties: resolveCommonProperties(product.commit, pkg.version, configuration.machineId, product.msftInternalDomains, installSourcePath), piiPaths: extensionsPath ? [appRoot, extensionsPath] : [appRoot] }; diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 66c0baf0401..cf63cbaf3e2 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -474,7 +474,7 @@ export class CodeApplication extends Disposable { if (!this.environmentService.isExtensionDevelopment && !this.environmentService.args['disable-telemetry'] && !!product.enableTelemetry) { const channel = getDelayedChannel(sharedProcessClient.then(client => client.getChannel('telemetryAppender'))); const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(this.logService)); - const commonProperties = resolveCommonProperties(product.commit, pkg.version, machineId, this.environmentService.installSourcePath); + const commonProperties = resolveCommonProperties(product.commit, pkg.version, machineId, product.msftInternalDomains, this.environmentService.installSourcePath); const piiPaths = this.environmentService.extensionsPath ? [this.environmentService.appRoot, this.environmentService.extensionsPath] : [this.environmentService.appRoot]; const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths, trueMachineId }; diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index 32005dd153e..ee828c29374 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -359,7 +359,7 @@ export async function main(argv: ParsedArgs): Promise { const config: ITelemetryServiceConfig = { appender: combinedAppender(...appenders), - commonProperties: resolveCommonProperties(product.commit, pkg.version, stateService.getItem('telemetry.machineId'), installSourcePath), + commonProperties: resolveCommonProperties(product.commit, pkg.version, stateService.getItem('telemetry.machineId'), product.msftInternalDomains, installSourcePath), piiPaths: extensionsPath ? [appRoot, extensionsPath] : [appRoot] }; diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts index 460ce163168..8041912d93f 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -87,6 +87,7 @@ export interface IProductConfiguration { }; readonly portable?: string; readonly uiExtensions?: readonly string[]; + readonly msftInternalDomains?: string[]; readonly linkProtectionTrustedDomains?: readonly string[]; } diff --git a/src/vs/platform/telemetry/common/telemetry.ts b/src/vs/platform/telemetry/common/telemetry.ts index 847f4856a55..556a23103a6 100644 --- a/src/vs/platform/telemetry/common/telemetry.ts +++ b/src/vs/platform/telemetry/common/telemetry.ts @@ -12,6 +12,7 @@ export interface ITelemetryInfo { sessionId: string; machineId: string; instanceId: string; + msftInternal?: boolean; } export interface ITelemetryData { @@ -43,4 +44,4 @@ export interface ITelemetryService { export const instanceStorageKey = 'telemetry.instanceId'; export const currentSessionDateStorageKey = 'telemetry.currentSessionDate'; export const firstSessionDateStorageKey = 'telemetry.firstSessionDate'; -export const lastSessionDateStorageKey = 'telemetry.lastSessionDate'; \ No newline at end of file +export const lastSessionDateStorageKey = 'telemetry.lastSessionDate'; diff --git a/src/vs/platform/telemetry/common/telemetryService.ts b/src/vs/platform/telemetry/common/telemetryService.ts index 576a337237e..22dd0725cd5 100644 --- a/src/vs/platform/telemetry/common/telemetryService.ts +++ b/src/vs/platform/telemetry/common/telemetryService.ts @@ -104,8 +104,9 @@ export class TelemetryService implements ITelemetryService { let sessionId = values['sessionID']; let instanceId = values['common.instanceId']; let machineId = values['common.machineId']; + let msftInternal = values['common.msftInternal']; - return { sessionId, instanceId, machineId }; + return { sessionId, instanceId, machineId, msftInternal }; } dispose(): void { diff --git a/src/vs/platform/telemetry/node/commonProperties.ts b/src/vs/platform/telemetry/node/commonProperties.ts index 204a229e777..1e943ade588 100644 --- a/src/vs/platform/telemetry/node/commonProperties.ts +++ b/src/vs/platform/telemetry/node/commonProperties.ts @@ -8,8 +8,8 @@ import * as os from 'os'; import * as uuid from 'vs/base/common/uuid'; import { readFile } from 'vs/base/node/pfs'; -export async function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, installSourcePath: string, product?: string): Promise<{ [name: string]: string | undefined; }> { - const result: { [name: string]: string | undefined; } = Object.create(null); +export async function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, msftInternalDomains: string[] | undefined, installSourcePath: string, product?: string): Promise<{ [name: string]: string | boolean | undefined; }> { + const result: { [name: string]: string | boolean | undefined; } = Object.create(null); // __GDPR__COMMON__ "common.machineId" : { "endPoint": "MacAddressHash", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" } result['common.machineId'] = machineId; @@ -30,6 +30,12 @@ export async function resolveCommonProperties(commit: string | undefined, versio // __GDPR__COMMON__ "common.product" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" } result['common.product'] = product || 'desktop'; + const msftInternal = verifyMicrosoftInternalDomain(msftInternalDomains || []); + if (msftInternal) { + // __GDPR__COMMON__ "common.msftInternal" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + result['common.msftInternal'] = msftInternal; + } + // dynamic properties which value differs on each call let seq = 0; const startTime = Date.now(); @@ -67,3 +73,18 @@ export async function resolveCommonProperties(commit: string | undefined, versio return result; } + +function verifyMicrosoftInternalDomain(domainList: string[]): boolean { + if (!process || !process.env || !process.env['USERDNSDOMAIN']) { + return false; + } + + const domain = process.env['USERDNSDOMAIN']!.toLowerCase(); + for (let msftDomain of domainList) { + if (domain === msftDomain) { + return true; + } + } + + return false; +} diff --git a/src/vs/platform/telemetry/node/workbenchCommonProperties.ts b/src/vs/platform/telemetry/node/workbenchCommonProperties.ts index 81d6a4d3d22..cf6f57836fe 100644 --- a/src/vs/platform/telemetry/node/workbenchCommonProperties.ts +++ b/src/vs/platform/telemetry/node/workbenchCommonProperties.ts @@ -8,8 +8,8 @@ import { resolveCommonProperties } from 'vs/platform/telemetry/node/commonProper import { instanceStorageKey, firstSessionDateStorageKey, lastSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry'; import { cleanRemoteAuthority } from 'vs/platform/telemetry/common/telemetryUtils'; -export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, installSourcePath: string, remoteAuthority?: string): Promise<{ [name: string]: string | undefined }> { - const result = await resolveCommonProperties(commit, version, machineId, installSourcePath); +export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, msftInternalDomains: string[] | undefined, installSourcePath: string, remoteAuthority?: string): Promise<{ [name: string]: string | boolean | undefined }> { + const result = await resolveCommonProperties(commit, version, machineId, msftInternalDomains, installSourcePath); const instanceId = storageService.get(instanceStorageKey, StorageScope.GLOBAL)!; const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!; const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!; diff --git a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts index ff7f3977f0c..ee49c04ba3f 100644 --- a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts @@ -31,7 +31,7 @@ suite('Telemetry - common properties', function () { test('default', async function () { await mkdirp(parentDir); fs.writeFileSync(installSource, 'my.install.source'); - const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource); + const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource); assert.ok('commitHash' in props); assert.ok('sessionID' in props); assert.ok('timestamp' in props); @@ -52,7 +52,7 @@ suite('Telemetry - common properties', function () { assert.ok('common.instanceId' in props, 'instanceId'); assert.ok('common.machineId' in props, 'machineId'); fs.unlinkSync(installSource); - const props_1 = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource); + const props_1 = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource); assert.ok(!('common.source' in props_1)); }); @@ -60,14 +60,14 @@ suite('Telemetry - common properties', function () { testStorageService.store('telemetry.lastSessionDate', new Date().toUTCString(), StorageScope.GLOBAL); - const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource); + const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource); assert.ok('common.lastSessionDate' in props); // conditional, see below assert.ok('common.isNewSession' in props); assert.equal(props['common.isNewSession'], 0); }); test('values chance on ask', async function () { - const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', installSource); + const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource); let value1 = props['common.sequence']; let value2 = props['common.sequence']; assert.ok(value1 !== value2, 'seq'); diff --git a/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts b/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts index c5561e44295..b9dd1dd7b4a 100644 --- a/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts +++ b/src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts @@ -38,7 +38,7 @@ export class TelemetryService extends Disposable implements ITelemetryService { const channel = sharedProcessService.getChannel('telemetryAppender'); const config: ITelemetryServiceConfig = { appender: combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(logService)), - commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, environmentService.installSourcePath, environmentService.configuration.remoteAuthority), + commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.configuration.machineId, productService.msftInternalDomains, environmentService.installSourcePath, environmentService.configuration.remoteAuthority), piiPaths: environmentService.extensionsPath ? [environmentService.appRoot, environmentService.extensionsPath] : [environmentService.appRoot] }; From 86723e74b6d7e83c06ac271c072c90734cddfa83 Mon Sep 17 00:00:00 2001 From: Andrew Liu Date: Mon, 26 Aug 2019 17:19:36 -0700 Subject: [PATCH 139/163] fix for 79704 - support for @example --- .../typescript-language-features/src/utils/previewer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/typescript-language-features/src/utils/previewer.ts b/extensions/typescript-language-features/src/utils/previewer.ts index f4a17274960..0c1e880162d 100644 --- a/extensions/typescript-language-features/src/utils/previewer.ts +++ b/extensions/typescript-language-features/src/utils/previewer.ts @@ -13,6 +13,11 @@ function getTagBodyText(tag: Proto.JSDocTagInfo): string | undefined { switch (tag.name) { case 'example': + // check for caption tags, fix for #79704 + const captionTagMatches = tag.text.match('(.*?)<\/caption>\r'); + if (captionTagMatches && captionTagMatches.index === 0) { + tag.text = captionTagMatches[1] + '\r\r' + tag.text.substr(captionTagMatches[0].length); + } case 'default': // Convert to markdown code block if it is not already one if (tag.text.match(/^\s*[~`]{3}/g)) { From 8cd00a7935eabef4aad0b0130b1d46daca0a47aa Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 27 Aug 2019 07:45:16 +0200 Subject: [PATCH 140/163] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index abd4295af8d..e3ec3f037df 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "9e9dfcce5e5fa0a30c1521e12c0d48a94f01b193", + "distro": "ae0015489bf2fc418bf61e0ed4b425bc75bdce89", "author": { "name": "Microsoft Corporation" }, From 445f7a0a4b6f7a8176adbc56b11047c65e37c741 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 27 Aug 2019 07:47:52 +0200 Subject: [PATCH 141/163] build - please run --- build/azure-pipelines/exploration-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/exploration-build.yml b/build/azure-pipelines/exploration-build.yml index b1cce331c4c..bfb6f2cc123 100644 --- a/build/azure-pipelines/exploration-build.yml +++ b/build/azure-pipelines/exploration-build.yml @@ -36,8 +36,8 @@ trigger: none pr: none schedules: -- cron: "0 5 * * Mon-Fri" - displayName: Mon-Fri at 7:00 +- cron: "10 5 * * Mon-Fri" + displayName: Mon-Fri at 7:10 branches: include: - master From 9a67092e0d65d48b9bc4986e5c244c26ef3e2678 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 27 Aug 2019 11:12:49 +0200 Subject: [PATCH 142/163] editors - preserve group activation behaviour for extensions --- .../api/browser/mainThreadEditors.ts | 5 ++- .../webview/browser/webviewEditorService.ts | 12 +++++- .../editor/test/browser/editorService.test.ts | 39 ++++++++++++++++++- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadEditors.ts b/src/vs/workbench/api/browser/mainThreadEditors.ts index 76334b577b1..ad52c83dd81 100644 --- a/src/vs/workbench/api/browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadEditors.ts @@ -15,7 +15,7 @@ import { ISelection } from 'vs/editor/common/core/selection'; import { IDecorationOptions, IDecorationRenderOptions, ILineChange } from 'vs/editor/common/editorCommon'; import { ISingleEditOperation } from 'vs/editor/common/model'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IEditorOptions, ITextEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor'; +import { IEditorOptions, ITextEditorOptions, IResourceInput, EditorActivation } from 'vs/platform/editor/common/editor'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { MainThreadDocumentsAndEditors } from 'vs/workbench/api/browser/mainThreadDocumentsAndEditors'; @@ -118,7 +118,8 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { const editorOptions: ITextEditorOptions = { preserveFocus: options.preserveFocus, pinned: options.pinned, - selection: options.selection + selection: options.selection, + activation: options.preserveFocus ? EditorActivation.PRESERVE : undefined // preserve pre 1.38 behaviour to not make group active when preserveFocus: true }; const input: IResourceInput = { diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts index 6fdda6cfb1c..5b4b2511939 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorService.ts @@ -16,6 +16,7 @@ import { ACTIVE_GROUP_TYPE, IEditorService, SIDE_GROUP_TYPE } from 'vs/workbench import { RevivedWebviewEditorInput, WebviewEditorInput } from './webviewEditorInput'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { EditorActivation } from 'vs/platform/editor/common/editor'; export const IWebviewEditorService = createDecorator('webviewEditorService'); @@ -146,7 +147,11 @@ export class WebviewEditorService implements IWebviewEditorService { const webview = this.createWebiew(id, extension, options); const webviewInput = this._instantiationService.createInstance(WebviewEditorInput, id, viewType, title, extension, new UnownedDisposable(webview)); - this._editorService.openEditor(webviewInput, { pinned: true, preserveFocus: showOptions.preserveFocus }, showOptions.group); + this._editorService.openEditor(webviewInput, { + pinned: true, + preserveFocus: showOptions.preserveFocus, + activation: showOptions.preserveFocus ? EditorActivation.PRESERVE : undefined // preserve pre 1.38 behaviour to not make group active when preserveFocus: true + }, showOptions.group); return webviewInput; } @@ -156,7 +161,10 @@ export class WebviewEditorService implements IWebviewEditorService { preserveFocus: boolean ): void { if (webview.group === group.id) { - this._editorService.openEditor(webview, { preserveFocus }, webview.group); + this._editorService.openEditor(webview, { + preserveFocus, + activation: preserveFocus ? EditorActivation.PRESERVE : undefined // preserve pre 1.38 behaviour to not make group active when preserveFocus: true + }, webview.group); } else { const groupView = this._editorGroupService.getGroup(webview.group!); if (groupView) { diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index d2fa3c6025b..258d85d6e21 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { IEditorModel } from 'vs/platform/editor/common/editor'; +import { IEditorModel, EditorActivation } from 'vs/platform/editor/common/editor'; import { URI } from 'vs/base/common/uri'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, EditorOptions, IFileEditorInput, IEditorInput } from 'vs/workbench/common/editor'; @@ -408,6 +408,43 @@ suite('EditorService', () => { assert.equal(editor!.group, part.groups[1]); }); + test('pasero editor group activation', async () => { + const partInstantiator = workbenchInstantiationService(); + + const part = partInstantiator.createInstance(EditorPart); + part.create(document.createElement('div')); + part.layout(400, 300); + + const testInstantiationService = partInstantiator.createChild(new ServiceCollection([IEditorGroupsService, part])); + + const service: IEditorService = testInstantiationService.createInstance(EditorService); + + const input1 = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource1-openside')); + const input2 = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource2-openside')); + + const rootGroup = part.activeGroup; + + await part.whenRestored; + + await service.openEditor(input1, { pinned: true }, rootGroup); + let editor = await service.openEditor(input2, { pinned: true, preserveFocus: true, activation: EditorActivation.ACTIVATE }, SIDE_GROUP); + const sideGroup = editor!.group; + + assert.equal(part.activeGroup, sideGroup); + + editor = await service.openEditor(input1, { pinned: true, preserveFocus: true, activation: EditorActivation.PRESERVE }, rootGroup); + assert.equal(part.activeGroup, sideGroup); + + editor = await service.openEditor(input1, { pinned: true, preserveFocus: true, activation: EditorActivation.ACTIVATE }, rootGroup); + assert.equal(part.activeGroup, rootGroup); + + editor = await service.openEditor(input2, { pinned: true, activation: EditorActivation.PRESERVE }, sideGroup); + assert.equal(part.activeGroup, rootGroup); + + editor = await service.openEditor(input2, { pinned: true, activation: EditorActivation.ACTIVATE }, sideGroup); + assert.equal(part.activeGroup, sideGroup); + }); + test('active editor change / visible editor change events', async function () { const partInstantiator = workbenchInstantiationService(); From c587f2355381f5f785fd31d3b6d8da0476def9cc Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 27 Aug 2019 11:42:11 +0200 Subject: [PATCH 143/163] Use version of C++ grammar from 1.37.1 There is an issue in the current version of the grammar that causes duplicate scopes. Until that's fixed, rolling back --- extensions/cpp/cgmanifest.json | 6 +- extensions/cpp/syntaxes/c.tmLanguage.json | 2444 +- extensions/cpp/syntaxes/cpp.tmLanguage.json | 21631 ++-------------- .../cpp/test/colorize-fixtures/test.cpp | 2 +- .../test/colorize-results/test-23630_cpp.json | 12 +- .../test/colorize-results/test-23850_cpp.json | 12 +- .../cpp/test/colorize-results/test_cc.json | 448 +- .../cpp/test/colorize-results/test_cpp.json | 1346 +- 8 files changed, 3724 insertions(+), 22177 deletions(-) diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index b8eb0579838..93f854d4d04 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "jeff-hykin/cpp-textmate-grammar", "repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar", - "commitHash": "031ef619bef4c5a1ca46e6fa69d7c913e0c32068" + "commitHash": "e33a317ccd0babba4b07ffc042ab9796e6412ddc" } }, "license": "MIT", - "version": "1.13.2", + "version": "1.8.15", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." }, { @@ -42,4 +42,4 @@ } ], "version": 1 -} \ No newline at end of file +} diff --git a/extensions/cpp/syntaxes/c.tmLanguage.json b/extensions/cpp/syntaxes/c.tmLanguage.json index fbfac34d19d..acc75a190eb 100644 --- a/extensions/cpp/syntaxes/c.tmLanguage.json +++ b/extensions/cpp/syntaxes/c.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/218448eb46260864352d569db13be6cb20767e92", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/e33a317ccd0babba4b07ffc042ab9796e6412ddc", "name": "C", "scopeName": "source.c", "patterns": [ @@ -17,9 +17,6 @@ { "include": "#preprocessor-rule-conditional" }, - { - "include": "#predefined_macros" - }, { "include": "#comments" }, @@ -67,71 +64,32 @@ "include": "#strings" }, { - "name": "meta.preprocessor.macro.c", - "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((#)\\s*define\\b)\\s+((?[a-zA-Z_$][\\w$]*))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g \\s*\t\t # first argument\n\t ((,) \\s* \\g \\s*)* # additional arguments\n\t (?:\\.\\.\\.)?\t\t\t# varargs ellipsis?\n\t)\n (\\))\n)?", "beginCaptures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.c punctuation.definition.comment.begin.c" - }, - "3": { - "name": "comment.block.c" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.c punctuation.definition.comment.end.c" - }, - { - "match": "\\*", - "name": "comment.block.c" - } - ] - }, - "5": { "name": "keyword.control.directive.define.c" }, - "6": { + "2": { "name": "punctuation.definition.directive.c" }, - "7": { + "3": { "name": "entity.name.function.preprocessor.c" }, - "8": { + "5": { "name": "punctuation.definition.parameters.begin.c" }, - "9": { - "patterns": [ - { - "match": "(?<=[(,])\\s*((?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))", - "captures": { - "1": { - "name": "comment.block.c punctuation.definition.comment.begin.c" - }, - "2": { - "name": "comment.block.c" - }, - "3": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.c punctuation.definition.comment.end.c" - }, - { - "match": "\\*", - "name": "comment.block.c" - } - ] - } - } - }, - "default_statement": { - "name": "meta.conditional.case.c", - "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?|\\?\\?>)|(?=[;>\\[\\]=]))", - "patterns": [ - { - "name": "meta.head.switch.c", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.switch.c" - } - }, - "patterns": [ - { - "include": "#switch_conditional_parentheses" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.body.switch.c", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.switch.c" - } - }, - "patterns": [ - { - "include": "#default_statement" - }, - { - "include": "#case_statement" - }, - { - "include": "$self" - }, - { - "include": "#block_innards" - } - ] - }, - { - "name": "meta.tail.switch.c", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "switch_conditional_parentheses": { - "name": "meta.conditional.switch.c", - "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.c punctuation.definition.comment.begin.c" - }, - "3": { - "name": "comment.block.c" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.c punctuation.definition.comment.end.c" - }, - { - "match": "\\*", - "name": "comment.block.c" - } - ] - }, - "5": { - "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.conditional.switch.c" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - }, - { - "include": "#c_conditional_context" - } - ] - }, - "static_assert": { - "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.c punctuation.definition.comment.begin.c" - }, - "3": { - "name": "comment.block.c" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.c punctuation.definition.comment.end.c" - }, - { - "match": "\\*", - "name": "comment.block.c" - } - ] - }, - "5": { - "name": "keyword.other.static_assert.c" - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.c punctuation.definition.comment.begin.c" - }, - "8": { - "name": "comment.block.c" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.c punctuation.definition.comment.end.c" - }, - { - "match": "\\*", - "name": "comment.block.c" - } - ] - }, - "10": { - "name": "punctuation.section.arguments.begin.bracket.round.static_assert.c" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.static_assert.c" - } - }, - "patterns": [ - { - "name": "meta.static_assert.message.c", - "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", - "beginCaptures": { - "1": { - "name": "punctuation.separator.delimiter.comma.c" - } - }, - "end": "(?=\\))", - "patterns": [ - { - "include": "#string_context" - }, - { - "include": "#string_context_c" - } - ] - }, - { - "include": "#evaluation_context" - } - ] - }, - "backslash_escapes": { - "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", - "name": "constant.character.escape.c" - }, - "c_conditional_context": { - "patterns": [ - { - "include": "$self" - }, - { - "include": "#block_innards" - } - ] - }, - "evalutation_context": { - "patterns": [ - { - "include": "#function-call-innards" - }, - { - "include": "$base" - } - ] - }, - "member_access": { - "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:void|char|short|int|signed|unsigned|long|float|double|bool|_Bool|_Complex|_Imaginary|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|memory_order|atomic_bool|atomic_char|atomic_schar|atomic_uchar|atomic_short|atomic_ushort|atomic_int|atomic_uint|atomic_long|atomic_ulong|atomic_llong|atomic_ullong|atomic_char16_t|atomic_char32_t|atomic_wchar_t|atomic_int_least8_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_least16_t|atomic_int_least32_t|atomic_uint_least32_t|atomic_int_least64_t|atomic_uint_least64_t|atomic_int_fast8_t|atomic_uint_fast8_t|atomic_int_fast16_t|atomic_uint_fast16_t|atomic_int_fast32_t|atomic_uint_fast32_t|atomic_int_fast64_t|atomic_uint_fast64_t|atomic_intptr_t|atomic_uintptr_t|atomic_size_t|atomic_ptrdiff_t|atomic_intmax_t|atomic_uintmax_t)\\b)[a-zA-Z_]\\w*\\b(?!\\())", - "captures": { - "1": { - "name": "variable.other.object.access.c" - }, - "2": { - "name": "punctuation.separator.dot-access.c" - }, - "3": { - "name": "punctuation.separator.pointer-access.c" - }, - "4": { - "patterns": [ - { - "include": "#member_access" - }, - { - "include": "#method_access" - }, - { - "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", - "captures": { - "1": { - "name": "variable.other.object.access.c" - }, - "2": { - "name": "punctuation.separator.dot-access.c" - }, - "3": { - "name": "punctuation.separator.pointer-access.c" - } - } - } - ] - }, - "5": { - "name": "variable.other.member.c" - } - } - }, - "method_access": { - "contentName": "meta.function-call.member.c", - "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", - "beginCaptures": { - "1": { - "name": "variable.other.object.access.c" - }, - "2": { - "name": "punctuation.separator.dot-access.c" - }, - "3": { - "name": "punctuation.separator.pointer-access.c" - }, - "4": { - "patterns": [ - { - "include": "#member_access" - }, - { - "include": "#method_access" - }, - { - "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", - "captures": { - "1": { - "name": "variable.other.object.access.c" - }, - "2": { - "name": "punctuation.separator.dot-access.c" - }, - "3": { - "name": "punctuation.separator.pointer-access.c" - } - } - } - ] - }, - "5": { - "name": "entity.name.function.member.c" - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.function.member.c" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.function.member.c" - } - }, - "patterns": [ - { - "include": "#function-call-innards" - } - ] - }, - "predefined_macros": { - "patterns": [ - { - "match": "\\b__cplusplus\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__cplusplus.c" - }, - { - "match": "\\b__DATE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__DATE__.c" - }, - { - "match": "\\b__FILE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FILE__.c" - }, - { - "match": "\\b__LINE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__LINE__.c" - }, - { - "match": "\\b__STDC__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__STDC__.c" - }, - { - "match": "\\b__STDC_HOSTED__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__STDC_HOSTED__.c" - }, - { - "match": "\\b__STDC_NO_COMPLEX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__STDC_NO_COMPLEX__.c" - }, - { - "match": "\\b__STDC_VERSION__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__STDC_VERSION__.c" - }, - { - "match": "\\b__STDCPP_THREADS__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__STDCPP_THREADS__.c" - }, - { - "match": "\\b__TIME__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__TIME__.c" - }, - { - "match": "\\bNDEBUG\\b", - "name": "entity.name.other.preprocessor.macro.predefined.NDEBUG.c" - }, - { - "match": "\\b__OBJC__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__OBJC__.c" - }, - { - "match": "\\b__ASSEMBLER__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__ASSEMBLER__.c" - }, - { - "match": "\\b__ATOM__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__ATOM__.c" - }, - { - "match": "\\b__AVX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__AVX__.c" - }, - { - "match": "\\b__AVX2__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__AVX2__.c" - }, - { - "match": "\\b_CHAR_UNSIGNED\\b", - "name": "entity.name.other.preprocessor.macro.predefined._CHAR_UNSIGNED.c" - }, - { - "match": "\\b__CLR_VER\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__CLR_VER.c" - }, - { - "match": "\\b_CONTROL_FLOW_GUARD\\b", - "name": "entity.name.other.preprocessor.macro.predefined._CONTROL_FLOW_GUARD.c" - }, - { - "match": "\\b__COUNTER__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__COUNTER__.c" - }, - { - "match": "\\b__cplusplus_cli\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__cplusplus_cli.c" - }, - { - "match": "\\b__cplusplus_winrt\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__cplusplus_winrt.c" - }, - { - "match": "\\b_CPPRTTI\\b", - "name": "entity.name.other.preprocessor.macro.predefined._CPPRTTI.c" - }, - { - "match": "\\b_CPPUNWIND\\b", - "name": "entity.name.other.preprocessor.macro.predefined._CPPUNWIND.c" - }, - { - "match": "\\b_DEBUG\\b", - "name": "entity.name.other.preprocessor.macro.predefined._DEBUG.c" - }, - { - "match": "\\b_DLL\\b", - "name": "entity.name.other.preprocessor.macro.predefined._DLL.c" - }, - { - "match": "\\b__FUNCDNAME__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FUNCDNAME__.c" - }, - { - "match": "\\b__FUNCSIG__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FUNCSIG__.c" - }, - { - "match": "\\b__FUNCTION__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FUNCTION__.c" - }, - { - "match": "\\b_INTEGRAL_MAX_BITS\\b", - "name": "entity.name.other.preprocessor.macro.predefined._INTEGRAL_MAX_BITS.c" - }, - { - "match": "\\b__INTELLISENSE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INTELLISENSE__.c" - }, - { - "match": "\\b_ISO_VOLATILE\\b", - "name": "entity.name.other.preprocessor.macro.predefined._ISO_VOLATILE.c" - }, - { - "match": "\\b_KERNEL_MODE\\b", - "name": "entity.name.other.preprocessor.macro.predefined._KERNEL_MODE.c" - }, - { - "match": "\\b_M_AMD64\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_AMD64.c" - }, - { - "match": "\\b_M_ARM\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_ARM.c" - }, - { - "match": "\\b_M_ARM_ARMV7VE\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_ARM_ARMV7VE.c" - }, - { - "match": "\\b_M_ARM_FP\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_ARM_FP.c" - }, - { - "match": "\\b_M_ARM64\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_ARM64.c" - }, - { - "match": "\\b_M_CEE\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_CEE.c" - }, - { - "match": "\\b_M_CEE_PURE\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_CEE_PURE.c" - }, - { - "match": "\\b_M_CEE_SAFE\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_CEE_SAFE.c" - }, - { - "match": "\\b_M_FP_EXCEPT\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_FP_EXCEPT.c" - }, - { - "match": "\\b_M_FP_FAST\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_FP_FAST.c" - }, - { - "match": "\\b_M_FP_PRECISE\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_FP_PRECISE.c" - }, - { - "match": "\\b_M_FP_STRICT\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_FP_STRICT.c" - }, - { - "match": "\\b_M_IX86\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_IX86.c" - }, - { - "match": "\\b_M_IX86_FP\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_IX86_FP.c" - }, - { - "match": "\\b_M_X64\\b", - "name": "entity.name.other.preprocessor.macro.predefined._M_X64.c" - }, - { - "match": "\\b_MANAGED\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MANAGED.c" - }, - { - "match": "\\b_MSC_BUILD\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MSC_BUILD.c" - }, - { - "match": "\\b_MSC_EXTENSIONS\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MSC_EXTENSIONS.c" - }, - { - "match": "\\b_MSC_FULL_VER\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MSC_FULL_VER.c" - }, - { - "match": "\\b_MSC_VER\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MSC_VER.c" - }, - { - "match": "\\b_MSVC_LANG\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MSVC_LANG.c" - }, - { - "match": "\\b__MSVC_RUNTIME_CHECKS\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__MSVC_RUNTIME_CHECKS.c" - }, - { - "match": "\\b_MT\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MT.c" - }, - { - "match": "\\b_NATIVE_WCHAR_T_DEFINED\\b", - "name": "entity.name.other.preprocessor.macro.predefined._NATIVE_WCHAR_T_DEFINED.c" - }, - { - "match": "\\b_OPENMP\\b", - "name": "entity.name.other.preprocessor.macro.predefined._OPENMP.c" - }, - { - "match": "\\b_PREFAST\\b", - "name": "entity.name.other.preprocessor.macro.predefined._PREFAST.c" - }, - { - "match": "\\b__TIMESTAMP__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__TIMESTAMP__.c" - }, - { - "match": "\\b_VC_NO_DEFAULTLIB\\b", - "name": "entity.name.other.preprocessor.macro.predefined._VC_NO_DEFAULTLIB.c" - }, - { - "match": "\\b_WCHAR_T_DEFINED\\b", - "name": "entity.name.other.preprocessor.macro.predefined._WCHAR_T_DEFINED.c" - }, - { - "match": "\\b_WIN32\\b", - "name": "entity.name.other.preprocessor.macro.predefined._WIN32.c" - }, - { - "match": "\\b_WIN64\\b", - "name": "entity.name.other.preprocessor.macro.predefined._WIN64.c" - }, - { - "match": "\\b_WINRT_DLL\\b", - "name": "entity.name.other.preprocessor.macro.predefined._WINRT_DLL.c" - }, - { - "match": "\\b_ATL_VER\\b", - "name": "entity.name.other.preprocessor.macro.predefined._ATL_VER.c" - }, - { - "match": "\\b_MFC_VER\\b", - "name": "entity.name.other.preprocessor.macro.predefined._MFC_VER.c" - }, - { - "match": "\\b__GFORTRAN__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GFORTRAN__.c" - }, - { - "match": "\\b__GNUC__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GNUC__.c" - }, - { - "match": "\\b__GNUC_MINOR__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GNUC_MINOR__.c" - }, - { - "match": "\\b__GNUC_PATCHLEVEL__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GNUC_PATCHLEVEL__.c" - }, - { - "match": "\\b__GNUG__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GNUG__.c" - }, - { - "match": "\\b__STRICT_ANSI__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__STRICT_ANSI__.c" - }, - { - "match": "\\b__BASE_FILE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__BASE_FILE__.c" - }, - { - "match": "\\b__INCLUDE_LEVEL__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INCLUDE_LEVEL__.c" - }, - { - "match": "\\b__ELF__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__ELF__.c" - }, - { - "match": "\\b__VERSION__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__VERSION__.c" - }, - { - "match": "\\b__OPTIMIZE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__OPTIMIZE__.c" - }, - { - "match": "\\b__OPTIMIZE_SIZE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__OPTIMIZE_SIZE__.c" - }, - { - "match": "\\b__NO_INLINE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__NO_INLINE__.c" - }, - { - "match": "\\b__GNUC_STDC_INLINE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GNUC_STDC_INLINE__.c" - }, - { - "match": "\\b__CHAR_UNSIGNED__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__CHAR_UNSIGNED__.c" - }, - { - "match": "\\b__WCHAR_UNSIGNED__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_UNSIGNED__.c" - }, - { - "match": "\\b__REGISTER_PREFIX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__REGISTER_PREFIX__.c" - }, - { - "match": "\\b__REGISTER_PREFIX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__REGISTER_PREFIX__.c" - }, - { - "match": "\\b__SIZE_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZE_TYPE__.c" - }, - { - "match": "\\b__PTRDIFF_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__PTRDIFF_TYPE__.c" - }, - { - "match": "\\b__WCHAR_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_TYPE__.c" - }, - { - "match": "\\b__WINT_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WINT_TYPE__.c" - }, - { - "match": "\\b__INTMAX_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INTMAX_TYPE__.c" - }, - { - "match": "\\b__UINTMAX_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINTMAX_TYPE__.c" - }, - { - "match": "\\b__SIG_ATOMIC_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_TYPE__.c" - }, - { - "match": "\\b__INT8_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT8_TYPE__.c" - }, - { - "match": "\\b__INT16_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT16_TYPE__.c" - }, - { - "match": "\\b__INT32_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT32_TYPE__.c" - }, - { - "match": "\\b__INT64_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT64_TYPE__.c" - }, - { - "match": "\\b__UINT8_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT8_TYPE__.c" - }, - { - "match": "\\b__UINT16_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT16_TYPE__.c" - }, - { - "match": "\\b__UINT32_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT32_TYPE__.c" - }, - { - "match": "\\b__UINT64_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT64_TYPE__.c" - }, - { - "match": "\\b__INT_LEAST8_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST8_TYPE__.c" - }, - { - "match": "\\b__INT_LEAST16_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST16_TYPE__.c" - }, - { - "match": "\\b__INT_LEAST32_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST32_TYPE__.c" - }, - { - "match": "\\b__INT_LEAST64_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST64_TYPE__.c" - }, - { - "match": "\\b__UINT_LEAST8_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST8_TYPE__.c" - }, - { - "match": "\\b__UINT_LEAST16_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST16_TYPE__.c" - }, - { - "match": "\\b__UINT_LEAST32_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST32_TYPE__.c" - }, - { - "match": "\\b__UINT_LEAST64_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST64_TYPE__.c" - }, - { - "match": "\\b__INT_FAST8_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST8_TYPE__.c" - }, - { - "match": "\\b__INT_FAST16_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST16_TYPE__.c" - }, - { - "match": "\\b__INT_FAST32_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST32_TYPE__.c" - }, - { - "match": "\\b__INT_FAST64_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST64_TYPE__.c" - }, - { - "match": "\\b__UINT_FAST8_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST8_TYPE__.c" - }, - { - "match": "\\b__UINT_FAST16_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST16_TYPE__.c" - }, - { - "match": "\\b__UINT_FAST32_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST32_TYPE__.c" - }, - { - "match": "\\b__UINT_FAST64_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST64_TYPE__.c" - }, - { - "match": "\\b__INTPTR_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INTPTR_TYPE__.c" - }, - { - "match": "\\b__UINTPTR_TYPE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINTPTR_TYPE__.c" - }, - { - "match": "\\b__CHAR_BIT__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__CHAR_BIT__.c" - }, - { - "match": "\\b__SCHAR_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SCHAR_MAX__.c" - }, - { - "match": "\\b__WCHAR_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_MAX__.c" - }, - { - "match": "\\b__SHRT_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SHRT_MAX__.c" - }, - { - "match": "\\b__INT_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_MAX__.c" - }, - { - "match": "\\b__LONG_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__LONG_MAX__.c" - }, - { - "match": "\\b__LONG_LONG_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__LONG_LONG_MAX__.c" - }, - { - "match": "\\b__WINT_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WINT_MAX__.c" - }, - { - "match": "\\b__SIZE_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZE_MAX__.c" - }, - { - "match": "\\b__PTRDIFF_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__PTRDIFF_MAX__.c" - }, - { - "match": "\\b__INTMAX_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INTMAX_MAX__.c" - }, - { - "match": "\\b__UINTMAX_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINTMAX_MAX__.c" - }, - { - "match": "\\b__SIG_ATOMIC_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_MAX__.c" - }, - { - "match": "\\b__INT8_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT8_MAX__.c" - }, - { - "match": "\\b__INT16_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT16_MAX__.c" - }, - { - "match": "\\b__INT32_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT32_MAX__.c" - }, - { - "match": "\\b__INT64_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT64_MAX__.c" - }, - { - "match": "\\b__UINT8_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT8_MAX__.c" - }, - { - "match": "\\b__UINT16_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT16_MAX__.c" - }, - { - "match": "\\b__UINT32_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT32_MAX__.c" - }, - { - "match": "\\b__UINT64_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT64_MAX__.c" - }, - { - "match": "\\b__INT_LEAST8_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST8_MAX__.c" - }, - { - "match": "\\b__INT_LEAST16_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST16_MAX__.c" - }, - { - "match": "\\b__INT_LEAST32_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST32_MAX__.c" - }, - { - "match": "\\b__INT_LEAST64_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST64_MAX__.c" - }, - { - "match": "\\b__UINT_LEAST8_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST8_MAX__.c" - }, - { - "match": "\\b__UINT_LEAST16_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST16_MAX__.c" - }, - { - "match": "\\b__UINT_LEAST32_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST32_MAX__.c" - }, - { - "match": "\\b__UINT_LEAST64_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST64_MAX__.c" - }, - { - "match": "\\b__INT_FAST8_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST8_MAX__.c" - }, - { - "match": "\\b__INT_FAST16_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST16_MAX__.c" - }, - { - "match": "\\b__INT_FAST32_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST32_MAX__.c" - }, - { - "match": "\\b__INT_FAST64_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST64_MAX__.c" - }, - { - "match": "\\b__UINT_FAST8_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST8_MAX__.c" - }, - { - "match": "\\b__UINT_FAST16_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST16_MAX__.c" - }, - { - "match": "\\b__UINT_FAST32_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST32_MAX__.c" - }, - { - "match": "\\b__UINT_FAST64_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST64_MAX__.c" - }, - { - "match": "\\b__INTPTR_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INTPTR_MAX__.c" - }, - { - "match": "\\b__UINTPTR_MAX__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__UINTPTR_MAX__.c" - }, - { - "match": "\\b__WCHAR_MIN__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_MIN__.c" - }, - { - "match": "\\b__WINT_MIN__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WINT_MIN__.c" - }, - { - "match": "\\b__SIG_ATOMIC_MIN__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_MIN__.c" - }, - { - "match": "\\b__SCHAR_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SCHAR_WIDTH__.c" - }, - { - "match": "\\b__SHRT_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SHRT_WIDTH__.c" - }, - { - "match": "\\b__INT_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_WIDTH__.c" - }, - { - "match": "\\b__LONG_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__LONG_WIDTH__.c" - }, - { - "match": "\\b__LONG_LONG_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__LONG_LONG_WIDTH__.c" - }, - { - "match": "\\b__PTRDIFF_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__PTRDIFF_WIDTH__.c" - }, - { - "match": "\\b__SIG_ATOMIC_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_WIDTH__.c" - }, - { - "match": "\\b__SIZE_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZE_WIDTH__.c" - }, - { - "match": "\\b__WCHAR_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_WIDTH__.c" - }, - { - "match": "\\b__WINT_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__WINT_WIDTH__.c" - }, - { - "match": "\\b__INT_LEAST8_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST8_WIDTH__.c" - }, - { - "match": "\\b__INT_LEAST16_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST16_WIDTH__.c" - }, - { - "match": "\\b__INT_LEAST32_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST32_WIDTH__.c" - }, - { - "match": "\\b__INT_LEAST64_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST64_WIDTH__.c" - }, - { - "match": "\\b__INT_FAST8_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST8_WIDTH__.c" - }, - { - "match": "\\b__INT_FAST16_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST16_WIDTH__.c" - }, - { - "match": "\\b__INT_FAST32_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST32_WIDTH__.c" - }, - { - "match": "\\b__INT_FAST64_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST64_WIDTH__.c" - }, - { - "match": "\\b__INTPTR_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INTPTR_WIDTH__.c" - }, - { - "match": "\\b__INTMAX_WIDTH__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__INTMAX_WIDTH__.c" - }, - { - "match": "\\b__SIZEOF_INT__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_INT__.c" - }, - { - "match": "\\b__SIZEOF_LONG__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_LONG__.c" - }, - { - "match": "\\b__SIZEOF_LONG_LONG__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_LONG_LONG__.c" - }, - { - "match": "\\b__SIZEOF_SHORT__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_SHORT__.c" - }, - { - "match": "\\b__SIZEOF_POINTER__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_POINTER__.c" - }, - { - "match": "\\b__SIZEOF_FLOAT__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_FLOAT__.c" - }, - { - "match": "\\b__SIZEOF_DOUBLE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_DOUBLE__.c" - }, - { - "match": "\\b__SIZEOF_LONG_DOUBLE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_LONG_DOUBLE__.c" - }, - { - "match": "\\b__SIZEOF_SIZE_T__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_SIZE_T__.c" - }, - { - "match": "\\b__SIZEOF_WCHAR_T__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_WCHAR_T__.c" - }, - { - "match": "\\b__SIZEOF_WINT_T__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_WINT_T__.c" - }, - { - "match": "\\b__SIZEOF_PTRDIFF_T__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_PTRDIFF_T__.c" - }, - { - "match": "\\b__BYTE_ORDER__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__BYTE_ORDER__.c" - }, - { - "match": "\\b__ORDER_LITTLE_ENDIAN__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__ORDER_LITTLE_ENDIAN__.c" - }, - { - "match": "\\b__ORDER_BIG_ENDIAN__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__ORDER_BIG_ENDIAN__.c" - }, - { - "match": "\\b__ORDER_PDP_ENDIAN__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__ORDER_PDP_ENDIAN__.c" - }, - { - "match": "\\b__FLOAT_WORD_ORDER__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FLOAT_WORD_ORDER__.c" - }, - { - "match": "\\b__DEPRECATED\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__DEPRECATED.c" - }, - { - "match": "\\b__EXCEPTIONS\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__EXCEPTIONS.c" - }, - { - "match": "\\b__GXX_RTTI\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GXX_RTTI.c" - }, - { - "match": "\\b__USING_SJLJ_EXCEPTIONS__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__USING_SJLJ_EXCEPTIONS__.c" - }, - { - "match": "\\b__GXX_EXPERIMENTAL_CXX0X__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GXX_EXPERIMENTAL_CXX0X__.c" - }, - { - "match": "\\b__GXX_WEAK__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GXX_WEAK__.c" - }, - { - "match": "\\b__NEXT_RUNTIME__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__NEXT_RUNTIME__.c" - }, - { - "match": "\\b__LP64__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__LP64__.c" - }, - { - "match": "\\b_LP64\\b", - "name": "entity.name.other.preprocessor.macro.predefined._LP64.c" - }, - { - "match": "\\b__SSP__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SSP__.c" - }, - { - "match": "\\b__SSP_ALL__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SSP_ALL__.c" - }, - { - "match": "\\b__SSP_STRONG__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SSP_STRONG__.c" - }, - { - "match": "\\b__SSP_EXPLICIT__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SSP_EXPLICIT__.c" - }, - { - "match": "\\b__SANITIZE_ADDRESS__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SANITIZE_ADDRESS__.c" - }, - { - "match": "\\b__SANITIZE_THREAD__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__SANITIZE_THREAD__.c" - }, - { - "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1.c" - }, - { - "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2.c" - }, - { - "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.c" - }, - { - "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8.c" - }, - { - "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16.c" - }, - { - "match": "\\b__HAVE_SPECULATION_SAFE_VALUE\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__HAVE_SPECULATION_SAFE_VALUE.c" - }, - { - "match": "\\b__GCC_HAVE_DWARF2_CFI_ASM\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_DWARF2_CFI_ASM.c" - }, - { - "match": "\\b__FP_FAST_FMA\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMA.c" - }, - { - "match": "\\b__FP_FAST_FMAF\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF.c" - }, - { - "match": "\\b__FP_FAST_FMAL\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAL.c" - }, - { - "match": "\\b__FP_FAST_FMAF16\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF16.c" - }, - { - "match": "\\b__FP_FAST_FMAF32\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF32.c" - }, - { - "match": "\\b__FP_FAST_FMAF64\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF64.c" - }, - { - "match": "\\b__FP_FAST_FMAF128\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF128.c" - }, - { - "match": "\\b__FP_FAST_FMAF32X\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF32X.c" - }, - { - "match": "\\b__FP_FAST_FMAF64X\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF64X.c" - }, - { - "match": "\\b__FP_FAST_FMAF128X\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF128X.c" - }, - { - "match": "\\b__GCC_IEC_559\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_IEC_559.c" - }, - { - "match": "\\b__GCC_IEC_559_COMPLEX\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__GCC_IEC_559_COMPLEX.c" - }, - { - "match": "\\b__NO_MATH_ERRNO__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__NO_MATH_ERRNO__.c" - }, - { - "match": "\\b__has_builtin\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_builtin.c" - }, - { - "match": "\\b__has_feature\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_feature.c" - }, - { - "match": "\\b__has_extension\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_extension.c" - }, - { - "match": "\\b__has_cpp_attribute\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_cpp_attribute.c" - }, - { - "match": "\\b__has_c_attribute\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_c_attribute.c" - }, - { - "match": "\\b__has_attribute\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_attribute.c" - }, - { - "match": "\\b__has_declspec_attribute\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_declspec_attribute.c" - }, - { - "match": "\\b__is_identifier\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__is_identifier.c" - }, - { - "match": "\\b__has_include\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_include.c" - }, - { - "match": "\\b__has_include_next\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_include_next.c" - }, - { - "match": "\\b__has_warning\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__has_warning.c" - }, - { - "match": "\\b__BASE_FILE__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__BASE_FILE__.c" - }, - { - "match": "\\b__FILE_NAME__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__FILE_NAME__.c" - }, - { - "match": "\\b__clang__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__clang__.c" - }, - { - "match": "\\b__clang_major__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__clang_major__.c" - }, - { - "match": "\\b__clang_minor__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__clang_minor__.c" - }, - { - "match": "\\b__clang_patchlevel__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__clang_patchlevel__.c" - }, - { - "match": "\\b__clang_version__\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__clang_version__.c" - }, - { - "match": "\\b__fp16\\b", - "name": "entity.name.other.preprocessor.macro.predefined.__fp16.c" - }, - { - "match": "\\b_Float16\\b", - "name": "entity.name.other.preprocessor.macro.predefined._Float16.c" - }, - { - "match": "(\\b__([A-Z_]+)__\\b)", - "captures": { - "1": { - "name": "entity.name.other.preprocessor.macro.predefined.probably.$2.c" - } - } - } - ] - }, - "numbers": { - "begin": "(?\\]\\)]))\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))", "captures": { @@ -2335,6 +559,10 @@ }, "name": "comment.block.c" }, + { + "match": "\\*/.*\\n", + "name": "invalid.illegal.stray-comment-end.c" + }, { "captures": { "1": { @@ -2620,102 +848,8 @@ "name": "storage.type.built-in.c" }, { - "match": "(?-mix:\\b(enum|struct|union)\\b)", + "match": "(?-mix:\\b(asm|__asm__|enum|struct|union)\\b)", "name": "storage.type.$1.c" - }, - { - "name": "meta.asm.c", - "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "storage.type.asm.c" - }, - "2": { - "name": "storage.modifier.c" - }, - "3": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.c" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.c" - } - }, - "patterns": [ - { - "name": "string.quoted.double.c", - "contentName": "meta.embedded.assembly.c", - "begin": "(R?)(\")", - "beginCaptures": { - "1": { - "name": "meta.encoding.c" - }, - "2": { - "name": "punctuation.definition.string.begin.assembly.c" - } - }, - "end": "(\")", - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.assembly.c" - } - }, - "patterns": [ - { - "include": "source.asm" - }, - { - "include": "source.x86" - }, - { - "include": "source.x86_64" - }, - { - "include": "source.arm" - }, - { - "include": "#backslash_escapes" - }, - { - "include": "#string_escaped_char" - }, - { - "match": "(?=not)possible" - } - ] - }, - { - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.c" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.inner.c" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "match": ":", - "name": "punctuation.separator.delimiter.colon.assembly.c" - }, - { - "include": "#comments_context" - }, - { - "include": "#comments" - } - ] } ] }, @@ -3037,9 +1171,9 @@ ] }, { + "contentName": "comment.block.preprocessor.if-branch.c", "begin": "\\n", "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", - "contentName": "comment.block.preprocessor.if-branch.c", "patterns": [ { "include": "#disabled" @@ -3134,9 +1268,9 @@ ] }, { + "contentName": "comment.block.preprocessor.if-branch.in-block.c", "begin": "\\n", "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", - "contentName": "comment.block.preprocessor.if-branch.in-block.c", "patterns": [ { "include": "#disabled" @@ -3179,9 +1313,9 @@ "include": "#comments" }, { + "contentName": "comment.block.preprocessor.elif-branch.c", "begin": "\\n", "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", - "contentName": "comment.block.preprocessor.elif-branch.c", "patterns": [ { "include": "#disabled" @@ -3238,6 +1372,7 @@ "include": "#comments" }, { + "contentName": "comment.block.preprocessor.else-branch.c", "begin": "^\\s*((#)\\s*else\\b)", "beginCaptures": { "0": { @@ -3251,7 +1386,6 @@ } }, "end": "(?=^\\s*((#)\\s*endif\\b))", - "contentName": "comment.block.preprocessor.else-branch.c", "patterns": [ { "include": "#disabled" @@ -3262,6 +1396,7 @@ ] }, { + "contentName": "comment.block.preprocessor.if-branch.c", "begin": "^\\s*((#)\\s*elif\\b)", "beginCaptures": { "0": { @@ -3275,7 +1410,6 @@ } }, "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", - "contentName": "comment.block.preprocessor.if-branch.c", "patterns": [ { "include": "#disabled" @@ -3340,6 +1474,7 @@ "include": "#comments" }, { + "contentName": "comment.block.preprocessor.else-branch.in-block.c", "begin": "^\\s*((#)\\s*else\\b)", "beginCaptures": { "0": { @@ -3353,7 +1488,6 @@ } }, "end": "(?=^\\s*((#)\\s*endif\\b))", - "contentName": "comment.block.preprocessor.else-branch.in-block.c", "patterns": [ { "include": "#disabled" @@ -3364,6 +1498,7 @@ ] }, { + "contentName": "comment.block.preprocessor.if-branch.in-block.c", "begin": "^\\s*((#)\\s*elif\\b)", "beginCaptures": { "0": { @@ -3377,7 +1512,6 @@ } }, "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", - "contentName": "comment.block.preprocessor.if-branch.in-block.c", "patterns": [ { "include": "#disabled" @@ -3433,6 +1567,7 @@ "end": "(?=^\\s*((#)\\s*(?:endif)\\b))", "patterns": [ { + "contentName": "comment.block.preprocessor.elif-branch.c", "begin": "^\\s*((#)\\s*(else)\\b)", "beginCaptures": { "0": { @@ -3446,7 +1581,6 @@ } }, "end": "(?=^\\s*((#)\\s*endif\\b))", - "contentName": "comment.block.preprocessor.elif-branch.c", "patterns": [ { "include": "#disabled" @@ -3457,6 +1591,7 @@ ] }, { + "contentName": "comment.block.preprocessor.elif-branch.c", "begin": "^\\s*((#)\\s*(elif)\\b)", "beginCaptures": { "0": { @@ -3470,7 +1605,6 @@ } }, "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", - "contentName": "comment.block.preprocessor.elif-branch.c", "patterns": [ { "include": "#disabled" @@ -3520,6 +1654,7 @@ "end": "(?=^\\s*((#)\\s*(?:endif)\\b))", "patterns": [ { + "contentName": "comment.block.preprocessor.elif-branch.in-block.c", "begin": "^\\s*((#)\\s*(else)\\b)", "beginCaptures": { "0": { @@ -3533,7 +1668,6 @@ } }, "end": "(?=^\\s*((#)\\s*endif\\b))", - "contentName": "comment.block.preprocessor.elif-branch.in-block.c", "patterns": [ { "include": "#disabled" @@ -3544,6 +1678,7 @@ ] }, { + "contentName": "comment.block.preprocessor.elif-branch.c", "begin": "^\\s*((#)\\s*(elif)\\b)", "beginCaptures": { "0": { @@ -3557,7 +1692,6 @@ } }, "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", - "contentName": "comment.block.preprocessor.elif-branch.c", "patterns": [ { "include": "#disabled" @@ -3938,6 +2072,524 @@ "include": "#block_innards" } ] + }, + "default_statement": { + "name": "meta.conditional.case.c", + "begin": "((?\\[\\]=]))", + "patterns": [ + { + "name": "meta.head.switch.c", + "begin": "\\G ?", + "end": "((?:\\{|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.switch.c" + } + }, + "patterns": [ + { + "include": "#switch_conditional_parentheses" + }, + { + "include": "$base" + } + ] + }, + { + "name": "meta.body.switch.c", + "begin": "(?<=\\{)", + "end": "(\\})", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.switch.c" + } + }, + "patterns": [ + { + "include": "#default_statement" + }, + { + "include": "#case_statement" + }, + { + "include": "$base" + }, + { + "include": "#block_innards" + } + ] + }, + { + "name": "meta.tail.switch.c", + "begin": "(?<=})[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "patterns": [ + { + "include": "$base" + } + ] + } + ] + }, + "switch_conditional_parentheses": { + "name": "meta.conditional.switch.c", + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.conditional.switch.c" + } + }, + "patterns": [ + { + "include": "#conditional_context" + } + ] + }, + "static_assert": { + "begin": "(static_assert|_Static_assert)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.static_assert.c" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.c" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.c" + } + }, + "patterns": [ + { + "name": "meta.static_assert.message.c", + "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", + "beginCaptures": { + "1": { + "name": "comma.c punctuation.separator.delimiter.c" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#string_context" + }, + { + "include": "#string_context_c" + } + ] + }, + { + "include": "#function_call_context_c" + } + ] + }, + "conditional_context": { + "patterns": [ + { + "include": "$base" + }, + { + "include": "#block_innards" + } + ] + }, + "member_access": { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:void|char|short|int|signed|unsigned|long|float|double|bool|_Bool|_Complex|_Imaginary|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|memory_order|atomic_bool|atomic_char|atomic_schar|atomic_uchar|atomic_short|atomic_ushort|atomic_int|atomic_uint|atomic_long|atomic_ulong|atomic_llong|atomic_ullong|atomic_char16_t|atomic_char32_t|atomic_wchar_t|atomic_int_least8_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_least16_t|atomic_int_least32_t|atomic_uint_least32_t|atomic_int_least64_t|atomic_uint_least64_t|atomic_int_fast8_t|atomic_uint_fast8_t|atomic_int_fast16_t|atomic_uint_fast16_t|atomic_int_fast32_t|atomic_uint_fast32_t|atomic_int_fast64_t|atomic_uint_fast64_t|atomic_intptr_t|atomic_uintptr_t|atomic_size_t|atomic_ptrdiff_t|atomic_intmax_t|atomic_uintmax_t))[a-zA-Z_]\\w*\\b(?!\\())", + "captures": { + "1": { + "name": "variable.other.object.access.c" + }, + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.c" + }, + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + } + } + } + ] + }, + "5": { + "name": "variable.other.member.c" + } + } + }, + "method_access": { + "contentName": "meta.function-call.member", + "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.other.object.access.c" + }, + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.c" + }, + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + } + } + } + ] + }, + "5": { + "name": "entity.name.function.member.c" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.c" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.c" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "numbers": { + "begin": "(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))", - "captures": { - "1": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "2": { - "name": "comment.block.cpp" - }, - "3": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "macro_name": { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*pragma\\s+mark)\\s+(.*)", - "captures": { - "1": { - "name": "keyword.control.directive.pragma.pragma-mark.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.definition.directive.cpp" - }, - "7": { - "name": "entity.name.tag.pragma-mark.cpp" - } - }, - "name": "meta.preprocessor.pragma.cpp" - }, - "pragma": { - "name": "meta.preprocessor.pragma.cpp", - "begin": "((?:^)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*pragma\\b)", + "sizeof_operator": { + "contentName": "meta.arguments.operator.sizeof", + "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((#)\\s*((?:(?:include|include_next)|import))\\b)\\s*(?:(?:(?:((<)[^>]*(>?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:\\n|$)|(?=\\/\\/)))|((\\\")[^\\\"]*(\\\"?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:\\n|$)|(?=\\/\\/))))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:\\n|$)|(?=\\/\\/))))|((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:\\n|$)|(?=\\/\\/)))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "keyword.control.directive.$7.cpp" - }, - "6": { - "name": "punctuation.definition.directive.cpp" - }, - "8": { - "name": "string.quoted.other.lt-gt.include.cpp" - }, - "9": { - "name": "punctuation.definition.string.begin.cpp" - }, - "10": { - "name": "punctuation.definition.string.end.cpp" - }, - "11": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "12": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "13": { - "name": "comment.block.cpp" - }, - "14": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "15": { - "name": "string.quoted.double.include.cpp" - }, - "16": { - "name": "punctuation.definition.string.begin.cpp" - }, - "17": { - "name": "punctuation.definition.string.end.cpp" - }, - "18": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "19": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "20": { - "name": "comment.block.cpp" - }, - "21": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "22": { - "name": "entity.name.other.preprocessor.macro.include.cpp" - }, - "23": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "24": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "25": { - "name": "comment.block.cpp" - }, - "26": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "27": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "28": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "29": { - "name": "comment.block.cpp" - }, - "30": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "meta.preprocessor.include.cpp" - }, - "line": { - "name": "meta.preprocessor.line.cpp", - "begin": "((?:^)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*line\\b)", - "beginCaptures": { - "1": { - "name": "keyword.control.directive.line.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.definition.directive.cpp" - } - }, - "end": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*((?:error|warning)))\\b\\s*", - "beginCaptures": { - "1": { - "name": "keyword.control.directive.diagnostic.$7.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.definition.directive.cpp" - } - }, - "end": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*undef\\b)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))#define.*(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*define\\b)\\s*((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*((?:(?:ifndef|ifdef)|if)))", - "beginCaptures": { - "1": { - "name": "keyword.control.directive.conditional.$7.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.definition.directive.cpp" - } - }, - "patterns": [ - { - "name": "meta.preprocessor.conditional.cpp", - "begin": "\\G(?<=ifndef|ifdef|if)", - "end": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(#)\\s*((?[#;\\/=*C~]+)(?![#;\\/=*C~]))\\s*.+\\s*\\8\\s*(?:\\n|$)))|(^\\s*((\\/\\*)\\s*?((?>[#;\\/=*C~]+)(?![#;\\/=*C~]))\\s*.+\\s*\\8\\s*\\*\\/)))", - "captures": { - "1": { - "name": "meta.toc-list.banner.double-slash.cpp" - }, - "2": { - "name": "comment.line.double-slash.cpp" - }, - "3": { - "name": "punctuation.definition.comment.cpp" - }, - "4": { - "name": "meta.banner.character.cpp" - }, - "5": { - "name": "meta.toc-list.banner.block.cpp" - }, - "6": { - "name": "comment.line.banner.cpp" - }, - "7": { - "name": "punctuation.definition.comment.cpp" - }, - "8": { - "name": "meta.banner.character.cpp" - } - } - }, - "invalid_comment_end": { - "match": "\\*\\/", - "name": "invalid.illegal.unexpected.punctuation.definition.comment.end.cpp" - }, - "comments": { - "patterns": [ - { - "include": "#emacs_file_banner" - }, - { - "include": "#block_comment" - }, - { - "include": "#line_comment" - }, - { - "include": "#invalid_comment_end" - } - ] - }, "number_literal": { "begin": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.functionlike.cpp keyword.other.decltype.cpp storage.type.decltype.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.decltype.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.decltype.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "decltype": { - "contentName": "meta.arguments.decltype.cpp", - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.functionlike.cpp keyword.other.decltype.cpp storage.type.decltype.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.decltype.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.decltype.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "pthread_types": { - "match": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(((?:private|protected|public))\\s*(:))", + "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:(delete)\\s*(\\[\\])|(delete))|(new))(?!\\w))", + "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)", - "captures": { - "1": { - "name": "keyword.control.goto.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.label.call.cpp" - } - } - }, - "label": { - "match": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "entity.name.label.cpp" - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "name": "punctuation.separator.label.cpp" - } - } + "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", + "begin": "(\\()", "beginCaptures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.cpp" } }, @@ -2562,55 +772,27 @@ }, "patterns": [ { - "include": "#evaluation_context" - }, - { - "include": "#c_conditional_context" + "include": "#conditional_context" } ] }, "switch_statement": { "name": "meta.block.switch.cpp", - "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?|\\?\\?>)|(?=[;>\\[\\]=]))", + "end": "(?:(?<=\\})|(?=[;>\\[\\]=]))", "patterns": [ { "name": "meta.head.switch.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "((?:\\{|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.switch.cpp" @@ -2621,14 +803,14 @@ "include": "#switch_conditional_parentheses" }, { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.body.switch.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "begin": "(?<=\\{)", + "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.switch.cpp" @@ -2642,7 +824,7 @@ "include": "#case_statement" }, { - "include": "$self" + "include": "$base" }, { "include": "#block_innards" @@ -2651,11 +833,11 @@ }, { "name": "meta.tail.switch.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "begin": "(?<=})[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$self" + "include": "$base" } ] } @@ -2692,13 +874,13 @@ ] }, { - "match": "(using)\\s+((?(?:(?>[^<>]*)\\g<1>?)+)>)\\s*", + "match": "(?:,\\w])*>\\s*", "captures": { "0": { "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_range" + "include": "#template_call_context" } ] } @@ -2947,7 +1133,7 @@ ] }, "template_isolated_definition": { - "match": "(?\\s*$)", + "match": "(?\\s*$)", "captures": { "1": { "name": "storage.type.template.cpp" @@ -3011,7 +1197,7 @@ ] }, "template_argument_defaulted": { - "match": "(?<=<|,)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s+)*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*([=])", + "match": "(?<=<|,)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s+)*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*([=])", "captures": { "1": { "name": "storage.type.template.cpp" @@ -3025,674 +1211,68 @@ } }, "template_definition_argument": { - "match": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*(\\.\\.\\.)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*(?:(,)|(?=>|$))", + "match": "(?:(?:\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(\\.\\.\\.)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*))\\s*(?:(,)|(?=>|$))", "captures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "storage.type.template.argument.$1.cpp" }, "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "name": "storage.type.template.argument.$2.cpp" }, "3": { - "name": "comment.block.cpp" + "name": "entity.name.type.template.cpp" }, "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "storage.type.template.argument.$5.cpp" - }, - "6": { - "patterns": [ - { - "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", - "name": "storage.type.template.argument.$0.cpp" - } - ] - }, - "7": { - "name": "entity.name.type.template.cpp" - }, - "8": { "name": "storage.type.template.cpp" }, - "9": { - "name": "punctuation.vararg-ellipses.template.definition.cpp" + "5": { + "name": "ellipses.cpp punctuation.vararg-ellipses.template.definition.cpp" }, - "10": { + "6": { "name": "entity.name.type.template.cpp" }, - "11": { - "name": "punctuation.separator.delimiter.comma.template.argument.cpp" + "7": { + "name": "comma.cpp punctuation.separator.template.argument.cpp" } } }, "scope_resolution": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", + "match": "((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)", "captures": { - "0": { + "1": { "patterns": [ { - "include": "#scope_resolution_inner_generated" + "include": "#scope_resolution" } ] }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + "2": { + "name": "entity.name.type.namespace.scope-resolution.cpp" }, "3": { "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_range" + "include": "#template_call_context" } ] - } - } - }, - "scope_resolution_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + "name": "punctuation.separator.namespace.access.cpp" } - } - }, - "scope_resolution_template_call": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_template_call_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_template_call_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_template_call_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.template.call.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" - } - } - }, - "scope_resolution_template_definition": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_template_definition_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_template_definition_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_template_definition_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.template.definition.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" - } - } - }, - "scope_resolution_function_call": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_function_call_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_function_call_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_function_call_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.function.call.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" - } - } - }, - "scope_resolution_function_definition": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_function_definition_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.function.definition.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - } - } - }, - "scope_resolution_namespace_alias": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_namespace_alias_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_namespace_alias_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_namespace_alias_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.namespace.alias.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" - } - } - }, - "scope_resolution_namespace_using": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_namespace_using_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_namespace_using_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_namespace_using_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.namespace.using.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" - } - } - }, - "scope_resolution_namespace_block": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_namespace_block_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_namespace_block_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_namespace_block_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.namespace.block.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" - } - } - }, - "scope_resolution_parameter": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_parameter_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_parameter_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_parameter_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.parameter.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.parameter.cpp" - } - } - }, - "scope_resolution_function_definition_operator_overload": { - "match": "(::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<4>?)+)>)\\s*)?::)*\\s*+", - "captures": { - "0": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_operator_overload_inner_generated" - } - ] - }, - "1": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" - }, - "3": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - } - } - }, - "scope_resolution_function_definition_operator_overload_inner_generated": { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<8>?)+)>)\\s*)?(::)", - "captures": { - "1": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_operator_overload_inner_generated" - } - ] - }, - "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { - "name": "entity.name.scope-resolution.function.definition.operator-overload.cpp" - }, - "7": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "9": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" - } - } + }, + "name": "meta.scope-resolution.cpp" }, "qualified_type": { - "match": "\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<26>?)+)>)\\s*)?(?![\\w<:.])", + "match": "\\s*(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.])", "captures": { "0": { - "name": "meta.qualified_type.cpp", + "name": "entity.name.type.cpp meta.qualified_type.cpp", "patterns": [ { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?", - "captures": { - "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "name": "punctuation.separator.namespace.access.cpp" } } }, "type_alias": { - "match": "(using)\\s*(?!namespace)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(?![\\w<:.]))\\s*(\\=)\\s*((?:typename)?)\\s*((?:(?:(?:(?:(?>\\s+)|(?:\\/\\*)(?:(?>(?:[^\\*]|(?>\\*+)[^\\/])*)(?:(?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<58>?)+)>)\\s*)?(?![\\w<:.]))|(.*(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:(\\[)(\\w*)(\\])\\s*)?\\s*(?:(;)|\\n)", + "match": "(using)\\s*(?!namespace)(\\s*(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))\\s*(\\=)\\s*(typename)?\\s*((?:(?-mix:(?:(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))|(.+(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] + "21": { + "name": "storage.modifier.pointer.cpp" }, - "61": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "22": { + "name": "storage.modifier.reference.cpp" }, - "62": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "63": { - "name": "comment.block.cpp" - }, - "64": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "65": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "66": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "67": { - "name": "comment.block.cpp" - }, - "68": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "69": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "70": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "71": { - "name": "comment.block.cpp" - }, - "72": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "73": { + "23": { "name": "punctuation.definition.begin.bracket.square.cpp" }, - "74": { + "24": { "patterns": [ { "include": "#evaluation_context" } ] }, - "75": { + "25": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "76": { + "26": { "name": "punctuation.terminator.statement.cpp" } }, "name": "meta.declaration.type.alias.cpp" }, - "typename": { - "match": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<36>?)+)>)\\s*)?(?![\\w<:.]))", + "struct_declare": { + "match": "(struct)\\s+((?))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\())", - "beginCaptures": { - "1": { - "name": "meta.head.function.definition.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "storage.type.template.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "name": "storage.modifier.$11.cpp" - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "44": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "45": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "46": { - "name": "comment.block.cpp" - }, - "47": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "48": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "49": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "50": { - "name": "comment.block.cpp" - }, - "51": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "52": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "53": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "54": { - "name": "comment.block.cpp" - }, - "55": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "56": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "57": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "58": { - "name": "comment.block.cpp" - }, - "59": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "60": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "61": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "62": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "63": { - "name": "comment.block.cpp" - }, - "64": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "65": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_inner_generated" - } - ] - }, - "66": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - }, - "68": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "70": { - "name": "entity.name.function.definition.cpp" - }, - "71": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "72": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "73": { - "name": "comment.block.cpp" - }, - "74": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", + "name": "meta.function.definition.parameters.cpp", + "begin": "(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "operator_overload": { - "name": "meta.function.definition.special.operator-overload.cpp", - "begin": "((?:(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(operator)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(?:(?:((?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|new|new\\[\\]|delete|delete\\[\\]|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,))|((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\<|\\())", - "beginCaptures": { - "1": { - "name": "meta.head.function.definition.special.operator-overload.cpp" - }, - "2": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "30": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "34": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "35": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "36": { - "name": "comment.block.cpp" - }, - "37": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "38": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "39": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "40": { - "name": "comment.block.cpp" - }, - "41": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "42": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "43": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "44": { - "name": "comment.block.cpp" - }, - "45": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "46": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "47": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "48": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "49": { - "name": "comment.block.cpp" - }, - "50": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "51": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "52": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "53": { - "name": "comment.block.cpp" - }, - "54": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "55": { - "patterns": [ - { - "match": "::", - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.operator.cpp" - }, - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "entity.name.operator.type.reference.cpp" - } - ] - }, - "71": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "72": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "73": { - "name": "comment.block.cpp" - }, - "74": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "75": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "76": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "77": { - "name": "comment.block.cpp" - }, - "78": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "79": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "80": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "81": { - "name": "comment.block.cpp" - }, - "82": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "83": { - "name": "entity.name.operator.type.array.cpp" - }, - "84": { - "name": "entity.name.operator.custom-literal.cpp" - }, - "85": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "86": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "87": { - "name": "comment.block.cpp" - }, - "88": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "89": { - "name": "entity.name.operator.custom-literal.cpp" - }, - "90": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "91": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "92": { - "name": "comment.block.cpp" - }, - "93": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", - "patterns": [ - { - "name": "meta.head.function.definition.special.operator-overload.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.operator-overload.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#template_call_range" - }, - { - "contentName": "meta.function.definition.parameters.special.operator-overload.cpp", - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parameters.begin.bracket.round.special.operator-overload.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.special.operator-overload.cpp" - } - }, - "patterns": [ - { - "include": "#function_parameter_context" - }, - { - "include": "#evaluation_context" - } - ] - }, - { - "include": "#qualifiers_and_specifiers_post_parameters" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.body.function.definition.special.operator-overload.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.operator-overload.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.operator-overload.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] + "include": "#function_context_c" } ] }, "static_assert": { - "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", + "begin": "(static_assert|_Static_assert)\\s*(\\()", "beginCaptures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { "name": "keyword.other.static_assert.cpp" }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "name": "punctuation.section.arguments.begin.bracket.round.static_assert.cpp" + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.cpp" } }, "end": "(\\))", "endCaptures": { "1": { - "name": "punctuation.section.arguments.end.bracket.round.static_assert.cpp" + "name": "punctuation.section.arguments.end.bracket.round.cpp" } }, "patterns": [ @@ -7171,7 +1569,7 @@ "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", "beginCaptures": { "1": { - "name": "punctuation.separator.delimiter.comma.cpp" + "name": "comma.cpp punctuation.separator.delimiter.cpp" } }, "end": "(?=\\))", @@ -7185,1644 +1583,70 @@ ] }, { - "include": "#evaluation_context" + "include": "#function_call_context_c" } ] }, "function_call": { - "begin": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<12>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(((?(?:(?>[^<>]*)\\g<12>?)+)>)\\s*)?(\\()", + "begin": "(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(\\()", "beginCaptures": { "1": { "patterns": [ { - "include": "#scope_resolution_function_call_inner_generated" + "include": "#scope_resolution" } ] }, "2": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" - }, - "4": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "6": { "name": "entity.name.function.call.cpp" }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { + "3": { "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_range" + "include": "#template_call_context" } ] }, - "13": { - "name": "punctuation.section.arguments.begin.bracket.round.function.call.cpp" + "4": { + "name": "punctuation.section.arguments.begin.bracket.round.cpp" } }, "end": "(\\))", "endCaptures": { "1": { - "name": "punctuation.section.arguments.end.bracket.round.function.call.cpp" + "name": "punctuation.section.arguments.end.bracket.round.cpp" } }, "patterns": [ { - "include": "#evaluation_context" + "include": "#function_call_context_c" } ] }, - "curly_initializer": { - "name": "meta.initialization.cpp", - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\{)", + "legacy_function_definition": { + "name": "meta.function.definition.parameters.cpp", + "begin": "(?!(?:(?:::|\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\.|\\->|\\+\\+|\\-\\-|\\+|\\-|!|not|~|compl|\\*|&|sizeof|sizeof\\.\\.\\.|new|new\\[\\]|delete|delete\\[\\]|\\.\\*|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|not_eq|&|bitand|\\^|xor|\\||bitor|&&|and|\\|\\||or|\\?:|throw|=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|and_eq|\\^=|xor_eq|\\|=|or_eq|,|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast)|(?:throw|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default))\\s*\\()((?:(?-mix:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|::)++|(?<=operator)(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|new|new\\[\\]|delete|delete\\[\\]|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)))\\s*(\\()", "beginCaptures": { "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "6": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "7": { - "name": "comment.block.cpp" - }, - "8": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "9": { - "name": "storage.type.primitive.cpp storage.type.built-in.primitive.cpp" - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "storage.type.cpp storage.type.built-in.cpp" - }, - "15": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "16": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "17": { - "name": "comment.block.cpp" - }, - "18": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "19": { - "name": "support.type.posix-reserved.pthread.cpp support.type.built-in.posix-reserved.pthread.cpp" - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "support.type.posix-reserved.cpp support.type.built-in.posix-reserved.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "name": "punctuation.section.arguments.begin.bracket.round.initializer.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.initializer.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "constructor_inline": { - "name": "meta.function.definition.special.constructor.cpp", - "begin": "(^((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:inline|constexpr|mutable|friend|explicit|virtual)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?|\\?\\?>)|(?=[;>\\[\\]=]))", - "patterns": [ - { - "name": "meta.head.function.definition.special.constructor.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.constructor.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "patterns": [ - { - "match": "(\\=)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "include": "#functional_specifiers_pre_parameters" - }, - { - "begin": "(:)", - "beginCaptures": { - "1": { - "name": "punctuation.separator.initializers.cpp" - } - }, - "end": "(?=\\{)", - "patterns": [ - { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?(?:(?>[^<>]*)\\g<3>?)+)>)\\s*)?(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.call.initializer.cpp" - }, - "2": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "4": { - "name": "punctuation.section.arguments.begin.bracket.round.function.call.initializer.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.function.call.initializer.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.constructor.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.constructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "constructor_root": { - "name": "meta.function.definition.special.constructor.cpp", - "begin": "(\\s*+((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))::((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\16((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\()))", - "beginCaptures": { - "1": { - "name": "meta.head.function.definition.special.constructor.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "::", - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.constructor.cpp" - }, - { - "match": "(?|\\?\\?>)|(?=[;>\\[\\]=]))", - "patterns": [ - { - "name": "meta.head.function.definition.special.constructor.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.constructor.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "patterns": [ - { - "match": "(\\=)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "include": "#functional_specifiers_pre_parameters" - }, - { - "begin": "(:)", - "beginCaptures": { - "1": { - "name": "punctuation.separator.initializers.cpp" - } - }, - "end": "(?=\\{)", - "patterns": [ - { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?(?:(?>[^<>]*)\\g<3>?)+)>)\\s*)?(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.call.initializer.cpp" - }, - "2": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "4": { - "name": "punctuation.section.arguments.begin.bracket.round.function.call.initializer.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.function.call.initializer.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.constructor.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.constructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "destructor_inline": { - "name": "meta.function.definition.special.member.destructor.cpp", - "begin": "(^((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:inline|constexpr|mutable|friend|explicit|virtual)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*)(~(?|\\?\\?>)|(?=[;>\\[\\]=]))", - "patterns": [ - { - "name": "meta.head.function.definition.special.member.destructor.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.member.destructor.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "patterns": [ - { - "match": "(\\=)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "contentName": "meta.function.definition.parameters.special.member.destructor.cpp", - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parameters.begin.bracket.round.special.member.destructor.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.special.member.destructor.cpp" - } - } - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.body.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.member.destructor.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "destructor_root": { - "name": "meta.function.definition.special.member.destructor.cpp", - "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))::((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))~\\16((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\()))", - "beginCaptures": { - "1": { - "name": "meta.head.function.definition.special.member.destructor.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "::", - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.destructor.cpp" - }, - { - "match": "(?|\\?\\?>)|(?=[;>\\[\\]=]))", - "patterns": [ - { - "name": "meta.head.function.definition.special.member.destructor.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.function.definition.special.member.destructor.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "patterns": [ - { - "match": "(\\=)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "contentName": "meta.function.definition.parameters.special.member.destructor.cpp", - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parameters.begin.bracket.round.special.member.destructor.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.special.member.destructor.cpp" - } - } - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.body.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.member.destructor.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] + "include": "#function_context_c" } ] }, @@ -8841,7 +1665,24 @@ "include": "#typeid_operator" }, { - "include": "#noexcept_operator" + "include": "#decltype_specifier" + }, + { + "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.functionlike.cpp keyword.operator.sizeof.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "keyword.operator.ternary.cpp" } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { + }, + "end": ":", + "applyEndPatternLast": true, + "endCaptures": { + "0": { + "name": "keyword.operator.ternary.cpp" + } + }, "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + "include": "#method_access" }, { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.operator.sizeof.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.operator.sizeof.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "alignof_operator": { - "contentName": "meta.arguments.operator.alignof.cpp", - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.functionlike.cpp keyword.operator.alignof.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + "include": "#member_access" }, { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.operator.alignof.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.operator.alignof.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "alignas_operator": { - "contentName": "meta.arguments.operator.alignas.cpp", - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.functionlike.cpp keyword.operator.alignas.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + "include": "#function_call_c" }, { - "match": "\\*", - "name": "comment.block.cpp" + "include": "$base" } ] - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.operator.alignas.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.operator.alignas.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "typeid_operator": { - "contentName": "meta.arguments.operator.typeid.cpp", - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.functionlike.cpp keyword.operator.typeid.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.operator.typeid.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.operator.typeid.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "noexcept_operator": { - "contentName": "meta.arguments.operator.noexcept.cpp", - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.functionlike.cpp keyword.operator.noexcept.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.operator.noexcept.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.operator.noexcept.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "ternary_operator": { - "applyEndPatternLast": true, - "begin": "(\\?)", - "beginCaptures": { - "1": { - "name": "keyword.operator.ternary.cpp" - } - }, - "end": "(:)", - "endCaptures": { - "1": { - "name": "keyword.operator.ternary.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#string_context" - }, - { - "include": "#number_literal" - }, - { - "include": "#string_context_c" - }, - { - "include": "#method_access" - }, - { - "include": "#member_access" - }, - { - "include": "#predefined_macros" - }, - { - "include": "#operators" - }, - { - "include": "#memory_operators" - }, - { - "include": "#wordlike_operators" - }, - { - "include": "#type_casting_operators" - }, - { - "include": "#control_flow_keywords" - }, - { - "include": "#exception_keywords" - }, - { - "include": "#the_this_keyword" - }, - { - "include": "#language_constants" - }, - { - "include": "#builtin_storage_type_initilizer" - }, - { - "include": "#qualifiers_and_specifiers_post_parameters" - }, - { - "include": "#functional_specifiers_pre_parameters" - }, - { - "include": "#storage_types" - }, - { - "include": "#misc_storage_modifiers" - }, - { - "include": "#lambdas" - }, - { - "include": "#attributes_context" - }, - { - "include": "#parentheses" - }, - { - "include": "#function_call" - }, - { - "include": "#scope_resolution_inner_generated" - }, - { - "include": "#square_brackets" - }, - { - "include": "#empty_square_brackets" - }, - { - "include": "#semicolon" - }, - { - "include": "#comma" } ] }, "function_pointer": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "begin": "(\\s*(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))\\s*(((?:\\*\\s*)*)((?:\\&\\s*?){0,2})\\s*)(\\()(\\*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)?\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", "beginCaptures": { "1": { - "name": "meta.qualified_type.cpp", + "name": "entity.name.type.cpp meta.qualified_type.cpp", "patterns": [ { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "39": { - "name": "comment.block.cpp" - }, - "40": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "41": { + "11": { "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" }, - "42": { + "12": { "name": "punctuation.definition.function.pointer.dereference.cpp" }, - "43": { + "13": { "name": "variable.other.definition.pointer.function.cpp" }, - "44": { + "14": { "name": "punctuation.definition.begin.bracket.square.cpp" }, - "45": { - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "46": { - "name": "punctuation.definition.end.bracket.square.cpp" - }, - "47": { - "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" - }, - "48": { - "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" - } - }, - "end": "(\\))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=[{=,);]|\\n)(?!\\()", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "patterns": [ - { - "include": "#function_parameter_context" - } - ] - }, - "function_pointer_parameter": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", - "beginCaptures": { - "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "39": { - "name": "comment.block.cpp" - }, - "40": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "41": { - "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" - }, - "42": { - "name": "punctuation.definition.function.pointer.dereference.cpp" - }, - "43": { - "name": "variable.parameter.pointer.function.cpp" - }, - "44": { - "name": "punctuation.definition.begin.bracket.square.cpp" - }, - "45": { "patterns": [ { "include": "#evaluation_context" } ] }, - "46": { + "16": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "47": { + "17": { "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" }, - "48": { + "18": { "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" } }, - "end": "(\\))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=[{=,);]|\\n)(?!\\()", + "end": "(\\))\\s*(?=[{=,);]|\\n)(?!\\()", "endCaptures": { "1": { "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] } }, "patterns": [ { - "include": "#function_parameter_context" - } - ] - }, - "typedef_function_pointer": { - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", - "beginCaptures": { - "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "38": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "39": { - "name": "comment.block.cpp" - }, - "40": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "41": { - "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" - }, - "42": { - "name": "punctuation.definition.function.pointer.dereference.cpp" - }, - "43": { - "name": "entity.name.type.alias.cpp entity.name.type.pointer.function.cpp" - }, - "44": { - "name": "punctuation.definition.begin.bracket.square.cpp" - }, - "45": { - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - "46": { - "name": "punctuation.definition.end.bracket.square.cpp" - }, - "47": { - "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" - }, - "48": { - "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" - } - }, - "end": "(\\))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=[{=,);]|\\n)(?!\\()", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "patterns": [ - { - "include": "#function_parameter_context" - } - ] + "include": "#probably_a_parameter" + }, + { + "include": "#function_context_c" } ] }, - "parameter_or_maybe_value": { - "name": "meta.parameter.cpp", - "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\w)", - "beginCaptures": { + "probably_a_parameter": { + "match": "(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?==))|((?<=\\w |\\*\\/|[&*>\\]\\)]|\\.\\.\\.)\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))))", + "captures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] + "name": "variable.parameter.defaulted.cpp" }, "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + "name": "variable.parameter.cpp" + } + } + }, + "operator_overload": { + "name": "meta.function.definition.parameters.operator-overload.cpp", + "begin": "(operator)((?:\\s*(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)|\\s+(?:(?:new|new\\[\\]|delete|delete\\[\\])|(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?::)*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:&)?)))\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.operator.overload.cpp" }, - "3": { - "name": "comment.block.cpp" - }, - "4": { + "2": { + "name": "entity.name.operator.overloadee.cpp", "patterns": [ { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" + "include": "#scope_resolution" } ] + }, + "3": { + "name": "punctuation.section.parameters.begin.bracket.round.operator-overload.cpp" } }, - "end": "(?:(?=\\))|(,))", + "end": "(\\))", "endCaptures": { "1": { - "name": "punctuation.separator.delimiter.comma.cpp" + "name": "punctuation.section.parameters.end.bracket.round.operator-overload.cpp" } }, "patterns": [ { - "include": "#ever_present_context" + "include": "#probably_a_parameter" }, { - "include": "#function_pointer_parameter" - }, - { - "include": "#memory_operators" - }, - { - "include": "#builtin_storage_type_initilizer" - }, - { - "include": "#curly_initializer" - }, - { - "include": "#decltype" - }, - { - "include": "#vararg_ellipses" - }, - { - "match": "((?:((?:const|static|volatile|register|restrict|extern))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))+)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=,|\\)|=)", - "captures": { - "1": { - "patterns": [ - { - "include": "#storage_types" - } - ] - }, - "2": { - "name": "storage.modifier.specifier.parameter.cpp" - }, - "3": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "4": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "5": { - "name": "comment.block.cpp" - }, - "6": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "12": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "13": { - "name": "comment.block.cpp" - }, - "14": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "15": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "16": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "17": { - "name": "comment.block.cpp" - }, - "18": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "19": { - "name": "storage.type.primitive.cpp storage.type.built-in.primitive.cpp" - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "storage.type.cpp storage.type.built-in.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "name": "support.type.posix-reserved.pthread.cpp support.type.built-in.posix-reserved.pthread.cpp" - }, - "30": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "34": { - "name": "support.type.posix-reserved.cpp support.type.built-in.posix-reserved.cpp" - }, - "35": { - "name": "entity.name.type.parameter.cpp" - }, - "36": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "37": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "38": { - "name": "comment.block.cpp" - }, - "39": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - { - "include": "#storage_types" - }, - { - "include": "#function_call" - }, - { - "include": "#scope_resolution_parameter_inner_generated" - }, - { - "match": "(?:class|struct|union|enum)", - "name": "storage.type.$0.cpp" - }, - { - "begin": "(?<==)", - "end": "(?:(?=\\))|(,))", - "endCaptures": { - "1": { - "name": "punctuation.separator.delimiter.comma.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=(?:\\)|,|\\[|=|\\/\\/|(?:\\n|$)))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "variable.parameter.cpp" - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - { - "include": "#attributes_context" - }, - { - "name": "meta.bracket.square.array.cpp", - "begin": "(\\[)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.begin.bracket.square.array.type.cpp" - } - }, - "end": "(\\])", - "endCaptures": { - "1": { - "name": "punctuation.definition.end.bracket.square.array.type.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\b(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*)", - "captures": { - "0": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "6": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "7": { - "name": "comment.block.cpp" - }, - "8": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - { - "include": "#evaluation_context" - } - ] - }, - "parameter": { - "name": "meta.parameter.cpp", - "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\w)", - "beginCaptures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "end": "(?:(?=\\))|(,))", - "endCaptures": { - "1": { - "name": "punctuation.separator.delimiter.comma.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#function_pointer_parameter" - }, - { - "include": "#decltype" - }, - { - "include": "#vararg_ellipses" - }, - { - "match": "((?:((?:const|static|volatile|register|restrict|extern))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))+)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=,|\\)|=)", - "captures": { - "1": { - "patterns": [ - { - "include": "#storage_types" - } - ] - }, - "2": { - "name": "storage.modifier.specifier.parameter.cpp" - }, - "3": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "4": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "5": { - "name": "comment.block.cpp" - }, - "6": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "12": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "13": { - "name": "comment.block.cpp" - }, - "14": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "15": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "16": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "17": { - "name": "comment.block.cpp" - }, - "18": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "19": { - "name": "storage.type.primitive.cpp storage.type.built-in.primitive.cpp" - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "storage.type.cpp storage.type.built-in.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "name": "support.type.posix-reserved.pthread.cpp support.type.built-in.posix-reserved.pthread.cpp" - }, - "30": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "34": { - "name": "support.type.posix-reserved.cpp support.type.built-in.posix-reserved.cpp" - }, - "35": { - "name": "entity.name.type.parameter.cpp" - }, - "36": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "37": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "38": { - "name": "comment.block.cpp" - }, - "39": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - { - "include": "#storage_types" - }, - { - "include": "#scope_resolution_parameter_inner_generated" - }, - { - "match": "(?:class|struct|union|enum)", - "name": "storage.type.$0.cpp" - }, - { - "begin": "(?<==)", - "end": "(?:(?=\\))|(,))", - "endCaptures": { - "1": { - "name": "punctuation.separator.delimiter.comma.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "include": "#assignment_operator" - }, - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\)|,|\\[|=|\\n)", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "variable.parameter.cpp" - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - { - "include": "#attributes_context" - }, - { - "name": "meta.bracket.square.array.cpp", - "begin": "(\\[)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.begin.bracket.square.array.type.cpp" - } - }, - "end": "(\\])", - "endCaptures": { - "1": { - "name": "punctuation.definition.end.bracket.square.array.type.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\b(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*)", - "captures": { - "0": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "6": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "7": { - "name": "comment.block.cpp" - }, - "8": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } + "include": "#function_context_c" } ] }, "member_access": { - "match": "(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!auto[^(?-mix:\\w)]|void[^(?-mix:\\w)]|char[^(?-mix:\\w)]|short[^(?-mix:\\w)]|int[^(?-mix:\\w)]|signed[^(?-mix:\\w)]|unsigned[^(?-mix:\\w)]|long[^(?-mix:\\w)]|float[^(?-mix:\\w)]|double[^(?-mix:\\w)]|bool[^(?-mix:\\w)]|wchar_t[^(?-mix:\\w)]|u_char[^(?-mix:\\w)]|u_short[^(?-mix:\\w)]|u_int[^(?-mix:\\w)]|u_long[^(?-mix:\\w)]|ushort[^(?-mix:\\w)]|uint[^(?-mix:\\w)]|u_quad_t[^(?-mix:\\w)]|quad_t[^(?-mix:\\w)]|qaddr_t[^(?-mix:\\w)]|caddr_t[^(?-mix:\\w)]|daddr_t[^(?-mix:\\w)]|div_t[^(?-mix:\\w)]|dev_t[^(?-mix:\\w)]|fixpt_t[^(?-mix:\\w)]|blkcnt_t[^(?-mix:\\w)]|blksize_t[^(?-mix:\\w)]|gid_t[^(?-mix:\\w)]|in_addr_t[^(?-mix:\\w)]|in_port_t[^(?-mix:\\w)]|ino_t[^(?-mix:\\w)]|key_t[^(?-mix:\\w)]|mode_t[^(?-mix:\\w)]|nlink_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|pid_t[^(?-mix:\\w)]|off_t[^(?-mix:\\w)]|segsz_t[^(?-mix:\\w)]|swblk_t[^(?-mix:\\w)]|uid_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|clock_t[^(?-mix:\\w)]|size_t[^(?-mix:\\w)]|ssize_t[^(?-mix:\\w)]|time_t[^(?-mix:\\w)]|useconds_t[^(?-mix:\\w)]|suseconds_t[^(?-mix:\\w)]|int8_t[^(?-mix:\\w)]|int16_t[^(?-mix:\\w)]|int32_t[^(?-mix:\\w)]|int64_t[^(?-mix:\\w)]|uint8_t[^(?-mix:\\w)]|uint16_t[^(?-mix:\\w)]|uint32_t[^(?-mix:\\w)]|uint64_t[^(?-mix:\\w)]|int_least8_t[^(?-mix:\\w)]|int_least16_t[^(?-mix:\\w)]|int_least32_t[^(?-mix:\\w)]|int_least64_t[^(?-mix:\\w)]|uint_least8_t[^(?-mix:\\w)]|uint_least16_t[^(?-mix:\\w)]|uint_least32_t[^(?-mix:\\w)]|uint_least64_t[^(?-mix:\\w)]|int_fast8_t[^(?-mix:\\w)]|int_fast16_t[^(?-mix:\\w)]|int_fast32_t[^(?-mix:\\w)]|int_fast64_t[^(?-mix:\\w)]|uint_fast8_t[^(?-mix:\\w)]|uint_fast16_t[^(?-mix:\\w)]|uint_fast32_t[^(?-mix:\\w)]|uint_fast64_t[^(?-mix:\\w)]|intptr_t[^(?-mix:\\w)]|uintptr_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\b(?!\\())", + "match": "(?:((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!auto[^(?-mix:\\w)]|void[^(?-mix:\\w)]|char[^(?-mix:\\w)]|short[^(?-mix:\\w)]|int[^(?-mix:\\w)]|signed[^(?-mix:\\w)]|unsigned[^(?-mix:\\w)]|long[^(?-mix:\\w)]|float[^(?-mix:\\w)]|double[^(?-mix:\\w)]|bool[^(?-mix:\\w)]|wchar_t[^(?-mix:\\w)]|u_char[^(?-mix:\\w)]|u_short[^(?-mix:\\w)]|u_int[^(?-mix:\\w)]|u_long[^(?-mix:\\w)]|ushort[^(?-mix:\\w)]|uint[^(?-mix:\\w)]|u_quad_t[^(?-mix:\\w)]|quad_t[^(?-mix:\\w)]|qaddr_t[^(?-mix:\\w)]|caddr_t[^(?-mix:\\w)]|daddr_t[^(?-mix:\\w)]|div_t[^(?-mix:\\w)]|dev_t[^(?-mix:\\w)]|fixpt_t[^(?-mix:\\w)]|blkcnt_t[^(?-mix:\\w)]|blksize_t[^(?-mix:\\w)]|gid_t[^(?-mix:\\w)]|in_addr_t[^(?-mix:\\w)]|in_port_t[^(?-mix:\\w)]|ino_t[^(?-mix:\\w)]|key_t[^(?-mix:\\w)]|mode_t[^(?-mix:\\w)]|nlink_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|pid_t[^(?-mix:\\w)]|off_t[^(?-mix:\\w)]|segsz_t[^(?-mix:\\w)]|swblk_t[^(?-mix:\\w)]|uid_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|clock_t[^(?-mix:\\w)]|size_t[^(?-mix:\\w)]|ssize_t[^(?-mix:\\w)]|time_t[^(?-mix:\\w)]|useconds_t[^(?-mix:\\w)]|suseconds_t[^(?-mix:\\w)]|int8_t[^(?-mix:\\w)]|int16_t[^(?-mix:\\w)]|int32_t[^(?-mix:\\w)]|int64_t[^(?-mix:\\w)]|uint8_t[^(?-mix:\\w)]|uint16_t[^(?-mix:\\w)]|uint32_t[^(?-mix:\\w)]|uint64_t[^(?-mix:\\w)]|int_least8_t[^(?-mix:\\w)]|int_least16_t[^(?-mix:\\w)]|int_least32_t[^(?-mix:\\w)]|int_least64_t[^(?-mix:\\w)]|uint_least8_t[^(?-mix:\\w)]|uint_least16_t[^(?-mix:\\w)]|uint_least32_t[^(?-mix:\\w)]|uint_least64_t[^(?-mix:\\w)]|int_fast8_t[^(?-mix:\\w)]|int_fast16_t[^(?-mix:\\w)]|int_fast32_t[^(?-mix:\\w)]|int_fast64_t[^(?-mix:\\w)]|uint_fast8_t[^(?-mix:\\w)]|uint_fast16_t[^(?-mix:\\w)]|uint_fast32_t[^(?-mix:\\w)]|uint_fast64_t[^(?-mix:\\w)]|intptr_t[^(?-mix:\\w)]|uintptr_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\b(?!\\())", "captures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { "name": "variable.language.this.cpp" }, - "6": { + "2": { "name": "variable.other.object.access.cpp" }, - "7": { + "3": { "name": "punctuation.separator.dot-access.cpp" }, - "8": { + "4": { "name": "punctuation.separator.pointer-access.cpp" }, - "9": { + "5": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\*|->)))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "variable.language.this.cpp" - }, - "6": { - "name": "variable.other.object.property.cpp" - }, - "7": { - "name": "punctuation.separator.dot-access.cpp" - }, - "8": { - "name": "punctuation.separator.pointer-access.cpp" - } - } + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?-mix:(?:(?:(?\\*|->))))", + "name": "variable.other.object.property.cpp" }, { - "match": "(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\*|->)))", + "match": "(?:((?\\*|->)))", "captures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { "name": "variable.language.this.cpp" }, - "6": { + "2": { "name": "variable.other.object.access.cpp" }, - "7": { + "3": { "name": "punctuation.separator.dot-access.cpp" }, - "8": { + "4": { "name": "punctuation.separator.pointer-access.cpp" } } @@ -11436,133 +1959,46 @@ } ] }, - "10": { + "6": { "name": "variable.other.property.cpp" } } }, "method_access": { - "begin": "(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(~?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*(\\()", + "contentName": "meta.function-call.member", + "begin": "(?:((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)(\\()", "beginCaptures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { "name": "variable.language.this.cpp" }, - "6": { + "2": { "name": "variable.other.object.access.cpp" }, - "7": { + "3": { "name": "punctuation.separator.dot-access.cpp" }, - "8": { + "4": { "name": "punctuation.separator.pointer-access.cpp" }, - "9": { + "5": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\*|->)))", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "variable.language.this.cpp" - }, - "6": { - "name": "variable.other.object.property.cpp" - }, - "7": { - "name": "punctuation.separator.dot-access.cpp" - }, - "8": { - "name": "punctuation.separator.pointer-access.cpp" - } - } + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?-mix:(?:(?:(?\\*|->))))", + "name": "variable.other.object.property.cpp" }, { - "match": "(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\*|->)))", + "match": "(?:((?\\*|->)))", "captures": { "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { "name": "variable.language.this.cpp" }, - "6": { + "2": { "name": "variable.other.object.access.cpp" }, - "7": { + "3": { "name": "punctuation.separator.dot-access.cpp" }, - "8": { + "4": { "name": "punctuation.separator.pointer-access.cpp" } } @@ -11575,10 +2011,10 @@ } ] }, - "10": { + "6": { "name": "entity.name.function.member.cpp" }, - "11": { + "7": { "name": "punctuation.section.arguments.begin.bracket.round.function.member.cpp" } }, @@ -11590,13 +2026,13 @@ }, "patterns": [ { - "include": "#evaluation_context" + "include": "#function_call_context_c" } ] }, "using_namespace": { "name": "meta.using-namespace.cpp", - "begin": "(?(?:(?>[^<>]*)\\g<7>?)+)>)\\s*)?::)*\\s*+)?((?:,\\w])*>\\s*)))?::)*\\s*))?((?(?:(?>[^<>]*)\\g<9>?)+)>)\\s*)?::)*\\s*+)\\s*((?:,\\w])*>\\s*)))?::)*\\s*)\\s*(?:(?:((?|\\?\\?>)|(?=[;>\\[\\]=]))", - "patterns": [ - { - "name": "meta.head.namespace.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.namespace.cpp" - } - }, + }, + "3": { "patterns": [ - { - "include": "#ever_present_context" - }, { "include": "#attributes_context" }, { - "match": "((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<5>?)+)>)\\s*)?::)*\\s*+)\\s*((?\\[\\]=]))", + "patterns": [ + { + "name": "meta.head.namespace.cpp", + "begin": "\\G ?", + "end": "((?:\\{|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.namespace.cpp" + } + } + }, { "name": "meta.body.namespace.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "begin": "(?<=\\{)", + "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.namespace.cpp" @@ -11749,24 +2122,28 @@ }, "patterns": [ { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.tail.namespace.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "begin": "(?<=})[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$self" + "include": "$base" } ] } ] }, + "macro_argument": { + "match": "##(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)", + "name": "variable.other.macro.argument.cpp" + }, "lambdas": { - "begin": "((?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:[^\\]\\[]*\\[.*?\\](?!\\s*\\[)[^\\]\\[]*?)*[^\\]\\[]*?)(\\](?!\\[)))", + "begin": "((?:(?<=[^\\s]|^)(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?=\\]|\\z|$)|(,))|(\\=))", - "captures": { - "1": { - "name": "variable.parameter.capture.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "punctuation.separator.delimiter.comma.cpp" - }, - "7": { - "name": "keyword.operator.assignment.cpp" - } - } - }, - { - "include": "#evaluation_context" + "include": "#function_context_c" } ] }, @@ -11843,7 +2181,10 @@ }, "patterns": [ { - "include": "#function_parameter_context" + "include": "#probably_a_parameter" + }, + { + "include": "#function_context_c" } ] }, @@ -11852,7 +2193,7 @@ "name": "storage.modifier.lambda.$0.cpp" }, { - "match": "(->)((?:.+?(?=\\{|$))?)", + "match": "(->)(.+?(?=\\{|$))?", "captures": { "1": { "name": "punctuation.definition.lambda.return-type.cpp" @@ -11878,14 +2219,22 @@ }, "patterns": [ { - "include": "$self" + "include": "$base" } ] } ] }, + "pthread_types": { + "match": "(?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?(::))?\\s*((?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*((?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -12001,7 +2342,7 @@ { "name": "meta.head.enum.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "((?:\\{|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.enum.cpp" @@ -12009,28 +2350,25 @@ }, "patterns": [ { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.body.enum.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "begin": "(?<=\\{)", + "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.enum.cpp" } }, "patterns": [ - { - "include": "#ever_present_context" - }, { "include": "#enumerator_list" }, { - "include": "#comments" + "include": "#comments_context" }, { "include": "#comma" @@ -12042,24 +2380,21 @@ }, { "name": "meta.tail.enum.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "begin": "(?<=})[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$self" + "include": "$base" } ] } ] }, - "inheritance_context": { + "inhertance_context": { "patterns": [ - { - "include": "#ever_present_context" - }, { "match": ",", - "name": "punctuation.separator.delimiter.comma.inheritance.cpp" + "name": "comma.cpp punctuation.separator.delimiter.inhertance.cpp" }, { "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))", + "match": "(?<=virtual|private|protected|public|,|:)\\s*(?!(?:(?:private|protected|public)|virtual))((?-mix:(?:\\s*(?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))", "captures": { "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", + "begin": "((((?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))", "beginCaptures": { "1": { "name": "meta.head.class.cpp" @@ -12254,29 +2427,14 @@ "4": { "patterns": [ { - "include": "#inline_comment" + "include": "#attributes_context" + }, + { + "include": "#number_literal" } ] }, "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { "patterns": [ { "include": "#attributes_context" @@ -12286,187 +2444,24 @@ } ] }, + "6": { + "name": "entity.name.type.$3.cpp" + }, + "7": { + "name": "storage.type.modifier.final.cpp" + }, + "8": { + "name": "colon.cpp punctuation.separator.inhertance.cpp" + }, "9": { "patterns": [ { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" + "include": "#inhertance_context" } ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -12479,7 +2474,7 @@ { "name": "meta.head.class.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "((?:\\{|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.class.cpp" @@ -12487,20 +2482,23 @@ }, "patterns": [ { - "include": "#ever_present_context" + "include": "#preprocessor_context" }, { - "include": "#inheritance_context" + "include": "#inhertance_context" }, { "include": "#template_call_range" + }, + { + "include": "#comments_context" } ] }, { "name": "meta.body.class.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "begin": "(?<=\\{)", + "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.class.cpp" @@ -12511,26 +2509,20 @@ "include": "#function_pointer" }, { - "include": "#static_assert" + "include": "#constructor_context" }, { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.tail.class.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "begin": "(?<=})[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$self" + "include": "$base" } ] } @@ -12538,7 +2530,7 @@ }, "struct_block": { "name": "meta.block.struct.cpp", - "begin": "((((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", + "begin": "((((?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))", "beginCaptures": { "1": { "name": "meta.head.struct.cpp" @@ -12549,29 +2541,14 @@ "4": { "patterns": [ { - "include": "#inline_comment" + "include": "#attributes_context" + }, + { + "include": "#number_literal" } ] }, "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { "patterns": [ { "include": "#attributes_context" @@ -12581,187 +2558,24 @@ } ] }, + "6": { + "name": "entity.name.type.$3.cpp" + }, + "7": { + "name": "storage.type.modifier.final.cpp" + }, + "8": { + "name": "colon.cpp punctuation.separator.inhertance.cpp" + }, "9": { "patterns": [ { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" + "include": "#inhertance_context" } ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -12774,7 +2588,7 @@ { "name": "meta.head.struct.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "((?:\\{|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.struct.cpp" @@ -12782,20 +2596,23 @@ }, "patterns": [ { - "include": "#ever_present_context" + "include": "#preprocessor_context" }, { - "include": "#inheritance_context" + "include": "#inhertance_context" }, { "include": "#template_call_range" + }, + { + "include": "#comments_context" } ] }, { "name": "meta.body.struct.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "begin": "(?<=\\{)", + "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.struct.cpp" @@ -12806,26 +2623,20 @@ "include": "#function_pointer" }, { - "include": "#static_assert" + "include": "#constructor_context" }, { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.tail.struct.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "begin": "(?<=})[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$self" + "include": "$base" } ] } @@ -12833,7 +2644,7 @@ }, "union_block": { "name": "meta.block.union.cpp", - "begin": "((((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", + "begin": "((((?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))", "beginCaptures": { "1": { "name": "meta.head.union.cpp" @@ -12844,29 +2655,14 @@ "4": { "patterns": [ { - "include": "#inline_comment" + "include": "#attributes_context" + }, + { + "include": "#number_literal" } ] }, "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { "patterns": [ { "include": "#attributes_context" @@ -12876,187 +2672,24 @@ } ] }, + "6": { + "name": "entity.name.type.$3.cpp" + }, + "7": { + "name": "storage.type.modifier.final.cpp" + }, + "8": { + "name": "colon.cpp punctuation.separator.inhertance.cpp" + }, "9": { "patterns": [ { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" + "include": "#inhertance_context" } ] } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -13069,7 +2702,7 @@ { "name": "meta.head.union.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "((?:\\{|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.union.cpp" @@ -13077,20 +2710,23 @@ }, "patterns": [ { - "include": "#ever_present_context" + "include": "#preprocessor_context" }, { - "include": "#inheritance_context" + "include": "#inhertance_context" }, { "include": "#template_call_range" + }, + { + "include": "#comments_context" } ] }, { "name": "meta.body.union.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "begin": "(?<=\\{)", + "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.union.cpp" @@ -13101,26 +2737,20 @@ "include": "#function_pointer" }, { - "include": "#static_assert" + "include": "#constructor_context" }, { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.tail.union.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "begin": "(?<=})[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$self" + "include": "$base" } ] } @@ -13128,41 +2758,16 @@ }, "extern_block": { "name": "meta.block.extern.cpp", - "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(extern)(?=\\s*\\\"))", + "begin": "((\\bextern)(?=\\s*\\\"))", "beginCaptures": { "1": { "name": "meta.head.extern.cpp" }, "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { "name": "storage.type.extern.cpp" } }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -13175,7 +2780,7 @@ { "name": "meta.head.extern.cpp", "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "end": "((?:\\{|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.extern.cpp" @@ -13183,14 +2788,14 @@ }, "patterns": [ { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.body.extern.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", + "begin": "(?<=\\{)", + "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.extern.cpp" @@ -13198,3206 +2803,28 @@ }, "patterns": [ { - "include": "$self" + "include": "$base" } ] }, { "name": "meta.tail.extern.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "begin": "(?<=})[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$self" + "include": "$base" } ] }, { - "include": "$self" + "include": "$base" } ] }, - "typedef_class": { - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", - "beginCaptures": { - "1": { - "name": "meta.head.class.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", - "endCaptures": { - "1": { - "name": "punctuation.terminator.statement.cpp" - }, - "2": { - "name": "punctuation.terminator.statement.cpp" - } - }, - "patterns": [ - { - "name": "meta.head.class.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.class.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#inheritance_context" - }, - { - "include": "#template_call_range" - } - ] - }, - { - "name": "meta.body.class.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.class.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.class.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "match": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "entity.name.type.alias.cpp" - } - } - }, - { - "match": "," - } - ] - } - ] - } - ] - }, - "typedef_struct": { - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", - "beginCaptures": { - "1": { - "name": "meta.head.struct.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", - "endCaptures": { - "1": { - "name": "punctuation.terminator.statement.cpp" - }, - "2": { - "name": "punctuation.terminator.statement.cpp" - } - }, - "patterns": [ - { - "name": "meta.head.struct.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.struct.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#inheritance_context" - }, - { - "include": "#template_call_range" - } - ] - }, - { - "name": "meta.body.struct.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.struct.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.struct.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "match": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "entity.name.type.alias.cpp" - } - } - }, - { - "match": "," - } - ] - } - ] - } - ] - }, - "typedef_union": { - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", - "beginCaptures": { - "1": { - "name": "meta.head.union.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", - "endCaptures": { - "1": { - "name": "punctuation.terminator.statement.cpp" - }, - "2": { - "name": "punctuation.terminator.statement.cpp" - } - }, - "patterns": [ - { - "name": "meta.head.union.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.union.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#inheritance_context" - }, - { - "include": "#template_call_range" - } - ] - }, - { - "name": "meta.body.union.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.union.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.union.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "match": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "entity.name.type.alias.cpp" - } - } - }, - { - "match": "," - } - ] - } - ] - } - ] - }, - "struct_declare": { - "match": "(struct)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\b(?!final\\W|final\\$|override\\W|override\\$)((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\S)(?!:)", - "captures": { - "1": { - "name": "storage.type.struct.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.struct.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "union_declare": { - "match": "(union)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\b(?!final\\W|final\\$|override\\W|override\\$)((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\S)(?!:)", - "captures": { - "1": { - "name": "storage.type.union.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.union.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "enum_declare": { - "match": "(enum)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\b(?!final\\W|final\\$|override\\W|override\\$)((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\S)(?!:)", - "captures": { - "1": { - "name": "storage.type.enum.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.enum.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "class_declare": { - "match": "(class)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\b(?!final\\W|final\\$|override\\W|override\\$)((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\S)(?!:)", - "captures": { - "1": { - "name": "storage.type.class.declare.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.class.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "9": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "10": { - "name": "comment.block.cpp" - }, - "11": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "name": "variable.other.object.declare.cpp" - }, - "21": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "22": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "23": { - "name": "comment.block.cpp" - }, - "24": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "standard_declares": { - "patterns": [ - { - "include": "#struct_declare" - }, - { - "include": "#union_declare" - }, - { - "include": "#enum_declare" - }, - { - "include": "#class_declare" - } - ] - }, - "parameter_struct": { - "match": "(struct)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.struct.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.struct.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "parameter_enum": { - "match": "(enum)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.enum.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.enum.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "parameter_union": { - "match": "(union)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.union.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.union.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "parameter_class": { - "match": "(class)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?=,|\\)|\\n)", - "captures": { - "1": { - "name": "storage.type.class.parameter.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "entity.name.type.class.parameter.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "\\*", - "name": "storage.modifier.pointer.cpp" - }, - { - "match": "(?:\\&((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "17": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "18": { - "name": "comment.block.cpp" - }, - "19": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "24": { - "name": "variable.other.object.declare.cpp" - }, - "25": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "27": { - "name": "comment.block.cpp" - }, - "28": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - } - }, - "over_qualified_types": { - "patterns": [ - { - "include": "#parameter_struct" - }, - { - "include": "#parameter_enum" - }, - { - "include": "#parameter_union" - }, - { - "include": "#parameter_class" - } - ] - }, - "assembly": { - "name": "meta.asm.cpp", - "begin": "(\\b(?:__asm__|asm)\\b)\\s*((?:volatile)?)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "storage.type.asm.cpp" - }, - "2": { - "name": "storage.modifier.cpp" - }, - "3": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.cpp" - } - }, - "patterns": [ - { - "name": "string.quoted.double.cpp", - "contentName": "meta.embedded.assembly.cpp", - "begin": "(R?)(\")", - "beginCaptures": { - "1": { - "name": "meta.encoding.cpp" - }, - "2": { - "name": "punctuation.definition.string.begin.assembly.cpp" - } - }, - "end": "(\")", - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.assembly.cpp" - } - }, - "patterns": [ - { - "include": "source.asm" - }, - { - "include": "source.x86" - }, - { - "include": "source.x86_64" - }, - { - "include": "source.arm" - }, - { - "include": "#backslash_escapes" - }, - { - "include": "#string_escaped_char" - }, - { - "match": "(?=not)possible" - } - ] - }, - { - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parens.end.bracket.round.assembly.inner.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "match": ":", - "name": "punctuation.separator.delimiter.colon.assembly.cpp" - }, - { - "include": "#comments_context" - }, - { - "include": "#comments" - } - ] - }, - "backslash_escapes": { - "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", - "name": "constant.character.escape.cpp" + "hacky_fix_for_stray_directive": { + "match": "(?(?-mix:[a-zA-Z_$][\\w$]*)))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g \\s*\t\t # first argument\n\t ((,) \\s* \\g \\s*)* # additional arguments\n\t (?:\\.\\.\\.)?\t\t\t# varargs ellipsis?\n\t)\n (\\))\n)?", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.define.cpp" + }, + "2": { + "name": "punctuation.definition.directive.cpp" + }, + "3": { + "name": "entity.name.function.preprocessor.cpp" + }, + "5": { + "name": "punctuation.definition.parameters.begin.cpp" + }, + "6": { + "name": "variable.parameter.preprocessor.cpp" + }, + "8": { + "name": "punctuation.separator.parameters.cpp" + }, + "9": { + "name": "punctuation.definition.parameters.end.cpp" + } + }, + "end": "(?=(?://|/\\*))|(?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.cpp" + } + }, + "name": "string.quoted.other.lt-gt.include.cpp" + } + ] + }, + "meta_preprocessor_line": { + "name": "meta.preprocessor.cpp", + "begin": "^\\s*((#)\\s*line)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.line.cpp" + }, + "2": { + "name": "punctuation.definition.directive.cpp" + } + }, + "end": "(?=(?://|/\\*))|(?=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket", + "beginCaptures": { + "1": { + "name": "variable.other.cpp" + }, + "2": { + "name": "punctuation.section.parens.begin.bracket.round.initialization.cpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.initialization.cpp" + } + }, + "patterns": [ + { + "include": "#function_call_context_c" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.cpp" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.cpp" + } + }, + "patterns": [ + { + "include": "#block_context" + } + ] + }, + { + "include": "#parentheses_block" + }, + { + "include": "$base" + } + ] + }, + "function_call_c": { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas|constexpr|volatile|operator|(?:::)?new|(?:::)?delete)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*(?-mix:(?:(?-mix:(?:(?:,\\w])*>\\s*)))?)\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)", + "name": "meta.function-call.cpp", + "patterns": [ + { + "include": "#function_call_context_c" + } + ] + }, + "comments_context": { + "patterns": [ + { + "captures": { + "1": { + "name": "meta.toc-list.banner.block.cpp" + } + }, + "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", + "name": "comment.block.cpp" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.cpp" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.cpp" + } + }, + "name": "comment.block.cpp" + }, + { + "captures": { + "1": { + "name": "meta.toc-list.banner.line.cpp" + } + }, + "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", + "name": "comment.line.banner.cpp" + }, + { + "begin": "(^[ \\t]+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.cpp" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.cpp" + } + }, + "end": "(?=\\n)", + "name": "comment.line.double-slash.cpp", + "patterns": [ + { + "include": "#line_continuation_character" + } + ] + } + ] + } + ] + }, + "disabled": { + "begin": "^\\s*#\\s*if(n?def)?\\b.*$", + "end": "^\\s*#\\s*endif\\b", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma_mark" } ] }, "line_continuation_character": { - "match": "\\\\\\n", - "name": "constant.character.escape.line-continuation.cpp" + "match": "(\\\\)\\n", + "captures": { + "1": { + "name": "constant.character.escape.line-continuation.cpp" + } + } }, "parentheses": { "name": "meta.parens.cpp", - "begin": "(\\()", + "begin": "\\(", "beginCaptures": { - "1": { + "0": { "name": "punctuation.section.parens.begin.bracket.round.cpp" } }, - "end": "(\\))", + "end": "\\)", "endCaptures": { - "1": { + "0": { "name": "punctuation.section.parens.end.bracket.round.cpp" } }, "patterns": [ { - "include": "#over_qualified_types" - }, - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))::((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\16((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\()))", + "preprocessor_rule_conditional": { + "begin": "^\\s*((#)\\s*if(?:n?def)?\\b)", "beginCaptures": { + "0": { + "name": "meta.preprocessor.cpp" + }, "1": { - "name": "meta.head.function.definition.special.constructor.cpp" + "name": "keyword.control.directive.conditional.cpp" }, "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "::", - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.constructor.cpp" - }, - { - "match": "(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "include": "#functional_specifiers_pre_parameters" - }, - { - "begin": "(:)", - "beginCaptures": { - "1": { - "name": "punctuation.separator.initializers.cpp" - } - }, - "end": "(?=\\{)", - "patterns": [ - { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?(?:(?>[^<>]*)\\g<3>?)+)>)\\s*)?(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.call.initializer.cpp" - }, - "2": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "4": { - "name": "punctuation.section.arguments.begin.bracket.round.function.call.initializer.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.arguments.end.bracket.round.function.call.initializer.cpp" - } - }, - "patterns": [ - { - "include": "#evaluation_context" - } - ] - }, - { - "contentName": "meta.parameter.initialization.cpp", - "begin": "((?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.constructor.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.constructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_destructor_root": { - "name": "meta.function.definition.special.member.destructor.cpp", - "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<14>?)+)>)\\s*)?::)*)(((?>(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))::((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))~\\16((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\()))", - "beginCaptures": { - "1": { - "name": "meta.head.function.definition.special.member.destructor.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "patterns": [ - { - "match": "::", - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.destructor.cpp" - }, - { - "match": "(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(default)|(delete))", - "captures": { - "1": { - "name": "keyword.operator.assignment.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "keyword.other.default.constructor.cpp" - }, - "7": { - "name": "keyword.other.delete.constructor.cpp" - } - } - } - ] - }, - { - "contentName": "meta.function.definition.parameters.special.member.destructor.cpp", - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.section.parameters.begin.bracket.round.special.member.destructor.cpp" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.special.member.destructor.cpp" - } - } - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.body.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.member.destructor.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.member.destructor.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_function_definition": { - "name": "meta.function.definition.cpp", - "begin": "((?:(?:^|\\G|(?<=;|\\}))|(?<=>))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<69>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\())", - "beginCaptures": { - "1": { - "name": "meta.head.function.definition.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "storage.type.template.cpp" - }, - "7": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "9": { - "name": "comment.block.cpp" - }, - "10": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "11": { - "name": "storage.modifier.$11.cpp" - }, - "12": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "14": { - "name": "comment.block.cpp" - }, - "15": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "16": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "44": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "45": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "46": { - "name": "comment.block.cpp" - }, - "47": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "48": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "49": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "50": { - "name": "comment.block.cpp" - }, - "51": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "52": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "53": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "54": { - "name": "comment.block.cpp" - }, - "55": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "56": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "57": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "58": { - "name": "comment.block.cpp" - }, - "59": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "60": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "61": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "62": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "63": { - "name": "comment.block.cpp" - }, - "64": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "65": { - "patterns": [ - { - "include": "#scope_resolution_function_definition_inner_generated" - } - ] - }, - "66": { - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" - }, - "68": { - "name": "meta.template.call.cpp", - "patterns": [ - { - "include": "#template_call_range" - } - ] - }, - "70": { - "name": "entity.name.function.definition.cpp" - }, - "71": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "72": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "73": { - "name": "comment.block.cpp" - }, - "74": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_operator_overload": { - "name": "meta.function.definition.special.operator-overload.cpp", - "begin": "((?:(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(operator)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<67>?)+)>)\\s*)?::)*)(?:(?:((?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|new|new\\[\\]|delete|delete\\[\\]|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,))|((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=\\<|\\())", - "beginCaptures": { - "1": { - "name": "meta.head.function.definition.special.operator-overload.cpp" - }, - "2": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "30": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "31": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "32": { - "name": "comment.block.cpp" - }, - "33": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "34": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "35": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "36": { - "name": "comment.block.cpp" - }, - "37": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "38": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "39": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "40": { - "name": "comment.block.cpp" - }, - "41": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "42": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "43": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "44": { - "name": "comment.block.cpp" - }, - "45": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "46": { - "name": "storage.type.modifier.calling-convention.cpp" - }, - "47": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "48": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "49": { - "name": "comment.block.cpp" - }, - "50": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "51": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "52": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "53": { - "name": "comment.block.cpp" - }, - "54": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "55": { - "patterns": [ - { - "match": "::", - "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.operator.cpp" - }, - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "entity.name.operator.type.reference.cpp" - } - ] - }, - "71": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "72": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "73": { - "name": "comment.block.cpp" - }, - "74": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "75": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "76": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "77": { - "name": "comment.block.cpp" - }, - "78": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "79": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "80": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "81": { - "name": "comment.block.cpp" - }, - "82": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "83": { - "name": "entity.name.operator.type.array.cpp" - }, - "84": { - "name": "entity.name.operator.custom-literal.cpp" - }, - "85": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "86": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "87": { - "name": "comment.block.cpp" - }, - "88": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "89": { - "name": "entity.name.operator.custom-literal.cpp" - }, - "90": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "91": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "92": { - "name": "comment.block.cpp" - }, - "93": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.function.definition.special.operator-overload.cpp" - } - }, - "patterns": [ - { - "include": "#function_body_context" - } - ] - }, - { - "name": "meta.tail.function.definition.special.operator-overload.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_using_namespace": { - "name": "meta.using-namespace.cpp", - "begin": "(?(?:(?>[^<>]*)\\g<7>?)+)>)\\s*)?::)*\\s*+)?((?|\\?\\?>)|(?=[;>\\[\\]=]))|(?(?:(?>[^<>]*)\\g<5>?)+)>)\\s*)?::)*\\s*+)\\s*((?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.namespace.cpp" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.namespace.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_extern_block": { - "name": "meta.block.extern.cpp", - "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(extern)(?=\\s*\\\"))", - "beginCaptures": { - "1": { - "name": "meta.head.extern.cpp" - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "name": "storage.type.extern.cpp" - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.extern.cpp" - } - }, - "patterns": [ - { - "include": "$self" - } - ] + "include": "#preprocessor_rule_enabled_elif" }, { - "name": "meta.tail.extern.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] + "include": "#preprocessor_rule_enabled_else" }, { - "include": "$self" - } - ] - }, - "macro_safe_typedef_class": { - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", + "begin": "^\\s*((#)\\s*elif\\b)", "beginCaptures": { "1": { - "name": "meta.head.class.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", - "endCaptures": { - "1": { - "name": "punctuation.terminator.statement.cpp" + "name": "keyword.control.directive.conditional.cpp" }, "2": { - "name": "punctuation.terminator.statement.cpp" + "name": "punctuation.definition.directive.cpp" } }, + "end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.class.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.class.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "match": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "entity.name.type.alias.cpp" - } - } - }, - { - "match": "," - } - ] + "include": "#preprocessor_rule_conditional_line_context" } ] + }, + { + "include": "$base" } ] }, - "macro_safe_typedef_struct": { - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", + "begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))", + "end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", - "endCaptures": { - "1": { - "name": "punctuation.terminator.statement.cpp" + "name": "keyword.control.directive.conditional.cpp" }, "2": { - "name": "punctuation.terminator.statement.cpp" + "name": "punctuation.definition.directive.cpp" } }, + "end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.struct.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.struct.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "match": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "entity.name.type.alias.cpp" - } - } - }, - { - "match": "," - } - ] + "include": "#preprocessor_rule_conditional_line_context" } ] + }, + { + "include": "#block_context" } ] }, - "macro_safe_typedef_union": { - "begin": "((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", - "beginCaptures": { - "1": { - "name": "meta.head.union.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", - "endCaptures": { - "1": { - "name": "punctuation.terminator.statement.cpp" - }, - "2": { - "name": "punctuation.terminator.statement.cpp" - } - }, - "patterns": [ - { - "name": "meta.head.union.cpp", - "begin": "\\G ?", - "end": "((?:\\{|<%|\\?\\?<|(?=;)))", - "endCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.union.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#inheritance_context" - }, - { - "include": "#template_call_range" - } - ] - }, - { - "name": "meta.body.union.cpp", - "begin": "(?<=\\{|<%|\\?\\?<)", - "end": "(\\}|%>|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.union.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.union.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "match": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - } - }, - "name": "invalid.illegal.reference-type.cpp" - }, - { - "match": "\\&", - "name": "storage.modifier.reference.cpp" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "3": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "4": { - "name": "comment.block.cpp" - }, - "5": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "14": { - "name": "entity.name.type.alias.cpp" - } - } - }, - { - "match": "," - } - ] - } - ] - } - ] - }, - "macro_safe_class_block": { - "name": "meta.block.class.cpp", - "begin": "((((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", - "beginCaptures": { - "1": { - "name": "meta.head.class.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.class.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.class.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_struct_block": { - "name": "meta.block.struct.cpp", - "begin": "((((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", - "beginCaptures": { - "1": { - "name": "meta.head.struct.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.struct.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.struct.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_union_block": { - "name": "meta.block.union.cpp", - "begin": "((((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(DLLEXPORT)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(final)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))?(?:((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(:)((?>[^{]*)))?))", - "beginCaptures": { - "1": { - "name": "meta.head.union.cpp" - }, - "3": { - "name": "storage.type.$3.cpp" - }, - "4": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "5": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "6": { - "name": "comment.block.cpp" - }, - "7": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "8": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "9": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "10": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "11": { - "name": "comment.block.cpp" - }, - "12": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "13": { - "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" - }, - "14": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "15": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "16": { - "name": "comment.block.cpp" - }, - "17": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "18": { - "patterns": [ - { - "include": "#attributes_context" - }, - { - "include": "#number_literal" - } - ] - }, - "19": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "20": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "21": { - "name": "comment.block.cpp" - }, - "22": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "23": { - "name": "entity.name.type.$3.cpp" - }, - "24": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "25": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "26": { - "name": "comment.block.cpp" - }, - "27": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "28": { - "name": "storage.type.modifier.final.cpp" - }, - "29": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "30": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "31": { - "name": "comment.block.cpp" - }, - "32": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "33": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "34": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "35": { - "name": "comment.block.cpp" - }, - "36": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "37": { - "name": "punctuation.separator.colon.inheritance.cpp" - }, - "38": { - "patterns": [ - { - "include": "#inheritance_context" - } - ] - } - }, - "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.union.cpp" - } - }, - "patterns": [ - { - "include": "#function_pointer" - }, - { - "include": "#static_assert" - }, - { - "include": "#constructor_inline" - }, - { - "include": "#destructor_inline" - }, - { - "include": "$self" - } - ] - }, - { - "name": "meta.tail.union.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_enum_block": { - "name": "meta.block.enum.cpp", - "begin": "(((?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<15>?)+)>)\\s*)?(::))?\\s*((?|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))|(?|\\?\\?>)", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.enum.cpp" - } - }, - "patterns": [ - { - "include": "#ever_present_context" - }, - { - "include": "#enumerator_list" - }, - { - "include": "#comments" - }, - { - "include": "#comma" - }, - { - "include": "#semicolon" - } - ] - }, - { - "name": "meta.tail.enum.cpp", - "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", - "end": "[\\s\\n]*(?=;)", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "macro_safe_template_definition": { - "name": "meta.template.definition.cpp", - "begin": "(?)|(?)", - "endCaptures": { - "1": { - "name": "punctuation.section.angle-brackets.begin.template.call.cpp" - } - }, - "patterns": [ - { - "include": "#template_call_context" - } - ] - }, - { - "include": "#template_definition_context" - } - ] - }, - "macro_safe_block": { - "name": "meta.block.cpp", - "begin": "({)", - "beginCaptures": { - "1": { - "name": "punctuation.section.block.begin.bracket.curly.cpp" - } - }, - "end": "(}|(?=\\s*#\\s*(?:elif|else|endif)\\b))|(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()", - "beginCaptures": { - "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "5": { - "name": "keyword.other.static_assert.cpp" - }, - "6": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "7": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "8": { - "name": "comment.block.cpp" - }, - "9": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] - }, - "10": { - "name": "punctuation.section.arguments.begin.bracket.round.static_assert.cpp" - } - }, - "end": "(\\))|(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(((::)?(?:((?-mix:(?!\\b(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\b)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\s*+(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(::))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)\\b)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(((?(?:(?>[^<>]*)\\g<27>?)+)>)\\s*)?(?![\\w<:.]))(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))?(?:(?:\\&|\\*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))*(?:\\&|\\*))?((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()(\\*)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "preprocessor_rule_disabled": { + "begin": "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0+\\b\\)*\\s*(?:$|//|/\\*))", "beginCaptures": { + "0": { + "name": "meta.preprocessor.cpp" + }, "1": { - "name": "meta.qualified_type.cpp", - "patterns": [ - { - "match": "(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))){2,}\\&", - "captures": { + "include": "#pragma_mark" + } + ] + }, + { + "begin": "\\n", + "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", + "patterns": [ + { + "include": "#block_context" + } + ] + } + ] + }, + "preprocessor_rule_enabled_elif": { + "begin": "^\\s*((#)\\s*elif\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))", + "beginCaptures": { + "0": { + "name": "meta.preprocessor.cpp" + }, + "1": { + "name": "keyword.control.directive.conditional.cpp" + }, + "2": { + "name": "punctuation.definition.directive.cpp" + } + }, + "end": "(?=^\\s*((#)\\s*endif\\b))", + "patterns": [ + { + "begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))", + "end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?=[{=,);]|\\n)(?!\\()|(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.cpp" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.cpp" + } + }, + "end": "(\\))|(?:,\\w])*>\\s*)))?)) # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.wordlike.cpp memory.cpp keyword.operator.new.cpp" + }, + "2": { + "patterns": [ + { + "include": "#template_call_innards" + } + ] + }, + "3": { + "name": "punctuation.section.arguments.begin.bracket.round.cpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.cpp" + } + }, + "patterns": [ + { + "include": "#function_call_context_c" + } + ] + }, + { + "include": "#function_call" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.cpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.cpp" + } + }, + "patterns": [ + { + "include": "#function_call_context_c" + } + ] + }, + { + "include": "#block_context" } ] } } -} \ No newline at end of file +} diff --git a/extensions/cpp/test/colorize-fixtures/test.cpp b/extensions/cpp/test/colorize-fixtures/test.cpp index 4c38c6904d3..c3c3c10a953 100644 --- a/extensions/cpp/test/colorize-fixtures/test.cpp +++ b/extensions/cpp/test/colorize-fixtures/test.cpp @@ -24,4 +24,4 @@ int main () { int t = 2; if (t > 0) puts("\n*************************************************"); return 0; -} \ No newline at end of file +} diff --git a/extensions/cpp/test/colorize-results/test-23630_cpp.json b/extensions/cpp/test/colorize-results/test-23630_cpp.json index 08d81e6afff..a58961ae945 100644 --- a/extensions/cpp/test/colorize-results/test-23630_cpp.json +++ b/extensions/cpp/test/colorize-results/test-23630_cpp.json @@ -1,7 +1,7 @@ [ { "c": "#", - "t": "source.cpp keyword.control.directive.conditional.ifndef.cpp punctuation.definition.directive.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -12,7 +12,7 @@ }, { "c": "ifndef", - "t": "source.cpp keyword.control.directive.conditional.ifndef.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -23,7 +23,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.conditional.cpp", + "t": "source.cpp meta.preprocessor.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -34,7 +34,7 @@ }, { "c": "_UCRT", - "t": "source.cpp meta.preprocessor.conditional.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -100,7 +100,7 @@ }, { "c": "#", - "t": "source.cpp keyword.control.directive.endif.cpp punctuation.definition.directive.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -111,7 +111,7 @@ }, { "c": "endif", - "t": "source.cpp keyword.control.directive.endif.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", diff --git a/extensions/cpp/test/colorize-results/test-23850_cpp.json b/extensions/cpp/test/colorize-results/test-23850_cpp.json index 4ba6b59dc9b..924bbc78243 100644 --- a/extensions/cpp/test/colorize-results/test-23850_cpp.json +++ b/extensions/cpp/test/colorize-results/test-23850_cpp.json @@ -1,7 +1,7 @@ [ { "c": "#", - "t": "source.cpp keyword.control.directive.conditional.ifndef.cpp punctuation.definition.directive.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -12,7 +12,7 @@ }, { "c": "ifndef", - "t": "source.cpp keyword.control.directive.conditional.ifndef.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -23,7 +23,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.conditional.cpp", + "t": "source.cpp meta.preprocessor.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -34,7 +34,7 @@ }, { "c": "_UCRT", - "t": "source.cpp meta.preprocessor.conditional.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -89,7 +89,7 @@ }, { "c": "#", - "t": "source.cpp keyword.control.directive.endif.cpp punctuation.definition.directive.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -100,7 +100,7 @@ }, { "c": "endif", - "t": "source.cpp keyword.control.directive.endif.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", diff --git a/extensions/cpp/test/colorize-results/test_cc.json b/extensions/cpp/test/colorize-results/test_cc.json index 902ef645164..d4892937997 100644 --- a/extensions/cpp/test/colorize-results/test_cc.json +++ b/extensions/cpp/test/colorize-results/test_cc.json @@ -1,7 +1,7 @@ [ { "c": "#", - "t": "source.cpp keyword.control.directive.conditional.if.cpp punctuation.definition.directive.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -12,7 +12,7 @@ }, { "c": "if", - "t": "source.cpp keyword.control.directive.conditional.if.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -23,7 +23,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.conditional.cpp", + "t": "source.cpp meta.preprocessor.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -34,7 +34,7 @@ }, { "c": "B4G_DEBUG_CHECK", - "t": "source.cpp meta.preprocessor.conditional.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -56,7 +56,7 @@ }, { "c": "fprintf", - "t": "source.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -67,7 +67,7 @@ }, { "c": "(", - "t": "source.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -78,7 +78,7 @@ }, { "c": "stderr", - "t": "source.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -89,7 +89,7 @@ }, { "c": ",", - "t": "source.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -100,7 +100,7 @@ }, { "c": "\"", - "t": "source.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -111,7 +111,7 @@ }, { "c": "num_candidate_ret=", - "t": "source.cpp string.quoted.double.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -122,7 +122,7 @@ }, { "c": "%d", - "t": "source.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -133,7 +133,7 @@ }, { "c": ":", - "t": "source.cpp string.quoted.double.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -144,7 +144,7 @@ }, { "c": "\"", - "t": "source.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -155,7 +155,7 @@ }, { "c": ",", - "t": "source.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -166,7 +166,7 @@ }, { "c": " num_candidate", - "t": "source.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -177,7 +177,7 @@ }, { "c": ")", - "t": "source.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -232,7 +232,7 @@ }, { "c": "int", - "t": "source.cpp meta.parens.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.parens.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -375,7 +375,7 @@ }, { "c": "fprintf", - "t": "source.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -386,7 +386,7 @@ }, { "c": "(", - "t": "source.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -397,7 +397,7 @@ }, { "c": "stderr", - "t": "source.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -408,7 +408,7 @@ }, { "c": ",", - "t": "source.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -419,7 +419,7 @@ }, { "c": "\"", - "t": "source.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -430,7 +430,7 @@ }, { "c": "%d", - "t": "source.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -441,7 +441,7 @@ }, { "c": ",", - "t": "source.cpp string.quoted.double.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -452,7 +452,7 @@ }, { "c": "\"", - "t": "source.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -463,7 +463,7 @@ }, { "c": ",", - "t": "source.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -474,7 +474,7 @@ }, { "c": "user_candidate", - "t": "source.cpp meta.bracket.square.access.cpp variable.other.object.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp variable.other.object.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -485,7 +485,7 @@ }, { "c": "[", - "t": "source.cpp meta.bracket.square.access.cpp punctuation.definition.begin.bracket.square.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.begin.bracket.square.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -496,7 +496,7 @@ }, { "c": "i", - "t": "source.cpp meta.bracket.square.access.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -507,7 +507,7 @@ }, { "c": "]", - "t": "source.cpp meta.bracket.square.access.cpp punctuation.definition.end.bracket.square.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.end.bracket.square.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -518,7 +518,7 @@ }, { "c": ")", - "t": "source.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -551,7 +551,7 @@ }, { "c": "fprintf", - "t": "source.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -562,7 +562,7 @@ }, { "c": "(", - "t": "source.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -573,7 +573,7 @@ }, { "c": "stderr", - "t": "source.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -584,7 +584,7 @@ }, { "c": ",", - "t": "source.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -595,7 +595,7 @@ }, { "c": "\"", - "t": "source.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -606,7 +606,7 @@ }, { "c": ";", - "t": "source.cpp string.quoted.double.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -617,7 +617,7 @@ }, { "c": "\"", - "t": "source.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -628,7 +628,7 @@ }, { "c": ")", - "t": "source.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -650,7 +650,7 @@ }, { "c": "#", - "t": "source.cpp keyword.control.directive.endif.cpp punctuation.definition.directive.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -661,7 +661,7 @@ }, { "c": "endif", - "t": "source.cpp keyword.control.directive.endif.cpp", + "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -672,7 +672,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp", + "t": "source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -683,7 +683,7 @@ }, { "c": "void", - "t": "source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -694,7 +694,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp", + "t": "source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -705,7 +705,7 @@ }, { "c": "main", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -716,7 +716,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -726,19 +726,8 @@ } }, { - "c": "O", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp entity.name.type.parameter.cpp", - "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "entity.name.type: #4EC9B0" - } - }, - { - "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp", + "c": "O ", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -749,7 +738,7 @@ }, { "c": "obj", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp variable.parameter.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -760,7 +749,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -771,7 +760,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", + "t": "source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -782,7 +771,7 @@ }, { "c": "{", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -793,7 +782,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -804,7 +793,7 @@ }, { "c": "LOG_INFO", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -815,7 +804,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -826,7 +815,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -837,7 +826,7 @@ }, { "c": "not hilighted as string", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -848,7 +837,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -859,7 +848,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -870,7 +859,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -881,7 +870,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -892,7 +881,7 @@ }, { "c": "LOG_INFO", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -903,7 +892,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -914,7 +903,7 @@ }, { "c": "obj ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -925,7 +914,7 @@ }, { "c": "<<", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -936,7 +925,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -947,7 +936,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -958,7 +947,7 @@ }, { "c": ", even worse; ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -969,7 +958,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -980,7 +969,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -991,7 +980,7 @@ }, { "c": "<<", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1002,7 +991,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1013,7 +1002,7 @@ }, { "c": "obj", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.object.access.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp variable.other.object.access.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1024,7 +1013,7 @@ }, { "c": ".", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.dot-access.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.separator.dot-access.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1035,7 +1024,7 @@ }, { "c": "x", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.property.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp variable.other.property.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1046,7 +1035,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1057,7 +1046,7 @@ }, { "c": "<<", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1068,7 +1057,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1079,7 +1068,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1090,7 +1079,7 @@ }, { "c": " check this out.", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1101,7 +1090,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1112,7 +1101,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1123,7 +1112,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1134,18 +1123,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", "r": { - "dark_plus": "comment: #6A9955", - "light_plus": "comment: #008000", - "dark_vs": "comment: #6A9955", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { "c": "//", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1156,7 +1145,7 @@ }, { "c": " everything from this point on is interpeted as a string literal...", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1167,7 +1156,7 @@ }, { "c": " O x", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1178,7 +1167,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1189,7 +1178,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.scope-resolution.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1200,18 +1189,18 @@ }, { "c": "std", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.scope-resolution.cpp", + "t": "source.cpp meta.block.cpp meta.scope-resolution.cpp entity.name.type.namespace.scope-resolution.cpp", "r": { - "dark_plus": "entity.name.scope-resolution: #4EC9B0", - "light_plus": "entity.name.scope-resolution: #267F99", + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "entity.name.scope-resolution: #4EC9B0" + "hc_black": "entity.name.type: #4EC9B0" } }, { "c": "::", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp", + "t": "source.cpp meta.block.cpp meta.scope-resolution.cpp punctuation.separator.namespace.access.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1222,7 +1211,7 @@ }, { "c": "unique_ptr", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1233,7 +1222,7 @@ }, { "c": "<", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.comparison.cpp", + "t": "source.cpp meta.block.cpp keyword.operator.comparison.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1244,7 +1233,7 @@ }, { "c": "O", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1255,7 +1244,7 @@ }, { "c": ">", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.comparison.cpp", + "t": "source.cpp meta.block.cpp keyword.operator.comparison.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1266,7 +1255,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1277,7 +1266,7 @@ }, { "c": "o", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1288,7 +1277,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1299,7 +1288,7 @@ }, { "c": "new", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.wordlike.cpp keyword.operator.new.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.wordlike.cpp alias.cpp keyword.operator.new.cpp", "r": { "dark_plus": "source.cpp keyword.operator.new: #C586C0", "light_plus": "source.cpp keyword.operator.new: #AF00DB", @@ -1310,7 +1299,7 @@ }, { "c": " O", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1321,7 +1310,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1332,7 +1321,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1343,18 +1332,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", "r": { - "dark_plus": "comment: #6A9955", - "light_plus": "comment: #008000", - "dark_vs": "comment: #6A9955", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { "c": "//", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1365,7 +1354,7 @@ }, { "c": " sadness.", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1376,7 +1365,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1387,7 +1376,7 @@ }, { "c": "sprintf", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1398,7 +1387,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1409,7 +1398,7 @@ }, { "c": "options", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1420,7 +1409,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1431,7 +1420,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1442,7 +1431,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1453,7 +1442,7 @@ }, { "c": "STYLE=Keramik;TITLE=", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1464,7 +1453,7 @@ }, { "c": "%s", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1475,7 +1464,7 @@ }, { "c": ";THEME=", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1486,7 +1475,7 @@ }, { "c": "%s", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1497,7 +1486,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1508,7 +1497,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1518,8 +1507,19 @@ } }, { - "c": " ...", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "c": " ", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "...", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.vararg-ellipses.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1530,7 +1530,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1541,7 +1541,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1552,7 +1552,7 @@ }, { "c": "}", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1563,7 +1563,7 @@ }, { "c": "int", - "t": "source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1574,7 +1574,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp", + "t": "source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1585,7 +1585,7 @@ }, { "c": "main2", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1596,7 +1596,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1607,7 +1607,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1618,7 +1618,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", + "t": "source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1629,7 +1629,7 @@ }, { "c": "{", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1640,7 +1640,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1651,7 +1651,7 @@ }, { "c": "printf", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1662,7 +1662,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1673,7 +1673,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1684,7 +1684,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1695,7 +1695,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1706,7 +1706,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1717,7 +1717,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1728,18 +1728,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", "r": { - "dark_plus": "comment: #6A9955", - "light_plus": "comment: #008000", - "dark_vs": "comment: #6A9955", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { "c": "//", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1750,7 +1750,7 @@ }, { "c": " the rest of", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1761,7 +1761,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1771,74 +1771,8 @@ } }, { - "c": "asm", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.asm.cpp storage.type.asm.cpp", - "r": { - "dark_plus": "storage.type: #569CD6", - "light_plus": "storage.type: #0000FF", - "dark_vs": "storage.type: #569CD6", - "light_vs": "storage.type: #0000FF", - "hc_black": "storage.type: #569CD6" - } - }, - { - "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.asm.cpp punctuation.section.parens.begin.bracket.round.assembly.cpp", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.asm.cpp string.quoted.double.cpp punctuation.definition.string.begin.assembly.cpp", - "r": { - "dark_plus": "string: #CE9178", - "light_plus": "string: #A31515", - "dark_vs": "string: #CE9178", - "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" - } - }, - { - "c": "movw $0x38, %ax; ltr %ax", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.asm.cpp string.quoted.double.cpp meta.embedded.assembly.cpp", - "r": { - "dark_plus": "meta.embedded: #D4D4D4", - "light_plus": "meta.embedded: #000000", - "dark_vs": "meta.embedded: #D4D4D4", - "light_vs": "meta.embedded: #000000", - "hc_black": "meta.embedded: #FFFFFF" - } - }, - { - "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.asm.cpp string.quoted.double.cpp punctuation.definition.string.end.assembly.cpp", - "r": { - "dark_plus": "string: #CE9178", - "light_plus": "string: #A31515", - "dark_vs": "string: #CE9178", - "light_vs": "string: #A31515", - "hc_black": "string: #CE9178" - } - }, - { - "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.asm.cpp punctuation.section.parens.end.bracket.round.assembly.cpp", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "c": "asm(\"movw $0x38, %ax; ltr %ax\");", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1849,7 +1783,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1860,7 +1794,7 @@ }, { "c": "fn", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1871,7 +1805,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1882,7 +1816,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1893,7 +1827,7 @@ }, { "c": "{};", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1904,7 +1838,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1915,7 +1849,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1926,7 +1860,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1937,18 +1871,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", "r": { - "dark_plus": "comment: #6A9955", - "light_plus": "comment: #008000", - "dark_vs": "comment: #6A9955", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" } }, { "c": "//", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1959,7 +1893,7 @@ }, { "c": " the rest of", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", + "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1970,7 +1904,7 @@ }, { "c": "}", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1979,4 +1913,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/cpp/test/colorize-results/test_cpp.json b/extensions/cpp/test/colorize-results/test_cpp.json index f84d916afa3..b45e23ee1e0 100644 --- a/extensions/cpp/test/colorize-results/test_cpp.json +++ b/extensions/cpp/test/colorize-results/test_cpp.json @@ -133,13 +133,13 @@ }, { "c": "std", - "t": "source.cpp meta.using-namespace.cpp entity.name.namespace.cpp", + "t": "source.cpp meta.using-namespace.cpp entity.name.type.namespace.cpp", "r": { - "dark_plus": "entity.name.namespace: #4EC9B0", - "light_plus": "entity.name.namespace: #267F99", + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "entity.name.namespace: #4EC9B0" + "hc_black": "entity.name.type: #4EC9B0" } }, { @@ -199,7 +199,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -265,7 +265,7 @@ }, { "c": "class", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp storage.type.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.head.class.cpp storage.type.class.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -276,62 +276,62 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.head.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "Rectangle", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp entity.name.type.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.head.class.cpp entity.name.type.class.cpp", "r": { "dark_plus": "entity.name.type: #4EC9B0", "light_plus": "entity.name.type: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "entity.name.type: #4EC9B0" } }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.head.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "{", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp punctuation.section.block.begin.bracket.curly.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.head.class.cpp punctuation.section.block.begin.bracket.curly.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -342,62 +342,62 @@ }, { "c": " width", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ",", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " height", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "public", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -408,7 +408,7 @@ }, { "c": ":", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp punctuation.separator.colon.access.control.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp colon.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -419,18 +419,18 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "void", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -441,51 +441,51 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "set_values", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "entity.name.function: #DCDCAA" } }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "(", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -496,18 +496,18 @@ }, { "c": ",", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -518,40 +518,40 @@ }, { "c": ")", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -562,73 +562,73 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "area", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "entity.name.function: #DCDCAA" } }, { "c": "(", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ")", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "{", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "return", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.control.return.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp keyword.control.return.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -639,18 +639,18 @@ }, { "c": " width", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "*", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp keyword.operator.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -661,62 +661,62 @@ }, { "c": "height", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "}", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "}", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.section.block.end.bracket.curly.class.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp meta.body.class.cpp punctuation.section.block.end.bracket.curly.class.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.block.class.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.block.class.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "void", - "t": "source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -727,73 +727,73 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.scope-resolution.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "Rectangle", - "t": "source.cpp meta.function.definition.cpp entity.name.scope-resolution.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.scope-resolution.cpp entity.name.type.namespace.scope-resolution.cpp", "r": { - "dark_plus": "entity.name.scope-resolution: #4EC9B0", - "light_plus": "entity.name.scope-resolution: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "entity.name.scope-resolution: #4EC9B0" + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "entity.name.type: #4EC9B0" } }, { "c": "::", - "t": "source.cpp meta.function.definition.cpp punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.scope-resolution.cpp punctuation.separator.namespace.access.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "set_values", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "entity.name.function: #DCDCAA" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -804,51 +804,51 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "x", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp variable.parameter.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "variable: #9CDCFE" } }, { "c": ",", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -859,73 +859,73 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "y", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp meta.parameter.cpp variable.parameter.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "variable: #9CDCFE" } }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "{", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.head.extern.cpp punctuation.section.block.begin.bracket.curly.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " width ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "=", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.assignment.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp keyword.operator.assignment.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -936,40 +936,40 @@ }, { "c": " x", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " height ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "=", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.assignment.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp keyword.operator.assignment.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -980,40 +980,40 @@ }, { "c": " y", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "}", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.body.extern.cpp punctuation.section.block.end.bracket.curly.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1024,172 +1024,172 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "main", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "entity.name.function: #DCDCAA" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "{", - "t": "source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " Rectangle rect", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "rect", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.object.access.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp variable.other.object.access.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "variable: #9CDCFE" } }, { "c": ".", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.dot-access.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.separator.dot-access.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "set_values", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.member.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp variable.other.property.cpp", "r": { - "dark_plus": "entity.name.function: #DCDCAA", - "light_plus": "entity.name.function: #795E26", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "entity.name.function: #DCDCAA" + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "variable: #9CDCFE" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp punctuation.section.parens.begin.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "3", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1200,18 +1200,18 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.delimiter.comma.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "4", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1222,40 +1222,40 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp punctuation.section.parens.end.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " cout ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "<<", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1266,18 +1266,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1288,7 +1288,7 @@ }, { "c": "area: ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1299,7 +1299,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1310,18 +1310,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "<<", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1332,216 +1332,216 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "rect", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.object.access.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp variable.other.object.access.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "variable: #9CDCFE" } }, { "c": ".", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.dot-access.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.separator.dot-access.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "area", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.member.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp entity.name.function.member.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "entity.name.function: #DCDCAA" } }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "Task", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.scope-resolution.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp entity.name.type.namespace.scope-resolution.cpp", "r": { - "dark_plus": "entity.name.scope-resolution: #4EC9B0", - "light_plus": "entity.name.scope-resolution: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "entity.name.scope-resolution: #4EC9B0" + "dark_plus": "entity.name.type: #4EC9B0", + "light_plus": "entity.name.type: #267F99", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "entity.name.type: #4EC9B0" } }, { "c": "<", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.template.call.cpp meta.template.call.cpp punctuation.section.angle-brackets.begin.template.call.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp meta.template.call.cpp keyword.operator.comparison.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" } }, { "c": "ANY_OUTPUT_TYPE", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.template.call.cpp meta.template.call.cpp meta.qualified_type.cpp entity.name.type.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp meta.template.call.cpp storage.type.user-defined.cpp", "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "entity.name.type: #4EC9B0" + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6" } }, { "c": ",", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.template.call.cpp meta.template.call.cpp punctuation.separator.delimiter.comma.template.argument.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp meta.template.call.cpp comma.cpp punctuation.separator.template.argument.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.template.call.cpp meta.template.call.cpp meta.qualified_type.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp meta.template.call.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "ANY_INPUT_TYPE", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.template.call.cpp meta.template.call.cpp meta.qualified_type.cpp entity.name.type.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp meta.template.call.cpp storage.type.user-defined.cpp", "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "entity.name.type: #4EC9B0" + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6" } }, { "c": ">", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.template.call.cpp meta.template.call.cpp punctuation.section.angle-brackets.end.template.call.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp meta.template.call.cpp keyword.operator.comparison.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" } }, { "c": "::", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.scope-resolution.cpp punctuation.separator.namespace.access.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "links_to", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "int", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp storage.type.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1552,18 +1552,18 @@ }, { "c": " t ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "=", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.assignment.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp keyword.operator.assignment.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1574,18 +1574,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "2", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1596,29 +1596,29 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "if", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.control.if.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp keyword.control.if.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -1629,40 +1629,40 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp punctuation.section.parens.begin.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp punctuation.section.parens.begin.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "t ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ">", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp keyword.operator.comparison.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp keyword.operator.comparison.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1673,18 +1673,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "0", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp constant.numeric.decimal.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1695,51 +1695,51 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp punctuation.section.parens.end.bracket.round.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.parens.block.cpp punctuation.section.parens.end.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "puts", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", "hc_black": "entity.name.function: #DCDCAA" } }, { "c": "(", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1750,7 +1750,7 @@ }, { "c": "\\n", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp constant.character.escape.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp constant.character.escape.cpp", "r": { "dark_plus": "constant.character.escape: #D7BA7D", "light_plus": "constant.character.escape: #FF0000", @@ -1761,7 +1761,7 @@ }, { "c": "*************************************************", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1772,7 +1772,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1783,40 +1783,40 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "return", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.control.return.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp keyword.control.return.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -1827,18 +1827,18 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "0", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1849,24 +1849,24 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.terminator.statement.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "}", - "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", + "t": "source.cpp meta.preprocessor.macro.cpp meta.block.extern.cpp meta.tail.extern.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } } ] \ No newline at end of file From 67b0d5805e1e77ba4df9dcdfc1249b70a50f994a Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Tue, 27 Aug 2019 11:42:10 +0200 Subject: [PATCH 144/163] Fixing #78474 don't move focus on click --- extensions/npm/src/npmView.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/npm/src/npmView.ts b/extensions/npm/src/npmView.ts index 9bcd272a958..8235c6f79eb 100644 --- a/extensions/npm/src/npmView.ts +++ b/extensions/npm/src/npmView.ts @@ -258,7 +258,7 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider { let document: TextDocument = await workspace.openTextDocument(uri); let offset = this.findScript(document, selection instanceof NpmScript ? selection : undefined); let position = document.positionAt(offset); - await window.showTextDocument(document, { selection: new Selection(position, position) }); + await window.showTextDocument(document, { preserveFocus: true, selection: new Selection(position, position) }); } public refresh() { @@ -353,4 +353,4 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider { } return [...folders.values()]; } -} \ No newline at end of file +} From 59462eb0b16e8726bf2a3b810014852ddd2b2018 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 27 Aug 2019 11:46:43 +0200 Subject: [PATCH 145/163] Local md fix for embedded C++ Fixes #79810 --- extensions/markdown-basics/syntaxes/markdown.tmLanguage.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json index 3fe94d8cf7e..fb937c24feb 100644 --- a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json +++ b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json @@ -716,7 +716,7 @@ { "begin": "(^|\\G)(\\s*)(.*)", "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", - "contentName": "meta.embedded.block.cpp", + "contentName": "meta.embedded.block.cpp source.cpp", "patterns": [ { "include": "source.cpp" @@ -2587,4 +2587,4 @@ "name": "markup.inline.raw.string.markdown" } } -} \ No newline at end of file +} From efae59a2be435bc8a5317d4b4d7d3eaba7b3fe3e Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 27 Aug 2019 12:58:13 +0200 Subject: [PATCH 146/163] clarify reason --- cglicenses.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cglicenses.json b/cglicenses.json index 15b30362685..df57f699bd2 100644 --- a/cglicenses.json +++ b/cglicenses.json @@ -48,6 +48,7 @@ }, { // Reason: The npm module does not contain a repository field. + // waiting for https://github.com/xtermjs/xterm.js/issues/2395 "name": "xterm-addon-search", "fullLicenseText": [ "Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)", @@ -73,6 +74,7 @@ }, { // Reason: The npm module does not contain a repository field. + // waiting for https://github.com/xtermjs/xterm.js/issues/2395 "name": "xterm-addon-web-links", "fullLicenseText": [ "Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)", From 98574d61ca1763323baaafe2ab49839964b7e93d Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 27 Aug 2019 14:02:31 +0200 Subject: [PATCH 147/163] Move tree create to happen when the data provider is set , not when the view is activated. Fixes #79889 --- src/vs/workbench/api/browser/mainThreadTreeViews.ts | 4 +++- src/vs/workbench/browser/parts/views/customView.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadTreeViews.ts b/src/vs/workbench/api/browser/mainThreadTreeViews.ts index 3c2e1c70801..db7d95f0d22 100644 --- a/src/vs/workbench/api/browser/mainThreadTreeViews.ts +++ b/src/vs/workbench/api/browser/mainThreadTreeViews.ts @@ -35,9 +35,11 @@ export class MainThreadTreeViews extends Disposable implements MainThreadTreeVie this._dataProviders.set(treeViewId, dataProvider); const viewer = this.getTreeView(treeViewId); if (viewer) { - viewer.dataProvider = dataProvider; + // Order is important here. The internal tree isn't created until the dataProvider is set. + // Set all other properties first! viewer.showCollapseAllAction = !!options.showCollapseAll; viewer.canSelectMany = !!options.canSelectMany; + viewer.dataProvider = dataProvider; this.registerListeners(treeViewId, viewer); this._proxy.$setVisible(treeViewId, viewer.visible); } else { diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index 2fcbf196e0d..956b6c10e0a 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -228,6 +228,10 @@ export class CustomTreeView extends Disposable implements ITreeView { } set dataProvider(dataProvider: ITreeViewDataProvider | undefined) { + if (this.tree === undefined) { + this.createTree(); + } + if (dataProvider) { this._dataProvider = new class implements ITreeViewDataProvider { async getChildren(node: ITreeItem): Promise { @@ -578,7 +582,6 @@ export class CustomTreeView extends Disposable implements ITreeView { private activate() { if (!this.activated) { - this.createTree(); this.progressService.withProgress({ location: this.viewContainer.id }, () => this.extensionService.activateByEvent(`onView:${this.id}`)) .then(() => timeout(2000)) .then(() => { From ba5ea8e2d29b2c2323200b5aa3832601cfc897b7 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 27 Aug 2019 14:45:31 +0200 Subject: [PATCH 148/163] [json] update service --- .../json-language-features/server/package.json | 2 +- .../json-language-features/server/yarn.lock | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index bf76da32dba..d05f3c36e23 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -14,7 +14,7 @@ "dependencies": { "jsonc-parser": "^2.1.1", "request-light": "^0.2.4", - "vscode-json-languageservice": "^3.3.1", + "vscode-json-languageservice": "^3.3.2", "vscode-languageserver": "^5.3.0-next.8", "vscode-nls": "^4.1.1", "vscode-uri": "^2.0.3" diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index 3c176e12603..20ad7ebfaef 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -54,11 +54,6 @@ https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" -jsonc-parser@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.1.0.tgz#eb0d0c7a3c33048524ce3574c57c7278fb2f1bf3" - integrity sha512-n9GrT8rrr2fhvBbANa1g+xFmgGK5X91KFeDwlKQ3+SJfmH5+tKv/M/kahx/TXOMflfWHKGKqKyfHQaLKTNzJ6w== - jsonc-parser@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.1.1.tgz#83dc3d7a6e7186346b889b1280eefa04446c6d3e" @@ -78,12 +73,12 @@ request-light@^0.2.4: https-proxy-agent "^2.2.1" vscode-nls "^4.0.0" -vscode-json-languageservice@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.1.tgz#4ad2c82db849a7bbe54fcbf5c9b3a2ed26dc8fee" - integrity sha512-Qyvlrftexu1acvwbMt+CDehVrDZtFV1GAJrKdOCHQL9bWNhzI06KEiSd4iXR0NUOuAdroG/uU4wBkH6e5CcTXg== +vscode-json-languageservice@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.2.tgz#2b241b73ead75b001bf90ee5107b1b0a4e47737c" + integrity sha512-+TXVA8KsIzPOZIBV4lI8S/460XihqL26N9hyH7wMOCbEA06W/zfmlZhHSmSJ/Nun9Q/CGLJYZKw4xn+vcuI62A== dependencies: - jsonc-parser "^2.1.0" + jsonc-parser "^2.1.1" vscode-languageserver-types "^3.15.0-next.2" vscode-nls "^4.1.1" vscode-uri "^2.0.3" From f90b40fdae96f6cd5c9ba98d8806b2ae84d293e0 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 27 Aug 2019 14:59:31 +0200 Subject: [PATCH 149/163] debt - clean up buildfiles (#79914) --- build/gulpfile.vscode.js | 2 +- build/gulpfile.vscode.web.js | 9 +++---- src/buildfile.js | 4 ++-- .../{buildfile.js => buildfile.desktop.js} | 0 src/vs/workbench/buildfile.web.js | 24 +++++++++++++++++++ 5 files changed, 32 insertions(+), 7 deletions(-) rename src/vs/workbench/{buildfile.js => buildfile.desktop.js} (100%) create mode 100644 src/vs/workbench/buildfile.web.js diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 98f776abb7e..6bb695db68c 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -50,7 +50,7 @@ const vscodeEntryPoints = _.flatten([ buildfile.entrypoint('vs/workbench/workbench.desktop.main'), buildfile.base, buildfile.serviceWorker, - buildfile.workbench, + buildfile.workbenchDesktop, buildfile.code ]); diff --git a/build/gulpfile.vscode.web.js b/build/gulpfile.vscode.web.js index 8f63d7b7d0b..f67c2a64a38 100644 --- a/build/gulpfile.vscode.web.js +++ b/build/gulpfile.vscode.web.js @@ -53,13 +53,14 @@ const vscodeWebResources = [ const buildfile = require('../src/buildfile'); -const vscodeWebEntryPoints = [ - buildfile.workbenchWeb, +const vscodeWebEntryPoints = _.flatten([ + buildfile.entrypoint('vs/workbench/workbench.web.api'), + buildfile.base, buildfile.serviceWorker, buildfile.workerExtensionHost, buildfile.keyboardMaps, - buildfile.base -]; + buildfile.workbenchWeb +]); const optimizeVSCodeWebTask = task.define('optimize-vscode-web', task.series( util.rimraf('out-vscode-web'), diff --git a/src/buildfile.js b/src/buildfile.js index 746975249ed..684954a3219 100644 --- a/src/buildfile.js +++ b/src/buildfile.js @@ -25,8 +25,8 @@ exports.serviceWorker = [{ exports.workerExtensionHost = [entrypoint('vs/workbench/services/extensions/worker/extensionHostWorker')]; -exports.workbench = require('./vs/workbench/buildfile').collectModules(['vs/workbench/workbench.desktop.main']); -exports.workbenchWeb = entrypoint('vs/workbench/workbench.web.api'); +exports.workbenchDesktop = require('./vs/workbench/buildfile.desktop').collectModules(); +exports.workbenchWeb = require('./vs/workbench/buildfile.web').collectModules(); exports.keyboardMaps = [ entrypoint('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux'), diff --git a/src/vs/workbench/buildfile.js b/src/vs/workbench/buildfile.desktop.js similarity index 100% rename from src/vs/workbench/buildfile.js rename to src/vs/workbench/buildfile.desktop.js diff --git a/src/vs/workbench/buildfile.web.js b/src/vs/workbench/buildfile.web.js new file mode 100644 index 00000000000..47a84533025 --- /dev/null +++ b/src/vs/workbench/buildfile.web.js @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +function createModuleDescription(name, exclude) { + const result = {}; + + let excludes = ['vs/css', 'vs/nls']; + result.name = name; + if (Array.isArray(exclude) && exclude.length > 0) { + excludes = excludes.concat(exclude); + } + result.exclude = excludes; + + return result; +} + +exports.collectModules = function () { + return [ + createModuleDescription('vs/workbench/contrib/output/common/outputLinkComputer', ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']), + ]; +}; From 621df58d08f07da95c4f284cc4577634d866fea6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 27 Aug 2019 15:01:16 +0200 Subject: [PATCH 150/163] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e3ec3f037df..d6861dd0b27 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.38.0", - "distro": "ae0015489bf2fc418bf61e0ed4b425bc75bdce89", + "distro": "4107c33b807ed89533362a04c4cab9471fbc302c", "author": { "name": "Microsoft Corporation" }, From 821158934e6035d366faeed306c7dd0973a63a10 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Tue, 27 Aug 2019 06:02:37 -0700 Subject: [PATCH 151/163] Fix #79859, use correct reference for error icon --- .../ui/octiconLabel/octicons/octicons.css | 6 +++--- .../ui/octiconLabel/octicons/octicons.svg | 2 +- .../ui/octiconLabel/octicons/octicons.ttf | Bin 37484 -> 37500 bytes .../ui/octiconLabel/octicons/octicons2.css | 8 ++++---- .../ui/octiconLabel/octicons/octicons2.svg | 2 +- .../ui/octiconLabel/octicons/octicons2.ttf | Bin 35564 -> 35580 bytes 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css index 381ae0fd1c1..4319e029b44 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css @@ -1,7 +1,7 @@ @font-face { font-family: "octicons"; - src: url("./octicons.ttf?759e9adce5213a11e27cd79af7448e2e") format("truetype"), -url("./octicons.svg?759e9adce5213a11e27cd79af7448e2e#octicons") format("svg"); + src: url("./octicons.ttf?05c5628ba539c873b956683ef1ed7b88") format("truetype"), +url("./octicons.svg?05c5628ba539c873b956683ef1ed7b88#octicons") format("svg"); } .octicon, .mega-octicon { @@ -157,7 +157,7 @@ url("./octicons.svg?759e9adce5213a11e27cd79af7448e2e#octicons") format("svg"); .octicon-note:before { content: "\f289" } .octicon-octoface:before { content: "\f008" } .octicon-organization:before { content: "\f037" } -.octicon-organization-filled:before { content: "\26a2" } +.octicon-organization-filled:before { content: "\26b6" } .octicon-organization-outline:before { content: "\f037" } .octicon-package:before { content: "\f0c4" } .octicon-paintcan:before { content: "\f0d1" } diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg index 8eca48d0e17..b7242c11992 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg @@ -374,7 +374,7 @@ unicode="" horiz-adv-x="1000" d=" M918.75 486.25C926.875 506.25 953.125 585.625 910.6249999999998 693.125C910.6249999999998 693.125 844.9999999999999 713.75 695.6249999999999 611.875C633.1249999999999 629.375 566.2499999999999 631.875 499.9999999999999 631.875S366.875 629.375 304.375 611.875C155 714.375 89.375 693.125 89.375 693.125C46.875 585.625 73.125 506.2499999999999 81.25 486.25C30.625 431.875 0 361.875 0 276.875C0 -45 208.125 -117.5 498.75 -117.5S1000 -45 1000 276.875C1000 361.8750000000001 969.375 431.8750000000001 918.75 486.25zM500 -56.25C293.75 -56.25 126.25 -46.875 126.25 153.125C126.25 200.625 150 245.625 190 282.5C256.875 343.7500000000001 371.25 311.2500000000001 500 311.2500000000001C629.375 311.2500000000001 742.4999999999999 343.7500000000001 810 282.5C850.6250000000001 245.625 873.75 201.25 873.75 153.125C873.75 -46.25 706.25 -56.25 500 -56.25zM343.125 256.875C301.875 256.875 268.125 206.875 268.125 145.625S301.875 33.7500000000001 343.125 33.7500000000001C384.375 33.7500000000001 418.125 83.7500000000001 418.125 145.625S384.375 256.875 343.125 256.875zM656.875 256.875C615.625 256.875 581.875 207.5 581.875 145.625S615.6250000000001 33.7500000000001 656.875 33.7500000000001C698.125 33.7500000000001 731.8749999999999 83.7500000000001 731.8749999999999 145.625S698.75 256.875 656.875 256.875z" /> +>Ag~AehHcFxiYPTC{<|g~62}fFX*ZnW2|q8iP558AJ8vWo-RSlN~wB Rxzx5XFn};nY#Zmc4gkvPLmdDB delta 206 zcmeyfgz3!^rU?cr5sR%P85md|Ffj0PrRP+p6?=b4Wnd7_VPGi!l98I2BFpc@`4Er3`}AL`NbuVln3G5acz&C&4BX5w7=Ykr=cR8jdNT{- zduClN21bwovkC($f%{Nty0@KS%o#0al_;`){X3p rK$#eZyvc5C(TvrT7qE$L-pfR&74PxupXDdV)Jj diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css b/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css index aa31d3d92b1..2a52cc0cb5d 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.css @@ -1,7 +1,7 @@ @font-face { font-family: "octicons2"; - src: url("./octicons2.ttf?e9cbaa049a291f47ea2a38815e18222e") format("truetype"), -url("./octicons2.svg?e9cbaa049a291f47ea2a38815e18222e#octicons2") format("svg"); + src: url("./octicons2.ttf?d963b05ee5ff3bfe9f854a5216888de7") format("truetype"), +url("./octicons2.svg?d963b05ee5ff3bfe9f854a5216888de7#octicons2") format("svg"); } .octicon, .mega-octicon { @@ -157,7 +157,7 @@ url("./octicons2.svg?e9cbaa049a291f47ea2a38815e18222e#octicons2") format("svg"); .octicon-note:before { content: "\f289" } .octicon-octoface:before { content: "\f008" } .octicon-organization:before { content: "\f037" } -.octicon-organization-filled:before { content: "\f037" } +.octicon-organization-filled:before { content: "\26a2" } .octicon-organization-outline:before { content: "\f037" } .octicon-package:before { content: "\f0c4" } .octicon-paintcan:before { content: "\f0d1" } @@ -233,7 +233,7 @@ url("./octicons2.svg?e9cbaa049a291f47ea2a38815e18222e#octicons2") format("svg"); .octicon-watch:before { content: "\f0e0" } .octicon-x:before { content: "\f081" } .octicon-zap:before { content: "\26a1" } -.octicon-error:before { content: "\26a2" } +.octicon-error:before { content: "\26b1" } .octicon-eye-closed:before { content: "\26a3" } .octicon-fold-down:before { content: "\26a4" } .octicon-fold-up:before { content: "\26a5" } diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.svg b/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.svg index 4028dd45666..8c6fce53fe9 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.svg +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons2.svg @@ -167,7 +167,7 @@ unicode="" horiz-adv-x="1000" d=" M250 320C250 307.63875 246.334375 295.555 239.466875 285.276875C232.599375 274.99875 222.838125 266.988125 211.4175 262.2575C199.9975 257.526875 187.430625 256.289375 175.306875 258.700625C163.183125 261.1125000000001 152.046875 267.0650000000001 143.305625 275.805625C134.565 284.546875 128.6125 295.683125 126.20125 307.806875C123.789375 319.930625 125.026875 332.4975 129.7575 343.9175C134.488125 355.338125 142.49875 365.099375 152.776875 371.966875C163.055 378.834375 175.13875 382.5 187.5 382.5C204.07625 382.5 219.973125 375.915 231.694375 364.1943750000001C243.415 352.473125 250 336.57625 250 320z M562.5 320C562.5 307.63875 558.834375 295.555 551.966875 285.276875C545.099375 274.99875 535.338125 266.988125 523.9175 262.2575C512.4975000000001 257.526875 499.930625 256.289375 487.806875 258.700625C475.683125 261.1125000000001 464.546875 267.0650000000001 455.805625 275.805625C447.065 284.546875 441.1125 295.683125 438.70125 307.806875C436.289375 319.930625 437.526875 332.4975 442.2575000000001 343.9175C446.9881250000001 355.338125 454.99875 365.099375 465.276875 371.966875C475.555 378.834375 487.63875 382.5 500 382.5C516.57625 382.5 532.473125 375.915 544.194375 364.1943750000001C555.9150000000001 352.473125 562.5 336.57625 562.5 320z M875 320C875 307.63875 871.3375 295.555 864.46875 285.276875C857.6 274.99875 847.8375 266.988125 836.41875 262.2575C825 257.526875 812.4312500000001 256.289375 800.30625 258.700625C788.1812500000001 261.1125000000001 777.04375 267.0650000000001 768.30625 275.805625C759.5625 284.546875 753.6125000000001 295.683125 751.1999999999999 307.806875C748.7875 319.930625 750.0250000000001 332.4975 754.75625 343.9175C759.4875 355.338125 767.5 365.099375 777.775 371.966875C788.05625 378.834375 800.1374999999999 382.5 812.5 382.5C829.075 382.5 844.975 375.915 856.69375 364.1943750000001C868.4125 352.473125 875 336.57625 875 320z" /> 50Ok^-;Fx%Y4*2^?mnKPbC PZ6gB%2m{3$ICB~S(dRv~ delta 222 zcmew}mFdk?rU?cr!4_Py3=Av>7#Mh7q~}zowTON3Vqg%KU|`5~$w*C15tDjuGcm-N zamB#)TNnlV@~xH7mg1TfSwbTCY0FyB0jt(S>&5d(u75HpxfR^d$AJc%=_ F5dgYKIcWd@ From 42a5afd6e83be84f0941d543ff132a39cb50ab8e Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 27 Aug 2019 16:03:40 +0200 Subject: [PATCH 152/163] build - catch up with distro --- build/gulpfile.vscode.web.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/gulpfile.vscode.web.js b/build/gulpfile.vscode.web.js index f67c2a64a38..edd34cd3931 100644 --- a/build/gulpfile.vscode.web.js +++ b/build/gulpfile.vscode.web.js @@ -117,6 +117,8 @@ function packageTask(sourceFolderName, destinationFolderName) { .pipe(util.cleanNodeModules(path.join(__dirname, '.nativeignore'))); const favicon = gulp.src('resources/server/favicon.ico', { base: 'resources/server' }); + const manifest = gulp.src('resources/server/manifest.json', { base: 'resources/server' }); + const pwaicon = gulp.src('resources/server/code.png', { base: 'resources/server' }); let all = es.merge( packageJsonStream, @@ -124,7 +126,9 @@ function packageTask(sourceFolderName, destinationFolderName) { license, sources, deps, - favicon + favicon, + manifest, + pwaicon ); let result = all From 85064257367b0383aff362d73e0913acf7baa4ce Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 27 Aug 2019 16:10:21 +0200 Subject: [PATCH 153/163] Update message to reflect current state --- src/vs/workbench/browser/parts/editor/editorStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 0d54b781fb0..f9c68540493 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -325,7 +325,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution { if (!this.screenReaderNotification) { this.screenReaderNotification = this.notificationService.prompt( Severity.Info, - nls.localize('screenReaderDetectedExplanation.question', "Are you using a screen reader to operate VS Code? (Certain features like folding, minimap or word wrap are disabled when using a screen reader)"), + nls.localize('screenReaderDetectedExplanation.question', "Are you using a screen reader to operate VS Code? (Certain features like word wrap are disabled when using a screen reader)"), [{ label: nls.localize('screenReaderDetectedExplanation.answerYes', "Yes"), run: () => { From 04d52502b8d04aa24353d0d683719b76b0c29132 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 27 Aug 2019 16:11:37 +0200 Subject: [PATCH 154/163] Add cookie --- remote/package.json | 1 + remote/yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/remote/package.json b/remote/package.json index 9fa3881681d..9960e55a9ec 100644 --- a/remote/package.json +++ b/remote/package.json @@ -4,6 +4,7 @@ "dependencies": { "@microsoft/applicationinsights-web": "^2.1.1", "applicationinsights": "1.0.8", + "cookie": "^0.4.0", "getmac": "1.4.1", "graceful-fs": "4.1.11", "http-proxy-agent": "^2.1.0", diff --git a/remote/yarn.lock b/remote/yarn.lock index 308bf9634b7..37fd7f8f725 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -207,6 +207,11 @@ component-emitter@^1.2.1: resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== +cookie@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" From 739ae7737a9c9407f549f5c33183da549dbd1dfe Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Tue, 27 Aug 2019 09:25:15 -0700 Subject: [PATCH 155/163] Fix #78068 --- .../client/src/customData.ts | 31 ++++++++++++++++++- extensions/css-language-features/package.json | 12 ++++++- .../css-language-features/package.nls.json | 1 + .../client/src/customData.ts | 25 +++++++++++++++ .../html-language-features/package.json | 12 ++++++- .../html-language-features/package.nls.json | 3 +- 6 files changed, 80 insertions(+), 4 deletions(-) diff --git a/extensions/css-language-features/client/src/customData.ts b/extensions/css-language-features/client/src/customData.ts index b812b133ddc..e5fbd4fc9cc 100644 --- a/extensions/css-language-features/client/src/customData.ts +++ b/extensions/css-language-features/client/src/customData.ts @@ -7,6 +7,7 @@ import * as path from 'path'; import { workspace, WorkspaceFolder, extensions } from 'vscode'; interface ExperimentalConfig { + customData?: string[]; experimental?: { customData?: string[]; }; @@ -19,6 +20,21 @@ export function getCustomDataPathsInAllWorkspaces(workspaceFolders: WorkspaceFol return dataPaths; } + workspaceFolders.forEach(wf => { + const allCssConfig = workspace.getConfiguration(undefined, wf.uri); + const wfCSSConfig = allCssConfig.inspect('css'); + if (wfCSSConfig && wfCSSConfig.workspaceFolderValue && wfCSSConfig.workspaceFolderValue.customData) { + const customData = wfCSSConfig.workspaceFolderValue.customData; + if (Array.isArray(customData)) { + customData.forEach(t => { + if (typeof t === 'string') { + dataPaths.push(path.resolve(wf.uri.fsPath, t)); + } + }); + } + } + }); + workspaceFolders.forEach(wf => { const allCssConfig = workspace.getConfiguration(undefined, wf.uri); const wfCSSConfig = allCssConfig.inspect('css'); @@ -48,7 +64,20 @@ export function getCustomDataPathsFromAllExtensions(): string[] { for (const extension of extensions.all) { const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (contributes && contributes.css && contributes.css.experimental.customData && Array.isArray(contributes.css.experimental.customData)) { + if (contributes && contributes.css && contributes.css.customData && Array.isArray(contributes.css.customData)) { + const relativePaths: string[] = contributes.css.customData; + relativePaths.forEach(rp => { + dataPaths.push(path.resolve(extension.extensionPath, rp)); + }); + } + + if ( + contributes && + contributes.css && + contributes.experimental && + contributes.css.experimental.customData && + Array.isArray(contributes.css.experimental.customData) + ) { const relativePaths: string[] = contributes.css.experimental.customData; relativePaths.forEach(rp => { dataPaths.push(path.resolve(extension.extensionPath, rp)); diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index be663d36b7b..b1a42926f9a 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -34,6 +34,15 @@ "id": "css", "title": "%css.title%", "properties": { + "css.customData": { + "type": "array", + "description": "%css.customData.desc%", + "default": [], + "items": { + "type": "string" + }, + "scope": "resource" + }, "css.experimental.customData": { "type": "array", "description": "A list of JSON file paths that define custom CSS data that loads custom properties, at directives, pseudo classes / elements.", @@ -41,7 +50,8 @@ "items": { "type": "string" }, - "scope": "resource" + "scope": "resource", + "deprecationMessage": "This setting is no longe experimental. Use `css.customData` instead." }, "css.completion.triggerPropertyValueCompletion": { "type": "boolean", diff --git a/extensions/css-language-features/package.nls.json b/extensions/css-language-features/package.nls.json index 3e890bfd9bd..fcd5d933686 100644 --- a/extensions/css-language-features/package.nls.json +++ b/extensions/css-language-features/package.nls.json @@ -2,6 +2,7 @@ "displayName": "CSS Language Features", "description": "Provides rich language support for CSS, LESS and SCSS files.", "css.title": "CSS", + "css.customData.desc": "A list of JSON file paths that define custom CSS data that loads custom properties, at directives, pseudo classes / elements.", "css.completion.triggerPropertyValueCompletion.desc": "By default, VS Code triggers property value completion after selecting a CSS property. Use this setting to disable this behavior.", "css.lint.argumentsInColorFunction.desc": "Invalid number of parameters.", "css.lint.boxModel.desc": "Do not use `width` or `height` when using `padding` or `border`.", diff --git a/extensions/html-language-features/client/src/customData.ts b/extensions/html-language-features/client/src/customData.ts index d716c0ae347..4c89d719539 100644 --- a/extensions/html-language-features/client/src/customData.ts +++ b/extensions/html-language-features/client/src/customData.ts @@ -7,6 +7,7 @@ import * as path from 'path'; import { workspace, WorkspaceFolder, extensions } from 'vscode'; interface ExperimentalConfig { + customData?: string[]; experimental?: { customData?: string[]; }; @@ -23,6 +24,17 @@ export function getCustomDataPathsInAllWorkspaces(workspaceFolders: WorkspaceFol const allHtmlConfig = workspace.getConfiguration(undefined, wf.uri); const wfHtmlConfig = allHtmlConfig.inspect('html'); + if (wfHtmlConfig && wfHtmlConfig.workspaceFolderValue && wfHtmlConfig.workspaceFolderValue.customData) { + const customData = wfHtmlConfig.workspaceFolderValue.customData; + if (Array.isArray(customData)) { + customData.forEach(t => { + if (typeof t === 'string') { + dataPaths.push(path.resolve(wf.uri.fsPath, t)); + } + }); + } + } + if ( wfHtmlConfig && wfHtmlConfig.workspaceFolderValue && @@ -52,6 +64,19 @@ export function getCustomDataPathsFromAllExtensions(): string[] { if ( contributes && contributes.html && + contributes.html.customData && + Array.isArray(contributes.html.customData) + ) { + const relativePaths: string[] = contributes.html.customData; + relativePaths.forEach(rp => { + dataPaths.push(path.resolve(extension.extensionPath, rp)); + }); + } + + if ( + contributes && + contributes.html && + contributes.html.experimental && contributes.html.experimental.customData && Array.isArray(contributes.html.experimental.customData) ) { diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index 3985c07b972..54c4a85b51e 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -32,6 +32,15 @@ "type": "object", "title": "HTML", "properties": { + "html.customData": { + "type": "array", + "description": "%html.customData.desc%", + "default": [], + "items": { + "type": "string" + }, + "scope": "resource" + }, "html.experimental.customData": { "type": "array", "description": "A list of JSON file paths that define custom tags, properties and other HTML syntax constructs. Only workspace folder setting will be read.", @@ -39,7 +48,8 @@ "items": { "type": "string" }, - "scope": "resource" + "scope": "resource", + "deprecationMessage": "This setting is no longe experimental. Use `html.customData` instead." }, "html.format.enable": { "type": "boolean", diff --git a/extensions/html-language-features/package.nls.json b/extensions/html-language-features/package.nls.json index 6a436fa5cb3..cf4a8dca92a 100644 --- a/extensions/html-language-features/package.nls.json +++ b/extensions/html-language-features/package.nls.json @@ -1,6 +1,7 @@ { "displayName": "HTML Language Features", "description": "Provides rich language support for HTML and Handlebar files", + "html.customData.desc": "A list of JSON file paths that define custom tags, properties and other HTML syntax constructs. Only workspace folder setting will be read.", "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.", @@ -24,4 +25,4 @@ "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." -} \ No newline at end of file +} From a22b7c65024a2e5befa0dd643cae483943da95c6 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Tue, 27 Aug 2019 09:33:19 -0700 Subject: [PATCH 156/163] Add prettier config --- .prettierrc.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000000..91855cc846d --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "useTabs": true, + "printWidth": 120, + "semi": true, + "singleQuote": true +} From d3605cc532239cef43c098ef873ab5156cd0cb87 Mon Sep 17 00:00:00 2001 From: Max Belsky Date: Tue, 27 Aug 2019 19:56:19 +0300 Subject: [PATCH 157/163] Use const instead of let --- src/bootstrap.js | 6 +++--- src/vs/base/node/languagePacks.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bootstrap.js b/src/bootstrap.js index bb29caa6e82..3aeaa72e3b1 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -203,7 +203,7 @@ exports.setupNLS = function () { const bundles = Object.create(null); nlsConfig.loadBundle = function (bundle, language, cb) { - let result = bundles[bundle]; + const result = bundles[bundle]; if (result) { cb(undefined, result); @@ -212,7 +212,7 @@ exports.setupNLS = function () { const bundleFile = path.join(nlsConfig._resolvedLanguagePackCoreLocation, bundle.replace(/\//g, '!') + '.nls.json'); exports.readFile(bundleFile).then(function (content) { - let json = JSON.parse(content); + const json = JSON.parse(content); bundles[bundle] = json; cb(undefined, json); @@ -301,4 +301,4 @@ exports.avoidMonkeyPatchFromAppInsights = function () { process.env['APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL'] = true; // Skip monkey patching of 3rd party modules by appinsights global['diagnosticsSource'] = {}; // Prevents diagnostic channel (which patches "require") from initializing entirely }; -//#endregion \ No newline at end of file +//#endregion diff --git a/src/vs/base/node/languagePacks.js b/src/vs/base/node/languagePacks.js index 445a6c5f7b3..3ae24454cb7 100644 --- a/src/vs/base/node/languagePacks.js +++ b/src/vs/base/node/languagePacks.js @@ -268,10 +268,10 @@ function factory(nodeRequire, path, fs, perf) { const packData = JSON.parse(values[1]).contents; const bundles = Object.keys(metadata.bundles); const writes = []; - for (let bundle of bundles) { + for (const bundle of bundles) { const modules = metadata.bundles[bundle]; const target = Object.create(null); - for (let module of modules) { + for (const module of modules) { const keys = metadata.keys[module]; const defaultMessages = metadata.messages[module]; const translations = packData[module]; @@ -329,4 +329,4 @@ if (typeof define === 'function') { module.exports = factory(require, path, fs, perf); } else { throw new Error('Unknown context'); -} \ No newline at end of file +} From e594b184afa04b54afb38b95dc2758fed769701e Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Tue, 27 Aug 2019 09:59:32 -0700 Subject: [PATCH 158/163] Scope new Octicon updates --- .../ui/octiconLabel/octicons/octicons.css | 33 +- .../ui/octiconLabel/octicons/octicons.svg | 24 +- .../ui/octiconLabel/octicons/octicons.ttf | Bin 37500 -> 37504 bytes .../ui/octiconLabel/octicons/octicons2.css | 460 +++++++++--------- .../ui/octiconLabel/octicons/octicons2.svg | 2 +- .../ui/octiconLabel/octicons/octicons2.ttf | Bin 35580 -> 35588 bytes 6 files changed, 258 insertions(+), 261 deletions(-) diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css index 4319e029b44..d9cc1b7a4fa 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css @@ -1,7 +1,7 @@ @font-face { font-family: "octicons"; - src: url("./octicons.ttf?05c5628ba539c873b956683ef1ed7b88") format("truetype"), -url("./octicons.svg?05c5628ba539c873b956683ef1ed7b88#octicons") format("svg"); + src: url("./octicons.ttf?1b0f2a9535896866c74dd24eedeb4374") format("truetype"), +url("./octicons.svg?1b0f2a9535896866c74dd24eedeb4374#octicons") format("svg"); } .octicon, .mega-octicon { @@ -157,7 +157,7 @@ url("./octicons.svg?05c5628ba539c873b956683ef1ed7b88#octicons") format("svg"); .octicon-note:before { content: "\f289" } .octicon-octoface:before { content: "\f008" } .octicon-organization:before { content: "\f037" } -.octicon-organization-filled:before { content: "\26b6" } +.octicon-organization-filled:before { content: "\26a2" } .octicon-organization-outline:before { content: "\f037" } .octicon-package:before { content: "\f0c4" } .octicon-paintcan:before { content: "\f0d1" } @@ -169,7 +169,7 @@ url("./octicons.svg?05c5628ba539c873b956683ef1ed7b88#octicons") format("svg"); .octicon-person-outline:before { content: "\f018" } .octicon-pin:before { content: "\f041" } .octicon-plug:before { content: "\f0d4" } -.octicon-plus-small:before { content: "\f05d" } +.octicon-plus-small:before { content: "\f28a" } .octicon-plus:before { content: "\f05d" } .octicon-primitive-dot:before { content: "\f052" } .octicon-primitive-square:before { content: "\f053" } @@ -233,19 +233,16 @@ url("./octicons.svg?05c5628ba539c873b956683ef1ed7b88#octicons") format("svg"); .octicon-watch:before { content: "\f0e0" } .octicon-x:before { content: "\f081" } .octicon-zap:before { content: "\26a1" } -.octicon-error:before { content: "\26b1" } -.octicon-eye-closed:before { content: "\26b0" } -.octicon-fold-down:before { content: "\26a4" } -.octicon-fold-up:before { content: "\26a5" } -.octicon-github-action:before { content: "\26a6" } -.octicon-info-outline:before { content: "\26a7" } -.octicon-play:before { content: "\26a8" } -.octicon-remote:before { content: "\26a9" } -.octicon-request-changes:before { content: "\26aa" } -.octicon-smiley-outline:before { content: "\f27d" } -.octicon-warning:before { content: "\f02d" } -.octicon-controls:before { content: "\26ad" } -.octicon-event:before { content: "\26ae" } -.octicon-record-keys:before { content: "\26af" } .octicon-archive:before { content: "\f101" } .octicon-arrow-both:before { content: "\f102" } +.octicon-error:before { content: "\f103" } +.octicon-eye-closed:before { content: "\f104" } +.octicon-fold-down:before { content: "\f105" } +.octicon-fold-up:before { content: "\f106" } +.octicon-github-action:before { content: "\f107" } +.octicon-info-outline:before { content: "\f108" } +.octicon-play:before { content: "\f109" } +.octicon-remote:before { content: "\f10a" } +.octicon-request-changes:before { content: "\f10b" } +.octicon-smiley-outline:before { content: "\f10c" } +.octicon-warning:before { content: "\f10d" } diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg index b7242c11992..3f4ab4f1807 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg @@ -167,10 +167,10 @@ unicode="" horiz-adv-x="750" d=" M687.5 507.5H62.5C28.125 507.5 0 479.375 0 445V195C0 160.625 28.125 132.5 62.5 132.5H687.5C721.875 132.5 750 160.625 750 195V445C750 479.375 721.875 507.5 687.5 507.5zM250 257.5H125V382.5H250V257.5zM437.5 257.5H312.5V382.5H437.5V257.5zM625 257.5H500V382.5H625V257.5z" /> 3{P|L31Em}Xpa9m@2VacM%7gv7?BBr6MIX0TAyOv)|elDjfZ*)y!E zDJdl@$qG9=S=s6Q4Ow7(GbiWm>72fEdEf7RpD3YI<-p^rpKy2q(+gm8PE5^>2YTXu zASVO_;*@6S2P~X7g zdDnjaKgUe;u2$)wWI-*5np#!!oX)N~OiG+LhR_ZTMY>;)MqFB--DYeW+s1w(0dVao zvZ0-MiBAn-7-I;sRgA&9na?uCahn?84keg^g%JC%Vwjc5B$jA&zl{8bo7XmP)dIB|G799dTQW^Nu+o z!?&SFCH&5(FviE5W84nH&QN^3&~3vF2rhDd8v__QOeqq3pX}~ z-I#tQ7s#JMxsY7AQ;WM5XZy-|`gFc^zUMj5=9!i`)eh{9iD0N5FuejLRr8ChbH3p( z4^XiI_`ViAGqW|N-@RdXr)J57LvBh?6zd<5 zdft2b?}mv!^^QJJcA$4b&%Iiu7s=H=nDhb}Ov4E?>e<65oaAf1iPV}$tXg^}y_??u z`2lj1IHzQ?X1$E2|}VMJou3qBz76j`4ywyi);{Q8`soBQZ5mi>Ou9PIl@f zM@~*s8X%Wwl-x8ylQd0!@=Gc=9 hYX9TJR!7PS6AS_@gVQ2%wDGbvXW-!cQxWn*>;Rz!LqX452 zqXeT0qZ*?IqZSnEFzPWHFj|439U}xfFuDMtA7c<>6k`ly9An(%IyPCxxtnLP*)wjw b&Ay$HOKlSa0|+zB-8_M_oPD#f;LAz?X2wmk delta 332 zcmZpf#`I?@(*y&Rg(eZq3=Av>7#Mhdq~}zowTON3Vqg%~U|`5~$w*C15tI4mFfqiK zamU0CdBGe81}3F~{NfVcgOUOa3{4Xz?l6#*3DH?uIF zXEwHBU<3&;n=vqhSvo+P3uvhg0}C^dW=LXiU|?lXQcG1^sJ2XPmD)PBjg#3}{U?XB zrcK_@npV#UQ~`n+3^`y}z|aJQ6Bs5jOktS8aD(9RtkaI&A%o!{gTp8RL0vPHTIv6Gb`DP3$ o4E+o}n^&<}GBVEH{D^%Ak From 9fee53765e1a14a4409c7c40cfb27960f214ffd5 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Tue, 27 Aug 2019 19:40:34 +0200 Subject: [PATCH 159/163] Fixing #76711 handle the case that a script is customized in the tasks.json --- extensions/npm/src/npmView.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/extensions/npm/src/npmView.ts b/extensions/npm/src/npmView.ts index 8235c6f79eb..f01e8121719 100644 --- a/extensions/npm/src/npmView.ts +++ b/extensions/npm/src/npmView.ts @@ -145,25 +145,7 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider { subscriptions.push(commands.registerCommand('npm.runInstall', this.runInstall, this)); } - private scriptIsValid(scripts: any, task: Task): boolean { - for (const script in scripts) { - let label = getTaskName(script, task.definition.path); - if (task.name === label) { - return true; - } - } - return false; - } - private async runScript(script: NpmScript) { - let task = script.task; - let uri = getPackageJsonUriFromTask(task); - let scripts = await getScripts(uri!); - - if (!this.scriptIsValid(scripts, task)) { - this.scriptNotValid(task); - return; - } tasks.executeTask(script.task); } @@ -176,11 +158,6 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider { let uri = getPackageJsonUriFromTask(task); let scripts = await getScripts(uri!); - if (!this.scriptIsValid(scripts, task)) { - this.scriptNotValid(task); - return; - } - let debugArg = this.extractDebugArg(scripts, task); if (!debugArg) { let message = localize('noDebugOptions', 'Could not launch "{0}" for debugging because the scripts lacks a node debug option, e.g. "--inspect-brk".', task.name); @@ -195,11 +172,6 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider { startDebugging(task.name, debugArg[0], debugArg[1], script.getFolder()); } - private scriptNotValid(task: Task) { - let message = localize('scriptInvalid', 'Could not find the script "{0}". Try to refresh the view.', task.name); - window.showErrorMessage(message); - } - private findScript(document: TextDocument, script?: NpmScript): number { let scriptOffset = 0; let inScripts = false; From 7ee04f67c761d7dc91996b35562715656afa3aba Mon Sep 17 00:00:00 2001 From: Greg Van Liew Date: Tue, 27 Aug 2019 12:00:50 -0700 Subject: [PATCH 160/163] Update Git count badge description --- extensions/git/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 7d90b4b15f2..b4cbdad0986 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -73,7 +73,7 @@ "config.autofetch": "When enabled, commits will automatically be fetched from the default remote of the current Git repository.", "config.autofetchPeriod": "Duration in seconds between each automatic git fetch, when `git.autofetch` is enabled.", "config.confirmSync": "Confirm before synchronizing git repositories.", - "config.countBadge": "Controls the git badge counter.", + "config.countBadge": "Controls the Git count badge.", "config.countBadge.all": "Count all changes.", "config.countBadge.tracked": "Count only tracked changes.", "config.countBadge.off": "Turn off counter.", From de3c53b21d6f89f3d1b16c3c0836c215895fb822 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Tue, 27 Aug 2019 22:59:33 +0200 Subject: [PATCH 161/163] Adjust description to match the behaviour of the checkbox --- extensions/npm/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/npm/package.nls.json b/extensions/npm/package.nls.json index 4a33bcc0bc3..40121b8fa8d 100644 --- a/extensions/npm/package.nls.json +++ b/extensions/npm/package.nls.json @@ -5,7 +5,7 @@ "config.npm.runSilent": "Run npm commands with the `--silent` option.", "config.npm.packageManager": "The package manager used to run scripts.", "config.npm.exclude": "Configure glob patterns for folders that should be excluded from automatic script detection.", - "config.npm.enableScriptExplorer": "Enable an explorer view for npm scripts.", + "config.npm.enableScriptExplorer": "Enable an explorer view for npm scripts when there is no top-level 'package.json' file.", "config.npm.scriptExplorerAction": "The default click action used in the scripts explorer: `open` or `run`, the default is `open`.", "config.npm.fetchOnlinePackageInfo": "Fetch data from https://registry.npmjs/org and https://registry.bower.io to provide auto-completion and information on hover features on npm dependencies.", "npm.parseError": "Npm task detection: failed to parse the file {0}", From 9ab856b571212dbdd3a6f3be054930885ef31d86 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 27 Aug 2019 10:55:57 -0700 Subject: [PATCH 162/163] Update markdown grammar Includes https://github.com/microsoft/vscode-markdown-tm-grammar/pull/47 --- extensions/markdown-basics/syntaxes/markdown.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json index fb937c24feb..0ea7eb8c782 100644 --- a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json +++ b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/eb3898715b50d7911377a650e383a768a3a21f25", + "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/b1249332db3d28b323895356ca00047056970988", "name": "Markdown", "scopeName": "text.html.markdown", "patterns": [ From 8891b8551861cb72b76d6ae7d93c7a14cefa778f Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 27 Aug 2019 14:49:19 -0700 Subject: [PATCH 163/163] Fix caption parsing For #79704 - Use regexp - Handle unix line endings - Don't highlight caption as part of code block --- .../src/utils/previewer.ts | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/extensions/typescript-language-features/src/utils/previewer.ts b/extensions/typescript-language-features/src/utils/previewer.ts index 0c1e880162d..2b2108ccd57 100644 --- a/extensions/typescript-language-features/src/utils/previewer.ts +++ b/extensions/typescript-language-features/src/utils/previewer.ts @@ -11,19 +11,26 @@ function getTagBodyText(tag: Proto.JSDocTagInfo): string | undefined { return undefined; } + // Convert to markdown code block if it is not already one + function makeCodeblock(text: string): string { + if (text.match(/^\s*[~`]{3}/g)) { + return text; + } + return '```\n' + text + '\n```'; + } + switch (tag.name) { case 'example': // check for caption tags, fix for #79704 - const captionTagMatches = tag.text.match('(.*?)<\/caption>\r'); + const captionTagMatches = tag.text.match(/(.*?)<\/caption>\s*(\r\n|\n)/); if (captionTagMatches && captionTagMatches.index === 0) { - tag.text = captionTagMatches[1] + '\r\r' + tag.text.substr(captionTagMatches[0].length); + return captionTagMatches[1] + '\n\n' + makeCodeblock(tag.text.substr(captionTagMatches[0].length)); + } else { + return makeCodeblock(tag.text); } + case 'default': - // Convert to markdown code block if it is not already one - if (tag.text.match(/^\s*[~`]{3}/g)) { - return tag.text; - } - return '```\n' + tag.text + '\n```'; + return makeCodeblock(tag.text); } return tag.text;