From 79c28deae4de565c47ae35a87c7a43cacd98b23d Mon Sep 17 00:00:00 2001 From: Ariel Davis Date: Thu, 17 Nov 2022 00:24:11 -0800 Subject: [PATCH 001/206] Put marker hovers on top --- .../editor/contrib/colorPicker/browser/colorHoverParticipant.ts | 2 +- src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts | 2 +- src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts | 2 +- .../inlineCompletions/browser/ghostTextHoverParticipant.ts | 2 +- .../contrib/unicodeHighlighter/browser/unicodeHighlighter.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts b/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts index adb039eecf6..cbc1b7ccdb8 100644 --- a/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts +++ b/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts @@ -46,7 +46,7 @@ export class ColorHover implements IHoverPart { export class ColorHoverParticipant implements IEditorHoverParticipant { - public readonly hoverOrdinal: number = 1; + public readonly hoverOrdinal: number = 2; constructor( private readonly _editor: ICodeEditor, diff --git a/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts b/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts index 4bee3614c9b..93f4631209b 100644 --- a/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts +++ b/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts @@ -46,7 +46,7 @@ export class MarkdownHover implements IHoverPart { export class MarkdownHoverParticipant implements IEditorHoverParticipant { - public readonly hoverOrdinal: number = 2; + public readonly hoverOrdinal: number = 3; constructor( protected readonly _editor: ICodeEditor, diff --git a/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts b/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts index 7b156b6fc8f..29acecce928 100644 --- a/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts +++ b/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts @@ -54,7 +54,7 @@ const markerCodeActionTrigger: CodeActionTrigger = { export class MarkerHoverParticipant implements IEditorHoverParticipant { - public readonly hoverOrdinal: number = 5; + public readonly hoverOrdinal: number = 1; private recentMarkerCodeActionsInfo: { marker: IMarker; hasCodeActions: boolean } | undefined = undefined; diff --git a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextHoverParticipant.ts b/src/vs/editor/contrib/inlineCompletions/browser/ghostTextHoverParticipant.ts index 46036f7f2f5..781932eaa77 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextHoverParticipant.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/ghostTextHoverParticipant.ts @@ -48,7 +48,7 @@ export class InlineCompletionsHover implements IHoverPart { export class InlineCompletionsHoverParticipant implements IEditorHoverParticipant { - public readonly hoverOrdinal: number = 3; + public readonly hoverOrdinal: number = 4; constructor( private readonly _editor: ICodeEditor, diff --git a/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts b/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts index 9cb1e2b67e0..bf6d09d3b41 100644 --- a/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts +++ b/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts @@ -407,7 +407,7 @@ export class UnicodeHighlighterHover implements IHoverPart { export class UnicodeHighlighterHoverParticipant implements IEditorHoverParticipant { - public readonly hoverOrdinal: number = 4; + public readonly hoverOrdinal: number = 5; constructor( private readonly _editor: ICodeEditor, From 1184c86da8fdd446e03b4c03395662421a225d58 Mon Sep 17 00:00:00 2001 From: Mark Zuber Date: Mon, 13 Feb 2023 11:37:09 -0800 Subject: [PATCH 002/206] Send large RPC messages in chunks --- src/vs/base/parts/ipc/node/ipc.net.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vs/base/parts/ipc/node/ipc.net.ts b/src/vs/base/parts/ipc/node/ipc.net.ts index 455caa3efeb..2a10bca0d57 100644 --- a/src/vs/base/parts/ipc/node/ipc.net.ts +++ b/src/vs/base/parts/ipc/node/ipc.net.ts @@ -300,7 +300,17 @@ export class WebSocketNodeSocket extends Disposable implements ISocket, ISocketT } public write(buffer: VSBuffer): void { - this._flowManager.writeMessage(buffer); + const maxSendChunkSize = 10 * 1024 * 1024; + + if (buffer.byteLength <= maxSendChunkSize) { + this._flowManager.writeMessage(buffer); + } else { + let start = 0; + while (start < buffer.byteLength) { + this._flowManager.writeMessage(buffer.slice(start, Math.min(start + maxSendChunkSize, buffer.byteLength))); + start += maxSendChunkSize; + } + } } private _write(buffer: VSBuffer, compressed: boolean): void { From a22ad64f06a9a45c0d58fd9feb2a3013fe89d269 Mon Sep 17 00:00:00 2001 From: Eliise Date: Fri, 17 Feb 2023 15:33:40 +0000 Subject: [PATCH 003/206] Fix issue with inconsistent line wrap application --- .../services/abstractCodeEditorService.ts | 7 ++++-- .../mergeEditor/browser/view/mergeEditor.ts | 24 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/vs/editor/browser/services/abstractCodeEditorService.ts b/src/vs/editor/browser/services/abstractCodeEditorService.ts index fd7ffee97c5..ec6c2fc64c9 100644 --- a/src/vs/editor/browser/services/abstractCodeEditorService.ts +++ b/src/vs/editor/browser/services/abstractCodeEditorService.ts @@ -225,8 +225,11 @@ export abstract class AbstractCodeEditorService extends Disposable implements IC this._transientWatchers[uri] = w; } - w.set(key, value); - this._onDidChangeTransientModelProperty.fire(model); + const previousValue = w.get(key); + if (previousValue !== value) { + w.set(key, value); + this._onDidChangeTransientModelProperty.fire(model); + } } public getTransientModelProperty(model: ITextModel, key: string): any { diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts index be0abe91852..4819ad62eeb 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts @@ -20,6 +20,7 @@ import { ICodeEditor, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBr import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { IEditorOptions as ICodeEditorOptions } from 'vs/editor/common/config/editorOptions'; import { ICodeEditorViewState, ScrollType } from 'vs/editor/common/editorCommon'; +import { ITextModel } from 'vs/editor/common/model'; import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; import { localize } from 'vs/nls'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -173,7 +174,7 @@ export class MergeEditor extends AbstractTextEditor { this.input1View.updateOptions(inputOptions); this.input2View.updateOptions(inputOptions); - this.baseViewOptions.set(this.input2View.editor.getRawOptions(), undefined); + this.baseViewOptions.set({ ...this.input2View.editor.getRawOptions() }, undefined); this.inputResultView.updateOptions(options); } @@ -302,17 +303,22 @@ export class MergeEditor extends AbstractTextEditor { } // word wrap special case - sync transient state from result model to input[1|2] models - const mirrorWordWrapTransientState = () => { - const state = readTransientState(model.resultTextModel, this._codeEditorService); - writeTransientState(model.input2.textModel, state, this._codeEditorService); - writeTransientState(model.input1.textModel, state, this._codeEditorService); + const mirrorWordWrapTransientState = (candidate: ITextModel) => { + const candidateState = readTransientState(candidate, this._codeEditorService); + + writeTransientState(model.input2.textModel, candidateState, this._codeEditorService); + writeTransientState(model.input1.textModel, candidateState, this._codeEditorService); + writeTransientState(model.resultTextModel, candidateState, this._codeEditorService); + + const baseTextModel = this.baseView.get()?.editor.getModel(); + if (baseTextModel) { + writeTransientState(baseTextModel, candidateState, this._codeEditorService); + } }; this._sessionDisposables.add(this._codeEditorService.onDidChangeTransientModelProperty(candidate => { - if (candidate === this.inputResultView.editor.getModel()) { - mirrorWordWrapTransientState(); - } + mirrorWordWrapTransientState(candidate); })); - mirrorWordWrapTransientState(); + mirrorWordWrapTransientState(this.inputResultView.editor.getModel()!); // detect when base, input1, and input2 become empty and replace THIS editor with its result editor // TODO@jrieken@hediet this needs a better/cleaner solution From 5454665328aa30aeb989abfc195e7a7aacd94edf Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 21 Feb 2023 01:16:55 +0100 Subject: [PATCH 004/206] update distro (#174868) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7954eb8fdb..401ce73181c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.76.0", - "distro": "1112bcec9676e1fbef79686e72269b95b715ef3a", + "distro": "d1298afbfabd0c7765a358bacbc66a179d2b0039", "author": { "name": "Microsoft Corporation" }, From 05abefc4cdac9605859783be88afb56853b39bc0 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 21 Feb 2023 07:27:06 +0100 Subject: [PATCH 005/206] [css/json/html] update services and server (#174867) --- extensions/css-language-features/package.json | 2 +- .../css-language-features/server/package.json | 4 +- .../css-language-features/server/yarn.lock | 53 ++-- extensions/css-language-features/yarn.lock | 38 +-- .../html-language-features/package.json | 4 +- .../server/package.json | 4 +- .../html-language-features/server/yarn.lock | 48 ++-- extensions/html-language-features/yarn.lock | 259 ++++++------------ .../json-language-features/package.json | 4 +- .../server/package.json | 2 +- .../json-language-features/server/yarn.lock | 37 ++- extensions/json-language-features/yarn.lock | 259 ++++++------------ 12 files changed, 263 insertions(+), 451 deletions(-) diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index bab5455187e..76254594586 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -994,7 +994,7 @@ ] }, "dependencies": { - "vscode-languageclient": "^8.1.0-next.2", + "vscode-languageclient": "^8.1.0", "vscode-uri": "^3.0.7" }, "devDependencies": { diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index 6cac2890c91..0a3fe4774b5 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -11,8 +11,8 @@ "browser": "./dist/browser/cssServerMain", "dependencies": { "@vscode/l10n": "^0.0.11", - "vscode-css-languageservice": "^6.2.3", - "vscode-languageserver": "^8.1.0-next.6", + "vscode-css-languageservice": "^6.2.4", + "vscode-languageserver": "^8.1.0", "vscode-uri": "^3.0.7" }, "devDependencies": { diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index a71968eb4ba..68c72ebc59c 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -17,50 +17,45 @@ resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.11.tgz#325d7beb2cfb87162bc624d16c4d546de6a73b72" integrity sha512-ukOMWnCg1tCvT7WnDfsUKQOFDQGsyR5tNgRpwmqi+5/vzU3ghdDXzvIM4IOPdSb3OeSsBNvmSL8nxIVOqi2WXA== -vscode-css-languageservice@^6.2.3: - version "6.2.3" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.3.tgz#6c1e6104e77f1fb729eeea5cd2f81f3b800d87ff" - integrity sha512-EAyhyIVHpEaf+GjtI+tVe7SekdoANfG0aubnspsQwak3Qkimn/97FpAufNyXk636ngW05pjNKAR9zyTCzo6avQ== +vscode-css-languageservice@^6.2.4: + version "6.2.4" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.4.tgz#d03ca783ad922cb903602ca1478f5161e5e5de54" + integrity sha512-9UG0s3Ss8rbaaPZL1AkGzdjrGY8F+P+Ne9snsrvD9gxltDGhsn8C2dQpqQewHrMW37OvlqJoI8sUU2AWDb+qNw== dependencies: "@vscode/l10n" "^0.0.11" vscode-languageserver-textdocument "^1.0.8" - vscode-languageserver-types "^3.17.2" + vscode-languageserver-types "^3.17.3" vscode-uri "^3.0.7" -vscode-jsonrpc@8.1.0-next.7: - version "8.1.0-next.7" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.7.tgz#4ecfada9866f677da9a5915abfceb7b7c90962f6" - integrity sha512-UJlY2e4wnI+GkaNYM2TERqrNvTe0XScny7lUA4f+F+z6XI5pDJnHj6udXiGJofT/tX57d8C6fnlfgrCfF6aptQ== +vscode-jsonrpc@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" + integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== -vscode-languageserver-protocol@3.17.3-next.6: - version "3.17.3-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.6.tgz#e43dc5dc0e730e3a4d1cb523cce85cd34b6fc64d" - integrity sha512-UCL2DaAOCzGFZKIAJ4wOS9BXVbeARL8GxXTW7ANnAXJg03IytNmOJcmguL6l+ht4CCdKNQbnRSJB4dh8cgDyJw== +vscode-languageserver-protocol@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" + integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== dependencies: - vscode-jsonrpc "8.1.0-next.7" - vscode-languageserver-types "3.17.3-next.3" + vscode-jsonrpc "8.1.0" + vscode-languageserver-types "3.17.3" vscode-languageserver-textdocument@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz#9eae94509cbd945ea44bca8dcfe4bb0c15bb3ac0" integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q== -vscode-languageserver-types@3.17.3-next.3: - version "3.17.3-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.3.tgz#fc909d37d4200126d74583f2114e53ace27a3e04" - integrity sha512-R36Wi5sHoVc/PsAva0QGoEgw+LRCXPDKcdjFfgoVwrRdrFOdYUkvp5G4NvrPUsVT2f2qS/bSs6QiRxyjNkcR9A== +vscode-languageserver-types@3.17.3, vscode-languageserver-types@^3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" + integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== -vscode-languageserver-types@^3.17.2: - version "3.17.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz#b2c2e7de405ad3d73a883e91989b850170ffc4f2" - integrity sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA== - -vscode-languageserver@^8.1.0-next.6: - version "8.1.0-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0-next.6.tgz#32fe5042b92b58b6f2c3c8cba0ddc77153ad47a7" - integrity sha512-YSj9fKN0FtVW95RKjcy8UheODK4YosqiZUkEbAgJJ0uMxR1Om1dhD/+QwYUKfJX/u8KLS/qFroMNVFHoPoc2hg== +vscode-languageserver@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz#5024253718915d84576ce6662dd46a791498d827" + integrity sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw== dependencies: - vscode-languageserver-protocol "3.17.3-next.6" + vscode-languageserver-protocol "3.17.3" vscode-uri@^3.0.7: version "3.0.7" diff --git a/extensions/css-language-features/yarn.lock b/extensions/css-language-features/yarn.lock index cca983722b6..6bcdcdd34fe 100644 --- a/extensions/css-language-features/yarn.lock +++ b/extensions/css-language-features/yarn.lock @@ -40,32 +40,32 @@ semver@^7.3.7: dependencies: lru-cache "^6.0.0" -vscode-jsonrpc@8.1.0-next.3: - version "8.1.0-next.3" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.3.tgz#964c91a3bfd1949b4c3da7136ba46b48b42991ad" - integrity sha512-4eDeAnkWFKFTmT7tUR2wDngNAuwGHvV7yPCzPWGudBWJOoXaPQnwmiQChoj+umH1y2NR+MdBtx49xlZA7FoLRQ== +vscode-jsonrpc@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" + integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== -vscode-languageclient@^8.1.0-next.2: - version "8.1.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.1.0-next.2.tgz#12a248299d23e48cb9d316129bf9ba0592caa533" - integrity sha512-ZGCQaqXyT7Y4H68zDQ/8XnNzo9tlUxuarJa0hT5EncAC0vmVAxLvhbsz2iSlWx3j6UZUgBM0b6UZtjpzkqr3tQ== +vscode-languageclient@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz#3e67d5d841481ac66ddbdaa55b4118742f6a9f3f" + integrity sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing== dependencies: minimatch "^5.1.0" semver "^7.3.7" - vscode-languageserver-protocol "3.17.3-next.2" + vscode-languageserver-protocol "3.17.3" -vscode-languageserver-protocol@3.17.3-next.2: - version "3.17.3-next.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.2.tgz#e906471899b9ed2ae1139f95592e0e5c7580bf0f" - integrity sha512-T+vSRHgApc1xCsOUJ/M7UN/tN4aINvc3FYJ6P3vAhvv0i4jZZewFMEonZB76B94TiY6z4eScgaG6m73gTgnyyw== +vscode-languageserver-protocol@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" + integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== dependencies: - vscode-jsonrpc "8.1.0-next.3" - vscode-languageserver-types "3.17.2" + vscode-jsonrpc "8.1.0" + vscode-languageserver-types "3.17.3" -vscode-languageserver-types@3.17.2: - version "3.17.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz#b2c2e7de405ad3d73a883e91989b850170ffc4f2" - integrity sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA== +vscode-languageserver-types@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" + integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== vscode-uri@^3.0.7: version "3.0.7" diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index cfb791ec324..ab8a7562758 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -258,8 +258,8 @@ ] }, "dependencies": { - "@vscode/extension-telemetry": "^0.7.4-preview", - "vscode-languageclient": "^8.1.0-next.2", + "@vscode/extension-telemetry": "^0.7.5", + "vscode-languageclient": "^8.1.0", "vscode-uri": "^3.0.7" }, "devDependencies": { diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index 18b9924e86f..7fc2795e590 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -10,9 +10,9 @@ "main": "./out/node/htmlServerMain", "dependencies": { "@vscode/l10n": "^0.0.11", - "vscode-css-languageservice": "^6.2.3", + "vscode-css-languageservice": "^6.2.4", "vscode-html-languageservice": "^5.0.4", - "vscode-languageserver": "^8.1.0-next.6", + "vscode-languageserver": "^8.1.0", "vscode-languageserver-textdocument": "^1.0.8", "vscode-uri": "^3.0.7" }, diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index 971f6b60510..20056d64263 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -17,14 +17,14 @@ resolved "https://registry.yarnpkg.com/@vscode/l10n/-/l10n-0.0.11.tgz#325d7beb2cfb87162bc624d16c4d546de6a73b72" integrity sha512-ukOMWnCg1tCvT7WnDfsUKQOFDQGsyR5tNgRpwmqi+5/vzU3ghdDXzvIM4IOPdSb3OeSsBNvmSL8nxIVOqi2WXA== -vscode-css-languageservice@^6.2.3: - version "6.2.3" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.3.tgz#6c1e6104e77f1fb729eeea5cd2f81f3b800d87ff" - integrity sha512-EAyhyIVHpEaf+GjtI+tVe7SekdoANfG0aubnspsQwak3Qkimn/97FpAufNyXk636ngW05pjNKAR9zyTCzo6avQ== +vscode-css-languageservice@^6.2.4: + version "6.2.4" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-6.2.4.tgz#d03ca783ad922cb903602ca1478f5161e5e5de54" + integrity sha512-9UG0s3Ss8rbaaPZL1AkGzdjrGY8F+P+Ne9snsrvD9gxltDGhsn8C2dQpqQewHrMW37OvlqJoI8sUU2AWDb+qNw== dependencies: "@vscode/l10n" "^0.0.11" vscode-languageserver-textdocument "^1.0.8" - vscode-languageserver-types "^3.17.2" + vscode-languageserver-types "^3.17.3" vscode-uri "^3.0.7" vscode-html-languageservice@^5.0.4: @@ -37,40 +37,40 @@ vscode-html-languageservice@^5.0.4: vscode-languageserver-types "^3.17.2" vscode-uri "^3.0.7" -vscode-jsonrpc@8.1.0-next.7: - version "8.1.0-next.7" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.7.tgz#4ecfada9866f677da9a5915abfceb7b7c90962f6" - integrity sha512-UJlY2e4wnI+GkaNYM2TERqrNvTe0XScny7lUA4f+F+z6XI5pDJnHj6udXiGJofT/tX57d8C6fnlfgrCfF6aptQ== +vscode-jsonrpc@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" + integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== -vscode-languageserver-protocol@3.17.3-next.6: - version "3.17.3-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.6.tgz#e43dc5dc0e730e3a4d1cb523cce85cd34b6fc64d" - integrity sha512-UCL2DaAOCzGFZKIAJ4wOS9BXVbeARL8GxXTW7ANnAXJg03IytNmOJcmguL6l+ht4CCdKNQbnRSJB4dh8cgDyJw== +vscode-languageserver-protocol@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" + integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== dependencies: - vscode-jsonrpc "8.1.0-next.7" - vscode-languageserver-types "3.17.3-next.3" + vscode-jsonrpc "8.1.0" + vscode-languageserver-types "3.17.3" vscode-languageserver-textdocument@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz#9eae94509cbd945ea44bca8dcfe4bb0c15bb3ac0" integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q== -vscode-languageserver-types@3.17.3-next.3: - version "3.17.3-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.3.tgz#fc909d37d4200126d74583f2114e53ace27a3e04" - integrity sha512-R36Wi5sHoVc/PsAva0QGoEgw+LRCXPDKcdjFfgoVwrRdrFOdYUkvp5G4NvrPUsVT2f2qS/bSs6QiRxyjNkcR9A== +vscode-languageserver-types@3.17.3, vscode-languageserver-types@^3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" + integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== vscode-languageserver-types@^3.17.2: version "3.17.2" resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz#b2c2e7de405ad3d73a883e91989b850170ffc4f2" integrity sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA== -vscode-languageserver@^8.1.0-next.6: - version "8.1.0-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0-next.6.tgz#32fe5042b92b58b6f2c3c8cba0ddc77153ad47a7" - integrity sha512-YSj9fKN0FtVW95RKjcy8UheODK4YosqiZUkEbAgJJ0uMxR1Om1dhD/+QwYUKfJX/u8KLS/qFroMNVFHoPoc2hg== +vscode-languageserver@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz#5024253718915d84576ce6662dd46a791498d827" + integrity sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw== dependencies: - vscode-languageserver-protocol "3.17.3-next.6" + vscode-languageserver-protocol "3.17.3" vscode-uri@^3.0.7: version "3.0.7" diff --git a/extensions/html-language-features/yarn.lock b/extensions/html-language-features/yarn.lock index 3d63be49483..4b4415ab484 100644 --- a/extensions/html-language-features/yarn.lock +++ b/extensions/html-language-features/yarn.lock @@ -9,7 +9,7 @@ dependencies: tslib "^2.2.0" -"@azure/core-auth@^1.3.0": +"@azure/core-auth@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.4.0.tgz#6fa9661c1705857820dbc216df5ba5665ac36a9e" integrity sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ== @@ -17,36 +17,30 @@ "@azure/abort-controller" "^1.0.0" tslib "^2.2.0" -"@azure/core-http@^2.2.3": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@azure/core-http/-/core-http-2.3.0.tgz#fb96de9a96923c186de15127472cb8e177f7158f" - integrity sha512-Gikj2QO9W41rw7yiKWi2Q2OcVcukt+ux7ZZeFy4ilC/0b1Wcr0rjseZh9bqJ3NI9+h78Hix34ZjEg316iHjbTA== +"@azure/core-rest-pipeline@^1.10.0": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.1.tgz#348290847ca31b9eecf9cf5de7519aaccdd30968" + integrity sha512-Kji9k6TOFRDB5ZMTw8qUf2IJ+CeJtsuMdAHox9eqpTf1cefiNMpzrfnF6sINEBZJsaVaWgQ0o48B6kcUH68niA== dependencies: "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/core-util" "^1.1.1" + "@azure/core-auth" "^1.4.0" + "@azure/core-tracing" "^1.0.1" + "@azure/core-util" "^1.0.0" "@azure/logger" "^1.0.0" - "@types/node-fetch" "^2.5.0" - "@types/tunnel" "^0.0.3" form-data "^4.0.0" - node-fetch "^2.6.7" - process "^0.11.10" - tough-cookie "^4.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" tslib "^2.2.0" - tunnel "^0.0.6" uuid "^8.3.0" - xml2js "^0.4.19" -"@azure/core-tracing@1.0.0-preview.13": - version "1.0.0-preview.13" - resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz#55883d40ae2042f6f1e12b17dd0c0d34c536d644" - integrity sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ== +"@azure/core-tracing@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.1.tgz#352a38cbea438c4a83c86b314f48017d70ba9503" + integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw== dependencies: - "@opentelemetry/api" "^1.0.1" tslib "^2.2.0" -"@azure/core-util@^1.1.1": +"@azure/core-util@^1.0.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.1.1.tgz#8f87b3dd468795df0f0849d9f096c3e7b29452c1" integrity sha512-A4TBYVQCtHOigFb2ETiiKFDocBoI1Zk2Ui1KpI42aJSIDexF7DHQFpnjonltXAIU/ceH+1fsZAWWgvX6/AKzog== @@ -132,7 +126,7 @@ resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.7.tgz#ede48dd3f85af14ee369c805e5ed5b84222b9fe2" integrity sha512-SK3D3aVt+5vOOccKPnGaJWB5gQ8FuKfjboUJHedMP7gu54HqSCXX5iFXhktGD8nfJb0Go30eDvs/UDoTnR2kOA== -"@opentelemetry/api@^1.0.1", "@opentelemetry/api@^1.0.4": +"@opentelemetry/api@^1.0.4": version "1.2.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.2.0.tgz#89ef99401cde6208cff98760b67663726ef26686" integrity sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g== @@ -166,47 +160,40 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.7.0.tgz#af80a1ef7cf110ea3a68242acd95648991bcd763" integrity sha512-FGBx/Qd09lMaqQcogCHyYrFEpTx4cAjeS+48lMIR12z7LdH+zofGDVQSubN59nL6IpubfKqTeIDu9rNO28iHVA== -"@types/node-fetch@^2.5.0": - version "2.6.2" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da" - integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "18.11.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" - integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== "@types/node@16.x": version "16.11.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== -"@types/tunnel@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.3.tgz#f109e730b072b3136347561fc558c9358bb8c6e9" - integrity sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA== - dependencies: - "@types/node" "*" - -"@vscode/extension-telemetry@^0.7.4-preview": - version "0.7.4-preview" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.7.4-preview.tgz#318d6bc54064e5f443b25dfb42fec724d888c36b" - integrity sha512-6OkvjCc+DaC9B26t3hj7vuAxf1ONm/p4LrVvFrapa+jBCKxXXUaV1Asz6+QxYaPfd4Ws/MlnFfCvlgvv3uYRwQ== +"@vscode/extension-telemetry@^0.7.5": + version "0.7.5" + resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.7.5.tgz#bf965731816e08c3f146f96d901ec67954fc913b" + integrity sha512-fJ5y3TcpqqkFYHneabYaoB4XAhDdVflVm+TDKshw9VOs77jkgNS4UA7LNXrWeO0eDne3Sh3JgURf+xzc1rk69w== dependencies: "@microsoft/1ds-core-js" "^3.2.8" "@microsoft/1ds-post-js" "^3.2.8" "@microsoft/applicationinsights-web-basic" "^2.8.9" - applicationinsights "2.3.6" + applicationinsights "2.4.1" -applicationinsights@2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.3.6.tgz#91277ce44e5f6d2f85336922c05d90f8699c2e70" - integrity sha512-ZzXXpZpDRGcy6Pp5V319nDF9/+Ey7jNknEXZyaBajtC5onN0dcBem6ng5jcb3MPH2AjYWRI8XgyNEuzP/6Y5/A== +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: - "@azure/core-http" "^2.2.3" + debug "4" + +applicationinsights@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.4.1.tgz#4de4c4dd3c7c4a44445cfbf3d15808fc0dcc423d" + integrity sha512-0n0Ikd0gzSm460xm+M0UTWIwXrhrH/0bqfZatcJjYObWyefxfAxapGEyNnSGd1Tg90neHz+Yhf+Ff/zgvPiQYA== + dependencies: + "@azure/core-auth" "^1.4.0" + "@azure/core-rest-pipeline" "^1.10.0" "@microsoft/applicationinsights-web-snippet" "^1.0.1" "@opentelemetry/api" "^1.0.4" "@opentelemetry/core" "^1.0.1" @@ -273,6 +260,13 @@ continuation-local-storage@^3.2.1: async-listener "^0.6.0" emitter-listener "^1.1.1" +debug@4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -297,15 +291,6 @@ emitter-listener@^1.0.1, emitter-listener@^1.1.1: dependencies: shimmer "^1.2.0" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -315,6 +300,23 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -341,42 +343,10 @@ minimatch@^5.1.0: dependencies: brace-expansion "^2.0.1" -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== - -psl@^1.1.33: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -querystringify@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" - integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== - -sax@>=0.6.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== semver@^5.3.0, semver@^5.4.1: version "5.7.1" @@ -400,107 +370,48 @@ stack-chain@^1.3.7: resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285" integrity sha512-D8cWtWVdIe/jBA7v5p5Hwl5yOSOrmZPWDPe2KxQ5UAGD+nxbxU0lKXA4h85Ta6+qgdKVL3vUxsbIZjc1kBG7ug== -tough-cookie@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" - integrity sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.2.0" - url-parse "^1.5.3" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - tslib@^2.2.0: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== -tunnel@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" - integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== - -universalify@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" - integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== - -url-parse@^1.5.3: - version "1.5.10" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" - integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - uuid@^8.3.0: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -vscode-jsonrpc@8.1.0-next.3: - version "8.1.0-next.3" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.3.tgz#964c91a3bfd1949b4c3da7136ba46b48b42991ad" - integrity sha512-4eDeAnkWFKFTmT7tUR2wDngNAuwGHvV7yPCzPWGudBWJOoXaPQnwmiQChoj+umH1y2NR+MdBtx49xlZA7FoLRQ== +vscode-jsonrpc@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" + integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== -vscode-languageclient@^8.1.0-next.2: - version "8.1.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.1.0-next.2.tgz#12a248299d23e48cb9d316129bf9ba0592caa533" - integrity sha512-ZGCQaqXyT7Y4H68zDQ/8XnNzo9tlUxuarJa0hT5EncAC0vmVAxLvhbsz2iSlWx3j6UZUgBM0b6UZtjpzkqr3tQ== +vscode-languageclient@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz#3e67d5d841481ac66ddbdaa55b4118742f6a9f3f" + integrity sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing== dependencies: minimatch "^5.1.0" semver "^7.3.7" - vscode-languageserver-protocol "3.17.3-next.2" + vscode-languageserver-protocol "3.17.3" -vscode-languageserver-protocol@3.17.3-next.2: - version "3.17.3-next.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.2.tgz#e906471899b9ed2ae1139f95592e0e5c7580bf0f" - integrity sha512-T+vSRHgApc1xCsOUJ/M7UN/tN4aINvc3FYJ6P3vAhvv0i4jZZewFMEonZB76B94TiY6z4eScgaG6m73gTgnyyw== +vscode-languageserver-protocol@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" + integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== dependencies: - vscode-jsonrpc "8.1.0-next.3" - vscode-languageserver-types "3.17.2" + vscode-jsonrpc "8.1.0" + vscode-languageserver-types "3.17.3" -vscode-languageserver-types@3.17.2: - version "3.17.2" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz#b2c2e7de405ad3d73a883e91989b850170ffc4f2" - integrity sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA== +vscode-languageserver-types@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" + integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== vscode-uri@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.7.tgz#6d19fef387ee6b46c479e5fb00870e15e58c1eb8" integrity sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA== -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -xml2js@^0.4.19: - version "0.4.23" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" - integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== - dependencies: - sax ">=0.6.0" - xmlbuilder "~11.0.0" - -xmlbuilder@~11.0.0: - version "11.0.1" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" - integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json index 198b3919657..46b1b5564ff 100644 --- a/extensions/json-language-features/package.json +++ b/extensions/json-language-features/package.json @@ -158,9 +158,9 @@ ] }, "dependencies": { - "@vscode/extension-telemetry": "^0.7.4-preview", + "@vscode/extension-telemetry": "^0.7.5", "request-light": "^0.7.0", - "vscode-languageclient": "^8.1.0-next.6" + "vscode-languageclient": "^8.1.0" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index d9b2a01af7a..e8c7e50305b 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -16,7 +16,7 @@ "jsonc-parser": "^3.2.0", "request-light": "^0.7.0", "vscode-json-languageservice": "^5.3.0", - "vscode-languageserver": "^8.1.0-next.6", + "vscode-languageserver": "^8.1.0", "vscode-uri": "^3.0.7" }, "devDependencies": { diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index db8d2feb850..076619e16a8 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -38,40 +38,35 @@ vscode-json-languageservice@^5.3.0: vscode-languageserver-types "^3.17.3" vscode-uri "^3.0.7" -vscode-jsonrpc@8.1.0-next.7: - version "8.1.0-next.7" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.7.tgz#4ecfada9866f677da9a5915abfceb7b7c90962f6" - integrity sha512-UJlY2e4wnI+GkaNYM2TERqrNvTe0XScny7lUA4f+F+z6XI5pDJnHj6udXiGJofT/tX57d8C6fnlfgrCfF6aptQ== +vscode-jsonrpc@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" + integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== -vscode-languageserver-protocol@3.17.3-next.6: - version "3.17.3-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.6.tgz#e43dc5dc0e730e3a4d1cb523cce85cd34b6fc64d" - integrity sha512-UCL2DaAOCzGFZKIAJ4wOS9BXVbeARL8GxXTW7ANnAXJg03IytNmOJcmguL6l+ht4CCdKNQbnRSJB4dh8cgDyJw== +vscode-languageserver-protocol@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" + integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== dependencies: - vscode-jsonrpc "8.1.0-next.7" - vscode-languageserver-types "3.17.3-next.3" + vscode-jsonrpc "8.1.0" + vscode-languageserver-types "3.17.3" vscode-languageserver-textdocument@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz#9eae94509cbd945ea44bca8dcfe4bb0c15bb3ac0" integrity sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q== -vscode-languageserver-types@3.17.3-next.3: - version "3.17.3-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.3.tgz#fc909d37d4200126d74583f2114e53ace27a3e04" - integrity sha512-R36Wi5sHoVc/PsAva0QGoEgw+LRCXPDKcdjFfgoVwrRdrFOdYUkvp5G4NvrPUsVT2f2qS/bSs6QiRxyjNkcR9A== - -vscode-languageserver-types@^3.17.3: +vscode-languageserver-types@3.17.3, vscode-languageserver-types@^3.17.3: version "3.17.3" resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== -vscode-languageserver@^8.1.0-next.6: - version "8.1.0-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0-next.6.tgz#32fe5042b92b58b6f2c3c8cba0ddc77153ad47a7" - integrity sha512-YSj9fKN0FtVW95RKjcy8UheODK4YosqiZUkEbAgJJ0uMxR1Om1dhD/+QwYUKfJX/u8KLS/qFroMNVFHoPoc2hg== +vscode-languageserver@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz#5024253718915d84576ce6662dd46a791498d827" + integrity sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw== dependencies: - vscode-languageserver-protocol "3.17.3-next.6" + vscode-languageserver-protocol "3.17.3" vscode-uri@^3.0.7: version "3.0.7" diff --git a/extensions/json-language-features/yarn.lock b/extensions/json-language-features/yarn.lock index 3f68105a5da..afa4409e718 100644 --- a/extensions/json-language-features/yarn.lock +++ b/extensions/json-language-features/yarn.lock @@ -9,7 +9,7 @@ dependencies: tslib "^2.2.0" -"@azure/core-auth@^1.3.0": +"@azure/core-auth@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.4.0.tgz#6fa9661c1705857820dbc216df5ba5665ac36a9e" integrity sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ== @@ -17,36 +17,30 @@ "@azure/abort-controller" "^1.0.0" tslib "^2.2.0" -"@azure/core-http@^2.2.3": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@azure/core-http/-/core-http-2.3.0.tgz#fb96de9a96923c186de15127472cb8e177f7158f" - integrity sha512-Gikj2QO9W41rw7yiKWi2Q2OcVcukt+ux7ZZeFy4ilC/0b1Wcr0rjseZh9bqJ3NI9+h78Hix34ZjEg316iHjbTA== +"@azure/core-rest-pipeline@^1.10.0": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.1.tgz#348290847ca31b9eecf9cf5de7519aaccdd30968" + integrity sha512-Kji9k6TOFRDB5ZMTw8qUf2IJ+CeJtsuMdAHox9eqpTf1cefiNMpzrfnF6sINEBZJsaVaWgQ0o48B6kcUH68niA== dependencies: "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/core-util" "^1.1.1" + "@azure/core-auth" "^1.4.0" + "@azure/core-tracing" "^1.0.1" + "@azure/core-util" "^1.0.0" "@azure/logger" "^1.0.0" - "@types/node-fetch" "^2.5.0" - "@types/tunnel" "^0.0.3" form-data "^4.0.0" - node-fetch "^2.6.7" - process "^0.11.10" - tough-cookie "^4.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" tslib "^2.2.0" - tunnel "^0.0.6" uuid "^8.3.0" - xml2js "^0.4.19" -"@azure/core-tracing@1.0.0-preview.13": - version "1.0.0-preview.13" - resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz#55883d40ae2042f6f1e12b17dd0c0d34c536d644" - integrity sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ== +"@azure/core-tracing@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.1.tgz#352a38cbea438c4a83c86b314f48017d70ba9503" + integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw== dependencies: - "@opentelemetry/api" "^1.0.1" tslib "^2.2.0" -"@azure/core-util@^1.1.1": +"@azure/core-util@^1.0.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.1.1.tgz#8f87b3dd468795df0f0849d9f096c3e7b29452c1" integrity sha512-A4TBYVQCtHOigFb2ETiiKFDocBoI1Zk2Ui1KpI42aJSIDexF7DHQFpnjonltXAIU/ceH+1fsZAWWgvX6/AKzog== @@ -132,7 +126,7 @@ resolved "https://registry.yarnpkg.com/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.7.tgz#ede48dd3f85af14ee369c805e5ed5b84222b9fe2" integrity sha512-SK3D3aVt+5vOOccKPnGaJWB5gQ8FuKfjboUJHedMP7gu54HqSCXX5iFXhktGD8nfJb0Go30eDvs/UDoTnR2kOA== -"@opentelemetry/api@^1.0.1", "@opentelemetry/api@^1.0.4": +"@opentelemetry/api@^1.0.4": version "1.2.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.2.0.tgz#89ef99401cde6208cff98760b67663726ef26686" integrity sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g== @@ -166,47 +160,40 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.7.0.tgz#af80a1ef7cf110ea3a68242acd95648991bcd763" integrity sha512-FGBx/Qd09lMaqQcogCHyYrFEpTx4cAjeS+48lMIR12z7LdH+zofGDVQSubN59nL6IpubfKqTeIDu9rNO28iHVA== -"@types/node-fetch@^2.5.0": - version "2.6.2" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da" - integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "18.11.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" - integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== "@types/node@16.x": version "16.11.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== -"@types/tunnel@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@types/tunnel/-/tunnel-0.0.3.tgz#f109e730b072b3136347561fc558c9358bb8c6e9" - integrity sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA== - dependencies: - "@types/node" "*" - -"@vscode/extension-telemetry@^0.7.4-preview": - version "0.7.4-preview" - resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.7.4-preview.tgz#318d6bc54064e5f443b25dfb42fec724d888c36b" - integrity sha512-6OkvjCc+DaC9B26t3hj7vuAxf1ONm/p4LrVvFrapa+jBCKxXXUaV1Asz6+QxYaPfd4Ws/MlnFfCvlgvv3uYRwQ== +"@vscode/extension-telemetry@^0.7.5": + version "0.7.5" + resolved "https://registry.yarnpkg.com/@vscode/extension-telemetry/-/extension-telemetry-0.7.5.tgz#bf965731816e08c3f146f96d901ec67954fc913b" + integrity sha512-fJ5y3TcpqqkFYHneabYaoB4XAhDdVflVm+TDKshw9VOs77jkgNS4UA7LNXrWeO0eDne3Sh3JgURf+xzc1rk69w== dependencies: "@microsoft/1ds-core-js" "^3.2.8" "@microsoft/1ds-post-js" "^3.2.8" "@microsoft/applicationinsights-web-basic" "^2.8.9" - applicationinsights "2.3.6" + applicationinsights "2.4.1" -applicationinsights@2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.3.6.tgz#91277ce44e5f6d2f85336922c05d90f8699c2e70" - integrity sha512-ZzXXpZpDRGcy6Pp5V319nDF9/+Ey7jNknEXZyaBajtC5onN0dcBem6ng5jcb3MPH2AjYWRI8XgyNEuzP/6Y5/A== +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: - "@azure/core-http" "^2.2.3" + debug "4" + +applicationinsights@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-2.4.1.tgz#4de4c4dd3c7c4a44445cfbf3d15808fc0dcc423d" + integrity sha512-0n0Ikd0gzSm460xm+M0UTWIwXrhrH/0bqfZatcJjYObWyefxfAxapGEyNnSGd1Tg90neHz+Yhf+Ff/zgvPiQYA== + dependencies: + "@azure/core-auth" "^1.4.0" + "@azure/core-rest-pipeline" "^1.10.0" "@microsoft/applicationinsights-web-snippet" "^1.0.1" "@opentelemetry/api" "^1.0.4" "@opentelemetry/core" "^1.0.1" @@ -273,6 +260,13 @@ continuation-local-storage@^3.2.1: async-listener "^0.6.0" emitter-listener "^1.1.1" +debug@4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -297,15 +291,6 @@ emitter-listener@^1.0.1, emitter-listener@^1.1.1: dependencies: shimmer "^1.2.0" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -315,6 +300,23 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -341,48 +343,16 @@ minimatch@^5.1.0: dependencies: brace-expansion "^2.0.1" -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== - -psl@^1.1.33: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -querystringify@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" - integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== request-light@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a" integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q== -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== - -sax@>=0.6.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - semver@^5.3.0, semver@^5.4.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -405,101 +375,42 @@ stack-chain@^1.3.7: resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285" integrity sha512-D8cWtWVdIe/jBA7v5p5Hwl5yOSOrmZPWDPe2KxQ5UAGD+nxbxU0lKXA4h85Ta6+qgdKVL3vUxsbIZjc1kBG7ug== -tough-cookie@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" - integrity sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.2.0" - url-parse "^1.5.3" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - tslib@^2.2.0: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== -tunnel@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" - integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== - -universalify@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" - integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== - -url-parse@^1.5.3: - version "1.5.10" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" - integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - uuid@^8.3.0: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -vscode-jsonrpc@8.1.0-next.7: - version "8.1.0-next.7" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0-next.7.tgz#4ecfada9866f677da9a5915abfceb7b7c90962f6" - integrity sha512-UJlY2e4wnI+GkaNYM2TERqrNvTe0XScny7lUA4f+F+z6XI5pDJnHj6udXiGJofT/tX57d8C6fnlfgrCfF6aptQ== +vscode-jsonrpc@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" + integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== -vscode-languageclient@^8.1.0-next.6: - version "8.1.0-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.1.0-next.6.tgz#ce5c19ee6831a9c1886b0f19d9c2e2ebb0aa4c07" - integrity sha512-DvqmwhnQlgvYVoiVxYemPo/wQ2gtpJrgt10rgv32J5bg3OkVgWFH31Uut3jF30UK4aA2sLis64PD/yMMJZy+bQ== +vscode-languageclient@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz#3e67d5d841481ac66ddbdaa55b4118742f6a9f3f" + integrity sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing== dependencies: minimatch "^5.1.0" semver "^7.3.7" - vscode-languageserver-protocol "3.17.3-next.6" + vscode-languageserver-protocol "3.17.3" -vscode-languageserver-protocol@3.17.3-next.6: - version "3.17.3-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3-next.6.tgz#e43dc5dc0e730e3a4d1cb523cce85cd34b6fc64d" - integrity sha512-UCL2DaAOCzGFZKIAJ4wOS9BXVbeARL8GxXTW7ANnAXJg03IytNmOJcmguL6l+ht4CCdKNQbnRSJB4dh8cgDyJw== +vscode-languageserver-protocol@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" + integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== dependencies: - vscode-jsonrpc "8.1.0-next.7" - vscode-languageserver-types "3.17.3-next.3" + vscode-jsonrpc "8.1.0" + vscode-languageserver-types "3.17.3" -vscode-languageserver-types@3.17.3-next.3: - version "3.17.3-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3-next.3.tgz#fc909d37d4200126d74583f2114e53ace27a3e04" - integrity sha512-R36Wi5sHoVc/PsAva0QGoEgw+LRCXPDKcdjFfgoVwrRdrFOdYUkvp5G4NvrPUsVT2f2qS/bSs6QiRxyjNkcR9A== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -xml2js@^0.4.19: - version "0.4.23" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" - integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== - dependencies: - sax ">=0.6.0" - xmlbuilder "~11.0.0" - -xmlbuilder@~11.0.0: - version "11.0.1" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" - integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== +vscode-languageserver-types@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" + integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== yallist@^4.0.0: version "4.0.0" From 784bbdab8f28a951e9b327aba1181641a1a282d9 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 21 Feb 2023 01:07:31 -0600 Subject: [PATCH 006/206] Allowing configuring if markdown inserts a `.md` when completing paths to markdown files (#174882) Fixes #174005 --- .../markdown-language-features/package.json | 15 ++++++++++++++ .../package.nls.json | 4 ++++ .../server/src/configuration.ts | 2 ++ .../server/src/server.ts | 20 +++++++++++++------ 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/extensions/markdown-language-features/package.json b/extensions/markdown-language-features/package.json index e09ebba0a07..42d4749692c 100644 --- a/extensions/markdown-language-features/package.json +++ b/extensions/markdown-language-features/package.json @@ -582,6 +582,21 @@ "additionalProperties": { "type": "string" } + }, + "markdown.preferredMdPathExtensionStyle": { + "type": "string", + "default": "auto", + "markdownDescription": "%configuration.markdown.preferredMdPathExtensionStyle%", + "enum": [ + "auto", + "includeExtension", + "removeExtension" + ], + "markdownEnumDescriptions": [ + "%configuration.markdown.preferredMdPathExtensionStyle.auto%", + "%configuration.markdown.preferredMdPathExtensionStyle.includeExtension%", + "%configuration.markdown.preferredMdPathExtensionStyle.removeExtension%" + ] } } }, diff --git a/extensions/markdown-language-features/package.nls.json b/extensions/markdown-language-features/package.nls.json index 7d8899e2fd3..fcdc094117d 100644 --- a/extensions/markdown-language-features/package.nls.json +++ b/extensions/markdown-language-features/package.nls.json @@ -54,5 +54,9 @@ "configuration.markdown.updateLinksOnFileMove.enableForDirectories": "Enable updating links when a directory is moved or renamed in the workspace.", "configuration.markdown.occurrencesHighlight.enabled": "Enable highlighting link occurrences in the current document.", "configuration.markdown.copyFiles.destination": "Defines where files copied into a Markdown document should be created. This is a map from globs that match on the Markdown document to destinations.\n\nThe destinations may use the following variables:\n\n- `${documentFileName}` — The full filename of the Markdown document, for example `readme.md`.\n- `${documentBaseName}` — The basename of Markdown document, for example `readme`.\n- `${documentExtName}` — The extension of the Markdown document, for example `md`.\n- `${documentDirName}` — The name of the Markdown document's parent directory.\n- `${documentWorkspaceFolder}` — The workspace folder for the Markdown document, for examples, `/Users/me/myProject`. This is the same as `${documentDirName}` if the file is not part of in a workspace.\n- `${fileName}` — The file name of the dropped file, for example `image.png`.", + "configuration.markdown.preferredMdPathExtensionStyle": "Controls if file extensions (e.g. `.md`) are added or not for links to Markdown files. This setting is used when file paths are added by tooling such as path completions or file renames.", + "configuration.markdown.preferredMdPathExtensionStyle.auto": "For existing paths, try to maintain the file extension style. For new paths, add file extensions.", + "configuration.markdown.preferredMdPathExtensionStyle.includeExtension": "Prefer including the file extension. For example, path completions to a file named `file.md` will insert `file.md`.", + "configuration.markdown.preferredMdPathExtensionStyle.removeExtension": "Prefer removing the file extension. For example, path completions to a file named `file.md` will insert `file` without the `.md`.", "workspaceTrust": "Required for loading styles configured in the workspace." } diff --git a/extensions/markdown-language-features/server/src/configuration.ts b/extensions/markdown-language-features/server/src/configuration.ts index b71cff5d416..676947163a1 100644 --- a/extensions/markdown-language-features/server/src/configuration.ts +++ b/extensions/markdown-language-features/server/src/configuration.ts @@ -10,6 +10,8 @@ export type ValidateEnabled = 'ignore' | 'warning' | 'error' | 'hint'; export interface Settings { readonly markdown: { + readonly preferredMdPathExtensionStyle: 'auto' | 'includeExtension' | 'removeExtension'; + readonly occurrencesHighlight: { readonly enabled: boolean; }; diff --git a/extensions/markdown-language-features/server/src/server.ts b/extensions/markdown-language-features/server/src/server.ts index a3f62c4ab2e..6f609c122f3 100644 --- a/extensions/markdown-language-features/server/src/server.ts +++ b/extensions/markdown-language-features/server/src/server.ts @@ -62,18 +62,26 @@ export async function startServer(connection: Connection, serverConfig: { let mdLs: md.IMdLanguageService | undefined; connection.onInitialize((params: InitializeParams): InitializeResult => { - const initOptions = params.initializationOptions as MdServerInitializationOptions | undefined; - const config = getLsConfiguration(initOptions ?? {}); - const configurationManager = new ConfigurationManager(connection); + const initOptions = params.initializationOptions as MdServerInitializationOptions | undefined; - const workspace = serverConfig.workspaceFactory({ connection, config, workspaceFolders: params.workspaceFolders }); + const mdConfig = getLsConfiguration(initOptions ?? {}); + + const workspace = serverConfig.workspaceFactory({ connection, config: mdConfig, workspaceFolders: params.workspaceFolders }); mdLs = md.createLanguageService({ workspace, parser: serverConfig.parser, logger: serverConfig.logger, - markdownFileExtensions: config.markdownFileExtensions, - excludePaths: config.excludePaths, + ...mdConfig, + get preferredMdPathExtensionStyle() { + switch (configurationManager.getSettings()?.markdown.preferredMdPathExtensionStyle) { + case 'includeExtension': return md.PreferredMdPathExtensionStyle.includeExtension; + case 'removeExtension': return md.PreferredMdPathExtensionStyle.removeExtension; + case 'auto': + default: + return md.PreferredMdPathExtensionStyle.auto; + } + } }); registerCompletionsSupport(connection, documents, mdLs, configurationManager); From 4d252ac40a9bc9f4b292095d9325a99ed4fa8f67 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 21 Feb 2023 15:07:37 +0100 Subject: [PATCH 007/206] sandbox - configure crash reporter with process type (#174927) --- src/bootstrap-fork.js | 21 +++++++++++++------ .../electron-main/utilityProcess.ts | 3 ++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/bootstrap-fork.js b/src/bootstrap-fork.js index 0f247ed8091..e3671222ccd 100644 --- a/src/bootstrap-fork.js +++ b/src/bootstrap-fork.js @@ -239,13 +239,22 @@ function terminateWhenParentTerminates() { function configureCrashReporter() { const crashReporterSandboxedHint = process.env['VSCODE_CRASH_REPORTER_SANDBOXED_HINT']; if (crashReporterSandboxedHint) { - try { - if (process['crashReporter'] && typeof process['crashReporter'].addExtraParameter === 'function' /* Electron only */) { - process['crashReporter'].addExtraParameter('_sandboxed', 'true'); - } - } catch (error) { - console.error(error); + addCrashReporterParameter('_sandboxed', 'true'); + } + + const crashReporterProcessType = process.env['VSCODE_CRASH_REPORTER_PROCESS_TYPE']; + if (crashReporterProcessType) { + addCrashReporterParameter('processType', crashReporterProcessType); + } +} + +function addCrashReporterParameter(key, value) { + try { + if (process['crashReporter'] && typeof process['crashReporter'].addExtraParameter === 'function' /* Electron only */) { + process['crashReporter'].addExtraParameter(key, value); } + } catch (error) { + console.error(error); } } diff --git a/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts b/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts index 0d907ece063..22759147b52 100644 --- a/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts +++ b/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts @@ -237,8 +237,9 @@ export class UtilityProcess extends Disposable { env['VSCODE_PARENT_PID'] = String(configuration.parentLifecycleBound); } if (isWindowSandboxed) { - env['VSCODE_CRASH_REPORTER_SANDBOXED_HINT'] = '1'; + env['VSCODE_CRASH_REPORTER_SANDBOXED_HINT'] = '1'; // TODO@bpasero remove me once sandbox is final } + env['VSCODE_CRASH_REPORTER_PROCESS_TYPE'] = configuration.type; // Remove any environment variables that are not allowed removeDangerousEnvVariables(env); From 8eb80b621378f6266a25286cfaf7e17ee512d982 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Tue, 21 Feb 2023 15:30:40 +0100 Subject: [PATCH 008/206] changing hc-white to hc-light --- src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css index a303d5f4945..82f4fb28481 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css @@ -23,7 +23,7 @@ } .monaco-editor.hc-black .sticky-widget, -.monaco-editor.hc-white .sticky-widget { +.monaco-editor.hc-light .sticky-widget { border-bottom: 1px solid var(--vscode-contrastBorder); } From 507e4549c01ba1ca88d2f7995b30046d8efc4ad3 Mon Sep 17 00:00:00 2001 From: Damon Tivel Date: Fri, 17 Feb 2023 14:33:52 -0800 Subject: [PATCH 009/206] Improve error handling and logging --- src/vs/base/node/zip.ts | 5 ++++- .../node/extensionDownloader.ts | 17 +++++++++++++---- .../node/extensionManagementService.ts | 15 ++++----------- .../node/extensionManagementUtil.ts | 17 ++++++++++++++++- .../extensionSignatureVerificationService.ts | 10 ++++++---- 5 files changed, 43 insertions(+), 21 deletions(-) diff --git a/src/vs/base/node/zip.ts b/src/vs/base/node/zip.ts index 2033f7cd98e..171b9e45bbc 100644 --- a/src/vs/base/node/zip.ts +++ b/src/vs/base/node/zip.ts @@ -14,6 +14,9 @@ import * as nls from 'vs/nls'; import { Entry, open as _openZip, ZipFile } from 'yauzl'; import * as yazl from 'yazl'; +export const CorruptZipMessage: string = 'end of central directory record signature not found'; +const CORRUPT_ZIP_PATTERN = new RegExp(CorruptZipMessage); + export interface IExtractOptions { overwrite?: boolean; @@ -63,7 +66,7 @@ function toExtractError(err: Error): ExtractError { let type: ExtractErrorType | undefined = undefined; - if (/end of central directory record signature not found/.test(err.message)) { + if (CORRUPT_ZIP_PATTERN.test(err.message)) { type = 'CorruptZip'; } diff --git a/src/vs/platform/extensionManagement/node/extensionDownloader.ts b/src/vs/platform/extensionManagement/node/extensionDownloader.ts index 1c70caad5ef..ccfd094ee33 100644 --- a/src/vs/platform/extensionManagement/node/extensionDownloader.ts +++ b/src/vs/platform/extensionManagement/node/extensionDownloader.ts @@ -14,11 +14,13 @@ import { isBoolean } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; import { Promises as FSPromises } from 'vs/base/node/pfs'; +import { CorruptZipMessage, ExtractError } from 'vs/base/node/zip'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; import { ExtensionVerificationStatus } from 'vs/platform/extensionManagement/common/abstractExtensionManagementService'; import { ExtensionManagementError, ExtensionManagementErrorCode, IExtensionGalleryService, IGalleryExtension, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ExtensionKey, groupByExtension } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { toExtensionManagementError } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; import { ExtensionSignatureVerificationError, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; import { IFileService, IFileStatWithMetadata } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; @@ -57,25 +59,32 @@ export class ExtensionsDownloader extends Disposable { let verificationStatus: ExtensionVerificationStatus = ExtensionVerificationStatus.Unverified; - if (await this.shouldVerifySignature(extension)) { + if (this.shouldVerifySignature(extension)) { const signatureArchiveLocation = await this.downloadSignatureArchive(extension); try { - const verified = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath); + const verified = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath, this.logService); if (verified) { verificationStatus = ExtensionVerificationStatus.Verified; } this.logService.info(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); } catch (error) { + await this.delete(signatureArchiveLocation); + const sigError = error as ExtensionSignatureVerificationError; const code: string = sigError.code; if (code === 'UnknownError') { verificationStatus = ExtensionVerificationStatus.UnknownError; this.logService.warn(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); + } else if (code === 'PackageIsInvalidZip' || code === 'SignatureArchiveIsInvalidZip') { + error.message = CorruptZipMessage; + + const extractError = new ExtractError('CorruptZip', error); + + throw toExtensionManagementError(extractError); } else if (!sigError.didExecute) { this.logService.warn(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus} (${code})`); } else { - await this.delete(signatureArchiveLocation); await this.delete(location); throw new ExtensionManagementError(code, ExtensionManagementErrorCode.Signature); @@ -86,7 +95,7 @@ export class ExtensionsDownloader extends Disposable { return { location, verificationStatus }; } - private async shouldVerifySignature(extension: IGalleryExtension): Promise { + private shouldVerifySignature(extension: IGalleryExtension): boolean { if (!extension.isSigned) { return false; } diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 0a3a830fcf4..71280d2ec22 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -21,7 +21,7 @@ import { isBoolean, isUndefined } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { generateUuid, isUUID } from 'vs/base/common/uuid'; import * as pfs from 'vs/base/node/pfs'; -import { extract, ExtractError, IFile, zip } from 'vs/base/node/zip'; +import { extract, IFile, zip } from 'vs/base/node/zip'; import * as nls from 'vs/nls'; import { IDownloadService } from 'vs/platform/download/common/download'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -35,7 +35,7 @@ import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagemen import { IExtensionsScannerService, IScannedExtension, ScanOptions } from 'vs/platform/extensionManagement/common/extensionsScannerService'; import { ExtensionsDownloader } from 'vs/platform/extensionManagement/node/extensionDownloader'; import { ExtensionsLifecycle } from 'vs/platform/extensionManagement/node/extensionLifecycle'; -import { getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; +import { getManifest, toExtensionManagementError } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; import { ExtensionsManifestCache } from 'vs/platform/extensionManagement/node/extensionsManifestCache'; import { DidChangeProfileExtensionsEvent, ExtensionsWatcher } from 'vs/platform/extensionManagement/node/extensionsWatcher'; import { ExtensionType, IExtension, IExtensionManifest, isApplicationScopedExtension, TargetPlatform } from 'vs/platform/extensions/common/extensions'; @@ -597,15 +597,8 @@ export class ExtensionsScanner extends Disposable { this.logService.info(`Extracted extension to ${location}:`, identifier.id); } catch (e) { try { await pfs.Promises.rm(location); } catch (e) { /* Ignore */ } - let errorCode = ExtensionManagementErrorCode.Extract; - if (e instanceof ExtractError) { - if (e.type === 'CorruptZip') { - errorCode = ExtensionManagementErrorCode.CorruptZip; - } else if (e.type === 'Incomplete') { - errorCode = ExtensionManagementErrorCode.IncompleteZip; - } - } - throw new ExtensionManagementError(e.message, errorCode); + + throw toExtensionManagementError(e); } } diff --git a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts index 6d9a54272da..21236d90dc2 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts @@ -3,8 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { buffer } from 'vs/base/node/zip'; +import { buffer, ExtractError } from 'vs/base/node/zip'; import { localize } from 'vs/nls'; +import { ExtensionManagementError, ExtensionManagementErrorCode } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; export function getManifest(vsix: string): Promise { @@ -17,3 +18,17 @@ export function getManifest(vsix: string): Promise { } }); } + +export function toExtensionManagementError(error: Error): ExtensionManagementError { + let errorCode = ExtensionManagementErrorCode.Extract; + + if (error instanceof ExtractError) { + if (error.type === 'CorruptZip') { + errorCode = ExtensionManagementErrorCode.CorruptZip; + } else if (error.type === 'Incomplete') { + errorCode = ExtensionManagementErrorCode.IncompleteZip; + } + } + + return new ExtensionManagementError(error.message, errorCode); +} diff --git a/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts b/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts index e335e1fb029..1d8140de387 100644 --- a/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts +++ b/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { ILogger } from 'vs/platform/log/common/log'; export const IExtensionSignatureVerificationService = createDecorator('IExtensionSignatureVerificationService'); @@ -17,16 +18,17 @@ export interface IExtensionSignatureVerificationService { * Verifies an extension file (.vsix) against a signature archive file. * @param { string } vsixFilePath The extension file path. * @param { string } signatureArchiveFilePath The signature archive file path. + * @param { ILogger } logger A logger. * @returns { Promise } A promise with `true` if the extension is validly signed and trusted; * otherwise, `false` because verification is not enabled (e.g.: in the OSS version of VS Code). * @throws { ExtensionSignatureVerificationError } An error with a code indicating the validity, integrity, or trust issue * found during verification or a more fundamental issue (e.g.: a required dependency was not found). */ - verify(vsixFilePath: string, signatureArchiveFilePath: string): Promise; + verify(vsixFilePath: string, signatureArchiveFilePath: string, logger: ILogger): Promise; } declare module vsceSign { - export function verify(vsixFilePath: string, signatureArchiveFilePath: string): Promise; + export function verify(vsixFilePath: string, signatureArchiveFilePath: string, logger: ILogger): Promise; } /** @@ -57,7 +59,7 @@ export class ExtensionSignatureVerificationService implements IExtensionSignatur return this.moduleLoadingPromise; } - public async verify(vsixFilePath: string, signatureArchiveFilePath: string): Promise { + public async verify(vsixFilePath: string, signatureArchiveFilePath: string, logger: ILogger): Promise { let module: typeof vsceSign; try { @@ -66,6 +68,6 @@ export class ExtensionSignatureVerificationService implements IExtensionSignatur return false; } - return module.verify(vsixFilePath, signatureArchiveFilePath); + return module.verify(vsixFilePath, signatureArchiveFilePath, logger); } } From aa1006552fbd1640f3a7586737a4a190feade60f Mon Sep 17 00:00:00 2001 From: Ryan Tjoa <51928404+rtjoa@users.noreply.github.com> Date: Tue, 21 Feb 2023 08:26:35 -0800 Subject: [PATCH 010/206] =?UTF-8?q?Use=20markdown=20in=20the=20description?= =?UTF-8?q?=20of=20`Workbench=20=E2=80=BA=20List:=20Fast=20Scroll=20Sensit?= =?UTF-8?q?ivity`=20(#173878)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use markdown in description of List: Fast Scroll Sensitivity setting --- src/vs/platform/list/browser/listService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index d5b482ed6ef..350caaec175 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -1380,7 +1380,7 @@ configurationRegistry.registerConfiguration({ [fastScrollSensitivityKey]: { type: 'number', default: 5, - description: localize('Fast Scroll Sensitivity', "Scrolling speed multiplier when pressing `Alt`.") + markdownDescription: localize('Fast Scroll Sensitivity', "Scrolling speed multiplier when pressing `Alt`.") }, [defaultFindModeSettingKey]: { type: 'string', From 3e00dca41f2e0b1f27a9c2f90280b8735ee37f62 Mon Sep 17 00:00:00 2001 From: JSJ Date: Tue, 21 Feb 2023 17:43:21 +0100 Subject: [PATCH 011/206] Fixed OpenWithCodeContextMenu text (#173468) * Fixed OpenWithCodeContextMenu text Changed tab to space in OpenWithCodeContextMenu that caused the option to show "missplaced" in the context menu of Windows file explorer. * Fix encoding --- build/win32/i18n/messages.es.isl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/win32/i18n/messages.es.isl b/build/win32/i18n/messages.es.isl index f8ac2ff85b2..0ba4d0c44f2 100644 --- a/build/win32/i18n/messages.es.isl +++ b/build/win32/i18n/messages.es.isl @@ -6,4 +6,4 @@ AddToPath=Agregar a PATH (disponible despu RunAfter=Ejecutar %1 después de la instalación Other=Otros: SourceFile=Archivo de origen %1 -OpenWithCodeContextMenu=Abrir &con %1 +OpenWithCodeContextMenu=Abrir &con %1 From 78d7b16ffaf9287f917854028db15f2055798eac Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 21 Feb 2023 18:04:23 +0100 Subject: [PATCH 012/206] About dialog doesn't get custom dialog style (fix #174914) (#174948) --- .../electron-sandbox/parts/dialogs/dialog.contribution.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts index 8fabdc69d6f..5672b546ccf 100644 --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts @@ -85,7 +85,11 @@ export class DialogHandlerContribution extends Disposable implements IWorkbenchC // About else { - await this.nativeImpl.about(); + if (this.useCustomDialog) { + await this.browserImpl.about(); + } else { + await this.nativeImpl.about(); + } } this.currentDialog.close(result); From 96fcd769decc01e27b26d0f2b219753c2fadb1ab Mon Sep 17 00:00:00 2001 From: David Dossett Date: Tue, 21 Feb 2023 09:30:43 -0800 Subject: [PATCH 013/206] Update profiles badge styling --- .../browser/parts/activitybar/media/activityaction.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css index f632b92e413..2af77fae3d7 100644 --- a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css +++ b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css @@ -179,11 +179,11 @@ line-height: 10px; top: 24px; right: 6px; - padding: 2px; - border-radius: 4px; - background-color: var(--vscode-activityBar-background); - color: var(--vscode-activityBar-inactiveForeground); - border: 1px solid; + padding: 2px 3px; + border-radius: 7px; + background-color: var(--vscode-badge-background); + color: var(--vscode-badge-foreground); + border: 2px solid var(--vscode-activityBar-background); } .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:active .profile-badge-content, From 5dc060974d6155cfc2caf32ef10cc1bedb2a8483 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Tue, 21 Feb 2023 11:42:05 -0600 Subject: [PATCH 014/206] add setting for aria-live assertive alert for ghost text (#174606) --- src/vs/editor/common/config/editorOptions.ts | 13 + .../common/standalone/standaloneEnums.ts | 273 ++++++++--------- .../browser/ghostTextWidget.ts | 10 + src/vs/monaco.d.ts | 278 +++++++++--------- .../audioCueLineFeatureContribution.ts | 36 --- 5 files changed, 302 insertions(+), 308 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 3383600a83b..365246b15be 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -57,6 +57,11 @@ export interface IEditorOptions { * The aria label for the editor's textarea (when it is focused). */ ariaLabel?: string; + + /** + * Control whether a screen reader announces inline suggestion content immediately. + */ + screenReaderAnnounceInlineSuggestion?: boolean; /** * The `tabindex` property of the editor's textarea */ @@ -4752,6 +4757,7 @@ export const enum EditorOption { acceptSuggestionOnEnter, accessibilitySupport, accessibilityPageSize, + screenReaderAnnounceInlineSuggestion, ariaLabel, autoClosingBrackets, autoClosingDelete, @@ -4918,6 +4924,13 @@ export const EditorOptions = { ariaLabel: register(new EditorStringOption( EditorOption.ariaLabel, 'ariaLabel', nls.localize('editorViewAccessibleLabel', "Editor content") )), + screenReaderAnnounceInlineSuggestion: register(new EditorBooleanOption( + EditorOption.screenReaderAnnounceInlineSuggestion, 'screenReaderAnnounceInlineSuggestion', false, + { + description: nls.localize('ariaAssertiveInlineSuggestion', "Control whether aria-live assertive & role alert are on the inline suggestion element so that a screen reader detects it immediately."), + tags: ['accessibility'] + } + )), autoClosingBrackets: register(new EditorStringEnumOption( EditorOption.autoClosingBrackets, 'autoClosingBrackets', 'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never', diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index d15fc2e84d2..624ab7fdd1d 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -177,142 +177,143 @@ export enum EditorOption { acceptSuggestionOnEnter = 1, accessibilitySupport = 2, accessibilityPageSize = 3, - ariaLabel = 4, - autoClosingBrackets = 5, - autoClosingDelete = 6, - autoClosingOvertype = 7, - autoClosingQuotes = 8, - autoIndent = 9, - automaticLayout = 10, - autoSurround = 11, - bracketPairColorization = 12, - guides = 13, - codeLens = 14, - codeLensFontFamily = 15, - codeLensFontSize = 16, - colorDecorators = 17, - colorDecoratorsLimit = 18, - columnSelection = 19, - comments = 20, - contextmenu = 21, - copyWithSyntaxHighlighting = 22, - cursorBlinking = 23, - cursorSmoothCaretAnimation = 24, - cursorStyle = 25, - cursorSurroundingLines = 26, - cursorSurroundingLinesStyle = 27, - cursorWidth = 28, - disableLayerHinting = 29, - disableMonospaceOptimizations = 30, - domReadOnly = 31, - dragAndDrop = 32, - dropIntoEditor = 33, - emptySelectionClipboard = 34, - experimentalWhitespaceRendering = 35, - extraEditorClassName = 36, - fastScrollSensitivity = 37, - find = 38, - fixedOverflowWidgets = 39, - folding = 40, - foldingStrategy = 41, - foldingHighlight = 42, - foldingImportsByDefault = 43, - foldingMaximumRegions = 44, - unfoldOnClickAfterEndOfLine = 45, - fontFamily = 46, - fontInfo = 47, - fontLigatures = 48, - fontSize = 49, - fontWeight = 50, - fontVariations = 51, - formatOnPaste = 52, - formatOnType = 53, - glyphMargin = 54, - gotoLocation = 55, - hideCursorInOverviewRuler = 56, - hover = 57, - inDiffEditor = 58, - inlineSuggest = 59, - letterSpacing = 60, - lightbulb = 61, - lineDecorationsWidth = 62, - lineHeight = 63, - lineNumbers = 64, - lineNumbersMinChars = 65, - linkedEditing = 66, - links = 67, - matchBrackets = 68, - minimap = 69, - mouseStyle = 70, - mouseWheelScrollSensitivity = 71, - mouseWheelZoom = 72, - multiCursorMergeOverlapping = 73, - multiCursorModifier = 74, - multiCursorPaste = 75, - multiCursorLimit = 76, - occurrencesHighlight = 77, - overviewRulerBorder = 78, - overviewRulerLanes = 79, - padding = 80, - parameterHints = 81, - peekWidgetDefaultFocus = 82, - definitionLinkOpensInPeek = 83, - quickSuggestions = 84, - quickSuggestionsDelay = 85, - readOnly = 86, - renameOnType = 87, - renderControlCharacters = 88, - renderFinalNewline = 89, - renderLineHighlight = 90, - renderLineHighlightOnlyWhenFocus = 91, - renderValidationDecorations = 92, - renderWhitespace = 93, - revealHorizontalRightPadding = 94, - roundedSelection = 95, - rulers = 96, - scrollbar = 97, - scrollBeyondLastColumn = 98, - scrollBeyondLastLine = 99, - scrollPredominantAxis = 100, - selectionClipboard = 101, - selectionHighlight = 102, - selectOnLineNumbers = 103, - showFoldingControls = 104, - showUnused = 105, - snippetSuggestions = 106, - smartSelect = 107, - smoothScrolling = 108, - stickyScroll = 109, - stickyTabStops = 110, - stopRenderingLineAfter = 111, - suggest = 112, - suggestFontSize = 113, - suggestLineHeight = 114, - suggestOnTriggerCharacters = 115, - suggestSelection = 116, - tabCompletion = 117, - tabIndex = 118, - unicodeHighlighting = 119, - unusualLineTerminators = 120, - useShadowDOM = 121, - useTabStops = 122, - wordBreak = 123, - wordSeparators = 124, - wordWrap = 125, - wordWrapBreakAfterCharacters = 126, - wordWrapBreakBeforeCharacters = 127, - wordWrapColumn = 128, - wordWrapOverride1 = 129, - wordWrapOverride2 = 130, - wrappingIndent = 131, - wrappingStrategy = 132, - showDeprecated = 133, - inlayHints = 134, - editorClassName = 135, - pixelRatio = 136, - tabFocusMode = 137, - layoutInfo = 138, - wrappingInfo = 139 + screenReaderAnnounceInlineSuggestion = 4, + ariaLabel = 5, + autoClosingBrackets = 6, + autoClosingDelete = 7, + autoClosingOvertype = 8, + autoClosingQuotes = 9, + autoIndent = 10, + automaticLayout = 11, + autoSurround = 12, + bracketPairColorization = 13, + guides = 14, + codeLens = 15, + codeLensFontFamily = 16, + codeLensFontSize = 17, + colorDecorators = 18, + colorDecoratorsLimit = 19, + columnSelection = 20, + comments = 21, + contextmenu = 22, + copyWithSyntaxHighlighting = 23, + cursorBlinking = 24, + cursorSmoothCaretAnimation = 25, + cursorStyle = 26, + cursorSurroundingLines = 27, + cursorSurroundingLinesStyle = 28, + cursorWidth = 29, + disableLayerHinting = 30, + disableMonospaceOptimizations = 31, + domReadOnly = 32, + dragAndDrop = 33, + dropIntoEditor = 34, + emptySelectionClipboard = 35, + experimentalWhitespaceRendering = 36, + extraEditorClassName = 37, + fastScrollSensitivity = 38, + find = 39, + fixedOverflowWidgets = 40, + folding = 41, + foldingStrategy = 42, + foldingHighlight = 43, + foldingImportsByDefault = 44, + foldingMaximumRegions = 45, + unfoldOnClickAfterEndOfLine = 46, + fontFamily = 47, + fontInfo = 48, + fontLigatures = 49, + fontSize = 50, + fontWeight = 51, + fontVariations = 52, + formatOnPaste = 53, + formatOnType = 54, + glyphMargin = 55, + gotoLocation = 56, + hideCursorInOverviewRuler = 57, + hover = 58, + inDiffEditor = 59, + inlineSuggest = 60, + letterSpacing = 61, + lightbulb = 62, + lineDecorationsWidth = 63, + lineHeight = 64, + lineNumbers = 65, + lineNumbersMinChars = 66, + linkedEditing = 67, + links = 68, + matchBrackets = 69, + minimap = 70, + mouseStyle = 71, + mouseWheelScrollSensitivity = 72, + mouseWheelZoom = 73, + multiCursorMergeOverlapping = 74, + multiCursorModifier = 75, + multiCursorPaste = 76, + multiCursorLimit = 77, + occurrencesHighlight = 78, + overviewRulerBorder = 79, + overviewRulerLanes = 80, + padding = 81, + parameterHints = 82, + peekWidgetDefaultFocus = 83, + definitionLinkOpensInPeek = 84, + quickSuggestions = 85, + quickSuggestionsDelay = 86, + readOnly = 87, + renameOnType = 88, + renderControlCharacters = 89, + renderFinalNewline = 90, + renderLineHighlight = 91, + renderLineHighlightOnlyWhenFocus = 92, + renderValidationDecorations = 93, + renderWhitespace = 94, + revealHorizontalRightPadding = 95, + roundedSelection = 96, + rulers = 97, + scrollbar = 98, + scrollBeyondLastColumn = 99, + scrollBeyondLastLine = 100, + scrollPredominantAxis = 101, + selectionClipboard = 102, + selectionHighlight = 103, + selectOnLineNumbers = 104, + showFoldingControls = 105, + showUnused = 106, + snippetSuggestions = 107, + smartSelect = 108, + smoothScrolling = 109, + stickyScroll = 110, + stickyTabStops = 111, + stopRenderingLineAfter = 112, + suggest = 113, + suggestFontSize = 114, + suggestLineHeight = 115, + suggestOnTriggerCharacters = 116, + suggestSelection = 117, + tabCompletion = 118, + tabIndex = 119, + unicodeHighlighting = 120, + unusualLineTerminators = 121, + useShadowDOM = 122, + useTabStops = 123, + wordBreak = 124, + wordSeparators = 125, + wordWrap = 126, + wordWrapBreakAfterCharacters = 127, + wordWrapBreakBeforeCharacters = 128, + wordWrapColumn = 129, + wordWrapOverride1 = 130, + wordWrapOverride2 = 131, + wrappingIndent = 132, + wrappingStrategy = 133, + showDeprecated = 134, + inlayHints = 135, + editorClassName = 136, + pixelRatio = 137, + tabFocusMode = 138, + layoutInfo = 139, + wrappingInfo = 140 } /** diff --git a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts b/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts index fe1ad377ea0..53c54d7562f 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts @@ -22,6 +22,7 @@ import { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/vie import { InlineDecorationType } from 'vs/editor/common/viewModel'; import { GhostTextReplacement, GhostTextWidgetModel } from 'vs/editor/contrib/inlineCompletions/browser/ghostText'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { AudioCue, IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService'; const ttPolicy = window.trustedTypes?.createPolicy('editorGhostText', { createHTML: value => value }); @@ -36,6 +37,7 @@ export class GhostTextWidget extends Disposable { private readonly model: GhostTextWidgetModel, @IInstantiationService private readonly instantiationService: IInstantiationService, @ILanguageService private readonly languageService: ILanguageService, + @IAudioCueService private readonly audioCueService: IAudioCueService ) { super(); @@ -157,6 +159,14 @@ export class GhostTextWidget extends Disposable { hiddenTextStartColumn !== undefined ? { column: hiddenTextStartColumn, length: textBufferLine.length + 1 - hiddenTextStartColumn } : undefined); this.additionalLinesWidget.updateLines(ghostText.lineNumber, additionalLines, ghostText.additionalReservedLineCount); + + this.audioCueService.playAudioCue(AudioCue.inlineSuggestion).then(() => { + if (this.editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) { + const lineText = this.editor.getModel()!.getLineContent(ghostText.lineNumber); + alert(ghostText.renderForScreenReader(lineText)); + } + }); + if (0 < 0) { // Not supported at the moment, condition is always false. this.viewMoreContentWidget = this.renderViewMoreLines( diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index ea87b12a731..73fb0789942 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3028,6 +3028,10 @@ declare namespace monaco.editor { * The aria label for the editor's textarea (when it is focused). */ ariaLabel?: string; + /** + * Control whether a screen reader announces inline suggestion content immediately. + */ + screenReaderAnnounceInlineSuggestion?: boolean; /** * The `tabindex` property of the editor's textarea */ @@ -4586,142 +4590,143 @@ declare namespace monaco.editor { acceptSuggestionOnEnter = 1, accessibilitySupport = 2, accessibilityPageSize = 3, - ariaLabel = 4, - autoClosingBrackets = 5, - autoClosingDelete = 6, - autoClosingOvertype = 7, - autoClosingQuotes = 8, - autoIndent = 9, - automaticLayout = 10, - autoSurround = 11, - bracketPairColorization = 12, - guides = 13, - codeLens = 14, - codeLensFontFamily = 15, - codeLensFontSize = 16, - colorDecorators = 17, - colorDecoratorsLimit = 18, - columnSelection = 19, - comments = 20, - contextmenu = 21, - copyWithSyntaxHighlighting = 22, - cursorBlinking = 23, - cursorSmoothCaretAnimation = 24, - cursorStyle = 25, - cursorSurroundingLines = 26, - cursorSurroundingLinesStyle = 27, - cursorWidth = 28, - disableLayerHinting = 29, - disableMonospaceOptimizations = 30, - domReadOnly = 31, - dragAndDrop = 32, - dropIntoEditor = 33, - emptySelectionClipboard = 34, - experimentalWhitespaceRendering = 35, - extraEditorClassName = 36, - fastScrollSensitivity = 37, - find = 38, - fixedOverflowWidgets = 39, - folding = 40, - foldingStrategy = 41, - foldingHighlight = 42, - foldingImportsByDefault = 43, - foldingMaximumRegions = 44, - unfoldOnClickAfterEndOfLine = 45, - fontFamily = 46, - fontInfo = 47, - fontLigatures = 48, - fontSize = 49, - fontWeight = 50, - fontVariations = 51, - formatOnPaste = 52, - formatOnType = 53, - glyphMargin = 54, - gotoLocation = 55, - hideCursorInOverviewRuler = 56, - hover = 57, - inDiffEditor = 58, - inlineSuggest = 59, - letterSpacing = 60, - lightbulb = 61, - lineDecorationsWidth = 62, - lineHeight = 63, - lineNumbers = 64, - lineNumbersMinChars = 65, - linkedEditing = 66, - links = 67, - matchBrackets = 68, - minimap = 69, - mouseStyle = 70, - mouseWheelScrollSensitivity = 71, - mouseWheelZoom = 72, - multiCursorMergeOverlapping = 73, - multiCursorModifier = 74, - multiCursorPaste = 75, - multiCursorLimit = 76, - occurrencesHighlight = 77, - overviewRulerBorder = 78, - overviewRulerLanes = 79, - padding = 80, - parameterHints = 81, - peekWidgetDefaultFocus = 82, - definitionLinkOpensInPeek = 83, - quickSuggestions = 84, - quickSuggestionsDelay = 85, - readOnly = 86, - renameOnType = 87, - renderControlCharacters = 88, - renderFinalNewline = 89, - renderLineHighlight = 90, - renderLineHighlightOnlyWhenFocus = 91, - renderValidationDecorations = 92, - renderWhitespace = 93, - revealHorizontalRightPadding = 94, - roundedSelection = 95, - rulers = 96, - scrollbar = 97, - scrollBeyondLastColumn = 98, - scrollBeyondLastLine = 99, - scrollPredominantAxis = 100, - selectionClipboard = 101, - selectionHighlight = 102, - selectOnLineNumbers = 103, - showFoldingControls = 104, - showUnused = 105, - snippetSuggestions = 106, - smartSelect = 107, - smoothScrolling = 108, - stickyScroll = 109, - stickyTabStops = 110, - stopRenderingLineAfter = 111, - suggest = 112, - suggestFontSize = 113, - suggestLineHeight = 114, - suggestOnTriggerCharacters = 115, - suggestSelection = 116, - tabCompletion = 117, - tabIndex = 118, - unicodeHighlighting = 119, - unusualLineTerminators = 120, - useShadowDOM = 121, - useTabStops = 122, - wordBreak = 123, - wordSeparators = 124, - wordWrap = 125, - wordWrapBreakAfterCharacters = 126, - wordWrapBreakBeforeCharacters = 127, - wordWrapColumn = 128, - wordWrapOverride1 = 129, - wordWrapOverride2 = 130, - wrappingIndent = 131, - wrappingStrategy = 132, - showDeprecated = 133, - inlayHints = 134, - editorClassName = 135, - pixelRatio = 136, - tabFocusMode = 137, - layoutInfo = 138, - wrappingInfo = 139 + screenReaderAnnounceInlineSuggestion = 4, + ariaLabel = 5, + autoClosingBrackets = 6, + autoClosingDelete = 7, + autoClosingOvertype = 8, + autoClosingQuotes = 9, + autoIndent = 10, + automaticLayout = 11, + autoSurround = 12, + bracketPairColorization = 13, + guides = 14, + codeLens = 15, + codeLensFontFamily = 16, + codeLensFontSize = 17, + colorDecorators = 18, + colorDecoratorsLimit = 19, + columnSelection = 20, + comments = 21, + contextmenu = 22, + copyWithSyntaxHighlighting = 23, + cursorBlinking = 24, + cursorSmoothCaretAnimation = 25, + cursorStyle = 26, + cursorSurroundingLines = 27, + cursorSurroundingLinesStyle = 28, + cursorWidth = 29, + disableLayerHinting = 30, + disableMonospaceOptimizations = 31, + domReadOnly = 32, + dragAndDrop = 33, + dropIntoEditor = 34, + emptySelectionClipboard = 35, + experimentalWhitespaceRendering = 36, + extraEditorClassName = 37, + fastScrollSensitivity = 38, + find = 39, + fixedOverflowWidgets = 40, + folding = 41, + foldingStrategy = 42, + foldingHighlight = 43, + foldingImportsByDefault = 44, + foldingMaximumRegions = 45, + unfoldOnClickAfterEndOfLine = 46, + fontFamily = 47, + fontInfo = 48, + fontLigatures = 49, + fontSize = 50, + fontWeight = 51, + fontVariations = 52, + formatOnPaste = 53, + formatOnType = 54, + glyphMargin = 55, + gotoLocation = 56, + hideCursorInOverviewRuler = 57, + hover = 58, + inDiffEditor = 59, + inlineSuggest = 60, + letterSpacing = 61, + lightbulb = 62, + lineDecorationsWidth = 63, + lineHeight = 64, + lineNumbers = 65, + lineNumbersMinChars = 66, + linkedEditing = 67, + links = 68, + matchBrackets = 69, + minimap = 70, + mouseStyle = 71, + mouseWheelScrollSensitivity = 72, + mouseWheelZoom = 73, + multiCursorMergeOverlapping = 74, + multiCursorModifier = 75, + multiCursorPaste = 76, + multiCursorLimit = 77, + occurrencesHighlight = 78, + overviewRulerBorder = 79, + overviewRulerLanes = 80, + padding = 81, + parameterHints = 82, + peekWidgetDefaultFocus = 83, + definitionLinkOpensInPeek = 84, + quickSuggestions = 85, + quickSuggestionsDelay = 86, + readOnly = 87, + renameOnType = 88, + renderControlCharacters = 89, + renderFinalNewline = 90, + renderLineHighlight = 91, + renderLineHighlightOnlyWhenFocus = 92, + renderValidationDecorations = 93, + renderWhitespace = 94, + revealHorizontalRightPadding = 95, + roundedSelection = 96, + rulers = 97, + scrollbar = 98, + scrollBeyondLastColumn = 99, + scrollBeyondLastLine = 100, + scrollPredominantAxis = 101, + selectionClipboard = 102, + selectionHighlight = 103, + selectOnLineNumbers = 104, + showFoldingControls = 105, + showUnused = 106, + snippetSuggestions = 107, + smartSelect = 108, + smoothScrolling = 109, + stickyScroll = 110, + stickyTabStops = 111, + stopRenderingLineAfter = 112, + suggest = 113, + suggestFontSize = 114, + suggestLineHeight = 115, + suggestOnTriggerCharacters = 116, + suggestSelection = 117, + tabCompletion = 118, + tabIndex = 119, + unicodeHighlighting = 120, + unusualLineTerminators = 121, + useShadowDOM = 122, + useTabStops = 123, + wordBreak = 124, + wordSeparators = 125, + wordWrap = 126, + wordWrapBreakAfterCharacters = 127, + wordWrapBreakBeforeCharacters = 128, + wordWrapColumn = 129, + wordWrapOverride1 = 130, + wordWrapOverride2 = 131, + wrappingIndent = 132, + wrappingStrategy = 133, + showDeprecated = 134, + inlayHints = 135, + editorClassName = 136, + pixelRatio = 137, + tabFocusMode = 138, + layoutInfo = 139, + wrappingInfo = 140 } export const EditorOptions: { @@ -4730,6 +4735,7 @@ declare namespace monaco.editor { accessibilitySupport: IEditorOption; accessibilityPageSize: IEditorOption; ariaLabel: IEditorOption; + screenReaderAnnounceInlineSuggestion: IEditorOption; autoClosingBrackets: IEditorOption; autoClosingDelete: IEditorOption; autoClosingOvertype: IEditorOption; diff --git a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts index 630452c5ca7..038f66846a5 100644 --- a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts +++ b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts @@ -13,7 +13,6 @@ import { IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/marke import { FoldingController } from 'vs/editor/contrib/folding/browser/folding'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITextModel } from 'vs/editor/common/model'; -import { GhostTextController } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextController'; import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; import { autorun, autorunDelta, constObservable, debouncedObservable, derived, IObservable, observableFromEvent, observableFromPromise, wasEventTriggeredRecently } from 'vs/base/common/observable'; import { AudioCue, IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService'; @@ -31,7 +30,6 @@ export class AudioCueLineFeatureContribution this.instantiationService.createInstance(MarkerLineFeature, AudioCue.warning, MarkerSeverity.Warning), this.instantiationService.createInstance(FoldedAreaLineFeature), this.instantiationService.createInstance(BreakpointLineFeature), - this.instantiationService.createInstance(InlineCompletionLineFeature), ]; private readonly isEnabledCache = new CachedFunction>((cue) => observableFromEvent( @@ -259,37 +257,3 @@ class BreakpointLineFeature implements LineFeature { ); } } - -class InlineCompletionLineFeature implements LineFeature { - public readonly audioCue = AudioCue.inlineSuggestion; - - getObservableState(editor: ICodeEditor, _model: ITextModel): IObservable { - const ghostTextController = GhostTextController.get(editor); - if (!ghostTextController) { - return constObservable({ - isPresent: () => false, - }); - } - - const activeGhostText = observableFromEvent( - ghostTextController.onActiveModelDidChange, - () => /** @description ghostTextController.onActiveModelDidChange */ ghostTextController.activeModel - ).map((activeModel) => ( - activeModel - ? observableFromEvent( - activeModel.inlineCompletionsModel.onDidChange, - () => /** @description activeModel.inlineCompletionsModel.onDidChange */ activeModel.inlineCompletionsModel.ghostText - ) - : undefined - )); - - return derived('ghostText', reader => { - const ghostText = activeGhostText.read(reader)?.read(reader); - return { - isPresent(position) { - return ghostText?.lineNumber === position.lineNumber; - } - }; - }); - } -} From e123385d1d32038eaec131d9007de186f810a2f8 Mon Sep 17 00:00:00 2001 From: David Dossett Date: Tue, 21 Feb 2023 11:10:51 -0800 Subject: [PATCH 015/206] Fix active tab foreground in dark+ v2 (#174991) --- extensions/theme-defaults/themes/dark_plus_experimental.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/theme-defaults/themes/dark_plus_experimental.json b/extensions/theme-defaults/themes/dark_plus_experimental.json index 4addd3d37e7..a35819446ab 100644 --- a/extensions/theme-defaults/themes/dark_plus_experimental.json +++ b/extensions/theme-defaults/themes/dark_plus_experimental.json @@ -111,7 +111,7 @@ "tab.activeBackground": "#1f1f1f", "tab.activeBorder": "#1f1f1f", "tab.activeBorderTop": "#0078d4", - "tab.activeForeground": "#cccccc", + "tab.activeForeground": "#ffffff", "tab.border": "#ffffff15", "tab.hoverBackground": "#1f1f1f", "tab.inactiveBackground": "#181818", From d47bacfb758d55b26431ebae0772725d99904603 Mon Sep 17 00:00:00 2001 From: David Dossett Date: Tue, 21 Feb 2023 11:15:45 -0800 Subject: [PATCH 016/206] Fix input border contrast in v2 themes (#172951) * Fix v2 light theme input contrast * Fix dark v2 theme border contrast --- .../theme-defaults/themes/dark_plus_experimental.json | 8 ++++---- .../theme-defaults/themes/light_plus_experimental.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/theme-defaults/themes/dark_plus_experimental.json b/extensions/theme-defaults/themes/dark_plus_experimental.json index a35819446ab..f5e9c3f3ce3 100644 --- a/extensions/theme-defaults/themes/dark_plus_experimental.json +++ b/extensions/theme-defaults/themes/dark_plus_experimental.json @@ -20,7 +20,7 @@ "button.secondaryForeground": "#cccccc", "button.secondaryHoverBackground": "#ffffff15", "checkbox.background": "#313131", - "checkbox.border": "#ffffff15", + "checkbox.border": "#ffffff1f", "debugToolBar.background": "#181818", "descriptionForeground": "#8b949e", "diffEditor.insertedLineBackground": "#23863633", @@ -28,7 +28,7 @@ "diffEditor.removedLineBackground": "#da363333", "diffEditor.removedTextBackground": "#da36334d", "dropdown.background": "#313131", - "dropdown.border": "#ffffff17", + "dropdown.border": "#ffffff1f", "dropdown.foreground": "#cccccc", "dropdown.listBackground": "#313131", "editor.background": "#1f1f1f", @@ -53,7 +53,7 @@ "foreground": "#cccccc", "icon.foreground": "#cccccc", "input.background": "#ffffff0f", - "input.border": "#ffffff17", + "input.border": "#ffffff1f", "input.foreground": "#cccccc", "input.placeholderForeground": "#ffffff79", "inputOption.activeBackground": "#2489db82", @@ -88,7 +88,7 @@ "scrollbarSlider.background": "#6e768133", "scrollbarSlider.hoverBackground": "#6e768145", "settings.dropdownBackground": "#313131", - "settings.dropdownBorder": "#ffffff17", + "settings.dropdownBorder": "#ffffff1f", "settings.headerForeground": "#ffffff", "settings.modifiedItemIndicator": "#bb800966", "sideBar.background": "#181818", diff --git a/extensions/theme-defaults/themes/light_plus_experimental.json b/extensions/theme-defaults/themes/light_plus_experimental.json index 9de9868f036..16d2de9d9a7 100644 --- a/extensions/theme-defaults/themes/light_plus_experimental.json +++ b/extensions/theme-defaults/themes/light_plus_experimental.json @@ -20,14 +20,14 @@ "button.secondaryForeground": "#3b3b3b", "button.secondaryHoverBackground": "#00000034", "checkbox.background": "#f8f8f8", - "checkbox.border": "#0000001a", + "checkbox.border": "#CECECE", "descriptionForeground": "#3b3b3b", "diffEditor.insertedLineBackground": "#23863633", "diffEditor.insertedTextBackground": "#2386364d", "diffEditor.removedLineBackground": "#da363333", "diffEditor.removedTextBackground": "#da36334d", "dropdown.background": "#ffffff", - "dropdown.border": "#0000001a", + "dropdown.border": "#CECECE", "dropdown.foreground": "#3b3b3b", "dropdown.listBackground": "#ffffff", "editor.background": "#ffffff", @@ -56,7 +56,7 @@ "foreground": "#3b3b3b", "icon.foreground": "#3b3b3b", "input.background": "#ffffff", - "input.border": "#0000001a", + "input.border": "#CECECE", "input.foreground": "#3b3b3b", "input.placeholderForeground": "#00000079", "inputOption.activeBackground": "#005fb841", @@ -96,7 +96,7 @@ "scrollbarSlider.hoverBackground": "#6e768145", "searchEditor.textInputBorder": "#CECECE", "settings.dropdownBackground": "#ffffff", - "settings.dropdownBorder": "#0000001a", + "settings.dropdownBorder": "#CECECE", "settings.headerForeground": "#1f1f1f", "settings.modifiedItemIndicator": "#bb800966", "settings.numberInputBorder": "#CECECE", From c82353d84e6ae2f912d8e8179cd4db64f0da9fab Mon Sep 17 00:00:00 2001 From: Damon Tivel Date: Tue, 21 Feb 2023 11:23:12 -0800 Subject: [PATCH 017/206] Apply feedback --- .../extensionManagement/node/extensionDownloader.ts | 12 ++++++++++-- .../node/extensionSignatureVerificationService.ts | 12 ++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/vs/platform/extensionManagement/node/extensionDownloader.ts b/src/vs/platform/extensionManagement/node/extensionDownloader.ts index ccfd094ee33..82c963151c4 100644 --- a/src/vs/platform/extensionManagement/node/extensionDownloader.ts +++ b/src/vs/platform/extensionManagement/node/extensionDownloader.ts @@ -23,7 +23,7 @@ import { ExtensionKey, groupByExtension } from 'vs/platform/extensionManagement/ import { toExtensionManagementError } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; import { ExtensionSignatureVerificationError, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; import { IFileService, IFileStatWithMetadata } from 'vs/platform/files/common/files'; -import { ILogService } from 'vs/platform/log/common/log'; +import { ILogService, LogLevel } from 'vs/platform/log/common/log'; export class ExtensionsDownloader extends Disposable { @@ -61,18 +61,26 @@ export class ExtensionsDownloader extends Disposable { if (this.shouldVerifySignature(extension)) { const signatureArchiveLocation = await this.downloadSignatureArchive(extension); + const verbose: boolean = this.logService.getLevel() === LogLevel.Trace; + try { - const verified = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath, this.logService); + const verified = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath, verbose); if (verified) { verificationStatus = ExtensionVerificationStatus.Verified; } this.logService.info(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); + + await this.delete(signatureArchiveLocation); } catch (error) { await this.delete(signatureArchiveLocation); const sigError = error as ExtensionSignatureVerificationError; const code: string = sigError.code; + if (verbose && sigError.output) { + this.logService.trace(`Extension signature verification details for ${extension.identifier.id} ${extension.version}:\n${error.output}`); + } + if (code === 'UnknownError') { verificationStatus = ExtensionVerificationStatus.UnknownError; this.logService.warn(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); diff --git a/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts b/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts index 1d8140de387..05c9ad01cd2 100644 --- a/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts +++ b/src/vs/platform/extensionManagement/node/extensionSignatureVerificationService.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ILogger } from 'vs/platform/log/common/log'; export const IExtensionSignatureVerificationService = createDecorator('IExtensionSignatureVerificationService'); @@ -18,17 +17,17 @@ export interface IExtensionSignatureVerificationService { * Verifies an extension file (.vsix) against a signature archive file. * @param { string } vsixFilePath The extension file path. * @param { string } signatureArchiveFilePath The signature archive file path. - * @param { ILogger } logger A logger. + * @param { boolean } verbose A flag indicating whether or not to capture verbose detail in the event of an error. * @returns { Promise } A promise with `true` if the extension is validly signed and trusted; * otherwise, `false` because verification is not enabled (e.g.: in the OSS version of VS Code). * @throws { ExtensionSignatureVerificationError } An error with a code indicating the validity, integrity, or trust issue * found during verification or a more fundamental issue (e.g.: a required dependency was not found). */ - verify(vsixFilePath: string, signatureArchiveFilePath: string, logger: ILogger): Promise; + verify(vsixFilePath: string, signatureArchiveFilePath: string, verbose: boolean): Promise; } declare module vsceSign { - export function verify(vsixFilePath: string, signatureArchiveFilePath: string, logger: ILogger): Promise; + export function verify(vsixFilePath: string, signatureArchiveFilePath: string, verbose: boolean): Promise; } /** @@ -37,6 +36,7 @@ declare module vsceSign { export interface ExtensionSignatureVerificationError extends Error { readonly code: string; readonly didExecute: boolean; + readonly output?: string; } export class ExtensionSignatureVerificationService implements IExtensionSignatureVerificationService { @@ -59,7 +59,7 @@ export class ExtensionSignatureVerificationService implements IExtensionSignatur return this.moduleLoadingPromise; } - public async verify(vsixFilePath: string, signatureArchiveFilePath: string, logger: ILogger): Promise { + public async verify(vsixFilePath: string, signatureArchiveFilePath: string, verbose: boolean): Promise { let module: typeof vsceSign; try { @@ -68,6 +68,6 @@ export class ExtensionSignatureVerificationService implements IExtensionSignatur return false; } - return module.verify(vsixFilePath, signatureArchiveFilePath, logger); + return module.verify(vsixFilePath, signatureArchiveFilePath, verbose); } } From 4965a140e9099cbe0b649c8d99ef6b0a56ae9601 Mon Sep 17 00:00:00 2001 From: David Dossett Date: Tue, 21 Feb 2023 11:25:22 -0800 Subject: [PATCH 018/206] Update active activity bar item foreground in v2 themes (#174980) --- extensions/theme-defaults/themes/dark_plus_experimental.json | 2 +- extensions/theme-defaults/themes/light_plus_experimental.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/theme-defaults/themes/dark_plus_experimental.json b/extensions/theme-defaults/themes/dark_plus_experimental.json index f5e9c3f3ce3..0eeea832e42 100644 --- a/extensions/theme-defaults/themes/dark_plus_experimental.json +++ b/extensions/theme-defaults/themes/dark_plus_experimental.json @@ -6,7 +6,7 @@ "activityBar.activeBorder": "#0078d4", "activityBar.background": "#181818", "activityBar.border": "#ffffff15", - "activityBar.foreground": "#cccccc", + "activityBar.foreground": "#d7d7d7", "activityBar.inactiveForeground": "#ffffff80", "activityBarBadge.background": "#0078d4", "activityBarBadge.foreground": "#ffffff", diff --git a/extensions/theme-defaults/themes/light_plus_experimental.json b/extensions/theme-defaults/themes/light_plus_experimental.json index 16d2de9d9a7..157d78d4024 100644 --- a/extensions/theme-defaults/themes/light_plus_experimental.json +++ b/extensions/theme-defaults/themes/light_plus_experimental.json @@ -6,7 +6,7 @@ "activityBar.activeBorder": "#005FB8", "activityBar.background": "#f8f8f8", "activityBar.border": "#0000001a", - "activityBar.foreground": "#3b3b3b", + "activityBar.foreground": "#1f1f1f", "activityBar.inactiveForeground": "#0000009e", "activityBarBadge.background": "#005FB8", "activityBarBadge.foreground": "#ffffff", From 9fb8f877d5ed1ccc094603859c89d1bab0a092b4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 21 Feb 2023 22:19:01 +0100 Subject: [PATCH 019/206] fix #174919 --- src/vs/workbench/contrib/logs/common/defaultLogLevels.ts | 2 +- src/vs/workbench/contrib/logs/common/logsActions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts b/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts index 8a318ed0ef7..0f4bff3cea3 100644 --- a/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts +++ b/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts @@ -94,7 +94,7 @@ class DefaultLogLevelsService implements IDefaultLogLevelsService { private async _writeLogLevelsToArgv(logLevels: ParsedArgvLogLevels): Promise { const logLevelsValue: string[] = []; - if (logLevels.default) { + if (!isUndefined(logLevels.default)) { logLevelsValue.push(LogLevelToString(logLevels.default)); } for (const [extension, logLevel] of logLevels.extensions ?? []) { diff --git a/src/vs/workbench/contrib/logs/common/logsActions.ts b/src/vs/workbench/contrib/logs/common/logsActions.ts index e5eb7911c87..5451519eb35 100644 --- a/src/vs/workbench/contrib/logs/common/logsActions.ts +++ b/src/vs/workbench/contrib/logs/common/logsActions.ts @@ -129,7 +129,7 @@ export class SetLogLevelAction extends Action { } private getLogLevelEntries(defaultLogLevel: LogLevel, currentLogLevel: LogLevel): LogLevelQuickPickItem[] { - const button: IQuickInputButton = { iconClass: ThemeIcon.asClassName(Codicon.arrowSwap), tooltip: nls.localize('resetLogLevel', "Set as Default Log Level") }; + const button: IQuickInputButton = { iconClass: ThemeIcon.asClassName(Codicon.checkAll), tooltip: nls.localize('resetLogLevel', "Set as Default Log Level") }; return [ { label: this.getLabel(LogLevel.Trace, currentLogLevel), level: LogLevel.Trace, description: this.getDescription(LogLevel.Trace, defaultLogLevel), buttons: defaultLogLevel !== LogLevel.Trace ? [button] : undefined }, { label: this.getLabel(LogLevel.Debug, currentLogLevel), level: LogLevel.Debug, description: this.getDescription(LogLevel.Debug, defaultLogLevel), buttons: defaultLogLevel !== LogLevel.Debug ? [button] : undefined }, From 08026f839fda13aec2cda5438ecc1dc531fad114 Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Tue, 21 Feb 2023 21:36:54 +0000 Subject: [PATCH 020/206] Show `Install Additional Remote Extensions` as long as extension gallery is enabled (#175005) * Show `Install Additional Remote Extensions` as long as extension gallery is enabled * Fix EOL --- src/vs/workbench/contrib/remote/browser/remoteIndicator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts index 4e2afff1f33..443d634806f 100644 --- a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts +++ b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts @@ -464,7 +464,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr } } - if (!this.remoteAuthority && !this.virtualWorkspaceLocation && this.extensionGalleryService.isEnabled()) { + if (this.extensionGalleryService.isEnabled()) { items.push({ id: RemoteStatusIndicator.INSTALL_REMOTE_EXTENSIONS_ID, label: nls.localize('installRemotes', "Install Additional Remote Extensions..."), From 780d041a754310ac8e0f041fabe9594d6dca45b4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 21 Feb 2023 22:44:56 +0100 Subject: [PATCH 021/206] clean up --- .../node/extensionDownloader.ts | 28 ++++++++----------- .../node/extensionManagementService.ts | 15 +++++++--- .../node/extensionManagementUtil.ts | 17 +---------- 3 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/vs/platform/extensionManagement/node/extensionDownloader.ts b/src/vs/platform/extensionManagement/node/extensionDownloader.ts index 82c963151c4..abc54a51b6d 100644 --- a/src/vs/platform/extensionManagement/node/extensionDownloader.ts +++ b/src/vs/platform/extensionManagement/node/extensionDownloader.ts @@ -14,13 +14,12 @@ import { isBoolean } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; import { Promises as FSPromises } from 'vs/base/node/pfs'; -import { CorruptZipMessage, ExtractError } from 'vs/base/node/zip'; +import { CorruptZipMessage } from 'vs/base/node/zip'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; import { ExtensionVerificationStatus } from 'vs/platform/extensionManagement/common/abstractExtensionManagementService'; import { ExtensionManagementError, ExtensionManagementErrorCode, IExtensionGalleryService, IGalleryExtension, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ExtensionKey, groupByExtension } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { toExtensionManagementError } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; import { ExtensionSignatureVerificationError, IExtensionSignatureVerificationService } from 'vs/platform/extensionManagement/node/extensionSignatureVerificationService'; import { IFileService, IFileStatWithMetadata } from 'vs/platform/files/common/files'; import { ILogService, LogLevel } from 'vs/platform/log/common/log'; @@ -61,35 +60,25 @@ export class ExtensionsDownloader extends Disposable { if (this.shouldVerifySignature(extension)) { const signatureArchiveLocation = await this.downloadSignatureArchive(extension); - const verbose: boolean = this.logService.getLevel() === LogLevel.Trace; - try { - const verified = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath, verbose); + const verified = await this.extensionSignatureVerificationService.verify(location.fsPath, signatureArchiveLocation.fsPath, this.logService.getLevel() === LogLevel.Trace); if (verified) { verificationStatus = ExtensionVerificationStatus.Verified; } this.logService.info(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); - - await this.delete(signatureArchiveLocation); } catch (error) { - await this.delete(signatureArchiveLocation); - const sigError = error as ExtensionSignatureVerificationError; const code: string = sigError.code; - if (verbose && sigError.output) { - this.logService.trace(`Extension signature verification details for ${extension.identifier.id} ${extension.version}:\n${error.output}`); + if (sigError.output) { + this.logService.trace(`Extension signature verification details for ${extension.identifier.id} ${extension.version}:\n${sigError.output}`); } if (code === 'UnknownError') { verificationStatus = ExtensionVerificationStatus.UnknownError; this.logService.warn(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus}.`); } else if (code === 'PackageIsInvalidZip' || code === 'SignatureArchiveIsInvalidZip') { - error.message = CorruptZipMessage; - - const extractError = new ExtractError('CorruptZip', error); - - throw toExtensionManagementError(extractError); + throw new ExtensionManagementError(CorruptZipMessage, ExtensionManagementErrorCode.CorruptZip); } else if (!sigError.didExecute) { this.logService.warn(`Extension signature verification: ${extension.identifier.id}. Verification status: ${verificationStatus} (${code})`); } else { @@ -97,6 +86,13 @@ export class ExtensionsDownloader extends Disposable { throw new ExtensionManagementError(code, ExtensionManagementErrorCode.Signature); } + } finally { + try { + // Delete signature archive always + await this.delete(signatureArchiveLocation); + } catch (error) { + this.logService.error(error); + } } } diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 71280d2ec22..0a3a830fcf4 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -21,7 +21,7 @@ import { isBoolean, isUndefined } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { generateUuid, isUUID } from 'vs/base/common/uuid'; import * as pfs from 'vs/base/node/pfs'; -import { extract, IFile, zip } from 'vs/base/node/zip'; +import { extract, ExtractError, IFile, zip } from 'vs/base/node/zip'; import * as nls from 'vs/nls'; import { IDownloadService } from 'vs/platform/download/common/download'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -35,7 +35,7 @@ import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagemen import { IExtensionsScannerService, IScannedExtension, ScanOptions } from 'vs/platform/extensionManagement/common/extensionsScannerService'; import { ExtensionsDownloader } from 'vs/platform/extensionManagement/node/extensionDownloader'; import { ExtensionsLifecycle } from 'vs/platform/extensionManagement/node/extensionLifecycle'; -import { getManifest, toExtensionManagementError } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; +import { getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; import { ExtensionsManifestCache } from 'vs/platform/extensionManagement/node/extensionsManifestCache'; import { DidChangeProfileExtensionsEvent, ExtensionsWatcher } from 'vs/platform/extensionManagement/node/extensionsWatcher'; import { ExtensionType, IExtension, IExtensionManifest, isApplicationScopedExtension, TargetPlatform } from 'vs/platform/extensions/common/extensions'; @@ -597,8 +597,15 @@ export class ExtensionsScanner extends Disposable { this.logService.info(`Extracted extension to ${location}:`, identifier.id); } catch (e) { try { await pfs.Promises.rm(location); } catch (e) { /* Ignore */ } - - throw toExtensionManagementError(e); + let errorCode = ExtensionManagementErrorCode.Extract; + if (e instanceof ExtractError) { + if (e.type === 'CorruptZip') { + errorCode = ExtensionManagementErrorCode.CorruptZip; + } else if (e.type === 'Incomplete') { + errorCode = ExtensionManagementErrorCode.IncompleteZip; + } + } + throw new ExtensionManagementError(e.message, errorCode); } } diff --git a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts index 21236d90dc2..6d9a54272da 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementUtil.ts @@ -3,9 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { buffer, ExtractError } from 'vs/base/node/zip'; +import { buffer } from 'vs/base/node/zip'; import { localize } from 'vs/nls'; -import { ExtensionManagementError, ExtensionManagementErrorCode } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; export function getManifest(vsix: string): Promise { @@ -18,17 +17,3 @@ export function getManifest(vsix: string): Promise { } }); } - -export function toExtensionManagementError(error: Error): ExtensionManagementError { - let errorCode = ExtensionManagementErrorCode.Extract; - - if (error instanceof ExtractError) { - if (error.type === 'CorruptZip') { - errorCode = ExtensionManagementErrorCode.CorruptZip; - } else if (error.type === 'Incomplete') { - errorCode = ExtensionManagementErrorCode.IncompleteZip; - } - } - - return new ExtensionManagementError(error.message, errorCode); -} From 7b6b6869e8f5b71b5e9cdbd3f590b10964f89607 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Tue, 21 Feb 2023 17:26:37 -0800 Subject: [PATCH 022/206] Add en as fallback osLocale (#175039) --- src/main.js | 8 +++++--- test/smoke/src/areas/workbench/localization.test.ts | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.js b/src/main.js index d9305dfb168..d6f46dba013 100644 --- a/src/main.js +++ b/src/main.js @@ -103,10 +103,12 @@ let osLocale = undefined; // Ref https://github.com/microsoft/vscode/issues/159813 // and https://github.com/electron/electron/pull/36035 if ('getPreferredSystemLanguages' in app - && typeof app.getPreferredSystemLanguages === 'function' - && app.getPreferredSystemLanguages().length) { + && typeof app.getPreferredSystemLanguages === 'function') { // Use the most preferred OS language for language recommendation. - osLocale = app.getPreferredSystemLanguages()[0]; + // The API might return an empty array on Linux, such as when + // the 'C' locale is the user's only configured locale. + // No matter the OS, if the array is empty, default back to 'en'. + osLocale = app.getPreferredSystemLanguages()?.[0] ?? 'en'; if (osLocale) { osLocale = processZhLocale(osLocale.toLowerCase()); } diff --git a/test/smoke/src/areas/workbench/localization.test.ts b/test/smoke/src/areas/workbench/localization.test.ts index 65c60152622..15a71ff505c 100644 --- a/test/smoke/src/areas/workbench/localization.test.ts +++ b/test/smoke/src/areas/workbench/localization.test.ts @@ -8,9 +8,7 @@ import { installAllHandlers } from '../../utils'; export function setup(logger: Logger) { - // BUG: app.getPreferredSystemLanguages() doesn't seem to return anything here on Linux: https://github.com/microsoft/vscode/blob/3ba29f37d6b9f3f2257b48f2b90f0699ea581be4/src/main.js#L100-L113 - // but it should when we move to Electron 22 so we can re-enable this test then. - (process.platform === 'linux' ? describe.skip : describe)('Localization', () => { + describe('Localization', () => { // Shared before/after handling installAllHandlers(logger); From ed2add34a5cc4d8f7897e9fef3d263bf9b5a671e Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Wed, 22 Feb 2023 06:07:10 +0000 Subject: [PATCH 023/206] Only show `Install Additional Remote Extensions` when there are more remote extensions to install (#175072) --- .../contrib/remote/browser/remoteIndicator.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts index 443d634806f..1a0b2feacb9 100644 --- a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts +++ b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts @@ -41,6 +41,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; +import { IProductService } from 'vs/platform/product/common/productService'; type ActionGroup = [string, Array]; export class RemoteStatusIndicator extends Disposable implements IWorkbenchContribution { @@ -84,6 +85,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr @ILogService private readonly logService: ILogService, @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, @ITelemetryService private readonly telemetryService: ITelemetryService, + @IProductService private readonly productService: IProductService, ) { super(); @@ -464,7 +466,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr } } - if (this.extensionGalleryService.isEnabled()) { + if (this.extensionGalleryService.isEnabled() && this.hasAdditionalRemoteExtensions()) { items.push({ id: RemoteStatusIndicator.INSTALL_REMOTE_EXTENSIONS_ID, label: nls.localize('installRemotes', "Install Additional Remote Extensions..."), @@ -509,6 +511,18 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr quickPick.show(); } + private hasAdditionalRemoteExtensions() { + const extensionTips = { ...this.productService.remoteExtensionTips, ...this.productService.virtualWorkspaceExtensionTips }; + for (const [_, extension] of Object.entries(extensionTips)) { + const { extensionId: recommendedExtensionId } = extension; + // if this recommended extension isn't already installed, return early + if (!this.extensionService.extensions.some((extension) => extension.id?.toLowerCase() === recommendedExtensionId.toLowerCase())) { + return true; + } + } + return false; + } + private hasRemoteMenuCommands(ignoreInstallAdditional: boolean): boolean { if (this.remoteAuthority !== undefined || this.virtualWorkspaceLocation !== undefined) { if (RemoteStatusIndicator.SHOW_CLOSE_REMOTE_COMMAND_ID) { From 6efb4dea05f095f849b7cfb8f174f881c0137611 Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Wed, 22 Feb 2023 06:28:59 +0000 Subject: [PATCH 024/206] Don't register onWillShutdown operation in web (#175075) --- .../browser/editSessions.contribution.ts | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts index 723b23a47a8..4eae9ffb679 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts @@ -158,7 +158,11 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo this.shouldShowViewsContext = EDIT_SESSIONS_SHOW_VIEW.bindTo(this.contextKeyService); this._register(this.fileService.registerProvider(EditSessionsFileSystemProvider.SCHEMA, new EditSessionsFileSystemProvider(this.editSessionsStorageService))); - this.lifecycleService.onWillShutdown((e) => e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: localize('autoStoreWorkingChanges', 'Storing current working changes...') })); + this.lifecycleService.onWillShutdown((e) => { + if (this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) { + e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: localize('autoStoreWorkingChanges', 'Storing current working changes...') }); + } + }); this._register(this.editSessionsStorageService.onDidSignIn(() => this.updateAccountsMenuBadge())); this._register(this.editSessionsStorageService.onDidSignOut(() => this.updateAccountsMenuBadge())); } @@ -223,17 +227,15 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo } private async autoStoreEditSession() { - if (this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) { - const cancellationTokenSource = new CancellationTokenSource(); - await this.progressService.withProgress({ - location: ProgressLocation.Window, - type: 'syncing', - title: localize('store working changes', 'Storing working changes...') - }, async () => this.storeEditSession(false, cancellationTokenSource.token), () => { - cancellationTokenSource.cancel(); - cancellationTokenSource.dispose(); - }); - } + const cancellationTokenSource = new CancellationTokenSource(); + await this.progressService.withProgress({ + location: ProgressLocation.Window, + type: 'syncing', + title: localize('store working changes', 'Storing working changes...') + }, async () => this.storeEditSession(false, cancellationTokenSource.token), () => { + cancellationTokenSource.cancel(); + cancellationTokenSource.dispose(); + }); } private registerViews() { From 2b838fda85ee216a9727cf82833542ac16dde360 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 07:30:55 +0100 Subject: [PATCH 025/206] Cannot toggle shared process when `window.experimental.sharedProcessUseUtilityProcess: true` (fix #174960) (#175000) --- src/vs/workbench/electron-sandbox/actions/developerActions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vs/workbench/electron-sandbox/actions/developerActions.ts b/src/vs/workbench/electron-sandbox/actions/developerActions.ts index 75959edb375..acd5350aea4 100644 --- a/src/vs/workbench/electron-sandbox/actions/developerActions.ts +++ b/src/vs/workbench/electron-sandbox/actions/developerActions.ts @@ -16,6 +16,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { IFileService } from 'vs/platform/files/common/files'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { URI } from 'vs/base/common/uri'; +import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; export class ToggleDevToolsAction extends Action2 { @@ -75,6 +76,7 @@ export class ToggleSharedProcessAction extends Action2 { id: 'workbench.action.toggleSharedProcess', title: { value: localize('toggleSharedProcess', "Toggle Shared Process"), original: 'Toggle Shared Process' }, category: Categories.Developer, + precondition: ContextKeyExpr.has('config.window.experimental.sharedProcessUseUtilityProcess').negate(), f1: true }); } From d7fec23a8a96fe0626bdb438114a36989df58845 Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Wed, 22 Feb 2023 06:35:34 +0000 Subject: [PATCH 026/206] Use `fs.readFile` instead of `openTextDocument` (#175077) --- extensions/extension-editing/src/extensionLinter.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/extension-editing/src/extensionLinter.ts b/extensions/extension-editing/src/extensionLinter.ts index 1e38459ab0a..bac6bd71e8a 100644 --- a/extensions/extension-editing/src/extensionLinter.ts +++ b/extensions/extension-editing/src/extensionLinter.ts @@ -12,6 +12,7 @@ import * as MarkdownItType from 'markdown-it'; import { languages, workspace, Disposable, TextDocument, Uri, Diagnostic, Range, DiagnosticSeverity, Position, env, l10n } from 'vscode'; import { INormalizedVersion, normalizeVersion, parseVersion } from './extensionEngineValidation'; +import { TextDecoder } from 'util'; const product = JSON.parse(fs.readFileSync(path.join(env.appRoot, 'product.json'), { encoding: 'utf-8' })); const allowedBadgeProviders: string[] = (product.extensionAllowedBadgeProviders || []).map((s: string) => s.toLowerCase()); @@ -69,6 +70,7 @@ export class ExtensionLinter { private timer: NodeJS.Timer | undefined; private markdownIt: MarkdownItType.MarkdownIt | undefined; private parse5: typeof import('parse5') | undefined; + private textDecoder = new TextDecoder(); constructor() { this.disposables.push( @@ -346,8 +348,8 @@ export class ExtensionLinter { } const file = folder.with({ path: path.posix.join(folder.path, 'package.json') }); try { - const document = await workspace.openTextDocument(file); - return parseTree(document.getText()); + const fileContents = await workspace.fs.readFile(file); // #174888 + return parseTree(this.textDecoder.decode(fileContents)); } catch (err) { return undefined; } From 4eda27585c04702e351edd7646cf7a718ab789e0 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 07:49:03 +0100 Subject: [PATCH 027/206] Double Cancel Buttons Mac Native Dialog Box (fix #174995) (#175078) --- .../contrib/workspace/browser/workspace.contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts b/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts index 6333c1461c6..45205704519 100644 --- a/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts +++ b/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts @@ -173,7 +173,7 @@ export class WorkspaceTrustRequestHandler extends Disposable implements IWorkben { markdown: new MarkdownString(localize('immediateTrustRequestLearnMore', "If you don't trust the authors of these files, we do not recommend continuing as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more.")) } ] }, - buttons: buttons.map(button => { + buttons: buttons.filter(b => b.type !== 'Cancel').map(button => { return { label: button.label, run: () => button.type From becbbfaa859bbcd39f5cd1216180052c8e054190 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 08:52:27 +0100 Subject: [PATCH 028/206] Filesystem errors shown in active tab when relevant tab closed (fix #170252) (#175084) --- src/vs/workbench/browser/parts/editor/editorPanes.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/workbench/browser/parts/editor/editorPanes.ts b/src/vs/workbench/browser/parts/editor/editorPanes.ts index 042d191541a..a20ad95ad47 100644 --- a/src/vs/workbench/browser/parts/editor/editorPanes.ts +++ b/src/vs/workbench/browser/parts/editor/editorPanes.ts @@ -424,6 +424,12 @@ export class EditorPanes extends Disposable { if (!operation.isCurrent()) { cancelled = true; } + } catch (error) { + if (!operation.isCurrent()) { + cancelled = true; + } else { + throw error; + } } finally { operation.stop(); } From 50f980e5889862f2acd85e33c09977ff320fd1ea Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 09:39:23 +0100 Subject: [PATCH 029/206] fix process explorer bounds are always wrong (#175085) --- src/vs/platform/issue/electron-main/issueMainService.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/vs/platform/issue/electron-main/issueMainService.ts b/src/vs/platform/issue/electron-main/issueMainService.ts index fa7935a1131..6652cd77a1b 100644 --- a/src/vs/platform/issue/electron-main/issueMainService.ts +++ b/src/vs/platform/issue/electron-main/issueMainService.ts @@ -258,11 +258,6 @@ export class IssueMainService implements IIssueMainService { const savedPosition = this.stateService.getItem(processExplorerWindowState, undefined); const position = isStrictWindowState(savedPosition) ? savedPosition : this.getWindowPosition(this.processExplorerParentWindow, 800, 500); - // Correct dimensions to take scale/dpr into account - const displayToUse = screen.getDisplayNearestPoint({ x: position.x!, y: position.y! }); - position.width /= displayToUse.scaleFactor; - position.height /= displayToUse.scaleFactor; - this.processExplorerWindow = this.createBrowserWindow(position, processExplorerWindowConfigUrl, { backgroundColor: data.styles.backgroundColor, title: localize('processExplorer', "Process Explorer"), From 3133ffcd12ce78441b39b82c64d11c7729a3c48b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 10:05:46 +0100 Subject: [PATCH 030/206] diag - indicate electron node.js processes in process explorer (#175088) * diag - indicate electron node.js processes in process explorer * improve --- src/vs/base/node/ps.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vs/base/node/ps.ts b/src/vs/base/node/ps.ts index cc01a30f0ba..70690df9d75 100644 --- a/src/vs/base/node/ps.ts +++ b/src/vs/base/node/ps.ts @@ -55,6 +55,7 @@ export function listProcesses(rootPid: number): Promise { const UTILITY_EXTENSION_HOST_HINT = /--vscode-utility-kind=extensionHost/i; const UTILITY_FILE_WATCHER_HOST_HINT = /--vscode-utility-kind=fileWatcher/i; const UTILITY_SHARED_PROCESS_HINT = /--vscode-utility-kind=shared-process/i; + const NODEJS_PROCESS_HINT = /--ms-enable-electron-run-as-node/i; const WINDOWS_CRASH_REPORTER = /--crashes-directory/i; const WINDOWS_PTY = /\\pipe\\winpty-control/i; const WINDOWS_CONSOLE_HOST = /conhost\.exe/i; @@ -70,7 +71,7 @@ export function listProcesses(rootPid: number): Promise { return 'winpty-process'; } - //find windows console host process + // find windows console host process if (WINDOWS_CONSOLE_HOST.exec(cmd)) { return 'console-window-host (Windows internal process)'; } @@ -126,9 +127,15 @@ export function listProcesses(rootPid: number): Promise { if (result) { if (cmd.indexOf('node ') < 0 && cmd.indexOf('node.exe') < 0) { - return `electron_node ${result}`; + return `electron-nodejs ${result}`; } } + + // find Electron node.js processes + if (NODEJS_PROCESS_HINT.exec(cmd)) { + return 'electron-nodejs'; + } + return cmd; } From a0bf7f5b134502205e8f626e76773076a96fc8f6 Mon Sep 17 00:00:00 2001 From: Mark Zuber Date: Wed, 22 Feb 2023 01:44:19 -0800 Subject: [PATCH 031/206] Add custom path for vscode-server socket files and named pipe length (#172481) * Add custom path for vscode-server socket files and named pipe length * Revert VSCODE_SOCKETS_DIR to XDG_RUNTIME_DIR behavior * :lipstick: --------- Co-authored-by: Benjamin Pasero --- src/vs/base/parts/ipc/node/ipc.net.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/vs/base/parts/ipc/node/ipc.net.ts b/src/vs/base/parts/ipc/node/ipc.net.ts index 455caa3efeb..0d083887afd 100644 --- a/src/vs/base/parts/ipc/node/ipc.net.ts +++ b/src/vs/base/parts/ipc/node/ipc.net.ts @@ -759,11 +759,20 @@ export function createStaticIPCHandle(directoryPath: string, type: string, versi // Mac/Unix: use socket file and prefer // XDG_RUNTIME_DIR over user data path // unless portable + // Trim the version and type values for + // the socket to prevent too large + // file names causing issues: + // https://unix.stackexchange.com/questions/367008/why-is-socket-path-length-limited-to-a-hundred-chars + + const versionForSocket = version.substr(0, 4); + const typeForSocket = type.substr(0, 6); + const scopeForSocket = scope.substr(0, 8); + let result: string; if (XDG_RUNTIME_DIR && !process.env['VSCODE_PORTABLE']) { - result = join(XDG_RUNTIME_DIR, `vscode-${scope.substr(0, 8)}-${version}-${type}.sock`); + result = join(XDG_RUNTIME_DIR, `vscode-${scopeForSocket}-${versionForSocket}-${typeForSocket}.sock`); } else { - result = join(directoryPath, `${version}-${type}.sock`); + result = join(directoryPath, `${versionForSocket}-${typeForSocket}.sock`); } // Validate length From 031e97749c2db619ce126395f787e0a2c16ca817 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Wed, 22 Feb 2023 11:47:30 +0100 Subject: [PATCH 032/206] Fixes http server launch config --- .vscode/tasks.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 32254a98a08..f97b01e8c62 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -260,9 +260,18 @@ // Used for monaco editor playground launch config "label": "Launch Http Server", "type": "shell", - "command": "node_modules/.bin/http-server --cors --port 5001 -a 127.0.0.1 -s -c-1", + "command": "node_modules/.bin/http-server --cors --port 5001 -a 127.0.0.1 -c-1 -s", "isBackground": true, - "problemMatcher": [], + "problemMatcher": { + "pattern": { + "regexp": "" + }, + "background": { + "activeOnStart": true, + "beginsPattern": "never match", + "endsPattern": ".*" + } + }, "dependsOn": [ "Core - Build" ] From d659fba9ea6893607d9b5e1e81d111a9bc9a666c Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 22 Feb 2023 12:03:33 +0100 Subject: [PATCH 033/206] update distro pointer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 401ce73181c..3f54e4054ea 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.76.0", - "distro": "d1298afbfabd0c7765a358bacbc66a179d2b0039", + "distro": "87377fc46aa67037dd50294542908b717255b603", "author": { "name": "Microsoft Corporation" }, From 50ef72d17c747f5cc1552100c6009ecb1f1ec17c Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 22 Feb 2023 12:42:45 +0100 Subject: [PATCH 034/206] labels only for extensions runtime editor btns (#175099) fixes https://github.com/microsoft/vscode/issues/173213 --- .../extensions/browser/abstractRuntimeExtensionsEditor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts index b764f946925..f9b251a5ee1 100644 --- a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts @@ -284,12 +284,12 @@ export abstract class AbstractRuntimeExtensionsEditor extends EditorPane { data.actionbar.clear(); const slowExtensionAction = this._createSlowExtensionAction(element); if (slowExtensionAction) { - data.actionbar.push(slowExtensionAction, { icon: true, label: true }); + data.actionbar.push(slowExtensionAction, { icon: false, label: true }); } if (isNonEmptyArray(element.status.runtimeErrors)) { const reportExtensionIssueAction = this._createReportExtensionIssueAction(element); if (reportExtensionIssueAction) { - data.actionbar.push(reportExtensionIssueAction, { icon: true, label: true }); + data.actionbar.push(reportExtensionIssueAction, { icon: false, label: true }); } } From 91501a27b82c5a1a52a240e3b5d6eb8f37263126 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 22 Feb 2023 13:32:46 +0100 Subject: [PATCH 035/206] Send large buffers in 256KB chunks to avoid having large WebSocket messages and delay firing the close event until all data has been inflated and emitted (#174277) --- src/vs/base/parts/ipc/node/ipc.net.ts | 51 ++++++++++++---- .../base/parts/ipc/test/node/ipc.net.test.ts | 61 ++++++++++++++++++- 2 files changed, 100 insertions(+), 12 deletions(-) diff --git a/src/vs/base/parts/ipc/node/ipc.net.ts b/src/vs/base/parts/ipc/node/ipc.net.ts index 1b6b7f78952..80873b97c1f 100644 --- a/src/vs/base/parts/ipc/node/ipc.net.ts +++ b/src/vs/base/parts/ipc/node/ipc.net.ts @@ -189,7 +189,15 @@ export class NodeSocket implements ISocket { } const enum Constants { - MinHeaderByteSize = 2 + MinHeaderByteSize = 2, + /** + * If we need to write a large buffer, we will split it into 256KB chunks and + * send each chunk as a websocket message. This is to prevent that the sending + * side is stuck waiting for the entire buffer to be compressed before writing + * to the underlying socket or that the receiving side is stuck waiting for the + * entire message to be received before processing the bytes. + */ + MaxWebSocketMessageLength = 256 * 1024 // 256 KB } const enum ReadState { @@ -272,7 +280,14 @@ export class WebSocketNodeSocket extends Disposable implements ISocket, ISocketT })); this._incomingData = new ChunkStream(); this._register(this.socket.onData(data => this._acceptChunk(data))); - this._register(this.socket.onClose((e) => this._onClose.fire(e))); + this._register(this.socket.onClose(async (e) => { + // Delay surfacing the close event until the async inflating is done + // and all data has been emitted + if (this._flowManager.isProcessingReadQueue()) { + await Event.toPromise(this._flowManager.onDidFinishProcessingReadQueue); + } + this._onClose.fire(e); + })); } public override dispose(): void { @@ -300,16 +315,22 @@ export class WebSocketNodeSocket extends Disposable implements ISocket, ISocketT } public write(buffer: VSBuffer): void { - const maxSendChunkSize = 10 * 1024 * 1024; + // If we write many logical messages (let's say 1000 messages of 100KB) during a single process tick, we do + // this thing where we install a process.nextTick timer and group all of them together and we then issue a + // single WebSocketNodeSocket.write with a 100MB buffer. + // + // The first problem is that the actual writing to the underlying node socket will only happen after all of + // the 100MB have been deflated (due to waiting on zlib flush). The second problem is on the reading side, + // where we will get a single WebSocketNodeSocket.onData event fired when all the 100MB have arrived, + // delaying processing the 1000 received messages until all have arrived, instead of processing them as each + // one arrives. + // + // We therefore split the buffer into chunks, and issue a write for each chunk. - if (buffer.byteLength <= maxSendChunkSize) { - this._flowManager.writeMessage(buffer); - } else { - let start = 0; - while (start < buffer.byteLength) { - this._flowManager.writeMessage(buffer.slice(start, Math.min(start + maxSendChunkSize, buffer.byteLength))); - start += maxSendChunkSize; - } + let start = 0; + while (start < buffer.byteLength) { + this._flowManager.writeMessage(buffer.slice(start, Math.min(start + Constants.MaxWebSocketMessageLength, buffer.byteLength))); + start += Constants.MaxWebSocketMessageLength; } } @@ -475,6 +496,9 @@ class WebSocketFlowManager extends Disposable { private readonly _writeQueue: VSBuffer[] = []; private readonly _readQueue: { data: VSBuffer; isCompressed: boolean; isLastFrameOfMessage: boolean }[] = []; + private readonly _onDidFinishProcessingReadQueue = this._register(new Emitter()); + public readonly onDidFinishProcessingReadQueue = this._onDidFinishProcessingReadQueue.event; + private readonly _onDidFinishProcessingWriteQueue = this._register(new Emitter()); public readonly onDidFinishProcessingWriteQueue = this._onDidFinishProcessingWriteQueue.event; @@ -575,6 +599,11 @@ class WebSocketFlowManager extends Disposable { } } this._isProcessingReadQueue = false; + this._onDidFinishProcessingReadQueue.fire(); + } + + public isProcessingReadQueue(): boolean { + return (this._isProcessingReadQueue); } /** diff --git a/src/vs/base/parts/ipc/test/node/ipc.net.test.ts b/src/vs/base/parts/ipc/test/node/ipc.net.test.ts index ed797697982..42d77c57bdc 100644 --- a/src/vs/base/parts/ipc/test/node/ipc.net.test.ts +++ b/src/vs/base/parts/ipc/test/node/ipc.net.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { EventEmitter } from 'events'; -import { createServer, Socket } from 'net'; +import { AddressInfo, connect, createServer, Server, Socket } from 'net'; import { tmpdir } from 'os'; import { Barrier, timeout } from 'vs/base/common/async'; import { VSBuffer } from 'vs/base/common/buffer'; @@ -706,4 +706,63 @@ suite('WebSocketNodeSocket', () => { assert.deepStrictEqual(actual, 'Helloworld'); }); }); + + test('Large buffers are split and sent in chunks', async () => { + + let receivingSideOnDataCallCount = 0; + let receivingSideTotalBytes = 0; + const receivingSideSocketClosedBarrier = new Barrier(); + + const server = await listenOnRandomPort((socket) => { + // stop the server when the first connection is received + server.close(); + + const webSocketNodeSocket = new WebSocketNodeSocket(new NodeSocket(socket), true, null, false); + webSocketNodeSocket.onData((data) => { + receivingSideOnDataCallCount++; + receivingSideTotalBytes += data.byteLength; + }); + + webSocketNodeSocket.onClose(() => { + webSocketNodeSocket.dispose(); + receivingSideSocketClosedBarrier.open(); + }); + }); + + const socket = connect({ + host: '127.0.0.1', + port: (server.address()).port + }); + + const buff = generateRandomBuffer(1 * 1024 * 1024); + + const webSocketNodeSocket = new WebSocketNodeSocket(new NodeSocket(socket), true, null, false); + webSocketNodeSocket.write(buff); + await webSocketNodeSocket.drain(); + webSocketNodeSocket.dispose(); + await receivingSideSocketClosedBarrier.wait(); + + assert.strictEqual(receivingSideTotalBytes, buff.byteLength); + assert.strictEqual(receivingSideOnDataCallCount, 4); + }); + + function generateRandomBuffer(size: number): VSBuffer { + const buff = VSBuffer.alloc(size); + for (let i = 0; i < size; i++) { + buff.writeUInt8(Math.floor(256 * Math.random()), i); + } + return buff; + } + + function listenOnRandomPort(handler: (socket: Socket) => void): Promise { + return new Promise((resolve, reject) => { + const server = createServer(handler).listen(0); + server.on('listening', () => { + resolve(server); + }); + server.on('error', (err) => { + reject(err); + }); + }); + } }); From f4bcbb57b9d69d0d52aef03ca50839f988bc4ab1 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 22 Feb 2023 14:27:22 +0100 Subject: [PATCH 036/206] Prefer SCM quick diff when multiple on a line (#175101) Fixes #174950 --- .../api/browser/mainThreadQuickDiff.ts | 1 + src/vs/workbench/api/browser/mainThreadSCM.ts | 2 ++ .../contrib/scm/browser/dirtydiffDecorator.ts | 24 +++++++++++++++---- .../workbench/contrib/scm/common/quickDiff.ts | 2 ++ .../contrib/scm/common/quickDiffService.ts | 12 ++++++---- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadQuickDiff.ts b/src/vs/workbench/api/browser/mainThreadQuickDiff.ts index 41d923795bc..0aa31f94c96 100644 --- a/src/vs/workbench/api/browser/mainThreadQuickDiff.ts +++ b/src/vs/workbench/api/browser/mainThreadQuickDiff.ts @@ -29,6 +29,7 @@ export class MainThreadQuickDiff implements MainThreadQuickDiffShape { label, rootUri: URI.revive(rootUri), selector, + isSCM: false, getOriginalResource: async (uri: URI) => { return URI.revive(await this.proxy.$provideOriginalResource(handle, uri, new CancellationTokenSource().token)); } diff --git a/src/vs/workbench/api/browser/mainThreadSCM.ts b/src/vs/workbench/api/browser/mainThreadSCM.ts index f75b82bee9f..413fb39df1f 100644 --- a/src/vs/workbench/api/browser/mainThreadSCM.ts +++ b/src/vs/workbench/api/browser/mainThreadSCM.ts @@ -135,6 +135,7 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { readonly onDidChange: Event = this._onDidChange.event; private _quickDiff: IDisposable | undefined; + public readonly isSCM: boolean = true; constructor( private readonly proxy: ExtHostSCMShape, @@ -161,6 +162,7 @@ class MainThreadSCMProvider implements ISCMProvider, QuickDiffProvider { this._quickDiff = this._quickDiffService.addQuickDiffProvider({ label: features.quickDiffLabel ?? this.label, rootUri: this.rootUri, + isSCM: this.isSCM, getOriginalResource: (uri: URI) => this.getOriginalResource(uri) }); } else if (features.hasQuickDiffProvider === false && this._quickDiff) { diff --git a/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts b/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts index 212a40fe506..a7f3b419a7b 100644 --- a/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts @@ -1430,24 +1430,38 @@ export class DirtyDiffModel extends Disposable { } findNextClosestChange(lineNumber: number, inclusive = true, provider?: string): number { + let preferredProvider: string | undefined; + if (!provider && inclusive) { + preferredProvider = this.quickDiffs.find(value => value.isSCM)?.label; + } + + const possibleChanges: number[] = []; for (let i = 0; i < this.changes.length; i++) { if (provider && this.changes[i].label !== provider) { continue; } - const change = this.changes[i].change; + const change = this.changes[i]; + const possibleChangesLength = possibleChanges.length; if (inclusive) { - if (getModifiedEndLineNumber(change) >= lineNumber) { - return i; + if ((getModifiedEndLineNumber(change.change) >= lineNumber) && (change.change.modifiedStartLineNumber <= lineNumber)) { + if (preferredProvider && change.label !== preferredProvider) { + possibleChanges.push(i); + } else { + return i; + } } } else { - if (change.modifiedStartLineNumber > lineNumber) { + if (change.change.modifiedStartLineNumber > lineNumber) { return i; } } + if ((possibleChanges.length > 0) && (possibleChanges.length === possibleChangesLength)) { + return possibleChanges[0]; + } } - return 0; + return possibleChanges.length > 0 ? possibleChanges[0] : 0; } findPreviousClosestChange(lineNumber: number, inclusive = true, provider?: string): number { diff --git a/src/vs/workbench/contrib/scm/common/quickDiff.ts b/src/vs/workbench/contrib/scm/common/quickDiff.ts index 34caf0865dd..eec1b2ae86d 100644 --- a/src/vs/workbench/contrib/scm/common/quickDiff.ts +++ b/src/vs/workbench/contrib/scm/common/quickDiff.ts @@ -15,12 +15,14 @@ export interface QuickDiffProvider { label: string; rootUri: URI | undefined; selector?: LanguageSelector; + isSCM: boolean; getOriginalResource(uri: URI): Promise; } export interface QuickDiff { label: string; originalResource: URI; + isSCM: boolean; } export interface IQuickDiffService { diff --git a/src/vs/workbench/contrib/scm/common/quickDiffService.ts b/src/vs/workbench/contrib/scm/common/quickDiffService.ts index 384cbcf1a5d..72a6f93a98a 100644 --- a/src/vs/workbench/contrib/scm/common/quickDiffService.ts +++ b/src/vs/workbench/contrib/scm/common/quickDiffService.ts @@ -9,6 +9,7 @@ import { IQuickDiffService, QuickDiff, QuickDiffProvider } from 'vs/workbench/co import { isEqualOrParent } from 'vs/base/common/resources'; import { score } from 'vs/editor/common/languageSelector'; import { Emitter } from 'vs/base/common/event'; +import { withNullAsUndefined } from 'vs/base/common/types'; function createProviderComparer(uri: URI): (a: QuickDiffProvider, b: QuickDiffProvider) => number { return (a, b) => { @@ -53,8 +54,8 @@ export class QuickDiffService extends Disposable implements IQuickDiffService { }; } - private isQuickDiff(diff: { originalResource: URI | null; label: string }): diff is QuickDiff { - return !!diff.originalResource; + private isQuickDiff(diff: { originalResource?: URI; label?: string; isSCM?: boolean }): diff is QuickDiff { + return !!diff.originalResource && (typeof diff.label === 'string') && (typeof diff.isSCM === 'boolean'); } async getQuickDiffs(uri: URI, language: string = '', isSynchronized: boolean = false): Promise { @@ -62,9 +63,10 @@ export class QuickDiffService extends Disposable implements IQuickDiffService { const diffs = await Promise.all(Array.from(sorted.values()).map(async (provider) => { const scoreValue = provider.selector ? score(provider.selector, uri, language, isSynchronized, undefined, undefined) : 10; - const diff = { - originalResource: scoreValue > 0 ? await provider.getOriginalResource(uri) : null, - label: provider.label + const diff: Partial = { + originalResource: scoreValue > 0 ? withNullAsUndefined(await provider.getOriginalResource(uri)) : undefined, + label: provider.label, + isSCM: provider.isSCM }; return diff; })); From f909533a1fe9c68193388db5cc3b7592500e6889 Mon Sep 17 00:00:00 2001 From: Damon Tivel Date: Wed, 22 Feb 2023 05:39:50 -0800 Subject: [PATCH 037/206] Bump distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3f54e4054ea..14409e0a218 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.76.0", - "distro": "87377fc46aa67037dd50294542908b717255b603", + "distro": "ef7b3fe403fb76194fc61bc83b4b53af19a8f704", "author": { "name": "Microsoft Corporation" }, From c7e4e328c4165c747e22a17e5a34e726e0badc6c Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 22 Feb 2023 15:08:59 +0100 Subject: [PATCH 038/206] Quick diff dropdown list background transparency bug (#175119) Fixes #174947 --- src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts b/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts index b2db48e1881..c90f84ac8c3 100644 --- a/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts +++ b/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts @@ -11,7 +11,7 @@ import { SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewIte import { defaultSelectBoxStyles } from 'vs/platform/theme/browser/defaultStyles'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { peekViewTitleBackground } from 'vs/editor/contrib/peekView/browser/peekView'; -import { Color } from 'vs/base/common/color'; +import { editorBackground } from 'vs/platform/theme/common/colorRegistry'; export interface IQuickDiffSelectItem extends ISelectOptionItem { provider: string; @@ -34,7 +34,10 @@ export class SwitchQuickDiffViewItem extends SelectActionViewItem Date: Wed, 22 Feb 2023 08:14:23 -0600 Subject: [PATCH 039/206] Pick up latest markdown language service (#174881) For #174005 --- extensions/markdown-language-features/server/package.json | 2 +- extensions/markdown-language-features/server/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/markdown-language-features/server/package.json b/extensions/markdown-language-features/server/package.json index 27d09b94257..52fc6208219 100644 --- a/extensions/markdown-language-features/server/package.json +++ b/extensions/markdown-language-features/server/package.json @@ -18,7 +18,7 @@ "vscode-languageserver": "^8.0.2", "vscode-languageserver-textdocument": "^1.0.5", "vscode-languageserver-types": "^3.17.1", - "vscode-markdown-languageservice": "^0.3.0-alpha.4", + "vscode-markdown-languageservice": "^0.3.0-alpha.5", "vscode-uri": "^3.0.3" }, "devDependencies": { diff --git a/extensions/markdown-language-features/server/yarn.lock b/extensions/markdown-language-features/server/yarn.lock index a08e3800d89..0f8c0deefbe 100644 --- a/extensions/markdown-language-features/server/yarn.lock +++ b/extensions/markdown-language-features/server/yarn.lock @@ -52,10 +52,10 @@ vscode-languageserver@^8.0.2: dependencies: vscode-languageserver-protocol "3.17.2" -vscode-markdown-languageservice@^0.3.0-alpha.4: - version "0.3.0-alpha.4" - resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.3.0-alpha.4.tgz#59cc97102d6d0177a028b320fa76fe86d294cdb0" - integrity sha512-wMstTLuX3F+BkjxXCY4d1xKzHyBTHTC2EECg701FpBbSppa17Zj/Hk2G9H1dZGXhQeexXifxVXKScbLD6cB/3g== +vscode-markdown-languageservice@^0.3.0-alpha.5: + version "0.3.0-alpha.5" + resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.3.0-alpha.5.tgz#fce18193c16186eacdd322f49775fd43d659fc25" + integrity sha512-5SEn8hr999N/K8IaY25fdZoW7JPJT4pOm53AQvimGNYiCntb0TWJhMJD1Izbc2DvbyrWAksVkLqzbGKV/zW+Sg== dependencies: "@vscode/l10n" "^0.0.10" picomatch "^2.3.1" From c327a4ab2d3dd40a0861af6c079cebdb63ba2bf8 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 15:20:18 +0100 Subject: [PATCH 040/206] Command line don't work as specified in the docs (fix #174283) (#175120) --- src/vs/platform/environment/common/argv.ts | 1 + src/vs/platform/environment/node/argv.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/vs/platform/environment/common/argv.ts b/src/vs/platform/environment/common/argv.ts index ed567c6ca6f..3fd7438bad4 100644 --- a/src/vs/platform/environment/common/argv.ts +++ b/src/vs/platform/environment/common/argv.ts @@ -123,6 +123,7 @@ export interface NativeParsedArgs { 'inspect-brk'?: string; 'js-flags'?: string; 'disable-gpu'?: boolean; + 'disable-gpu-sandbox'?: boolean; 'nolazy'?: boolean; 'force-device-scale-factor'?: string; 'force-renderer-accessibility'?: boolean; diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index d972185f033..8f94ff9c6c4 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -157,6 +157,7 @@ export const OPTIONS: OptionDescriptions> = { 'force-user-env': { type: 'boolean' }, 'force-disable-user-env': { type: 'boolean' }, 'open-devtools': { type: 'boolean' }, + 'disable-gpu-sandbox': { type: 'boolean' }, 'logsPath': { type: 'string' }, '__enable-file-policy': { type: 'boolean' }, 'editSessionId': { type: 'string' }, From 22c891f6fb24dfc6cc4f436eabe4436cf2744c3d Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 22 Feb 2023 16:41:04 +0100 Subject: [PATCH 041/206] Quick Diff selection dropdown is not keyboard accessible (#175128) Fixes #174926 --- src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts b/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts index c90f84ac8c3..8cc5b7d8527 100644 --- a/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts +++ b/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.ts @@ -50,6 +50,11 @@ export class SwitchQuickDiffViewItem extends SelectActionViewItem Date: Wed, 22 Feb 2023 09:16:03 -0700 Subject: [PATCH 042/206] Remove explorer when empty (#175132) --- src/vs/workbench/contrib/files/browser/explorerViewlet.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts index b1239eac438..8c4267b61b5 100644 --- a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts @@ -277,6 +277,7 @@ export const VIEW_CONTAINER: ViewContainer = viewContainerRegistry.registerViewC storageId: 'workbench.explorer.views.state', icon: explorerViewIcon, alwaysUseContainerInfo: true, + hideIfEmpty: true, order: 0, openCommandActionDescriptor: { id: VIEWLET_ID, From 49dec737d21c0f0f765837e897325818edf27fbc Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 22 Feb 2023 08:30:51 -0800 Subject: [PATCH 043/206] Revert "disable initializing user data (#173560)" (#175134) This reverts commit ca480b035121981f86bfdde04505ddc00863dbcf. --- .../common/abstractSynchronizer.ts | 73 ++- .../userDataSync/common/extensionsSync.ts | 59 ++- .../userDataSync/common/globalStateSync.ts | 59 ++- .../userDataSync/common/keybindingsSync.ts | 57 ++- .../userDataSync/common/settingsSync.ts | 56 ++- .../userDataSync/common/snippetsSync.ts | 53 +- .../platform/userDataSync/common/tasksSync.ts | 44 +- .../userDataSync/common/userDataSync.ts | 4 + src/vs/workbench/browser/web.main.ts | 32 ++ .../extensions.contribution.ts | 2 + .../electron-sandbox/remoteExtensionsInit.ts | 138 ++++++ .../extensions/browser/extensionService.ts | 8 +- .../themes/browser/workbenchThemeService.ts | 4 +- .../services/userData/browser/userDataInit.ts | 455 ++++++++++++++++++ src/vs/workbench/workbench.desktop.main.ts | 2 + 15 files changed, 1029 insertions(+), 17 deletions(-) create mode 100644 src/vs/workbench/contrib/extensions/electron-sandbox/remoteExtensionsInit.ts create mode 100644 src/vs/workbench/services/userData/browser/userDataInit.ts diff --git a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts index b6423c763e6..9451928cf66 100644 --- a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts +++ b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts @@ -21,12 +21,13 @@ import { localize } from 'vs/nls'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { FileChangesEvent, FileOperationError, FileOperationResult, IFileContent, IFileService, toFileOperationResult } from 'vs/platform/files/common/files'; +import { ILogService } from 'vs/platform/log/common/log'; import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { Change, getLastSyncResourceUri, IRemoteUserData, IResourcePreview as IBaseResourcePreview, ISyncData, IUserDataSyncResourcePreview as IBaseSyncResourcePreview, IUserData, IUserDataSyncBackupStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, MergeState, PREVIEW_DIR_NAME, SyncResource, SyncStatus, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_CONFIGURATION_SCOPE, USER_DATA_SYNC_SCHEME, IUserDataResourceManifest, getPathSegments, IUserDataSyncResourceConflicts, IUserDataSyncResource } from 'vs/platform/userDataSync/common/userDataSync'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { Change, getLastSyncResourceUri, IRemoteUserData, IResourcePreview as IBaseResourcePreview, ISyncData, IUserDataSyncResourcePreview as IBaseSyncResourcePreview, IUserData, IUserDataInitializer, IUserDataSyncBackupStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, MergeState, PREVIEW_DIR_NAME, SyncResource, SyncStatus, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_CONFIGURATION_SCOPE, USER_DATA_SYNC_SCHEME, IUserDataResourceManifest, getPathSegments, IUserDataSyncResourceConflicts, IUserDataSyncResource } from 'vs/platform/userDataSync/common/userDataSync'; +import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; type IncompatibleSyncSourceClassification = { owner: 'sandy081'; @@ -913,3 +914,71 @@ export abstract class AbstractJsonFileSynchroniser extends AbstractFileSynchroni } } + +export abstract class AbstractInitializer implements IUserDataInitializer { + + protected readonly extUri: IExtUri; + private readonly lastSyncResource: URI; + + constructor( + readonly resource: SyncResource, + @IUserDataProfilesService protected readonly userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService protected readonly environmentService: IEnvironmentService, + @ILogService protected readonly logService: ILogService, + @IFileService protected readonly fileService: IFileService, + @IStorageService protected readonly storageService: IStorageService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + this.extUri = uriIdentityService.extUri; + this.lastSyncResource = getLastSyncResourceUri(undefined, this.resource, environmentService, this.extUri); + } + + async initialize({ ref, content }: IUserData): Promise { + if (!content) { + this.logService.info('Remote content does not exist.', this.resource); + return; + } + + const syncData = this.parseSyncData(content); + if (!syncData) { + return; + } + + try { + await this.doInitialize({ ref, syncData }); + } catch (error) { + this.logService.error(error); + } + } + + private parseSyncData(content: string): ISyncData | undefined { + try { + const syncData: ISyncData = JSON.parse(content); + if (isSyncData(syncData)) { + return syncData; + } + } catch (error) { + this.logService.error(error); + } + this.logService.info('Cannot parse sync data as it is not compatible with the current version.', this.resource); + return undefined; + } + + protected async updateLastSyncUserData(lastSyncRemoteUserData: IRemoteUserData, additionalProps: IStringDictionary = {}): Promise { + if (additionalProps['ref'] || additionalProps['version']) { + throw new Error('Cannot have core properties as additional'); + } + + const lastSyncUserDataState: ILastSyncUserDataState = { + ref: lastSyncRemoteUserData.ref, + version: undefined, + ...additionalProps + }; + + this.storageService.store(`${this.resource}.lastSyncUserData`, JSON.stringify(lastSyncUserDataState), StorageScope.APPLICATION, StorageTarget.MACHINE); + await this.fileService.writeFile(this.lastSyncResource, VSBuffer.fromString(JSON.stringify(lastSyncRemoteUserData))); + } + + protected abstract doInitialize(remoteUserData: IRemoteUserData): Promise; + +} diff --git a/src/vs/platform/userDataSync/common/extensionsSync.ts b/src/vs/platform/userDataSync/common/extensionsSync.ts index c39f1bab57c..5bbed1cfb93 100644 --- a/src/vs/platform/userDataSync/common/extensionsSync.ts +++ b/src/vs/platform/userDataSync/common/extensionsSync.ts @@ -22,11 +22,12 @@ import { ExtensionType, IExtensionIdentifier } from 'vs/platform/extensions/comm import { IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import { ILogService } from 'vs/platform/log/common/log'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview } from 'vs/platform/userDataSync/common/abstractSynchronizer'; +import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { AbstractInitializer, AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview } from 'vs/platform/userDataSync/common/abstractSynchronizer'; import { IMergeResult as IExtensionMergeResult, merge } from 'vs/platform/userDataSync/common/extensionsMerge'; import { IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions'; import { Change, IRemoteUserData, ISyncData, ISyncExtension, IUserDataSyncBackupStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME, ILocalSyncExtension } from 'vs/platform/userDataSync/common/userDataSync'; @@ -568,3 +569,57 @@ export class LocalExtensionsProvider { } } + +export interface IExtensionsInitializerPreviewResult { + readonly installedExtensions: ILocalExtension[]; + readonly disabledExtensions: IExtensionIdentifier[]; + readonly newExtensions: (IExtensionIdentifier & { preRelease: boolean })[]; + readonly remoteExtensions: ISyncExtension[]; +} + +export abstract class AbstractExtensionsInitializer extends AbstractInitializer { + + constructor( + @IExtensionManagementService protected readonly extensionManagementService: IExtensionManagementService, + @IIgnoredExtensionsManagementService private readonly ignoredExtensionsManagementService: IIgnoredExtensionsManagementService, + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @ILogService logService: ILogService, + @IStorageService storageService: IStorageService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + super(SyncResource.Extensions, userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService); + } + + protected async parseExtensions(remoteUserData: IRemoteUserData): Promise { + return remoteUserData.syncData ? await parseAndMigrateExtensions(remoteUserData.syncData, this.extensionManagementService) : null; + } + + protected generatePreview(remoteExtensions: ISyncExtension[], localExtensions: ILocalExtension[]): IExtensionsInitializerPreviewResult { + const installedExtensions: ILocalExtension[] = []; + const newExtensions: (IExtensionIdentifier & { preRelease: boolean })[] = []; + const disabledExtensions: IExtensionIdentifier[] = []; + for (const extension of remoteExtensions) { + if (this.ignoredExtensionsManagementService.hasToNeverSyncExtension(extension.identifier.id)) { + // Skip extension ignored to sync + continue; + } + + const installedExtension = localExtensions.find(i => areSameExtensions(i.identifier, extension.identifier)); + if (installedExtension) { + installedExtensions.push(installedExtension); + if (extension.disabled) { + disabledExtensions.push(extension.identifier); + } + } else if (extension.installed) { + newExtensions.push({ ...extension.identifier, preRelease: !!extension.preRelease }); + if (extension.disabled) { + disabledExtensions.push(extension.identifier); + } + } + } + return { installedExtensions, newExtensions, disabledExtensions, remoteExtensions }; + } + +} diff --git a/src/vs/platform/userDataSync/common/globalStateSync.ts b/src/vs/platform/userDataSync/common/globalStateSync.ts index 18804bf3b64..6f2ebfd43c7 100644 --- a/src/vs/platform/userDataSync/common/globalStateSync.ts +++ b/src/vs/platform/userDataSync/common/globalStateSync.ts @@ -19,15 +19,15 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IFileService } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; import { getServiceMachineId } from 'vs/platform/externalServices/common/serviceMachineId'; -import { IStorageService, StorageTarget } from 'vs/platform/storage/common/storage'; +import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview, isSyncData } from 'vs/platform/userDataSync/common/abstractSynchronizer'; +import { AbstractInitializer, AbstractSynchroniser, getSyncResourceLogLabel, IAcceptResult, IMergeResult, IResourcePreview, isSyncData } from 'vs/platform/userDataSync/common/abstractSynchronizer'; import { edit } from 'vs/platform/userDataSync/common/content'; import { merge } from 'vs/platform/userDataSync/common/globalStateMerge'; import { ALL_SYNC_RESOURCES, Change, createSyncHeaders, getEnablementKey, IGlobalState, IRemoteUserData, IStorageValue, ISyncData, IUserData, IUserDataSyncBackupStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, SYNC_SERVICE_URL_TYPE, UserDataSyncError, UserDataSyncErrorCode, UserDataSyncStoreType, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; import { UserDataSyncStoreClient } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -395,6 +395,59 @@ export class LocalGlobalStateProvider { } } +export class GlobalStateInitializer extends AbstractInitializer { + + constructor( + @IStorageService storageService: IStorageService, + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @IUserDataSyncLogService logService: IUserDataSyncLogService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + super(SyncResource.GlobalState, userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService); + } + + protected async doInitialize(remoteUserData: IRemoteUserData): Promise { + const remoteGlobalState: IGlobalState = remoteUserData.syncData ? JSON.parse(remoteUserData.syncData.content) : null; + if (!remoteGlobalState) { + this.logService.info('Skipping initializing global state because remote global state does not exist.'); + return; + } + + const argv: IStringDictionary = {}; + const storage: IStringDictionary = {}; + for (const key of Object.keys(remoteGlobalState.storage)) { + if (key.startsWith(argvStoragePrefx)) { + argv[key.substring(argvStoragePrefx.length)] = remoteGlobalState.storage[key].value; + } else { + if (this.storageService.get(key, StorageScope.PROFILE) === undefined) { + storage[key] = remoteGlobalState.storage[key].value; + } + } + } + + if (Object.keys(argv).length) { + let content = '{}'; + try { + const fileContent = await this.fileService.readFile(this.environmentService.argvResource); + content = fileContent.value.toString(); + } catch (error) { } + for (const argvProperty of Object.keys(argv)) { + content = edit(content, [argvProperty], argv[argvProperty], {}); + } + await this.fileService.writeFile(this.environmentService.argvResource, VSBuffer.fromString(content)); + } + + if (Object.keys(storage).length) { + for (const key of Object.keys(storage)) { + this.storageService.store(key, storage[key], StorageScope.PROFILE, StorageTarget.USER); + } + } + } + +} + export class UserDataSyncStoreTypeSynchronizer { constructor( diff --git a/src/vs/platform/userDataSync/common/keybindingsSync.ts b/src/vs/platform/userDataSync/common/keybindingsSync.ts index ba0ec9641df..95e228c72fa 100644 --- a/src/vs/platform/userDataSync/common/keybindingsSync.ts +++ b/src/vs/platform/userDataSync/common/keybindingsSync.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { isNonEmptyArray } from 'vs/base/common/arrays'; +import { VSBuffer } from 'vs/base/common/buffer'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Event } from 'vs/base/common/event'; import { parse } from 'vs/base/common/json'; @@ -18,8 +19,8 @@ import { ILogService } from 'vs/platform/log/common/log'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; +import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; import { merge } from 'vs/platform/userDataSync/common/keybindingsMerge'; import { Change, IRemoteUserData, IUserDataSyncBackupStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_SCHEME, CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM } from 'vs/platform/userDataSync/common/userDataSync'; @@ -336,3 +337,55 @@ export class KeybindingsSynchroniser extends AbstractJsonFileSynchroniser implem } } + +export class KeybindingsInitializer extends AbstractInitializer { + + constructor( + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @IUserDataSyncLogService logService: IUserDataSyncLogService, + @IStorageService storageService: IStorageService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + super(SyncResource.Keybindings, userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService); + } + + protected async doInitialize(remoteUserData: IRemoteUserData): Promise { + const keybindingsContent = remoteUserData.syncData ? this.getKeybindingsContentFromSyncContent(remoteUserData.syncData.content) : null; + if (!keybindingsContent) { + this.logService.info('Skipping initializing keybindings because remote keybindings does not exist.'); + return; + } + + const isEmpty = await this.isEmpty(); + if (!isEmpty) { + this.logService.info('Skipping initializing keybindings because local keybindings exist.'); + return; + } + + await this.fileService.writeFile(this.userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsContent)); + + await this.updateLastSyncUserData(remoteUserData); + } + + private async isEmpty(): Promise { + try { + const fileContent = await this.fileService.readFile(this.userDataProfilesService.defaultProfile.settingsResource); + const keybindings = parse(fileContent.value.toString()); + return !isNonEmptyArray(keybindings); + } catch (error) { + return (error).fileOperationResult === FileOperationResult.FILE_NOT_FOUND; + } + } + + private getKeybindingsContentFromSyncContent(syncContent: string): string | null { + try { + return getKeybindingsContentFromSyncContent(syncContent, true, this.logService); + } catch (e) { + this.logService.error(e); + return null; + } + } + +} diff --git a/src/vs/platform/userDataSync/common/settingsSync.ts b/src/vs/platform/userDataSync/common/settingsSync.ts index 6f75623e48c..6a9be85ab7e 100644 --- a/src/vs/platform/userDataSync/common/settingsSync.ts +++ b/src/vs/platform/userDataSync/common/settingsSync.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { VSBuffer } from 'vs/base/common/buffer'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Event } from 'vs/base/common/event'; import { URI } from 'vs/base/common/uri'; @@ -15,8 +16,8 @@ import { FileOperationError, FileOperationResult, IFileService } from 'vs/platfo import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; +import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { AbstractInitializer, AbstractJsonFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; import { edit } from 'vs/platform/userDataSync/common/content'; import { getIgnoredSettings, isEmpty, merge, updateIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge'; import { Change, CONFIGURATION_SYNC_STORE_KEY, IRemoteUserData, IUserDataSyncBackupStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, IUserDataSyncUtilService, SyncResource, UserDataSyncError, UserDataSyncErrorCode, USER_DATA_SYNC_CONFIGURATION_SCOPE, USER_DATA_SYNC_SCHEME, IUserDataResourceManifest } from 'vs/platform/userDataSync/common/userDataSync'; @@ -339,3 +340,54 @@ export class SettingsSynchroniser extends AbstractJsonFileSynchroniser implement } } + +export class SettingsInitializer extends AbstractInitializer { + + constructor( + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @IUserDataSyncLogService logService: IUserDataSyncLogService, + @IStorageService storageService: IStorageService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + super(SyncResource.Settings, userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService); + } + + protected async doInitialize(remoteUserData: IRemoteUserData): Promise { + const settingsSyncContent = remoteUserData.syncData ? this.parseSettingsSyncContent(remoteUserData.syncData.content) : null; + if (!settingsSyncContent) { + this.logService.info('Skipping initializing settings because remote settings does not exist.'); + return; + } + + const isEmpty = await this.isEmpty(); + if (!isEmpty) { + this.logService.info('Skipping initializing settings because local settings exist.'); + return; + } + + await this.fileService.writeFile(this.userDataProfilesService.defaultProfile.settingsResource, VSBuffer.fromString(settingsSyncContent.settings)); + + await this.updateLastSyncUserData(remoteUserData); + } + + private async isEmpty(): Promise { + try { + const fileContent = await this.fileService.readFile(this.userDataProfilesService.defaultProfile.settingsResource); + return isEmpty(fileContent.value.toString().trim()); + } catch (error) { + return (error).fileOperationResult === FileOperationResult.FILE_NOT_FOUND; + } + } + + private parseSettingsSyncContent(syncContent: string): ISettingsSyncContent | null { + try { + return parseSettingsSyncContent(syncContent); + } catch (e) { + this.logService.error(e); + } + return null; + } + +} diff --git a/src/vs/platform/userDataSync/common/snippetsSync.ts b/src/vs/platform/userDataSync/common/snippetsSync.ts index d44638eccf5..7a6a086ca59 100644 --- a/src/vs/platform/userDataSync/common/snippetsSync.ts +++ b/src/vs/platform/userDataSync/common/snippetsSync.ts @@ -15,8 +15,8 @@ import { FileOperationError, FileOperationResult, IFileContent, IFileService, IF import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; +import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { AbstractInitializer, AbstractSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; import { areSame, IMergeResult as ISnippetsMergeResult, merge } from 'vs/platform/userDataSync/common/snippetsMerge'; import { Change, IRemoteUserData, ISyncData, IUserDataSyncBackupStoreService, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; @@ -501,3 +501,52 @@ export class SnippetsSynchroniser extends AbstractSynchroniser implements IUserD return snippets; } } + +export class SnippetsInitializer extends AbstractInitializer { + + constructor( + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @IUserDataSyncLogService logService: IUserDataSyncLogService, + @IStorageService storageService: IStorageService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + super(SyncResource.Snippets, userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService); + } + + protected async doInitialize(remoteUserData: IRemoteUserData): Promise { + const remoteSnippets: IStringDictionary | null = remoteUserData.syncData ? JSON.parse(remoteUserData.syncData.content) : null; + if (!remoteSnippets) { + this.logService.info('Skipping initializing snippets because remote snippets does not exist.'); + return; + } + + const isEmpty = await this.isEmpty(); + if (!isEmpty) { + this.logService.info('Skipping initializing snippets because local snippets exist.'); + return; + } + + for (const key of Object.keys(remoteSnippets)) { + const content = remoteSnippets[key]; + if (content) { + const resource = this.extUri.joinPath(this.userDataProfilesService.defaultProfile.snippetsHome, key); + await this.fileService.createFile(resource, VSBuffer.fromString(content)); + this.logService.info('Created snippet', this.extUri.basename(resource)); + } + } + + await this.updateLastSyncUserData(remoteUserData); + } + + private async isEmpty(): Promise { + try { + const stat = await this.fileService.resolve(this.userDataProfilesService.defaultProfile.snippetsHome); + return !stat.children?.length; + } catch (error) { + return (error).fileOperationResult === FileOperationResult.FILE_NOT_FOUND; + } + } + +} diff --git a/src/vs/platform/userDataSync/common/tasksSync.ts b/src/vs/platform/userDataSync/common/tasksSync.ts index 3c7e1475a69..ae77bac5301 100644 --- a/src/vs/platform/userDataSync/common/tasksSync.ts +++ b/src/vs/platform/userDataSync/common/tasksSync.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { VSBuffer } from 'vs/base/common/buffer'; import { CancellationToken } from 'vs/base/common/cancellation'; import { URI } from 'vs/base/common/uri'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -12,8 +13,8 @@ import { ILogService } from 'vs/platform/log/common/log'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { AbstractFileSynchroniser, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; +import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { AbstractFileSynchroniser, AbstractInitializer, IAcceptResult, IFileResourcePreview, IMergeResult } from 'vs/platform/userDataSync/common/abstractSynchronizer'; import { Change, IRemoteUserData, IUserDataSyncBackupStoreService, IUserDataSyncConfiguration, IUserDataSynchroniser, IUserDataSyncLogService, IUserDataSyncEnablementService, IUserDataSyncStoreService, SyncResource, USER_DATA_SYNC_SCHEME } from 'vs/platform/userDataSync/common/userDataSync'; interface ITasksSyncContent { @@ -244,6 +245,45 @@ export class TasksSynchroniser extends AbstractFileSynchroniser implements IUser } +export class TasksInitializer extends AbstractInitializer { + + private tasksResource = this.userDataProfilesService.defaultProfile.tasksResource; + + constructor( + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @IUserDataSyncLogService logService: IUserDataSyncLogService, + @IStorageService storageService: IStorageService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + super(SyncResource.Tasks, userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService); + } + + protected async doInitialize(remoteUserData: IRemoteUserData): Promise { + const tasksContent = remoteUserData.syncData ? getTasksContentFromSyncContent(remoteUserData.syncData.content, this.logService) : null; + if (!tasksContent) { + this.logService.info('Skipping initializing tasks because remote tasks does not exist.'); + return; + } + + const isEmpty = await this.isEmpty(); + if (!isEmpty) { + this.logService.info('Skipping initializing tasks because local tasks exist.'); + return; + } + + await this.fileService.writeFile(this.tasksResource, VSBuffer.fromString(tasksContent)); + + await this.updateLastSyncUserData(remoteUserData); + } + + private async isEmpty(): Promise { + return this.fileService.exists(this.tasksResource); + } + +} + function merge(originalLocalContent: string | null, originalRemoteContent: string | null, baseContent: string | null): { content: string | null; hasLocalChanged: boolean; diff --git a/src/vs/platform/userDataSync/common/userDataSync.ts b/src/vs/platform/userDataSync/common/userDataSync.ts index c3bd150dfeb..eb52d29bd75 100644 --- a/src/vs/platform/userDataSync/common/userDataSync.ts +++ b/src/vs/platform/userDataSync/common/userDataSync.ts @@ -423,6 +423,10 @@ export interface IUserDataSyncResourceError extends IUserDataSyncResource { readonly error: UserDataSyncError; } +export interface IUserDataInitializer { + initialize(userData: IUserData): Promise; +} + export interface IUserDataSynchroniser { readonly resource: SyncResource; diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts index 9ff45090e6a..7a13fa96855 100644 --- a/src/vs/workbench/browser/web.main.ts +++ b/src/vs/workbench/browser/web.main.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { mark } from 'vs/base/common/performance'; import { domContentLoaded, detectFullscreen, getCookieValue } from 'vs/base/browser/dom'; import { assertIsDefined } from 'vs/base/common/types'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; @@ -44,6 +45,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IndexedDBFileSystemProviderErrorDataClassification, IndexedDBFileSystemProvider, IndexedDBFileSystemProviderErrorData } from 'vs/platform/files/browser/indexedDBFileSystemProvider'; import { BrowserRequestService } from 'vs/workbench/services/request/browser/requestService'; import { IRequestService } from 'vs/platform/request/common/request'; +import { IUserDataInitializationService, UserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit'; import { UserDataSyncStoreManagementService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; import { IUserDataSyncStoreManagementService } from 'vs/platform/userDataSync/common/userDataSync'; import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; @@ -79,6 +81,7 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { UserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfileService'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; import { BrowserUserDataProfilesService } from 'vs/platform/userDataProfile/browser/userDataProfile'; +import { timeout } from 'vs/base/common/async'; import { rendererLogId } from 'vs/workbench/common/logConstants'; import { LogService } from 'vs/platform/log/common/logService'; @@ -359,9 +362,38 @@ export class BrowserMain extends Disposable { const credentialsService = new BrowserCredentialsService(environmentService, remoteAgentService, productService); serviceCollection.set(ICredentialsService, credentialsService); + // Userdata Initialize Service + const userDataInitializationService = new UserDataInitializationService(environmentService, credentialsService, userDataSyncStoreManagementService, fileService, userDataProfilesService, storageService, productService, requestService, logService, uriIdentityService); + serviceCollection.set(IUserDataInitializationService, userDataInitializationService); + + try { + await Promise.race([ + // Do not block more than 5s + timeout(5000), + this.initializeUserData(userDataInitializationService, configurationService)] + ); + } catch (error) { + logService.error(error); + } + return { serviceCollection, configurationService, logService }; } + private async initializeUserData(userDataInitializationService: UserDataInitializationService, configurationService: WorkspaceService) { + if (await userDataInitializationService.requiresInitialization()) { + mark('code/willInitRequiredUserData'); + + // Initialize required resources - settings & global state + await userDataInitializationService.initializeRequiredResources(); + + // Important: Reload only local user configuration after initializing + // Reloading complete configuration blocks workbench until remote configuration is loaded. + await configurationService.reloadLocalUserConfiguration(); + + mark('code/didInitRequiredUserData'); + } + } + private async registerFileSystemProviders(environmentService: IWorkbenchEnvironmentService, fileService: IWorkbenchFileService, remoteAgentService: IRemoteAgentService, bufferLogger: BufferLogger, logService: ILogService, loggerService: ILoggerService, logsPath: URI): Promise { // IndexedDB is used for logging and user data diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts index f43bc2b7798..2cf602e6072 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts @@ -24,6 +24,7 @@ import { IExtensionRecommendationNotificationService } from 'vs/platform/extensi import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; import { ExtensionRecommendationNotificationServiceChannel } from 'vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc'; import { Codicon } from 'vs/base/common/codicons'; +import { RemoteExtensionsInitializerContribution } from 'vs/workbench/contrib/extensions/electron-sandbox/remoteExtensionsInit'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ExtensionHostProfileService } from 'vs/workbench/contrib/extensions/electron-sandbox/extensionProfileService'; import { ExtensionsAutoProfiler } from 'vs/workbench/contrib/extensions/electron-sandbox/extensionsAutoProfiler'; @@ -69,6 +70,7 @@ class ExtensionsContributions implements IWorkbenchContribution { const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); workbenchRegistry.registerWorkbenchContribution(ExtensionsContributions, LifecyclePhase.Restored); workbenchRegistry.registerWorkbenchContribution(ExtensionsAutoProfiler, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(RemoteExtensionsInitializerContribution, LifecyclePhase.Restored); // Register Commands CommandsRegistry.registerCommand(DebugExtensionHostAction.ID, (accessor: ServicesAccessor) => { diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/remoteExtensionsInit.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/remoteExtensionsInit.ts new file mode 100644 index 00000000000..f323ded3750 --- /dev/null +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/remoteExtensionsInit.ts @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { IFileService } from 'vs/platform/files/common/files'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import { ILogService } from 'vs/platform/log/common/log'; +import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; +import { IStorageService, IS_NEW_KEY, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; +import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { AbstractExtensionsInitializer } from 'vs/platform/userDataSync/common/extensionsSync'; +import { IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions'; +import { IRemoteUserData, IUserDataSyncStoreManagementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync'; +import { UserDataSyncStoreClient } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; +import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; +import { IAuthenticationService } from 'vs/workbench/services/authentication/common/authentication'; +import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService'; +import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; + +export class RemoteExtensionsInitializerContribution implements IWorkbenchContribution { + constructor( + @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, + @IStorageService private readonly storageService: IStorageService, + @IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService, + @IUserDataSyncStoreManagementService private readonly userDataSyncStoreManagementService: IUserDataSyncStoreManagementService, + @IInstantiationService private readonly instantiationService: IInstantiationService, + @ILogService private readonly logService: ILogService, + @IAuthenticationService private readonly authenticationService: IAuthenticationService, + @IRemoteAuthorityResolverService private readonly remoteAuthorityResolverService: IRemoteAuthorityResolverService, + ) { + this.initializeRemoteExtensions(); + } + + private async initializeRemoteExtensions(): Promise { + const connection = this.remoteAgentService.getConnection(); + const localExtensionManagementServer = this.extensionManagementServerService.localExtensionManagementServer; + const remoteExtensionManagementServer = this.extensionManagementServerService.remoteExtensionManagementServer; + // Skip: Not a remote window + if (!connection || !remoteExtensionManagementServer) { + return; + } + // Skip: Not a native window + if (!localExtensionManagementServer) { + return; + } + // Skip: No UserdataSyncStore is configured + if (!this.userDataSyncStoreManagementService.userDataSyncStore) { + return; + } + const newRemoteConnectionKey = `${IS_NEW_KEY}.${connection.remoteAuthority}`; + // Skip: Not a new remote connection + if (!this.storageService.getBoolean(newRemoteConnectionKey, StorageScope.APPLICATION, true)) { + this.logService.trace(`Skipping initializing remote extensions because the window with this remote authority was opened before.`); + return; + } + this.storageService.store(newRemoteConnectionKey, false, StorageScope.APPLICATION, StorageTarget.MACHINE); + // Skip: Not a new workspace + if (!this.storageService.isNew(StorageScope.WORKSPACE)) { + this.logService.trace(`Skipping initializing remote extensions because this workspace was opened before.`); + return; + } + // Skip: No account is provided to initialize + const resolvedAuthority = await this.remoteAuthorityResolverService.resolveAuthority(connection.remoteAuthority); + if (!resolvedAuthority.options?.authenticationSession) { + return; + } + + const sessions = await this.authenticationService.getSessions(resolvedAuthority.options?.authenticationSession.providerId); + const session = sessions.find(s => s.id === resolvedAuthority.options?.authenticationSession?.id); + // Skip: Session is not found + if (!session) { + this.logService.info('Skipping initializing remote extensions because the account with given session id is not found', resolvedAuthority.options.authenticationSession.id); + return; + } + + const userDataSyncStoreClient = this.instantiationService.createInstance(UserDataSyncStoreClient, this.userDataSyncStoreManagementService.userDataSyncStore.url); + userDataSyncStoreClient.setAuthToken(session.accessToken, resolvedAuthority.options.authenticationSession.providerId); + const userData = await userDataSyncStoreClient.readResource(SyncResource.Extensions, null); + + const serviceCollection = new ServiceCollection(); + serviceCollection.set(IExtensionManagementService, remoteExtensionManagementServer.extensionManagementService); + const instantiationService = this.instantiationService.createChild(serviceCollection); + const extensionsToInstallInitializer = instantiationService.createInstance(RemoteExtensionsInitializer); + + await extensionsToInstallInitializer.initialize(userData); + } +} + +class RemoteExtensionsInitializer extends AbstractExtensionsInitializer { + + constructor( + @IExtensionManagementService extensionManagementService: IExtensionManagementService, + @IIgnoredExtensionsManagementService ignoredExtensionsManagementService: IIgnoredExtensionsManagementService, + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @ILogService logService: ILogService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, + @IStorageService storageService: IStorageService, + @IExtensionManifestPropertiesService private readonly extensionManifestPropertiesService: IExtensionManifestPropertiesService, + ) { + super(extensionManagementService, ignoredExtensionsManagementService, fileService, userDataProfilesService, environmentService, logService, storageService, uriIdentityService); + } + + protected override async doInitialize(remoteUserData: IRemoteUserData): Promise { + const remoteExtensions = await this.parseExtensions(remoteUserData); + if (!remoteExtensions) { + this.logService.info('No synced extensions exist while initializing remote extensions.'); + return; + } + const installedExtensions = await this.extensionManagementService.getInstalled(); + const { newExtensions } = this.generatePreview(remoteExtensions, installedExtensions); + if (!newExtensions.length) { + this.logService.trace('No new remote extensions to install.'); + return; + } + const targetPlatform = await this.extensionManagementService.getTargetPlatform(); + const extensionsToInstall = await this.extensionGalleryService.getExtensions(newExtensions, { targetPlatform, compatible: true }, CancellationToken.None); + if (extensionsToInstall.length) { + await Promise.allSettled(extensionsToInstall.map(async e => { + const manifest = await this.extensionGalleryService.getManifest(e, CancellationToken.None); + if (manifest && this.extensionManifestPropertiesService.canExecuteOnWorkspace(manifest)) { + const syncedExtension = remoteExtensions.find(e => areSameExtensions(e.identifier, e.identifier)); + await this.extensionManagementService.installFromGallery(e, { installPreReleaseVersion: syncedExtension?.preRelease, donotIncludePackAndDependencies: true }); + } + })); + } + } +} diff --git a/src/vs/workbench/services/extensions/browser/extensionService.ts b/src/vs/workbench/services/extensions/browser/extensionService.ts index 496d82be53a..6e69078bd0f 100644 --- a/src/vs/workbench/services/extensions/browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/browser/extensionService.ts @@ -27,6 +27,7 @@ import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remot import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService'; +import { IUserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit'; import { IAutomatedWindow } from 'vs/platform/log/browser/log'; import { ILogService } from 'vs/platform/log/common/log'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; @@ -56,6 +57,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten @IRemoteExtensionsScannerService remoteExtensionsScannerService: IRemoteExtensionsScannerService, @ILifecycleService lifecycleService: ILifecycleService, @IRemoteAuthorityResolverService private readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService, + @IUserDataInitializationService private readonly _userDataInitializationService: IUserDataInitializationService, @IUserDataProfileService userDataProfileService: IUserDataProfileService, ) { super( @@ -77,7 +79,11 @@ export class ExtensionService extends AbstractExtensionService implements IExten userDataProfileService ); - lifecycleService.when(LifecyclePhase.Ready).then(() => this._initialize()); + // Initialize installed extensions first and do it only after workbench is ready + lifecycleService.when(LifecyclePhase.Ready).then(async () => { + await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService); + this._initialize(); + }); this._initFetchFileSystem(); } diff --git a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts index 07950da24cc..41b75f7daf4 100644 --- a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts @@ -37,6 +37,7 @@ import { isWeb } from 'vs/base/common/platform'; import { ColorScheme } from 'vs/platform/theme/common/theme'; import { IHostColorSchemeService } from 'vs/workbench/services/themes/common/hostColorSchemeService'; import { RunOnceScheduler, Sequencer } from 'vs/base/common/async'; +import { IUserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit'; import { getIconsStyleSheet } from 'vs/platform/theme/browser/iconsStyleSheet'; import { asCssVariableName, getColorRegistry } from 'vs/platform/theme/common/colorRegistry'; import { ILanguageService } from 'vs/editor/common/languages/language'; @@ -114,6 +115,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @ILogService private readonly logService: ILogService, @IHostColorSchemeService private readonly hostColorService: IHostColorSchemeService, + @IUserDataInitializationService userDataInitializationService: IUserDataInitializationService, @ILanguageService languageService: ILanguageService ) { this.container = layoutService.container; @@ -175,7 +177,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { this.applyAndSetProductIconTheme(productIconData, true); } - Promise.all([extensionService.whenInstalledExtensionsRegistered()]).then(_ => { + Promise.all([extensionService.whenInstalledExtensionsRegistered(), userDataInitializationService.whenInitializationFinished()]).then(_ => { this.installConfigurationListener(); this.installPreferredSchemeListener(); this.installRegistryListeners(); diff --git a/src/vs/workbench/services/userData/browser/userDataInit.ts b/src/vs/workbench/services/userData/browser/userDataInit.ts new file mode 100644 index 00000000000..308deacf6a3 --- /dev/null +++ b/src/vs/workbench/services/userData/browser/userDataInit.ts @@ -0,0 +1,455 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { AbstractExtensionsInitializer, IExtensionsInitializerPreviewResult } from 'vs/platform/userDataSync/common/extensionsSync'; +import { GlobalStateInitializer, UserDataSyncStoreTypeSynchronizer } from 'vs/platform/userDataSync/common/globalStateSync'; +import { KeybindingsInitializer } from 'vs/platform/userDataSync/common/keybindingsSync'; +import { SettingsInitializer } from 'vs/platform/userDataSync/common/settingsSync'; +import { SnippetsInitializer } from 'vs/platform/userDataSync/common/snippetsSync'; +import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; +import { IFileService } from 'vs/platform/files/common/files'; +import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { ILogService } from 'vs/platform/log/common/log'; +import { UserDataSyncStoreClient } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; +import { IProductService } from 'vs/platform/product/common/productService'; +import { IRequestService } from 'vs/platform/request/common/request'; +import { IRemoteUserData, IUserData, IUserDataInitializer, IUserDataSyncLogService, IUserDataSyncStoreManagementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync'; +import { AuthenticationSessionInfo, getCurrentAuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService'; +import { getSyncAreaLabel } from 'vs/workbench/services/userDataSync/common/userDataSync'; +import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions } from 'vs/workbench/common/contributions'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; +import { isWeb } from 'vs/base/common/platform'; +import { Barrier, Promises } from 'vs/base/common/async'; +import { IExtensionGalleryService, IExtensionManagementService, IGlobalExtensionEnablementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IExtensionService, toExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; +import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { mark } from 'vs/base/common/performance'; +import { IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions'; +import { DisposableStore } from 'vs/base/common/lifecycle'; +import { isEqual } from 'vs/base/common/resources'; +import { CancellationToken } from 'vs/base/common/cancellation'; +import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; +import { IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage'; +import { ICredentialsService } from 'vs/platform/credentials/common/credentials'; +import { TasksInitializer } from 'vs/platform/userDataSync/common/tasksSync'; +import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; + +export const IUserDataInitializationService = createDecorator('IUserDataInitializationService'); +export interface IUserDataInitializationService { + _serviceBrand: any; + + requiresInitialization(): Promise; + whenInitializationFinished(): Promise; + initializeRequiredResources(): Promise; + initializeInstalledExtensions(instantiationService: IInstantiationService): Promise; + initializeOtherResources(instantiationService: IInstantiationService): Promise; +} + +export class UserDataInitializationService implements IUserDataInitializationService { + + _serviceBrand: any; + + private readonly initialized: SyncResource[] = []; + private readonly initializationFinished = new Barrier(); + private globalStateUserData: IUserData | null = null; + + constructor( + @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, + @ICredentialsService private readonly credentialsService: ICredentialsService, + @IUserDataSyncStoreManagementService private readonly userDataSyncStoreManagementService: IUserDataSyncStoreManagementService, + @IFileService private readonly fileService: IFileService, + @IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService, + @IStorageService private readonly storageService: IStorageService, + @IProductService private readonly productService: IProductService, + @IRequestService private readonly requestService: IRequestService, + @ILogService private readonly logService: ILogService, + @IUriIdentityService private readonly uriIdentityService: IUriIdentityService, + ) { + this.createUserDataSyncStoreClient().then(userDataSyncStoreClient => { + if (!userDataSyncStoreClient) { + this.initializationFinished.open(); + } + }); + } + + private _userDataSyncStoreClientPromise: Promise | undefined; + private createUserDataSyncStoreClient(): Promise { + if (!this._userDataSyncStoreClientPromise) { + this._userDataSyncStoreClientPromise = (async (): Promise => { + try { + if (!isWeb) { + this.logService.trace(`Skipping initializing user data in desktop`); + return; + } + + if (!this.storageService.isNew(StorageScope.APPLICATION)) { + this.logService.trace(`Skipping initializing user data as application was opened before`); + return; + } + + if (!this.storageService.isNew(StorageScope.WORKSPACE)) { + this.logService.trace(`Skipping initializing user data as workspace was opened before`); + return; + } + + let authenticationSession; + try { + authenticationSession = await getCurrentAuthenticationSessionInfo(this.credentialsService, this.productService); + } catch (error) { + this.logService.error(error); + } + if (!authenticationSession) { + this.logService.trace(`Skipping initializing user data as authentication session is not set`); + return; + } + + await this.initializeUserDataSyncStore(authenticationSession); + + const userDataSyncStore = this.userDataSyncStoreManagementService.userDataSyncStore; + if (!userDataSyncStore) { + this.logService.trace(`Skipping initializing user data as sync service is not provided`); + return; + } + + const userDataSyncStoreClient = new UserDataSyncStoreClient(userDataSyncStore.url, this.productService, this.requestService, this.logService, this.environmentService, this.fileService, this.storageService); + userDataSyncStoreClient.setAuthToken(authenticationSession.accessToken, authenticationSession.providerId); + + const manifest = await userDataSyncStoreClient.manifest(null); + if (manifest === null) { + userDataSyncStoreClient.dispose(); + this.logService.trace(`Skipping initializing user data as there is no data`); + return; + } + + this.logService.info(`Using settings sync service ${userDataSyncStore.url.toString()} for initialization`); + return userDataSyncStoreClient; + + } catch (error) { + this.logService.error(error); + return; + } + })(); + } + + return this._userDataSyncStoreClientPromise; + } + + private async initializeUserDataSyncStore(authenticationSession: AuthenticationSessionInfo): Promise { + const userDataSyncStore = this.userDataSyncStoreManagementService.userDataSyncStore; + if (!userDataSyncStore?.canSwitch) { + return; + } + + const disposables = new DisposableStore(); + try { + const userDataSyncStoreClient = disposables.add(new UserDataSyncStoreClient(userDataSyncStore.url, this.productService, this.requestService, this.logService, this.environmentService, this.fileService, this.storageService)); + userDataSyncStoreClient.setAuthToken(authenticationSession.accessToken, authenticationSession.providerId); + + // Cache global state data for global state initialization + this.globalStateUserData = await userDataSyncStoreClient.readResource(SyncResource.GlobalState, null); + + if (this.globalStateUserData) { + const userDataSyncStoreType = new UserDataSyncStoreTypeSynchronizer(userDataSyncStoreClient, this.storageService, this.environmentService, this.fileService, this.logService).getSyncStoreType(this.globalStateUserData); + if (userDataSyncStoreType) { + await this.userDataSyncStoreManagementService.switch(userDataSyncStoreType); + + // Unset cached global state data if urls are changed + if (!isEqual(userDataSyncStore.url, this.userDataSyncStoreManagementService.userDataSyncStore?.url)) { + this.logService.info('Switched settings sync store'); + this.globalStateUserData = null; + } + } + } + } finally { + disposables.dispose(); + } + } + + async whenInitializationFinished(): Promise { + await this.initializationFinished.wait(); + } + + async requiresInitialization(): Promise { + this.logService.trace(`UserDataInitializationService#requiresInitialization`); + const userDataSyncStoreClient = await this.createUserDataSyncStoreClient(); + return !!userDataSyncStoreClient; + } + + async initializeRequiredResources(): Promise { + this.logService.trace(`UserDataInitializationService#initializeRequiredResources`); + return this.initialize([SyncResource.Settings, SyncResource.GlobalState]); + } + + async initializeOtherResources(instantiationService: IInstantiationService): Promise { + try { + this.logService.trace(`UserDataInitializationService#initializeOtherResources`); + await Promise.allSettled([this.initialize([SyncResource.Keybindings, SyncResource.Snippets, SyncResource.Tasks]), this.initializeExtensions(instantiationService)]); + } finally { + this.initializationFinished.open(); + } + } + + private async initializeExtensions(instantiationService: IInstantiationService): Promise { + try { + await Promise.all([this.initializeInstalledExtensions(instantiationService), this.initializeNewExtensions(instantiationService)]); + } finally { + this.initialized.push(SyncResource.Extensions); + } + } + + private initializeInstalledExtensionsPromise: Promise | undefined; + async initializeInstalledExtensions(instantiationService: IInstantiationService): Promise { + if (!this.initializeInstalledExtensionsPromise) { + this.initializeInstalledExtensionsPromise = (async () => { + this.logService.trace(`UserDataInitializationService#initializeInstalledExtensions`); + const extensionsPreviewInitializer = await this.getExtensionsPreviewInitializer(instantiationService); + if (extensionsPreviewInitializer) { + await instantiationService.createInstance(InstalledExtensionsInitializer, extensionsPreviewInitializer).initialize(); + } + })(); + } + return this.initializeInstalledExtensionsPromise; + } + + private initializeNewExtensionsPromise: Promise | undefined; + private async initializeNewExtensions(instantiationService: IInstantiationService): Promise { + if (!this.initializeNewExtensionsPromise) { + this.initializeNewExtensionsPromise = (async () => { + this.logService.trace(`UserDataInitializationService#initializeNewExtensions`); + const extensionsPreviewInitializer = await this.getExtensionsPreviewInitializer(instantiationService); + if (extensionsPreviewInitializer) { + await instantiationService.createInstance(NewExtensionsInitializer, extensionsPreviewInitializer).initialize(); + } + })(); + } + return this.initializeNewExtensionsPromise; + } + + private extensionsPreviewInitializerPromise: Promise | undefined; + private getExtensionsPreviewInitializer(instantiationService: IInstantiationService): Promise { + if (!this.extensionsPreviewInitializerPromise) { + this.extensionsPreviewInitializerPromise = (async () => { + const userDataSyncStoreClient = await this.createUserDataSyncStoreClient(); + if (!userDataSyncStoreClient) { + return null; + } + const userData = await userDataSyncStoreClient.readResource(SyncResource.Extensions, null); + return instantiationService.createInstance(ExtensionsPreviewInitializer, userData); + })(); + } + return this.extensionsPreviewInitializerPromise; + } + + private async initialize(syncResources: SyncResource[]): Promise { + const userDataSyncStoreClient = await this.createUserDataSyncStoreClient(); + if (!userDataSyncStoreClient) { + return; + } + + await Promises.settled(syncResources.map(async syncResource => { + try { + if (this.initialized.includes(syncResource)) { + this.logService.info(`${getSyncAreaLabel(syncResource)} initialized already.`); + return; + } + this.initialized.push(syncResource); + this.logService.trace(`Initializing ${getSyncAreaLabel(syncResource)}`); + const initializer = this.createSyncResourceInitializer(syncResource); + const userData = await userDataSyncStoreClient.readResource(syncResource, syncResource === SyncResource.GlobalState ? this.globalStateUserData : null); + await initializer.initialize(userData); + this.logService.info(`Initialized ${getSyncAreaLabel(syncResource)}`); + } catch (error) { + this.logService.info(`Error while initializing ${getSyncAreaLabel(syncResource)}`); + this.logService.error(error); + } + })); + } + + private createSyncResourceInitializer(syncResource: SyncResource): IUserDataInitializer { + switch (syncResource) { + case SyncResource.Settings: return new SettingsInitializer(this.fileService, this.userDataProfilesService, this.environmentService, this.logService, this.storageService, this.uriIdentityService); + case SyncResource.Keybindings: return new KeybindingsInitializer(this.fileService, this.userDataProfilesService, this.environmentService, this.logService, this.storageService, this.uriIdentityService); + case SyncResource.Tasks: return new TasksInitializer(this.fileService, this.userDataProfilesService, this.environmentService, this.logService, this.storageService, this.uriIdentityService); + case SyncResource.Snippets: return new SnippetsInitializer(this.fileService, this.userDataProfilesService, this.environmentService, this.logService, this.storageService, this.uriIdentityService); + case SyncResource.GlobalState: return new GlobalStateInitializer(this.storageService, this.fileService, this.userDataProfilesService, this.environmentService, this.logService, this.uriIdentityService); + } + throw new Error(`Cannot create initializer for ${syncResource}`); + } + +} + +class ExtensionsPreviewInitializer extends AbstractExtensionsInitializer { + + private previewPromise: Promise | undefined; + private preview: IExtensionsInitializerPreviewResult | null = null; + + constructor( + private readonly extensionsData: IUserData, + @IExtensionManagementService extensionManagementService: IExtensionManagementService, + @IIgnoredExtensionsManagementService ignoredExtensionsManagementService: IIgnoredExtensionsManagementService, + @IFileService fileService: IFileService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IEnvironmentService environmentService: IEnvironmentService, + @IUserDataSyncLogService logService: IUserDataSyncLogService, + @IStorageService storageService: IStorageService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + ) { + super(extensionManagementService, ignoredExtensionsManagementService, fileService, userDataProfilesService, environmentService, logService, storageService, uriIdentityService); + } + + getPreview(): Promise { + if (!this.previewPromise) { + this.previewPromise = super.initialize(this.extensionsData).then(() => this.preview); + } + return this.previewPromise; + } + + override initialize(): Promise { + throw new Error('should not be called directly'); + } + + protected override async doInitialize(remoteUserData: IRemoteUserData): Promise { + const remoteExtensions = await this.parseExtensions(remoteUserData); + if (!remoteExtensions) { + this.logService.info('Skipping initializing extensions because remote extensions does not exist.'); + return; + } + const installedExtensions = await this.extensionManagementService.getInstalled(); + this.preview = this.generatePreview(remoteExtensions, installedExtensions); + } +} + +class InstalledExtensionsInitializer implements IUserDataInitializer { + + constructor( + private readonly extensionsPreviewInitializer: ExtensionsPreviewInitializer, + @IGlobalExtensionEnablementService private readonly extensionEnablementService: IGlobalExtensionEnablementService, + @IExtensionStorageService private readonly extensionStorageService: IExtensionStorageService, + @IUserDataSyncLogService private readonly logService: IUserDataSyncLogService, + ) { + } + + async initialize(): Promise { + const preview = await this.extensionsPreviewInitializer.getPreview(); + if (!preview) { + return; + } + + // 1. Initialise already installed extensions state + for (const installedExtension of preview.installedExtensions) { + const syncExtension = preview.remoteExtensions.find(({ identifier }) => areSameExtensions(identifier, installedExtension.identifier)); + if (syncExtension?.state) { + const extensionState = this.extensionStorageService.getExtensionState(installedExtension, true) || {}; + Object.keys(syncExtension.state).forEach(key => extensionState[key] = syncExtension.state![key]); + this.extensionStorageService.setExtensionState(installedExtension, extensionState, true); + } + } + + // 2. Initialise extensions enablement + if (preview.disabledExtensions.length) { + for (const identifier of preview.disabledExtensions) { + this.logService.trace(`Disabling extension...`, identifier.id); + await this.extensionEnablementService.disableExtension(identifier); + this.logService.info(`Disabling extension`, identifier.id); + } + } + } +} + +class NewExtensionsInitializer implements IUserDataInitializer { + + constructor( + private readonly extensionsPreviewInitializer: ExtensionsPreviewInitializer, + @IExtensionService private readonly extensionService: IExtensionService, + @IExtensionStorageService private readonly extensionStorageService: IExtensionStorageService, + @IExtensionGalleryService private readonly galleryService: IExtensionGalleryService, + @IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService, + @IUserDataSyncLogService private readonly logService: IUserDataSyncLogService, + ) { + } + + async initialize(): Promise { + const preview = await this.extensionsPreviewInitializer.getPreview(); + if (!preview) { + return; + } + + const newlyEnabledExtensions: ILocalExtension[] = []; + const targetPlatform = await this.extensionManagementService.getTargetPlatform(); + const galleryExtensions = await this.galleryService.getExtensions(preview.newExtensions, { targetPlatform, compatible: true }, CancellationToken.None); + for (const galleryExtension of galleryExtensions) { + try { + const extensionToSync = preview.remoteExtensions.find(({ identifier }) => areSameExtensions(identifier, galleryExtension.identifier)); + if (!extensionToSync) { + continue; + } + if (extensionToSync.state) { + this.extensionStorageService.setExtensionState(galleryExtension, extensionToSync.state, true); + } + this.logService.trace(`Installing extension...`, galleryExtension.identifier.id); + const local = await this.extensionManagementService.installFromGallery(galleryExtension, { + isMachineScoped: false, /* set isMachineScoped to prevent install and sync dialog in web */ + donotIncludePackAndDependencies: true, + installGivenVersion: !!extensionToSync.version, + installPreReleaseVersion: extensionToSync.preRelease + }); + if (!preview.disabledExtensions.some(identifier => areSameExtensions(identifier, galleryExtension.identifier))) { + newlyEnabledExtensions.push(local); + } + this.logService.info(`Installed extension.`, galleryExtension.identifier.id); + } catch (error) { + this.logService.error(error); + } + } + + const canEnabledExtensions = newlyEnabledExtensions.filter(e => this.extensionService.canAddExtension(toExtensionDescription(e))); + if (!(await this.areExtensionsRunning(canEnabledExtensions))) { + await new Promise((c, e) => { + const disposable = this.extensionService.onDidChangeExtensions(async () => { + try { + if (await this.areExtensionsRunning(canEnabledExtensions)) { + disposable.dispose(); + c(); + } + } catch (error) { + e(error); + } + }); + }); + } + } + + private async areExtensionsRunning(extensions: ILocalExtension[]): Promise { + await this.extensionService.whenInstalledExtensionsRegistered(); + const runningExtensions = this.extensionService.extensions; + return extensions.every(e => runningExtensions.some(r => areSameExtensions({ id: r.identifier.value }, e.identifier))); + } +} + +class InitializeOtherResourcesContribution implements IWorkbenchContribution { + constructor( + @IUserDataInitializationService userDataInitializeService: IUserDataInitializationService, + @IInstantiationService instantiationService: IInstantiationService, + @IExtensionService extensionService: IExtensionService + ) { + extensionService.whenInstalledExtensionsRegistered().then(() => this.initializeOtherResource(userDataInitializeService, instantiationService)); + } + + private async initializeOtherResource(userDataInitializeService: IUserDataInitializationService, instantiationService: IInstantiationService): Promise { + if (await userDataInitializeService.requiresInitialization()) { + mark('code/willInitOtherUserData'); + await userDataInitializeService.initializeOtherResources(instantiationService); + mark('code/didInitOtherUserData'); + } + } +} + +if (isWeb) { + const workbenchRegistry = Registry.as(Extensions.Workbench); + workbenchRegistry.registerWorkbenchContribution(InitializeOtherResourcesContribution, LifecyclePhase.Restored); +} diff --git a/src/vs/workbench/workbench.desktop.main.ts b/src/vs/workbench/workbench.desktop.main.ts index 421408a15b3..20ec06a9b8d 100644 --- a/src/vs/workbench/workbench.desktop.main.ts +++ b/src/vs/workbench/workbench.desktop.main.ts @@ -89,9 +89,11 @@ import 'vs/workbench/services/extensions/electron-sandbox/nativeExtensionService import 'vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { IUserDataInitializationService, UserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit'; import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService'; +registerSingleton(IUserDataInitializationService, UserDataInitializationService, InstantiationType.Delayed); registerSingleton(IExtensionsProfileScannerService, ExtensionsProfileScannerService, InstantiationType.Delayed); From 79bf64bb7afb1560cc183471692164ead7e88b95 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Wed, 22 Feb 2023 10:57:11 -0600 Subject: [PATCH 044/206] fix issues with tab move focus mode (#175135) --- src/vs/editor/browser/config/tabFocus.ts | 9 +++------ .../browser/parts/editor/editorStatus.ts | 15 ++++++++++++++- .../terminal/browser/terminalMainContribution.ts | 15 +-------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/vs/editor/browser/config/tabFocus.ts b/src/vs/editor/browser/config/tabFocus.ts index 8c81ea51fe1..3575cfed1af 100644 --- a/src/vs/editor/browser/config/tabFocus.ts +++ b/src/vs/editor/browser/config/tabFocus.ts @@ -14,23 +14,20 @@ class TabFocusImpl { private _tabFocusTerminal: boolean = false; private _tabFocusEditor: boolean = false; - private readonly _onDidChangeTabFocus = new Emitter(); - public readonly onDidChangeTabFocus: Event = this._onDidChangeTabFocus.event; + private readonly _onDidChangeTabFocus = new Emitter(); + public readonly onDidChangeTabFocus: Event = this._onDidChangeTabFocus.event; public getTabFocusMode(context: TabFocusContext): boolean { return context === TabFocusContext.Terminal ? this._tabFocusTerminal : this._tabFocusEditor; } public setTabFocusMode(tabFocusMode: boolean, context: TabFocusContext): void { - if ((context === TabFocusContext.Terminal && this._tabFocusTerminal === tabFocusMode) || (context === TabFocusContext.Editor && this._tabFocusEditor === tabFocusMode)) { - return; - } if (context === TabFocusContext.Terminal) { this._tabFocusTerminal = tabFocusMode; } else { this._tabFocusEditor = tabFocusMode; } - this._onDidChangeTabFocus.fire(this._tabFocusTerminal); + this._onDidChangeTabFocus.fire(); } } diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 6c794b28795..322a661a637 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -294,7 +294,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution { private readonly languageElement = this._register(new MutableDisposable()); private readonly metadataElement = this._register(new MutableDisposable()); private readonly currentProblemStatus: ShowCurrentMarkerInStatusbarContribution = this._register(this.instantiationService.createInstance(ShowCurrentMarkerInStatusbarContribution)); - + private _previousViewContext: 'terminal' | 'editor' | undefined; private readonly state = new State(); private readonly activeEditorListeners = this._register(new DisposableStore()); private readonly delayedRender = this._register(new MutableDisposable()); @@ -321,6 +321,19 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution { this._register(this.textFileService.untitled.onDidChangeEncoding(model => this.onResourceEncodingChange(model.resource))); this._register(this.textFileService.files.onDidChangeEncoding(model => this.onResourceEncodingChange((model.resource)))); this._register(Event.runAndSubscribe(TabFocus.onDidChangeTabFocus, () => this.onTabFocusModeChange())); + const viewKey = new Set(); + viewKey.add('focusedView'); + this._register(this.contextKeyService.onDidChangeContext((c) => { + if (c.affectsSome(viewKey)) { + const terminalFocus = this.contextKeyService.getContextKeyValue('focusedView') === 'terminal'; + const context = terminalFocus ? 'terminal' : 'editor'; + if (this._previousViewContext === context) { + return; + } + this._previousViewContext = context; + this.onTabFocusModeChange(); + } + })); } private registerCommands(): void { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalMainContribution.ts b/src/vs/workbench/contrib/terminal/browser/terminalMainContribution.ts index 1e678191506..9cdbc99e190 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalMainContribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalMainContribution.ts @@ -7,7 +7,6 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { Schemas } from 'vs/base/common/network'; import { TabFocus, TabFocusContext } from 'vs/editor/browser/config/tabFocus'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ILabelService } from 'vs/platform/label/common/label'; import { TerminalSettingId } from 'vs/platform/terminal/common/terminal'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; @@ -27,8 +26,7 @@ export class TerminalMainContribution extends Disposable implements IWorkbenchCo @ITerminalService terminalService: ITerminalService, @ITerminalEditorService terminalEditorService: ITerminalEditorService, @ITerminalGroupService terminalGroupService: ITerminalGroupService, - @IConfigurationService configurationService: IConfigurationService, - @IContextKeyService contextKeyService: IContextKeyService + @IConfigurationService configurationService: IConfigurationService ) { super(); @@ -75,18 +73,7 @@ export class TerminalMainContribution extends Disposable implements IWorkbenchCo } }); - const viewKey = new Set(); - viewKey.add('focusedView'); TabFocus.setTabFocusMode(configurationService.getValue('editor.tabFocusMode'), TabFocusContext.Editor); TabFocus.setTabFocusMode(configurationService.getValue(TerminalSettingId.TabFocusMode), TabFocusContext.Terminal); - this._register(contextKeyService.onDidChangeContext((c) => { - if (c.affectsSome(viewKey)) { - if (contextKeyService.getContextKeyValue('focusedView') === 'terminal') { - TabFocus.setTabFocusMode(configurationService.getValue(TerminalSettingId.TabFocusMode), TabFocusContext.Terminal); - } else { - TabFocus.setTabFocusMode(configurationService.getValue('editor.tabFocusMode'), TabFocusContext.Editor); - } - } - })); } } From 9abdddb78c2bc78348e28bea6d75310f8d82e11c Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Wed, 22 Feb 2023 11:21:15 -0600 Subject: [PATCH 045/206] unset accessible buffer tab index (#175138) fix #175111 --- src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts index d83ddae19c6..1657894c009 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts @@ -812,6 +812,7 @@ class AccessibleBuffer extends DisposableStore { readOnly: true }; this._accessibleBuffer = this._terminal.raw.element!.querySelector('.xterm-accessible-buffer') as HTMLElement; + this._accessibleBuffer.tabIndex = -1; this._editorContainer = document.createElement('div'); this._bufferEditor = this._instantiationService.createInstance(CodeEditorWidget, this._editorContainer, editorOptions, codeEditorWidgetOptions); this.add(configurationService.onDidChangeConfiguration(e => { From b438c3854c2541f349b99e94411f1d91186827ae Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 18:21:49 +0100 Subject: [PATCH 046/206] diag - still show cmd in paranthesis for electron node.js processes (#175139) --- src/vs/base/node/ps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/node/ps.ts b/src/vs/base/node/ps.ts index 70690df9d75..f6739b6c018 100644 --- a/src/vs/base/node/ps.ts +++ b/src/vs/base/node/ps.ts @@ -127,13 +127,13 @@ export function listProcesses(rootPid: number): Promise { if (result) { if (cmd.indexOf('node ') < 0 && cmd.indexOf('node.exe') < 0) { - return `electron-nodejs ${result}`; + return `electron-nodejs (${result})`; } } // find Electron node.js processes if (NODEJS_PROCESS_HINT.exec(cmd)) { - return 'electron-nodejs'; + return `electron-nodejs (${cmd})`; } return cmd; From be140a8d81d1f582cba3d5399697af3329eb8596 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Feb 2023 18:32:29 +0100 Subject: [PATCH 047/206] Forking from the extension host fails when running tests (fix #154549) (#175141) --- src/vs/base/node/ps.ts | 2 ++ src/vs/platform/utilityProcess/electron-main/utilityProcess.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/base/node/ps.ts b/src/vs/base/node/ps.ts index f6739b6c018..d1b035d7c23 100644 --- a/src/vs/base/node/ps.ts +++ b/src/vs/base/node/ps.ts @@ -109,6 +109,8 @@ export function listProcesses(rootPid: number): Promise { if (UTILITY_SHARED_PROCESS_HINT.exec(cmd)) { return 'shared-process'; } + + return 'utility-process'; } else if (matches[1] === 'extensionHost') { return 'extension-host'; // normalize remote extension host type } diff --git a/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts b/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts index 22759147b52..ab7299fbd5e 100644 --- a/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts +++ b/src/vs/platform/utilityProcess/electron-main/utilityProcess.ts @@ -206,7 +206,7 @@ export class UtilityProcess extends Disposable { const serviceName = `${this.configuration.type}-${this.id}`; const modulePath = FileAccess.asFileUri('bootstrap-fork.js').fsPath; const args = this.configuration.args ?? []; - const execArgv = [...this.configuration.execArgv ?? [], `--vscode-utility-kind=${this.configuration.type}`]; + const execArgv = this.configuration.execArgv ?? []; // TODO@deepak1556 this should be [...this.configuration.execArgv ?? [], `--vscode-utility-kind=${this.configuration.type}`] but is causing https://github.com/microsoft/vscode/issues/154549 const allowLoadingUnsignedLibraries = this.configuration.allowLoadingUnsignedLibraries; const stdio = 'pipe'; const env = this.createEnv(configuration, isWindowSandboxed); From cd6a0795cfdaf93067861622c86a5cd215c1ad1e Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Wed, 22 Feb 2023 18:38:15 +0100 Subject: [PATCH 048/206] Fixes #173193 (#175143) --- .../browser/inlineSuggestionHintsWidget.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vs/editor/contrib/inlineCompletions/browser/inlineSuggestionHintsWidget.ts b/src/vs/editor/contrib/inlineCompletions/browser/inlineSuggestionHintsWidget.ts index ee1d55d27a6..9f3a640a28b 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/inlineSuggestionHintsWidget.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/inlineSuggestionHintsWidget.ts @@ -36,6 +36,7 @@ export class InlineSuggestionHintsWidget extends Disposable { private readonly widget = this._register(this.instantiationService.createInstance(InlineSuggestionHintsContentWidget, this.editor, true)); private sessionPosition: Position | undefined = undefined; + private isDisposed = false; constructor( private readonly editor: ICodeEditor, @@ -51,7 +52,16 @@ export class InlineSuggestionHintsWidget extends Disposable { this.update(); } + override dispose(): void { + this.isDisposed = true; + super.dispose(); + } + private update(): void { + if (this.isDisposed) { + return; + } + const options = this.editor.getOption(EditorOption.inlineSuggest); if (options.showToolbar !== 'always' || !this.model.ghostText) { this.widget.update(null, 0, undefined, []); From 5526326c496692c63aef2ced1e30fd4f50d69b8d Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Wed, 22 Feb 2023 11:43:34 -0600 Subject: [PATCH 049/206] tweak setting description (#175145) --- .../workbench/contrib/terminal/common/terminalConfiguration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts index e07eeb45570..f2b672444f8 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts @@ -107,7 +107,7 @@ const terminalConfiguration: IConfigurationNode = { description: localize('terminal.integrated.tabs.location', "Controls the location of the terminal tabs, either to the left or right of the actual terminal(s).") }, [TerminalSettingId.TabFocusMode]: { - markdownDescription: localize('tabFocusMode', "Controls whether the terminal receives tabs or defers them to the workbench for navigation. this overrides {0} when the terminal is focused.", '`#editor.tabFocusMode#`'), + markdownDescription: localize('tabFocusMode', "Controls whether the terminal receives tabs or defers them to the workbench for navigation."), type: 'boolean', default: false }, From aa9dd051433f851609f9cb9f0445b52d94f8b251 Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Wed, 22 Feb 2023 18:31:31 +0000 Subject: [PATCH 050/206] Category title for `Continue in vscode.dev` (#175151) --- extensions/github/package.json | 3 ++- .../contrib/editSessions/browser/editSessions.contribution.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/github/package.json b/extensions/github/package.json index 046bdc70bfc..d56257ec5db 100644 --- a/extensions/github/package.json +++ b/extensions/github/package.json @@ -54,7 +54,8 @@ "command": "github.openOnVscodeDev", "when": "github.hasGitHubRepo", "qualifiedName": "Continue Working in vscode.dev", - "remoteGroup": "virtualfs_43_file_0_web@0" + "group": "Remote Repositories", + "remoteGroup": "virtualfs_44_vscode-vfs_2_web@2" } ], "menus": { diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts index 4eae9ffb679..567e8a66a68 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts @@ -800,7 +800,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo )); if (contribution.qualifiedName) { - this.generateStandaloneOptionCommand(command.id, contribution.qualifiedName, command.category, when, contribution.remoteGroup); + this.generateStandaloneOptionCommand(command.id, contribution.qualifiedName, contribution.group ?? command.category, when, contribution.remoteGroup); } } } From 87d5346c1753342f4fda74f32cc50e572b7d9d85 Mon Sep 17 00:00:00 2001 From: SteVen Batten <6561887+sbatten@users.noreply.github.com> Date: Wed, 22 Feb 2023 10:40:47 -0800 Subject: [PATCH 051/206] small typo (#175154) --- 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 76c5fc32870..843dcc35f77 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -272,7 +272,7 @@ const registry = Registry.as(ConfigurationExtensions.Con 'workbench.editor.centeredLayoutFixedWidth': { 'type': 'boolean', 'default': false, - 'description': localize('centeredLayoutDynamicWidth', "Controls wether the centered layout tries to maintain constant width when the window is resized.") + 'description': localize('centeredLayoutDynamicWidth', "Controls whether the centered layout tries to maintain constant width when the window is resized.") }, 'workbench.editor.limit.enabled': { 'type': 'boolean', From 3c9f409888c4be37ec305b604941e286f3dc9964 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 22 Feb 2023 11:01:44 -0800 Subject: [PATCH 052/206] Have English language return default result (#175157) Fixes #174848 --- src/vs/base/node/languagePacks.js | 35 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/vs/base/node/languagePacks.js b/src/vs/base/node/languagePacks.js index 4a94bc792e6..c4c2a658feb 100644 --- a/src/vs/base/node/languagePacks.js +++ b/src/vs/base/node/languagePacks.js @@ -112,33 +112,32 @@ * @param {string | undefined} language */ function getNLSConfiguration(commit, userDataPath, metaDataFile, locale, language) { - if (process.env['VSCODE_DEV']) { + const defaultResult = function (locale) { + perf.mark('code/didGenerateNls'); return Promise.resolve({ locale, availableLanguages: {} }); + }; + perf.mark('code/willGenerateNls'); + + // We are in development mode. So we don't have a built version + if (process.env['VSCODE_DEV']) { + return defaultResult(locale); + } + + // Also in development mode if we don't have a commit + if (!commit) { + return defaultResult(locale); } // We have a built version so we have extracted nls file. Try to find // the right file to use. - // If we didn't specify a language, use the default - if (!language) { - return Promise.resolve({ locale, availableLanguages: {} }); + // If we didn't specify a language, or if we specified English or English US, + // use the default. + if (!language || language === 'en' || language === 'en-us') { + return defaultResult(locale); } - // If we specified English or English US, return that as the available language. - if (language === 'en' || language === 'en-us') { - return Promise.resolve({ locale, availableLanguages: { '*': 'en' } }); - } - - perf.mark('code/willGenerateNls'); - - const defaultResult = function (locale) { - perf.mark('code/didGenerateNls'); - return Promise.resolve({ locale, availableLanguages: {} }); - }; try { - if (!commit) { - return defaultResult(locale); - } return getLanguagePackConfigurations(userDataPath).then(configs => { if (!configs) { return defaultResult(locale); From 372db6029f84d7d5ee276faf66216b9a3b20ea54 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Wed, 22 Feb 2023 13:43:23 -0600 Subject: [PATCH 053/206] fix cursor position issues (#175160) --- .../terminal/browser/xterm/xtermTerminal.ts | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts index 1657894c009..9dd835124d6 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts @@ -12,7 +12,7 @@ import type { SerializeAddon as SerializeAddonType } from 'xterm-addon-serialize import { IXtermCore } from 'vs/workbench/contrib/terminal/browser/xterm-private'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper'; -import { DisposableStore } from 'vs/base/common/lifecycle'; +import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IShellIntegration, TerminalLocation, TerminalSettingId } from 'vs/platform/terminal/common/terminal'; import { ITerminalFont, TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal'; @@ -776,7 +776,10 @@ class AccessibleBuffer extends DisposableStore { private _accessibleBuffer: HTMLElement; private _bufferEditor: CodeEditorWidget; private _editorContainer: HTMLElement; + private _commandFinishedDisposable: IDisposable | undefined; + private _refreshSelection: boolean = true; private _registered: boolean = false; + private _lastContentLength: number = 0; private _font: ITerminalFont; constructor( @@ -824,6 +827,40 @@ class AccessibleBuffer extends DisposableStore { async focus(): Promise { await this._updateBufferEditor(); + } + + private async _updateBufferEditor(): Promise { + const commandDetection = this._capabilities.get(TerminalCapability.CommandDetection); + const fragment = !!commandDetection ? this._getShellIntegrationContent() : this._getAllContent(); + const model = await this._getTextModel(URI.from({ scheme: ACCESSIBLE_BUFFER.Scheme, fragment })); + if (model) { + this._bufferEditor.setModel(model); + } + + if (!this._registered) { + this.add(this._terminal.raw.registerBufferElementProvider({ provideBufferElements: () => this._editorContainer })); + // When this is created, the element isn't yet attached so the dimensions are tiny + this._bufferEditor.layout({ width: this._accessibleBuffer.clientWidth, height: this._accessibleBuffer.clientHeight }); + this._registered = true; + } + + if (!this._commandFinishedDisposable && commandDetection) { + this._commandFinishedDisposable = commandDetection.onCommandFinished(() => this._refreshSelection = true); + this.add(this._commandFinishedDisposable); + } + + if (this._lastContentLength !== fragment.length || this._refreshSelection) { + let lineNumber = 1; + const lineCount = model?.getLineCount(); + if (lineCount && model) { + lineNumber = commandDetection ? lineCount - 1 : lineCount > 2 ? lineCount - 2 : 1; + } + this._bufferEditor.setSelection({ startLineNumber: lineNumber, startColumn: 1, endLineNumber: lineNumber, endColumn: 1 }); + this._bufferEditor.setScrollTop(this._bufferEditor.getScrollHeight()); + this._refreshSelection = false; + this._lastContentLength = fragment.length; + } + // Updates xterm's accessibleBufferActive property // such that mouse events do not cause the terminal buffer // to steal the focus @@ -831,22 +868,6 @@ class AccessibleBuffer extends DisposableStore { this._bufferEditor.focus(); } - private async _updateBufferEditor(): Promise { - if (!this._registered) { - // Registration is delayed until focus so the capability has time to have been added - this.add(this._terminal.raw.registerBufferElementProvider({ provideBufferElements: () => this._editorContainer })); - this._registered = true; - } - // When this is created, the element isn't yet attached so the dimensions are tiny - this._bufferEditor.layout({ width: this._accessibleBuffer.clientWidth, height: this._accessibleBuffer.clientHeight }); - const commandDetection = this._capabilities.has(TerminalCapability.CommandDetection); - const fragment = commandDetection ? this._getShellIntegrationContent() : this._getAllContent(); - const model = await this._getTextModel(URI.from({ scheme: ACCESSIBLE_BUFFER.Scheme, fragment })); - if (model) { - this._bufferEditor.setModel(model); - } - } - async _getTextModel(resource: URI): Promise { const existing = this._modelService.getModel(resource); if (existing && !existing.isDisposed()) { @@ -887,7 +908,7 @@ class AccessibleBuffer extends DisposableStore { } const isWrapped = buffer.getLine(i + 1)?.isWrapped; currentLine += line.translateToString(!isWrapped); - if (!isWrapped || i === end - 1) { + if (currentLine && !isWrapped || i === end - 1) { lines.push(currentLine.replace(new RegExp(' ', 'g'), '\xA0')); currentLine = ''; } From eff4ed67af0d0b7eecf8f3bd2f2224cb7e1bf64d Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Wed, 22 Feb 2023 21:28:40 +0100 Subject: [PATCH 054/206] Have the high contrast CSS rules match the regular ones (#174864) Fixes #173262 --- .../contrib/wordHighlighter/browser/highlightDecorations.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.css b/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.css index d5406c6d4c8..898d02e3f77 100644 --- a/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.css +++ b/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.css @@ -8,7 +8,7 @@ box-sizing: border-box; border: 1px solid var(--vscode-editor-selectionHighlightBorder); } -.monaco-editor.hc-black .selectionHighlight, .monaco-editor.hc-light .selectionHighlight { +.monaco-editor.hc-black .focused .selectionHighlight, .monaco-editor.hc-light .focused .selectionHighlight { border-style: dotted; } @@ -30,7 +30,7 @@ border-style: dotted; } -.monaco-editor .focused .wordHighlightText { +.monaco-editor .wordHighlightText { background-color: var(--vscode-editor-wordHighlightTextBackground); box-sizing: border-box; border: 1px solid var(--vscode-editor-wordHighlightTextBorder); From 8939e94f892dcc1a3ef4d4ac76ebd00ad8b06af2 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Wed, 22 Feb 2023 12:59:03 -0800 Subject: [PATCH 055/206] debug: bump js-debug (#175170) --- product.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product.json b/product.json index 212ad63ab68..9a240c460b5 100644 --- a/product.json +++ b/product.json @@ -47,7 +47,7 @@ }, { "name": "ms-vscode.js-debug", - "version": "1.75.1", + "version": "1.76.0", "repo": "https://github.com/microsoft/vscode-js-debug", "metadata": { "id": "25629058-ddac-4e17-abba-74678e126c5d", From bccf04907d6901710cddc4a5743a966c8e80d0ad Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Wed, 22 Feb 2023 15:07:09 -0600 Subject: [PATCH 056/206] Revert "add setting for aria-live assertive alert for ghost text" (#175165) Revert "add setting for aria-live assertive alert for ghost text (#174606)" This reverts commit 5dc060974d6155cfc2caf32ef10cc1bedb2a8483. --- src/vs/editor/common/config/editorOptions.ts | 13 - .../common/standalone/standaloneEnums.ts | 273 +++++++++-------- .../browser/ghostTextWidget.ts | 10 - src/vs/monaco.d.ts | 278 +++++++++--------- .../audioCueLineFeatureContribution.ts | 36 +++ 5 files changed, 308 insertions(+), 302 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 365246b15be..3383600a83b 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -57,11 +57,6 @@ export interface IEditorOptions { * The aria label for the editor's textarea (when it is focused). */ ariaLabel?: string; - - /** - * Control whether a screen reader announces inline suggestion content immediately. - */ - screenReaderAnnounceInlineSuggestion?: boolean; /** * The `tabindex` property of the editor's textarea */ @@ -4757,7 +4752,6 @@ export const enum EditorOption { acceptSuggestionOnEnter, accessibilitySupport, accessibilityPageSize, - screenReaderAnnounceInlineSuggestion, ariaLabel, autoClosingBrackets, autoClosingDelete, @@ -4924,13 +4918,6 @@ export const EditorOptions = { ariaLabel: register(new EditorStringOption( EditorOption.ariaLabel, 'ariaLabel', nls.localize('editorViewAccessibleLabel', "Editor content") )), - screenReaderAnnounceInlineSuggestion: register(new EditorBooleanOption( - EditorOption.screenReaderAnnounceInlineSuggestion, 'screenReaderAnnounceInlineSuggestion', false, - { - description: nls.localize('ariaAssertiveInlineSuggestion', "Control whether aria-live assertive & role alert are on the inline suggestion element so that a screen reader detects it immediately."), - tags: ['accessibility'] - } - )), autoClosingBrackets: register(new EditorStringEnumOption( EditorOption.autoClosingBrackets, 'autoClosingBrackets', 'languageDefined' as 'always' | 'languageDefined' | 'beforeWhitespace' | 'never', diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index 624ab7fdd1d..d15fc2e84d2 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -177,143 +177,142 @@ export enum EditorOption { acceptSuggestionOnEnter = 1, accessibilitySupport = 2, accessibilityPageSize = 3, - screenReaderAnnounceInlineSuggestion = 4, - ariaLabel = 5, - autoClosingBrackets = 6, - autoClosingDelete = 7, - autoClosingOvertype = 8, - autoClosingQuotes = 9, - autoIndent = 10, - automaticLayout = 11, - autoSurround = 12, - bracketPairColorization = 13, - guides = 14, - codeLens = 15, - codeLensFontFamily = 16, - codeLensFontSize = 17, - colorDecorators = 18, - colorDecoratorsLimit = 19, - columnSelection = 20, - comments = 21, - contextmenu = 22, - copyWithSyntaxHighlighting = 23, - cursorBlinking = 24, - cursorSmoothCaretAnimation = 25, - cursorStyle = 26, - cursorSurroundingLines = 27, - cursorSurroundingLinesStyle = 28, - cursorWidth = 29, - disableLayerHinting = 30, - disableMonospaceOptimizations = 31, - domReadOnly = 32, - dragAndDrop = 33, - dropIntoEditor = 34, - emptySelectionClipboard = 35, - experimentalWhitespaceRendering = 36, - extraEditorClassName = 37, - fastScrollSensitivity = 38, - find = 39, - fixedOverflowWidgets = 40, - folding = 41, - foldingStrategy = 42, - foldingHighlight = 43, - foldingImportsByDefault = 44, - foldingMaximumRegions = 45, - unfoldOnClickAfterEndOfLine = 46, - fontFamily = 47, - fontInfo = 48, - fontLigatures = 49, - fontSize = 50, - fontWeight = 51, - fontVariations = 52, - formatOnPaste = 53, - formatOnType = 54, - glyphMargin = 55, - gotoLocation = 56, - hideCursorInOverviewRuler = 57, - hover = 58, - inDiffEditor = 59, - inlineSuggest = 60, - letterSpacing = 61, - lightbulb = 62, - lineDecorationsWidth = 63, - lineHeight = 64, - lineNumbers = 65, - lineNumbersMinChars = 66, - linkedEditing = 67, - links = 68, - matchBrackets = 69, - minimap = 70, - mouseStyle = 71, - mouseWheelScrollSensitivity = 72, - mouseWheelZoom = 73, - multiCursorMergeOverlapping = 74, - multiCursorModifier = 75, - multiCursorPaste = 76, - multiCursorLimit = 77, - occurrencesHighlight = 78, - overviewRulerBorder = 79, - overviewRulerLanes = 80, - padding = 81, - parameterHints = 82, - peekWidgetDefaultFocus = 83, - definitionLinkOpensInPeek = 84, - quickSuggestions = 85, - quickSuggestionsDelay = 86, - readOnly = 87, - renameOnType = 88, - renderControlCharacters = 89, - renderFinalNewline = 90, - renderLineHighlight = 91, - renderLineHighlightOnlyWhenFocus = 92, - renderValidationDecorations = 93, - renderWhitespace = 94, - revealHorizontalRightPadding = 95, - roundedSelection = 96, - rulers = 97, - scrollbar = 98, - scrollBeyondLastColumn = 99, - scrollBeyondLastLine = 100, - scrollPredominantAxis = 101, - selectionClipboard = 102, - selectionHighlight = 103, - selectOnLineNumbers = 104, - showFoldingControls = 105, - showUnused = 106, - snippetSuggestions = 107, - smartSelect = 108, - smoothScrolling = 109, - stickyScroll = 110, - stickyTabStops = 111, - stopRenderingLineAfter = 112, - suggest = 113, - suggestFontSize = 114, - suggestLineHeight = 115, - suggestOnTriggerCharacters = 116, - suggestSelection = 117, - tabCompletion = 118, - tabIndex = 119, - unicodeHighlighting = 120, - unusualLineTerminators = 121, - useShadowDOM = 122, - useTabStops = 123, - wordBreak = 124, - wordSeparators = 125, - wordWrap = 126, - wordWrapBreakAfterCharacters = 127, - wordWrapBreakBeforeCharacters = 128, - wordWrapColumn = 129, - wordWrapOverride1 = 130, - wordWrapOverride2 = 131, - wrappingIndent = 132, - wrappingStrategy = 133, - showDeprecated = 134, - inlayHints = 135, - editorClassName = 136, - pixelRatio = 137, - tabFocusMode = 138, - layoutInfo = 139, - wrappingInfo = 140 + ariaLabel = 4, + autoClosingBrackets = 5, + autoClosingDelete = 6, + autoClosingOvertype = 7, + autoClosingQuotes = 8, + autoIndent = 9, + automaticLayout = 10, + autoSurround = 11, + bracketPairColorization = 12, + guides = 13, + codeLens = 14, + codeLensFontFamily = 15, + codeLensFontSize = 16, + colorDecorators = 17, + colorDecoratorsLimit = 18, + columnSelection = 19, + comments = 20, + contextmenu = 21, + copyWithSyntaxHighlighting = 22, + cursorBlinking = 23, + cursorSmoothCaretAnimation = 24, + cursorStyle = 25, + cursorSurroundingLines = 26, + cursorSurroundingLinesStyle = 27, + cursorWidth = 28, + disableLayerHinting = 29, + disableMonospaceOptimizations = 30, + domReadOnly = 31, + dragAndDrop = 32, + dropIntoEditor = 33, + emptySelectionClipboard = 34, + experimentalWhitespaceRendering = 35, + extraEditorClassName = 36, + fastScrollSensitivity = 37, + find = 38, + fixedOverflowWidgets = 39, + folding = 40, + foldingStrategy = 41, + foldingHighlight = 42, + foldingImportsByDefault = 43, + foldingMaximumRegions = 44, + unfoldOnClickAfterEndOfLine = 45, + fontFamily = 46, + fontInfo = 47, + fontLigatures = 48, + fontSize = 49, + fontWeight = 50, + fontVariations = 51, + formatOnPaste = 52, + formatOnType = 53, + glyphMargin = 54, + gotoLocation = 55, + hideCursorInOverviewRuler = 56, + hover = 57, + inDiffEditor = 58, + inlineSuggest = 59, + letterSpacing = 60, + lightbulb = 61, + lineDecorationsWidth = 62, + lineHeight = 63, + lineNumbers = 64, + lineNumbersMinChars = 65, + linkedEditing = 66, + links = 67, + matchBrackets = 68, + minimap = 69, + mouseStyle = 70, + mouseWheelScrollSensitivity = 71, + mouseWheelZoom = 72, + multiCursorMergeOverlapping = 73, + multiCursorModifier = 74, + multiCursorPaste = 75, + multiCursorLimit = 76, + occurrencesHighlight = 77, + overviewRulerBorder = 78, + overviewRulerLanes = 79, + padding = 80, + parameterHints = 81, + peekWidgetDefaultFocus = 82, + definitionLinkOpensInPeek = 83, + quickSuggestions = 84, + quickSuggestionsDelay = 85, + readOnly = 86, + renameOnType = 87, + renderControlCharacters = 88, + renderFinalNewline = 89, + renderLineHighlight = 90, + renderLineHighlightOnlyWhenFocus = 91, + renderValidationDecorations = 92, + renderWhitespace = 93, + revealHorizontalRightPadding = 94, + roundedSelection = 95, + rulers = 96, + scrollbar = 97, + scrollBeyondLastColumn = 98, + scrollBeyondLastLine = 99, + scrollPredominantAxis = 100, + selectionClipboard = 101, + selectionHighlight = 102, + selectOnLineNumbers = 103, + showFoldingControls = 104, + showUnused = 105, + snippetSuggestions = 106, + smartSelect = 107, + smoothScrolling = 108, + stickyScroll = 109, + stickyTabStops = 110, + stopRenderingLineAfter = 111, + suggest = 112, + suggestFontSize = 113, + suggestLineHeight = 114, + suggestOnTriggerCharacters = 115, + suggestSelection = 116, + tabCompletion = 117, + tabIndex = 118, + unicodeHighlighting = 119, + unusualLineTerminators = 120, + useShadowDOM = 121, + useTabStops = 122, + wordBreak = 123, + wordSeparators = 124, + wordWrap = 125, + wordWrapBreakAfterCharacters = 126, + wordWrapBreakBeforeCharacters = 127, + wordWrapColumn = 128, + wordWrapOverride1 = 129, + wordWrapOverride2 = 130, + wrappingIndent = 131, + wrappingStrategy = 132, + showDeprecated = 133, + inlayHints = 134, + editorClassName = 135, + pixelRatio = 136, + tabFocusMode = 137, + layoutInfo = 138, + wrappingInfo = 139 } /** diff --git a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts b/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts index 53c54d7562f..fe1ad377ea0 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts @@ -22,7 +22,6 @@ import { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/vie import { InlineDecorationType } from 'vs/editor/common/viewModel'; import { GhostTextReplacement, GhostTextWidgetModel } from 'vs/editor/contrib/inlineCompletions/browser/ghostText'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { AudioCue, IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService'; const ttPolicy = window.trustedTypes?.createPolicy('editorGhostText', { createHTML: value => value }); @@ -37,7 +36,6 @@ export class GhostTextWidget extends Disposable { private readonly model: GhostTextWidgetModel, @IInstantiationService private readonly instantiationService: IInstantiationService, @ILanguageService private readonly languageService: ILanguageService, - @IAudioCueService private readonly audioCueService: IAudioCueService ) { super(); @@ -159,14 +157,6 @@ export class GhostTextWidget extends Disposable { hiddenTextStartColumn !== undefined ? { column: hiddenTextStartColumn, length: textBufferLine.length + 1 - hiddenTextStartColumn } : undefined); this.additionalLinesWidget.updateLines(ghostText.lineNumber, additionalLines, ghostText.additionalReservedLineCount); - - this.audioCueService.playAudioCue(AudioCue.inlineSuggestion).then(() => { - if (this.editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) { - const lineText = this.editor.getModel()!.getLineContent(ghostText.lineNumber); - alert(ghostText.renderForScreenReader(lineText)); - } - }); - if (0 < 0) { // Not supported at the moment, condition is always false. this.viewMoreContentWidget = this.renderViewMoreLines( diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 73fb0789942..ea87b12a731 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3028,10 +3028,6 @@ declare namespace monaco.editor { * The aria label for the editor's textarea (when it is focused). */ ariaLabel?: string; - /** - * Control whether a screen reader announces inline suggestion content immediately. - */ - screenReaderAnnounceInlineSuggestion?: boolean; /** * The `tabindex` property of the editor's textarea */ @@ -4590,143 +4586,142 @@ declare namespace monaco.editor { acceptSuggestionOnEnter = 1, accessibilitySupport = 2, accessibilityPageSize = 3, - screenReaderAnnounceInlineSuggestion = 4, - ariaLabel = 5, - autoClosingBrackets = 6, - autoClosingDelete = 7, - autoClosingOvertype = 8, - autoClosingQuotes = 9, - autoIndent = 10, - automaticLayout = 11, - autoSurround = 12, - bracketPairColorization = 13, - guides = 14, - codeLens = 15, - codeLensFontFamily = 16, - codeLensFontSize = 17, - colorDecorators = 18, - colorDecoratorsLimit = 19, - columnSelection = 20, - comments = 21, - contextmenu = 22, - copyWithSyntaxHighlighting = 23, - cursorBlinking = 24, - cursorSmoothCaretAnimation = 25, - cursorStyle = 26, - cursorSurroundingLines = 27, - cursorSurroundingLinesStyle = 28, - cursorWidth = 29, - disableLayerHinting = 30, - disableMonospaceOptimizations = 31, - domReadOnly = 32, - dragAndDrop = 33, - dropIntoEditor = 34, - emptySelectionClipboard = 35, - experimentalWhitespaceRendering = 36, - extraEditorClassName = 37, - fastScrollSensitivity = 38, - find = 39, - fixedOverflowWidgets = 40, - folding = 41, - foldingStrategy = 42, - foldingHighlight = 43, - foldingImportsByDefault = 44, - foldingMaximumRegions = 45, - unfoldOnClickAfterEndOfLine = 46, - fontFamily = 47, - fontInfo = 48, - fontLigatures = 49, - fontSize = 50, - fontWeight = 51, - fontVariations = 52, - formatOnPaste = 53, - formatOnType = 54, - glyphMargin = 55, - gotoLocation = 56, - hideCursorInOverviewRuler = 57, - hover = 58, - inDiffEditor = 59, - inlineSuggest = 60, - letterSpacing = 61, - lightbulb = 62, - lineDecorationsWidth = 63, - lineHeight = 64, - lineNumbers = 65, - lineNumbersMinChars = 66, - linkedEditing = 67, - links = 68, - matchBrackets = 69, - minimap = 70, - mouseStyle = 71, - mouseWheelScrollSensitivity = 72, - mouseWheelZoom = 73, - multiCursorMergeOverlapping = 74, - multiCursorModifier = 75, - multiCursorPaste = 76, - multiCursorLimit = 77, - occurrencesHighlight = 78, - overviewRulerBorder = 79, - overviewRulerLanes = 80, - padding = 81, - parameterHints = 82, - peekWidgetDefaultFocus = 83, - definitionLinkOpensInPeek = 84, - quickSuggestions = 85, - quickSuggestionsDelay = 86, - readOnly = 87, - renameOnType = 88, - renderControlCharacters = 89, - renderFinalNewline = 90, - renderLineHighlight = 91, - renderLineHighlightOnlyWhenFocus = 92, - renderValidationDecorations = 93, - renderWhitespace = 94, - revealHorizontalRightPadding = 95, - roundedSelection = 96, - rulers = 97, - scrollbar = 98, - scrollBeyondLastColumn = 99, - scrollBeyondLastLine = 100, - scrollPredominantAxis = 101, - selectionClipboard = 102, - selectionHighlight = 103, - selectOnLineNumbers = 104, - showFoldingControls = 105, - showUnused = 106, - snippetSuggestions = 107, - smartSelect = 108, - smoothScrolling = 109, - stickyScroll = 110, - stickyTabStops = 111, - stopRenderingLineAfter = 112, - suggest = 113, - suggestFontSize = 114, - suggestLineHeight = 115, - suggestOnTriggerCharacters = 116, - suggestSelection = 117, - tabCompletion = 118, - tabIndex = 119, - unicodeHighlighting = 120, - unusualLineTerminators = 121, - useShadowDOM = 122, - useTabStops = 123, - wordBreak = 124, - wordSeparators = 125, - wordWrap = 126, - wordWrapBreakAfterCharacters = 127, - wordWrapBreakBeforeCharacters = 128, - wordWrapColumn = 129, - wordWrapOverride1 = 130, - wordWrapOverride2 = 131, - wrappingIndent = 132, - wrappingStrategy = 133, - showDeprecated = 134, - inlayHints = 135, - editorClassName = 136, - pixelRatio = 137, - tabFocusMode = 138, - layoutInfo = 139, - wrappingInfo = 140 + ariaLabel = 4, + autoClosingBrackets = 5, + autoClosingDelete = 6, + autoClosingOvertype = 7, + autoClosingQuotes = 8, + autoIndent = 9, + automaticLayout = 10, + autoSurround = 11, + bracketPairColorization = 12, + guides = 13, + codeLens = 14, + codeLensFontFamily = 15, + codeLensFontSize = 16, + colorDecorators = 17, + colorDecoratorsLimit = 18, + columnSelection = 19, + comments = 20, + contextmenu = 21, + copyWithSyntaxHighlighting = 22, + cursorBlinking = 23, + cursorSmoothCaretAnimation = 24, + cursorStyle = 25, + cursorSurroundingLines = 26, + cursorSurroundingLinesStyle = 27, + cursorWidth = 28, + disableLayerHinting = 29, + disableMonospaceOptimizations = 30, + domReadOnly = 31, + dragAndDrop = 32, + dropIntoEditor = 33, + emptySelectionClipboard = 34, + experimentalWhitespaceRendering = 35, + extraEditorClassName = 36, + fastScrollSensitivity = 37, + find = 38, + fixedOverflowWidgets = 39, + folding = 40, + foldingStrategy = 41, + foldingHighlight = 42, + foldingImportsByDefault = 43, + foldingMaximumRegions = 44, + unfoldOnClickAfterEndOfLine = 45, + fontFamily = 46, + fontInfo = 47, + fontLigatures = 48, + fontSize = 49, + fontWeight = 50, + fontVariations = 51, + formatOnPaste = 52, + formatOnType = 53, + glyphMargin = 54, + gotoLocation = 55, + hideCursorInOverviewRuler = 56, + hover = 57, + inDiffEditor = 58, + inlineSuggest = 59, + letterSpacing = 60, + lightbulb = 61, + lineDecorationsWidth = 62, + lineHeight = 63, + lineNumbers = 64, + lineNumbersMinChars = 65, + linkedEditing = 66, + links = 67, + matchBrackets = 68, + minimap = 69, + mouseStyle = 70, + mouseWheelScrollSensitivity = 71, + mouseWheelZoom = 72, + multiCursorMergeOverlapping = 73, + multiCursorModifier = 74, + multiCursorPaste = 75, + multiCursorLimit = 76, + occurrencesHighlight = 77, + overviewRulerBorder = 78, + overviewRulerLanes = 79, + padding = 80, + parameterHints = 81, + peekWidgetDefaultFocus = 82, + definitionLinkOpensInPeek = 83, + quickSuggestions = 84, + quickSuggestionsDelay = 85, + readOnly = 86, + renameOnType = 87, + renderControlCharacters = 88, + renderFinalNewline = 89, + renderLineHighlight = 90, + renderLineHighlightOnlyWhenFocus = 91, + renderValidationDecorations = 92, + renderWhitespace = 93, + revealHorizontalRightPadding = 94, + roundedSelection = 95, + rulers = 96, + scrollbar = 97, + scrollBeyondLastColumn = 98, + scrollBeyondLastLine = 99, + scrollPredominantAxis = 100, + selectionClipboard = 101, + selectionHighlight = 102, + selectOnLineNumbers = 103, + showFoldingControls = 104, + showUnused = 105, + snippetSuggestions = 106, + smartSelect = 107, + smoothScrolling = 108, + stickyScroll = 109, + stickyTabStops = 110, + stopRenderingLineAfter = 111, + suggest = 112, + suggestFontSize = 113, + suggestLineHeight = 114, + suggestOnTriggerCharacters = 115, + suggestSelection = 116, + tabCompletion = 117, + tabIndex = 118, + unicodeHighlighting = 119, + unusualLineTerminators = 120, + useShadowDOM = 121, + useTabStops = 122, + wordBreak = 123, + wordSeparators = 124, + wordWrap = 125, + wordWrapBreakAfterCharacters = 126, + wordWrapBreakBeforeCharacters = 127, + wordWrapColumn = 128, + wordWrapOverride1 = 129, + wordWrapOverride2 = 130, + wrappingIndent = 131, + wrappingStrategy = 132, + showDeprecated = 133, + inlayHints = 134, + editorClassName = 135, + pixelRatio = 136, + tabFocusMode = 137, + layoutInfo = 138, + wrappingInfo = 139 } export const EditorOptions: { @@ -4735,7 +4730,6 @@ declare namespace monaco.editor { accessibilitySupport: IEditorOption; accessibilityPageSize: IEditorOption; ariaLabel: IEditorOption; - screenReaderAnnounceInlineSuggestion: IEditorOption; autoClosingBrackets: IEditorOption; autoClosingDelete: IEditorOption; autoClosingOvertype: IEditorOption; diff --git a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts index 038f66846a5..630452c5ca7 100644 --- a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts +++ b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts @@ -13,6 +13,7 @@ import { IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/marke import { FoldingController } from 'vs/editor/contrib/folding/browser/folding'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITextModel } from 'vs/editor/common/model'; +import { GhostTextController } from 'vs/editor/contrib/inlineCompletions/browser/ghostTextController'; import { CursorChangeReason } from 'vs/editor/common/cursorEvents'; import { autorun, autorunDelta, constObservable, debouncedObservable, derived, IObservable, observableFromEvent, observableFromPromise, wasEventTriggeredRecently } from 'vs/base/common/observable'; import { AudioCue, IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService'; @@ -30,6 +31,7 @@ export class AudioCueLineFeatureContribution this.instantiationService.createInstance(MarkerLineFeature, AudioCue.warning, MarkerSeverity.Warning), this.instantiationService.createInstance(FoldedAreaLineFeature), this.instantiationService.createInstance(BreakpointLineFeature), + this.instantiationService.createInstance(InlineCompletionLineFeature), ]; private readonly isEnabledCache = new CachedFunction>((cue) => observableFromEvent( @@ -257,3 +259,37 @@ class BreakpointLineFeature implements LineFeature { ); } } + +class InlineCompletionLineFeature implements LineFeature { + public readonly audioCue = AudioCue.inlineSuggestion; + + getObservableState(editor: ICodeEditor, _model: ITextModel): IObservable { + const ghostTextController = GhostTextController.get(editor); + if (!ghostTextController) { + return constObservable({ + isPresent: () => false, + }); + } + + const activeGhostText = observableFromEvent( + ghostTextController.onActiveModelDidChange, + () => /** @description ghostTextController.onActiveModelDidChange */ ghostTextController.activeModel + ).map((activeModel) => ( + activeModel + ? observableFromEvent( + activeModel.inlineCompletionsModel.onDidChange, + () => /** @description activeModel.inlineCompletionsModel.onDidChange */ activeModel.inlineCompletionsModel.ghostText + ) + : undefined + )); + + return derived('ghostText', reader => { + const ghostText = activeGhostText.read(reader)?.read(reader); + return { + isPresent(position) { + return ghostText?.lineNumber === position.lineNumber; + } + }; + }); + } +} From 05fd8ad7f663dc0885e86f55b2f6519d75958e2d Mon Sep 17 00:00:00 2001 From: David Dossett Date: Wed, 22 Feb 2023 13:56:18 -0800 Subject: [PATCH 057/206] Add and consume new profile badge colors --- .../parts/activitybar/media/activityaction.css | 4 ++-- src/vs/workbench/common/theme.ts | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css index 2af77fae3d7..ee7ce57f32b 100644 --- a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css +++ b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css @@ -181,8 +181,8 @@ right: 6px; padding: 2px 3px; border-radius: 7px; - background-color: var(--vscode-badge-background); - color: var(--vscode-badge-foreground); + background-color: var(--vscode-profileBadge-background); + color: var(--vscode-profileBadge-foreground); border: 2px solid var(--vscode-activityBar-background); } diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index 61a08087a80..da197cf8b46 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground, listActiveSelectionBackground, listActiveSelectionForeground, editorForeground, toolbarHoverBackground, inputBorder, widgetBorder } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground, listActiveSelectionBackground, listActiveSelectionForeground, editorForeground, toolbarHoverBackground, inputBorder, widgetBorder, foreground } from 'vs/platform/theme/common/colorRegistry'; import { IColorTheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { ColorScheme } from 'vs/platform/theme/common/theme'; @@ -625,6 +625,22 @@ export const ACTIVITY_BAR_BADGE_FOREGROUND = registerColor('activityBarBadge.for hcLight: Color.white }, localize('activityBarBadgeForeground', "Activity notification badge foreground color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); +// < --- Profiles --- > + +export const PROFILE_BADGE_BACKGROUND = registerColor('profileBadge.background', { + dark: '#4D4D4D', + light: '#C4C4C4', + hcDark: Color.white, + hcLight: Color.black +}, localize('profileBadgeBackground', "Profile badge background color. The profile badge shows on top of the settings gear icon in the activity bar.")); + +export const PROFILE_BADGE_FOREGROUND = registerColor('profileBadge.foreground', { + dark: Color.white, + light: '#333333', + hcDark: Color.black, + hcLight: Color.white +}, localize('profileBadgeForeground', "Profile badge foreground color. The profile badge shows on top of the settings gear icon in the activity bar.")); + // < --- Remote --- > export const STATUS_BAR_HOST_NAME_BACKGROUND = registerColor('statusBarItem.remoteBackground', { From 9cec7256d133c74cbdee0d19f94276dbbce4050c Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Wed, 22 Feb 2023 16:05:35 -0600 Subject: [PATCH 058/206] fix terminal help menu bugs (#175178) --- .../workbench/contrib/terminal/browser/terminalInstance.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index d8729e3b6dc..1f30e806962 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -2663,6 +2663,8 @@ const focusAccessibleBufferNoKb = nls.localize('focusAccessibleBufferNoKb', 'The const shellIntegration = nls.localize('shellIntegration', "The terminal has a feature called shell integration that offers an enhanced experience and provides useful commands for screen readers such as:"); const runRecentCommand = nls.localize('runRecentCommand', 'Run Recent Command ({0})'); const runRecentCommandNoKb = nls.localize('runRecentCommandNoKb', 'Run Recent Command is currently not triggerable by a keybinding.'); +const goToRecentNoShellIntegration = nls.localize('goToRecentDirectoryNoShellIntegration', 'The Go to Recent Directory command ({0}) enables screen readers to easily navigate to a directory that has been used in the terminal.'); +const goToRecentNoKbNoShellIntegration = nls.localize('goToRecentDirectoryNoKbNoShellIntegration', 'The Go to Recent Directory command enables screen readers to easily navigate to a directory that has been used in the terminal and is currently not triggerable by a keybinding.'); const goToRecent = nls.localize('goToRecentDirectory', 'Go to Recent Directory ({0})'); const goToRecentNoKb = nls.localize('goToRecentDirectoryNoKb', 'Go to Recent Directory is currently not triggerable by a keybinding.'); const readMoreLink = nls.localize('readMore', '[Read more about terminal accessibility](https://code.visualstudio.com/docs/editor/accessibility#_terminal-accessibility)'); @@ -2670,7 +2672,7 @@ const dismiss = nls.localize('dismiss', "You can dismiss this dialog by pressing const openDetectedLink = nls.localize('openDetectedLink', 'The Open Detected Link ({0}) command enables screen readers to easily open links found in the terminal.'); const openDetectedLinkNoKb = nls.localize('openDetectedLinkNoKb', 'The Open Detected Link command enables screen readers to easily open links found in the terminal and is currently not triggerable by a keybinding.'); const newWithProfile = nls.localize('newWithProfile', 'The Create New Terminal (With Profile) ({0}) command allows for easy terminal creation using a specific profile.'); -const newWithProfileNoKb = nls.localize('newWithProfileNoKb', 'The Create New Terminal (With Profile) command command allows for easy terminal creation using a specific profile and is currently not triggerable by a keybinding.'); +const newWithProfileNoKb = nls.localize('newWithProfileNoKb', 'The Create New Terminal (With Profile) command allows for easy terminal creation using a specific profile and is currently not triggerable by a keybinding.'); const accessibilitySettings = nls.localize('accessibilitySettings', 'Access accessibility settings such as `terminal.integrated.tabFocusMode` via the Preferences: Open Accessibility Settings command.'); class AccessibilityHelpWidget extends Widget implements ITerminalWidget { @@ -2740,6 +2742,8 @@ class AccessibilityHelpWidget extends Widget implements ITerminalWidget { if (this._hasShellIntegration) { content.push(shellIntegration); content.push('- ' + this._descriptionForCommand(TerminalCommandId.RunRecentCommand, runRecentCommand, runRecentCommandNoKb) + '\n- ' + this._descriptionForCommand(TerminalCommandId.GoToRecentDirectory, goToRecent, goToRecentNoKb)); + } else { + content.push(this._descriptionForCommand(TerminalCommandId.GoToRecentDirectory, goToRecentNoShellIntegration, goToRecentNoKbNoShellIntegration)); } content.push(this._descriptionForCommand(TerminalCommandId.OpenDetectedLink, openDetectedLink, openDetectedLinkNoKb)); content.push(this._descriptionForCommand(TerminalCommandId.NewWithProfile, newWithProfile, newWithProfileNoKb)); From 1fa08d1121942740ba2651096c2c55777d95e0cd Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 22 Feb 2023 16:40:43 -0600 Subject: [PATCH 059/206] Revert "Restore notebook layout performance optimization (#172466)" (#175180) This reverts commit 317f309a269c2365044e6f28444933105123c840. Fixes #175179 The root cause is that the grid view is still passing us bad positions. Will open new bug for this --- .../contrib/notebook/browser/notebookEditorWidget.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts index b2b1d5076ca..2acce2e9101 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts @@ -1709,7 +1709,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD return this._scrollBeyondLastLine && !this.isEmbedded; } - layout(dimension: DOM.Dimension, shadowElement?: HTMLElement, position?: DOM.IDomPosition): void { + layout(dimension: DOM.Dimension, shadowElement?: HTMLElement, _position?: DOM.IDomPosition): void { if (!shadowElement && this._shadowElementViewInfo === null) { this._dimension = dimension; return; @@ -1721,7 +1721,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD } if (shadowElement) { - this.updateShadowElement(shadowElement, dimension, position); + this.updateShadowElement(shadowElement, dimension, /*position*/ undefined); } if (this._shadowElementViewInfo && this._shadowElementViewInfo.width <= 0 && this._shadowElementViewInfo.height <= 0) { @@ -1750,7 +1750,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD this._overlayContainer.style.position = 'absolute'; this._overlayContainer.style.overflow = 'hidden'; - this.layoutContainerOverShadowElement(dimension, position); + this.layoutContainerOverShadowElement(dimension, /*position*/ undefined); if (this._webviewTransparentCover) { this._webviewTransparentCover.style.height = `${dimension.height}px`; From 400fde0524651f4a587f50ef2d0afedd97cbf118 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 23 Feb 2023 00:01:20 +0100 Subject: [PATCH 060/206] relative schema path not resolved properly (#175185) --- .../client/src/jsonClient.ts | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/extensions/json-language-features/client/src/jsonClient.ts b/extensions/json-language-features/client/src/jsonClient.ts index c0881c57112..52136c3cf85 100644 --- a/extensions/json-language-features/client/src/jsonClient.ts +++ b/extensions/json-language-features/client/src/jsonClient.ts @@ -545,27 +545,32 @@ function getSettings(): Settings { } }; - const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[], folderUri?: Uri) => { - for (const setting of schemaSettings) { - const url = getSchemaId(setting, folderUri); - if (url) { - const schemaSetting: JSONSchemaSettings = { url, fileMatch: setting.fileMatch, folderUri: folderUri?.toString(false), schema: setting.schema }; - schemas.push(schemaSetting); + const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[] | undefined, folderUri?: Uri) => { + + if (schemaSettings) { + for (const setting of schemaSettings) { + const url = getSchemaId(setting, folderUri); + if (url) { + const schemaSetting: JSONSchemaSettings = { url, fileMatch: setting.fileMatch, folderUri: folderUri?.toString(false), schema: setting.schema }; + schemas.push(schemaSetting); + } } } }; - const globalSettings = workspace.getConfiguration('json', null).get('schemas'); - if (Array.isArray(globalSettings)) { - collectSchemaSettings(globalSettings); + const schemaConfigInfo = workspace.getConfiguration('json', null).inspect('schemas'); + if (schemaConfigInfo) { + if (workspace.workspaceFile) { + collectSchemaSettings(schemaConfigInfo.workspaceValue, workspace.workspaceFile); + } + collectSchemaSettings(schemaConfigInfo.globalValue); } + const folders = workspace.workspaceFolders; if (folders) { for (const folder of folders) { const schemaConfigInfo = workspace.getConfiguration('json', folder.uri).inspect('schemas'); - if (schemaConfigInfo && Array.isArray(schemaConfigInfo.workspaceFolderValue)) { - collectSchemaSettings(schemaConfigInfo.workspaceFolderValue, folder.uri); - } + collectSchemaSettings(schemaConfigInfo?.workspaceFolderValue, folder.uri); } } return settings; From f105526bbee74e8f377130b8843e80e74dd3e5e9 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Thu, 23 Feb 2023 00:25:53 +0100 Subject: [PATCH 061/206] Also export `RemoteAuthorityResolverErrorCode` for embedders (#175187) --- src/vs/workbench/workbench.web.main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 20b0040085a..882dc9c7abc 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -180,7 +180,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import { GroupOrientation } from 'vs/workbench/services/editor/common/editorGroupsService'; import { UserDataSyncResourceProviderService } from 'vs/platform/userDataSync/common/userDataSyncResourceProvider'; -import { RemoteAuthorityResolverError } from 'vs/platform/remote/common/remoteAuthorityResolver'; +import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver'; export { @@ -195,6 +195,7 @@ export { GroupOrientation, LogLevel, RemoteAuthorityResolverError, + RemoteAuthorityResolverErrorCode, // Facade API env, From 4d247bae443e38ca7e6d6548a65dbc043cac07bc Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 22 Feb 2023 17:26:18 -0600 Subject: [PATCH 062/206] Don't allow one click reporting of TS Server crashes against VS Code repo when TS server plugins are enabled (#175186) Don't allow one click reporting of TS Server crashes when TS server plugins are enabled Fixes #175184 --- .../src/typescriptServiceClient.ts | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 190c6730687..737f4523012 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -605,11 +605,14 @@ export default class TypeScriptServiceClient extends Disposable implements IType this.lastStart = Date.now(); startService = false; this.hasServerFatallyCrashedTooManyTimes = true; - prompt = vscode.window.showErrorMessage( - this.pluginManager.plugins.length - ? vscode.l10n.t("The JS/TS language service immediately crashed 5 times. The service will not be restarted.\nThis may be caused by a plugin contributed by one of these extensions: {0}", pluginExtensionList) - : vscode.l10n.t("The JS/TS language service immediately crashed 5 times. The service will not be restarted."), - reportIssueItem); + if (this.pluginManager.plugins.length) { + prompt = vscode.window.showErrorMessage( + vscode.l10n.t("The JS/TS language service immediately crashed 5 times. The service will not be restarted.\nThis may be caused by a plugin contributed by one of these extensions: {0}.\nPlease try disabling these extensions before filing an issue against VS Code.", pluginExtensionList)); + } else { + prompt = vscode.window.showErrorMessage( + vscode.l10n.t("The JS/TS language service immediately crashed 5 times. The service will not be restarted."), + reportIssueItem); + } /* __GDPR__ "serviceExited" : { @@ -623,22 +626,28 @@ export default class TypeScriptServiceClient extends Disposable implements IType } else if (diff < 60 * 1000 * 5 /* 5 Minutes */) { this.lastStart = Date.now(); if (!this._isPromptingAfterCrash) { - prompt = vscode.window.showWarningMessage( - this.pluginManager.plugins.length - ? vscode.l10n.t("The JS/TS language service crashed 5 times in the last 5 Minutes.\nThis may be caused by a plugin contributed by one of these extensions: {0}", pluginExtensionList) - : vscode.l10n.t("The JS/TS language service crashed 5 times in the last 5 Minutes."), - reportIssueItem); + if (this.pluginManager.plugins.length) { + prompt = vscode.window.showWarningMessage( + vscode.l10n.t("The JS/TS language service crashed 5 times in the last 5 Minutes.\nThis may be caused by a plugin contributed by one of these extensions: {0}\nPlease try disabling these extensions before filing an issue against VS Code.", pluginExtensionList)); + } else { + prompt = vscode.window.showWarningMessage( + vscode.l10n.t("The JS/TS language service crashed 5 times in the last 5 Minutes."), + reportIssueItem); + } } } } else if (['vscode-insiders', 'code-oss'].includes(vscode.env.uriScheme)) { // Prompt after a single restart this.numberRestarts = 0; if (!this._isPromptingAfterCrash) { - prompt = vscode.window.showWarningMessage( - this.pluginManager.plugins.length - ? vscode.l10n.t("The JS/TS language service crashed.\nThis may be caused by a plugin contributed by one of these extensions: {0}", pluginExtensionList) - : vscode.l10n.t("The JS/TS language service crashed."), - reportIssueItem); + if (this.pluginManager.plugins.length) { + prompt = vscode.window.showWarningMessage( + vscode.l10n.t("The JS/TS language service crashed.\nThis may be caused by a plugin contributed by one of these extensions: {0}.\nPlease try disabling these extensions before filing an issue against VS Code.", pluginExtensionList)); + } else { + prompt = vscode.window.showWarningMessage( + vscode.l10n.t("The JS/TS language service crashed."), + reportIssueItem); + } } } @@ -1047,7 +1056,7 @@ function getReportIssueArgsForError( [ `**Global TypeScript Server Plugins**`, `â—ï¸ Please test with extensions disabled. Extensions are the root cause of most TypeScript server crashes`, - globalPlugins.map(plugin => `- \`${plugin.name}\``).join('\n') + globalPlugins.map(plugin => `- \`${plugin.name}\` contributed by the \`${plugin.extension.id}\` extension`).join('\n') ].join('\n\n') ); } From d0acdbff1f30eac7cc68930013485276d1bae0ec Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 22 Feb 2023 16:58:22 -0800 Subject: [PATCH 063/206] Apply text decoration underline when render (#175193) Fixes https://github.com/microsoft/vscode/issues/174962 --- src/vs/platform/quickinput/browser/media/quickInput.css | 1 - src/vs/platform/quickinput/browser/quickInputUtils.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/quickinput/browser/media/quickInput.css b/src/vs/platform/quickinput/browser/media/quickInput.css index 10d98756933..c236c90ee25 100644 --- a/src/vs/platform/quickinput/browser/media/quickInput.css +++ b/src/vs/platform/quickinput/browser/media/quickInput.css @@ -142,7 +142,6 @@ /* Links in descriptions & validations */ .quick-input-message a { - text-decoration: underline; color: inherit; } diff --git a/src/vs/platform/quickinput/browser/quickInputUtils.ts b/src/vs/platform/quickinput/browser/quickInputUtils.ts index 86c469ef3c3..65df79a2d18 100644 --- a/src/vs/platform/quickinput/browser/quickInputUtils.ts +++ b/src/vs/platform/quickinput/browser/quickInputUtils.ts @@ -56,6 +56,7 @@ export function renderQuickInputDescription(description: string, container: HTML } const anchor = dom.$('a', { href: node.href, title, tabIndex: tabIndex++ }, node.label); + anchor.style.textDecoration = 'underline'; const handleOpen = (e: unknown) => { if (dom.isEventLike(e)) { dom.EventHelper.stop(e, true); From 9c48a9a42c56b0d57f03252801512dbd7749fcc6 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 23 Feb 2023 00:01:29 -0800 Subject: [PATCH 064/206] Fix #175210 (#175211) --- .../contrib/preferences/browser/preferences.contribution.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts b/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts index 3e11c840e99..e21ec780d58 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts @@ -1231,6 +1231,11 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon title: { value: nls.localize('defineKeybinding.start', "Define Keybinding"), original: 'Define Keybinding' }, f1: true, precondition: when, + keybinding: { + weight: KeybindingWeight.WorkbenchContrib, + when, + primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyK) + }, menu: { id: MenuId.EditorContent, when, From 2b54ca810fe289f2cabcba75521b004a021b0a79 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 23 Feb 2023 00:22:51 -0800 Subject: [PATCH 065/206] use vscode-userdata scheme for user data (#175212) --- src/vs/code/node/sharedProcess/sharedProcessMain.ts | 2 +- src/vs/workbench/electron-sandbox/desktop.main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/code/node/sharedProcess/sharedProcessMain.ts b/src/vs/code/node/sharedProcess/sharedProcessMain.ts index dd9c462b46f..2f602186c76 100644 --- a/src/vs/code/node/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/node/sharedProcess/sharedProcessMain.ts @@ -266,7 +266,7 @@ class SharedProcessMain extends Disposable { fileService.registerProvider(Schemas.vscodeUserData, userDataFileSystemProvider); // User Data Profiles - const userDataProfilesService = this._register(new UserDataProfilesService(this.configuration.profiles.all, URI.revive(this.configuration.profiles.home), mainProcessService.getChannel('userDataProfiles'))); + const userDataProfilesService = this._register(new UserDataProfilesService(this.configuration.profiles.all, URI.revive(this.configuration.profiles.home).with({ scheme: environmentService.userRoamingDataHome.scheme }), mainProcessService.getChannel('userDataProfiles'))); services.set(IUserDataProfilesService, userDataProfilesService); // Configuration diff --git a/src/vs/workbench/electron-sandbox/desktop.main.ts b/src/vs/workbench/electron-sandbox/desktop.main.ts index ea8d8b0a613..f983c2717c3 100644 --- a/src/vs/workbench/electron-sandbox/desktop.main.ts +++ b/src/vs/workbench/electron-sandbox/desktop.main.ts @@ -233,7 +233,7 @@ export class DesktopMain extends Disposable { serviceCollection.set(IUriIdentityService, uriIdentityService); // User Data Profiles - const userDataProfilesService = new UserDataProfilesService(this.configuration.profiles.all, URI.revive(this.configuration.profiles.home), mainProcessService.getChannel('userDataProfiles')); + const userDataProfilesService = new UserDataProfilesService(this.configuration.profiles.all, URI.revive(this.configuration.profiles.home).with({ scheme: environmentService.userRoamingDataHome.scheme }), mainProcessService.getChannel('userDataProfiles')); serviceCollection.set(IUserDataProfilesService, userDataProfilesService); const userDataProfileService = new UserDataProfileService(reviveProfile(this.configuration.profiles.profile, userDataProfilesService.profilesHome.scheme), userDataProfilesService); serviceCollection.set(IUserDataProfileService, userDataProfileService); From 083f695805c07915d5e9462632598f04d296e26e Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 23 Feb 2023 11:14:09 +0100 Subject: [PATCH 066/206] fix warning --- src/vs/workbench/common/theme.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index da197cf8b46..6db644acc7e 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground, listActiveSelectionBackground, listActiveSelectionForeground, editorForeground, toolbarHoverBackground, inputBorder, widgetBorder, foreground } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground, listActiveSelectionBackground, listActiveSelectionForeground, editorForeground, toolbarHoverBackground, inputBorder, widgetBorder } from 'vs/platform/theme/common/colorRegistry'; import { IColorTheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { ColorScheme } from 'vs/platform/theme/common/theme'; From 9b45d88abd0c319fd8a3c88095ee67987e88955e Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 23 Feb 2023 11:44:12 +0100 Subject: [PATCH 067/206] combine text edit refactoring --- .../beforeEditPositionMapper.ts | 4 + .../bracketPairsTree/combineTextEditInfos.ts | 165 ++++++++---------- .../bracketPairsTree/length.ts | 4 + .../combineTextEditInfos.test.ts | 6 +- 4 files changed, 77 insertions(+), 102 deletions(-) diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts index 162509bed20..a985d961511 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.ts @@ -12,6 +12,10 @@ export class TextEditInfo { public readonly newLength: Length ) { } + + toString(): string { + return `[${lengthToObj(this.startOffset)}...${lengthToObj(this.endOffset)}) -> ${lengthToObj(this.newLength)}`; + } } export class BeforeEditPositionMapper { diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts index 218ff36b6a3..01dec299fd9 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts @@ -5,92 +5,53 @@ import { ArrayQueue } from 'vs/base/common/arrays'; import { TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper'; -import { Length, lengthAdd, lengthDiffNonNegative, lengthEquals, lengthIsZero, lengthLessThanEqual, lengthZero, sumLengths } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; +import { Length, lengthAdd, lengthDiffNonNegative, lengthEquals, lengthIsZero, lengthLessThanEqual, lengthToObj, lengthZero, sumLengths } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; export function combineTextEditInfos(textEditInfoFirst: TextEditInfo[], textEditInfoSecond: TextEditInfo[]): TextEditInfo[] { if (textEditInfoFirst.length === 0) { return textEditInfoSecond; } + if (textEditInfoSecond.length === 0) { + return textEditInfoFirst; + } // s0: State before any edits - const firstMap = new ArrayQueue(toTextMap(textEditInfoFirst)); + const s0ToS1Map = new ArrayQueue(toLengthMapping(textEditInfoFirst)); // s1: State after first edit, but before second edit - const secondMap = toTextMap(textEditInfoSecond); + const s1ToS2Map = toLengthMapping(textEditInfoSecond) as (LengthMapping | { lengthBefore: undefined; lengthAfter: undefined; modified: false })[]; + s1ToS2Map.push({ modified: false, lengthBefore: undefined, lengthAfter: undefined }); // Copy everything from old to new // s2: State after both edits - // If set, we are in an edit - let remainingS0Length: Length | undefined = undefined; - let remainingS1Length: Length = lengthZero; + let curItem: LengthMapping | undefined = s0ToS1Map.dequeue(); /** * @param s1Length Use undefined for length "infinity" */ - function readPartialS0Map(s1Length: Length | undefined): TextMapping[] { - const result: TextMapping[] = []; - - while (true) { - if ((remainingS0Length !== undefined && !lengthIsZero(remainingS0Length)) || !lengthIsZero(remainingS1Length)) { - let readS1Length: Length; - if (s1Length !== undefined && lengthLessThanEqual(s1Length, remainingS1Length)) { - // remaining satisfies request - readS1Length = s1Length; - remainingS1Length = lengthDiffNonNegative(s1Length, remainingS1Length); - s1Length = lengthZero; - } else { - // Read all of remaining, potentially even more - readS1Length = remainingS1Length; - if (s1Length !== undefined) { - s1Length = lengthDiffNonNegative(remainingS1Length, s1Length); - } - remainingS1Length = lengthZero; - } - - if (remainingS0Length === undefined) { - // unchanged area - result.push({ - oldLength: readS1Length, - newLength: undefined - }); - } else { - // We eagerly consume all of the old length, even if - // we are in an edit and only consume it partially. - result.push({ - oldLength: remainingS0Length, - newLength: readS1Length - }); - remainingS0Length = lengthZero; - } - } - - if (s1Length !== undefined && lengthIsZero(s1Length)) { - break; - } - - const item = firstMap.dequeue(); - if (!item) { - if (s1Length !== undefined) { - result.push({ - oldLength: s1Length, - newLength: undefined, - }); - } - break; - } - if (item.newLength === undefined) { - remainingS1Length = item.oldLength; - remainingS0Length = undefined; - } else { - remainingS0Length = item.oldLength; - remainingS1Length = item.newLength; + function nextS0ToS1MapWithS1LengthOf(s1Length: Length | undefined): LengthMapping[] { + if (s1Length === undefined) { + const arr = s0ToS1Map.takeWhile(v => true) || []; + if (curItem) { + arr.unshift(curItem); } + return arr; } + const result: LengthMapping[] = []; + while (curItem && !lengthIsZero(s1Length)) { + const [item, remainingItem] = curItem.splitAt(s1Length); + result.push(item); + s1Length = lengthDiffNonNegative(item.lengthAfter, s1Length); + curItem = remainingItem ?? s0ToS1Map.dequeue(); + } + if (!lengthIsZero(s1Length)) { + result.push(new LengthMapping(false, s1Length, s1Length)); + } return result; } const result: TextEditInfo[] = []; - function push(startOffset: Length, endOffset: Length, newLength: Length) { + function pushEdit(startOffset: Length, endOffset: Length, newLength: Length): void { if (result.length > 0 && lengthEquals(result[result.length - 1].endOffset, startOffset)) { const lastResult = result[result.length - 1]; result[result.length - 1] = new TextEditInfo(lastResult.startOffset, endOffset, lengthAdd(lastResult.newLength, newLength)); @@ -100,61 +61,71 @@ export function combineTextEditInfos(textEditInfoFirst: TextEditInfo[], textEdit } let s0offset = lengthZero; - for (const s2 of secondMap) { - const s0ToS1Map = readPartialS0Map(s2.oldLength); - if (s2.newLength !== undefined) { - // This is an edit - const s0Length = sumLengths(s0ToS1Map, s => s.oldLength); + for (const s1ToS2 of s1ToS2Map) { + const s0ToS1Map = nextS0ToS1MapWithS1LengthOf(s1ToS2.lengthBefore); + if (s1ToS2.modified) { + const s0Length = sumLengths(s0ToS1Map, s => s.lengthBefore); const s0EndOffset = lengthAdd(s0offset, s0Length); - push(s0offset, s0EndOffset, s2.newLength); + pushEdit(s0offset, s0EndOffset, s1ToS2.lengthAfter); s0offset = s0EndOffset; } else { - // We are in an unchanged area for (const s1 of s0ToS1Map) { const s0startOffset = s0offset; - s0offset = lengthAdd(s0offset, s1.oldLength); - - if (s1.newLength !== undefined) { - push(s0startOffset, s0offset, s1.newLength); + s0offset = lengthAdd(s0offset, s1.lengthBefore); + if (s1.modified) { + pushEdit(s0startOffset, s0offset, s1.lengthAfter); } } } } - const s0ToS1Map = readPartialS0Map(undefined); - for (const s1 of s0ToS1Map) { - const s0startOffset = s0offset; - s0offset = lengthAdd(s0offset, s1.oldLength); - - if (s1.newLength !== undefined) { - push(s0startOffset, s0offset, s1.newLength); - } - } - return result; } -interface TextMapping { - oldLength: Length; +class LengthMapping { + constructor( + /** + * If false, length before and length after equal. + */ + public readonly modified: boolean, + public readonly lengthBefore: Length, + public readonly lengthAfter: Length, + ) { + } - /** - * If set, this mapping represents an edit. - * If not set, this mapping represents an unchanged region (for which the new length equals the old length). - */ - newLength?: Length; + splitAt(lengthAfter: Length): [LengthMapping, LengthMapping | undefined] { + const remainingLengthAfter = lengthDiffNonNegative(lengthAfter, this.lengthAfter); + if (lengthEquals(remainingLengthAfter, lengthZero)) { + return [this, undefined]; + } else if (this.modified) { + return [ + new LengthMapping(this.modified, this.lengthBefore, lengthAfter), + new LengthMapping(this.modified, lengthZero, remainingLengthAfter) + ]; + } else { + return [ + new LengthMapping(this.modified, lengthAfter, lengthAfter), + new LengthMapping(this.modified, remainingLengthAfter, remainingLengthAfter) + ]; + } + } + + toString(): string { + return `${this.modified ? 'M' : 'U'}:${lengthToObj(this.lengthBefore)} -> ${lengthToObj(this.lengthAfter)}`; + } } -function toTextMap(textEditInfos: TextEditInfo[]): TextMapping[] { - const result: TextMapping[] = []; +function toLengthMapping(textEditInfos: TextEditInfo[]): LengthMapping[] { + const result: LengthMapping[] = []; let lastOffset = lengthZero; for (const textEditInfo of textEditInfos) { const spaceLength = lengthDiffNonNegative(lastOffset, textEditInfo.startOffset); if (!lengthIsZero(spaceLength)) { - result.push({ oldLength: spaceLength }); + result.push(new LengthMapping(false, spaceLength, spaceLength)); } - const oldLength = lengthDiffNonNegative(textEditInfo.startOffset, textEditInfo.endOffset); - result.push({ oldLength, newLength: textEditInfo.newLength }); + const lengthBefore = lengthDiffNonNegative(textEditInfo.startOffset, textEditInfo.endOffset); + result.push(new LengthMapping(true, lengthBefore, textEditInfo.newLength)); lastOffset = textEditInfo.endOffset; } return result; diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts index 0b72d9dbf31..564cd5ab4b7 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts @@ -238,3 +238,7 @@ export function lengthOfStringObj(str: string): LengthObj { export function lengthHash(length: Length): number { return length as any; } + +export function lengthMax(length1: Length, length2: Length): Length { + return length1 > length2 ? length1 : length2; +} diff --git a/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts b/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts index 20bd2a503f8..619d10d52ec 100644 --- a/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts +++ b/src/vs/editor/test/common/model/bracketPairColorizer/combineTextEditInfos.test.ts @@ -72,11 +72,7 @@ function getRandomEdit(textModel: TextModel, rangeOffsetStart: number, rng: Mers const lineCount = rng.nextIntRange(0, 3); const columnCount = rng.nextIntRange(0, 5); - return { - startOffset: positionToLength(textModel.getPositionAt(offsetStart)), - endOffset: positionToLength(textModel.getPositionAt(offsetEnd)), - newLength: toLength(lineCount, columnCount) - }; + return new TextEditInfo(positionToLength(textModel.getPositionAt(offsetStart)), positionToLength(textModel.getPositionAt(offsetEnd)), toLength(lineCount, columnCount)); } function toEdit(editInfo: TextEditInfo): ISingleEditOperation { From 1a336e49516a0334facddf5bc75970286ad4d7fb Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Thu, 23 Feb 2023 12:06:17 +0100 Subject: [PATCH 068/206] Skip checking for RTL chunks which are basic ASCII (#175222) Skip checking for RTL chunks which are basic ASCII (#174939) --- .../pieceTreeTextBufferBuilder.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts index 6afe8339c96..824a5674a32 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts @@ -141,16 +141,15 @@ export class PieceTreeTextBufferBuilder implements ITextBufferBuilder { this.lf += lineStarts.lf; this.crlf += lineStarts.crlf; - if (this.isBasicASCII) { - this.isBasicASCII = lineStarts.isBasicASCII; - } - if (!this.isBasicASCII && !this.containsRTL) { - // No need to check if it is basic ASCII - this.containsRTL = strings.containsRTL(chunk); - } - if (!this.isBasicASCII && !this.containsUnusualLineTerminators) { - // No need to check if it is basic ASCII - this.containsUnusualLineTerminators = strings.containsUnusualLineTerminators(chunk); + if (!lineStarts.isBasicASCII) { + // this chunk contains non basic ASCII characters + this.isBasicASCII = false; + if (!this.containsRTL) { + this.containsRTL = strings.containsRTL(chunk); + } + if (!this.containsUnusualLineTerminators) { + this.containsUnusualLineTerminators = strings.containsUnusualLineTerminators(chunk); + } } } From d3dafbe6f4eaf3be6168bf19d5e52dbd0c7f759c Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Thu, 23 Feb 2023 12:55:32 +0100 Subject: [PATCH 069/206] Fix invisible scroll and button overlap in comment widget (#175228) --- src/vs/workbench/contrib/comments/browser/media/review.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/workbench/contrib/comments/browser/media/review.css b/src/vs/workbench/contrib/comments/browser/media/review.css index 78f8639cf0a..aa2bccc121f 100644 --- a/src/vs/workbench/contrib/comments/browser/media/review.css +++ b/src/vs/workbench/contrib/comments/browser/media/review.css @@ -367,9 +367,14 @@ margin: 10px 0; } +.review-widget .body .edit-container .form-actions { + padding-top: 10px; +} + .review-widget .body .edit-textarea { height: 90px; margin: 5px 0 10px 0; + margin-right: 12px; } .review-widget .body .comment-form .monaco-text-button, From 5c55541c72a4dc7695c509346b244bd7ffaa18cb Mon Sep 17 00:00:00 2001 From: Ulugbek Abdullaev Date: Thu, 23 Feb 2023 14:59:01 +0100 Subject: [PATCH 070/206] ulugbekna/remove console warns (#175239) * context keys: old parser: remove console.warn's * context keys: new parser: remove console.warn's --- .../platform/contextkey/common/contextkey.ts | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/vs/platform/contextkey/common/contextkey.ts b/src/vs/platform/contextkey/common/contextkey.ts index cd85383e3e4..5538caa019d 100644 --- a/src/vs/platform/contextkey/common/contextkey.ts +++ b/src/vs/platform/contextkey/common/contextkey.ts @@ -238,14 +238,12 @@ export abstract class ContextKeyExpr { private static _deserializeRegexValue(serializedValue: string): RegExp | null { if (isFalsyOrWhitespace(serializedValue)) { - console.warn('missing regexp-value for =~-expression'); return null; } const start = serializedValue.indexOf('/'); const end = serializedValue.lastIndexOf('/'); - if (start === end || start < 0 /* || to < 0 */) { - console.warn(`bad regexp-value '${serializedValue}', missing /-enclosure`); + if (start === end || start < 0) { return null; } @@ -253,8 +251,7 @@ export abstract class ContextKeyExpr { const caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : ''; try { return new RegExp(value, caseIgnoreFlag); - } catch (e) { - console.warn(`bad regexp-value '${serializedValue}', parse error: ${e}`); + } catch (_e) { return null; } } @@ -499,25 +496,23 @@ export class Parser { let regex: RegExp | null = null; - if (isFalsyOrWhitespace(serializedValue)) { - console.warn('missing regexp-value for =~-expression'); - } else { + if (!isFalsyOrWhitespace(serializedValue)) { const start = serializedValue.indexOf('/'); const end = serializedValue.lastIndexOf('/'); - if (start === end || start < 0 /* || to < 0 */) { - console.warn(`bad regexp-value '${serializedValue}', missing /-enclosure`); - } else { + if (start !== end && start >= 0) { const value = serializedValue.slice(start + 1, end); const caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : ''; try { regex = new RegExp(value, caseIgnoreFlag); - } catch (e) { - console.warn(`bad regexp-value '${serializedValue}', parse error: ${e}`); - } + } catch (_e) { } } } + if (regex === null) { + throw this._errExpectedButGot('REGEX', expr); + } + return ContextKeyRegexExpr.create(key, regex); } From 0d85cd4b554566ed62c0119fc5cecbc0a1972081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Thu, 23 Feb 2023 15:27:21 +0100 Subject: [PATCH 071/206] fixes #172725 (#175240) --- src/vs/workbench/browser/parts/editor/sideBySideEditor.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts index 89ba4915043..4c5b3425a57 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts @@ -203,7 +203,13 @@ export class SideBySideEditor extends AbstractEditorWithViewState this.splitview?.distributeViewSizes())); - this.splitview.orthogonalEndSash = this._boundarySashes?.bottom; + + if (this.orientation === Orientation.HORIZONTAL) { + this.splitview.orthogonalEndSash = this._boundarySashes?.bottom; + } else { + this.splitview.orthogonalStartSash = this._boundarySashes?.left; + this.splitview.orthogonalEndSash = this._boundarySashes?.right; + } // Figure out sizing let leftSizing: number | Sizing = Sizing.Distribute; From 7cfe4e043b9bffd8a32843fde84993820652a551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Thu, 23 Feb 2023 16:05:51 +0100 Subject: [PATCH 072/206] update classifier.json (#175244) * move snap * update classifier.json --- .github/classifier.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/classifier.json b/.github/classifier.json index 19bbd7d578d..c9810659a43 100644 --- a/.github/classifier.json +++ b/.github/classifier.json @@ -105,7 +105,7 @@ "image-preview": {"assign": ["mjbvz"]}, "inlay-hints": {"assign": ["jrieken", "hediet"]}, "inline-completions": {"assign": ["hediet"]}, - "install-update": {"assign": ["joaomoreno"]}, + "install-update": {"assign": ["joaomoreno"], "accuracy": 0.85}, "intellisense-config": {"assign": ["rzhao271"]}, "interactive-playground": {"assign": ["chrmarti"]}, "interactive-window": {"assign": ["amunger", "rebornix"]}, @@ -210,7 +210,7 @@ "shared-process": {"assign": []}, "simple-file-dialog": {"assign": ["alexr00"]}, "smart-select": {"assign": ["jrieken"]}, - "snap": {"assign": ["joaomoreno"]}, + "snap": {"assign": ["deepak1556"]}, "snippets": {"assign": ["jrieken"]}, "splitview-widget": {"assign": ["joaomoreno"]}, "ssh": {"assign": ["eleanorjboyd"]}, From d63ed75ce21504a56a54f9fb763fe48f58721700 Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Thu, 23 Feb 2023 16:27:57 +0100 Subject: [PATCH 073/206] removed the sorting options that were added --- src/vscode-dts/vscode.d.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 8a1e826817f..7bdd9fefda4 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -4074,27 +4074,6 @@ declare module 'vscode' { provideDocumentRangeSemanticTokens(document: TextDocument, range: Range, token: CancellationToken): ProviderResult; } - /** - * Value-object describing what options formatting should use. - */ - export interface SortingOptions { - - /** - * Size of a tab in spaces. - */ - tabSize: number; - - /** - * Prefer spaces over tabs. - */ - insertSpaces: boolean; - - /** - * Signature for further properties. - */ - [key: string]: boolean | number | string; - } - /** * Value-object describing what options formatting should use. */ From cc99387a093020325227f8f629f61a53cb91570e Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 23 Feb 2023 16:32:44 +0100 Subject: [PATCH 074/206] Support filtering remoteExtensionTips by platform (#175246) --- package.json | 2 +- src/vs/base/common/platform.ts | 4 +++- src/vs/base/common/product.ts | 3 +++ .../extensions/browser/remoteRecommendations.ts | 4 +++- .../contrib/remote/browser/remoteIndicator.ts | 15 +++++++++------ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 14409e0a218..b6ac004be40 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.76.0", - "distro": "ef7b3fe403fb76194fc61bc83b4b53af19a8f704", + "distro": "30820417178d1e9f8ca7347ab291696ee134692f", "author": { "name": "Microsoft Corporation" }, diff --git a/src/vs/base/common/platform.ts b/src/vs/base/common/platform.ts index 23f3c647b32..d9f0814f291 100644 --- a/src/vs/base/common/platform.ts +++ b/src/vs/base/common/platform.ts @@ -135,7 +135,9 @@ export const enum Platform { Linux, Windows } -export function PlatformToString(platform: Platform) { +export type PlatformName = 'Web' | 'Windows' | 'Mac' | 'Linux'; + +export function PlatformToString(platform: Platform): PlatformName { switch (platform) { case Platform.Web: return 'Web'; case Platform.Mac: return 'Mac'; diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts index e6be203b984..32cc759dc7d 100644 --- a/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IStringDictionary } from 'vs/base/common/collections'; +import { PlatformName } from 'vs/base/common/platform'; export interface IBuiltInExtension { readonly name: string; @@ -198,11 +199,13 @@ export interface IExeBasedExtensionTip { export interface IRemoteExtensionTip { friendlyName: string; extensionId: string; + supportedPlatforms?: PlatformName[]; } export interface IVirtualWorkspaceExtensionTip { friendlyName: string; extensionId: string; + supportedPlatforms?: PlatformName[]; } export interface ISurveyData { diff --git a/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.ts b/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.ts index b6be83a4de2..43d9c8a2dd8 100644 --- a/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.ts +++ b/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.ts @@ -6,6 +6,7 @@ import { ExtensionRecommendations, ExtensionRecommendation } from 'vs/workbench/contrib/extensions/browser/extensionRecommendations'; import { IProductService } from 'vs/platform/product/common/productService'; import { ExtensionRecommendationReason } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations'; +import { PlatformToString, platform } from 'vs/base/common/platform'; export class RemoteRecommendations extends ExtensionRecommendations { @@ -20,7 +21,8 @@ export class RemoteRecommendations extends ExtensionRecommendations { protected async doActivate(): Promise { const extensionTips = { ...this.productService.remoteExtensionTips, ...this.productService.virtualWorkspaceExtensionTips }; - this._recommendations = Object.entries(extensionTips).map(([_, extension]) => ({ + const currentPlatform = PlatformToString(platform); + this._recommendations = Object.values(extensionTips).filter(({ supportedPlatforms }) => !supportedPlatforms || supportedPlatforms.includes(currentPlatform)).map(extension => ({ extensionId: extension.extensionId.toLowerCase(), reason: { reasonId: ExtensionRecommendationReason.Application, diff --git a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts index 1a0b2feacb9..5425c173229 100644 --- a/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts +++ b/src/vs/workbench/contrib/remote/browser/remoteIndicator.ts @@ -21,7 +21,7 @@ import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/envir import { PersistentConnectionEventType } from 'vs/platform/remote/common/remoteAgentConnection'; import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { isWeb } from 'vs/base/common/platform'; +import { PlatformToString, isWeb, platform } from 'vs/base/common/platform'; import { once } from 'vs/base/common/functional'; import { truncate } from 'vs/base/common/strings'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -513,11 +513,14 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr private hasAdditionalRemoteExtensions() { const extensionTips = { ...this.productService.remoteExtensionTips, ...this.productService.virtualWorkspaceExtensionTips }; - for (const [_, extension] of Object.entries(extensionTips)) { - const { extensionId: recommendedExtensionId } = extension; - // if this recommended extension isn't already installed, return early - if (!this.extensionService.extensions.some((extension) => extension.id?.toLowerCase() === recommendedExtensionId.toLowerCase())) { - return true; + const currentPlatform = PlatformToString(platform); + for (const extension of Object.values(extensionTips)) { + const { extensionId: recommendedExtensionId, supportedPlatforms } = extension; + if (!supportedPlatforms || supportedPlatforms.includes(currentPlatform)) { + // if this recommended extension isn't already installed, return early + if (!this.extensionService.extensions.some((extension) => extension.id?.toLowerCase() === recommendedExtensionId.toLowerCase())) { + return true; + } } } return false; From 8dcf90c7d0355576ae60bdd13782dd4999ae493b Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 23 Feb 2023 16:52:44 +0100 Subject: [PATCH 075/206] Non-standard capitalization of JSON commands (#175251) --- extensions/json-language-features/client/src/jsonClient.ts | 2 +- extensions/json-language-features/package.nls.json | 4 ++-- extensions/json-language-features/server/src/jsonServer.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/json-language-features/client/src/jsonClient.ts b/extensions/json-language-features/client/src/jsonClient.ts index 52136c3cf85..598daf78f93 100644 --- a/extensions/json-language-features/client/src/jsonClient.ts +++ b/extensions/json-language-features/client/src/jsonClient.ts @@ -45,7 +45,7 @@ interface DocumentSortingParams { */ readonly uri: string; /** - * The format options + * The sort options */ readonly options: SortOptions; } diff --git a/extensions/json-language-features/package.nls.json b/extensions/json-language-features/package.nls.json index db0c326510d..571d047802d 100644 --- a/extensions/json-language-features/package.nls.json +++ b/extensions/json-language-features/package.nls.json @@ -17,6 +17,6 @@ "json.maxItemsComputed.desc": "The maximum number of outline symbols and folding regions computed (limited for performance reasons).", "json.maxItemsExceededInformation.desc": "Show notification when exceeding the maximum number of outline symbols and folding regions.", "json.enableSchemaDownload.desc": "When enabled, JSON schemas can be fetched from http and https locations.", - "json.command.clearCache": "Clear schema cache", - "json.command.sort": "Sort document" + "json.command.clearCache": "Clear Schema Cache", + "json.command.sort": "Sort Document" } diff --git a/extensions/json-language-features/server/src/jsonServer.ts b/extensions/json-language-features/server/src/jsonServer.ts index 27b5b8cbeae..0282e6fa939 100644 --- a/extensions/json-language-features/server/src/jsonServer.ts +++ b/extensions/json-language-features/server/src/jsonServer.ts @@ -45,7 +45,7 @@ export interface DocumentSortingParams { */ uri: string; /** - * The format options + * The sort options */ options: SortOptions; } From 6c3577d28fcffe2a2281e7849871bdca4a3dfdae Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Thu, 23 Feb 2023 09:35:11 -0700 Subject: [PATCH 076/206] Allow aml extension in telemetry (#175256) --- src/vs/platform/telemetry/common/telemetryUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/telemetry/common/telemetryUtils.ts b/src/vs/platform/telemetry/common/telemetryUtils.ts index b346f87ce86..3dd93b1bb3b 100644 --- a/src/vs/platform/telemetry/common/telemetryUtils.ts +++ b/src/vs/platform/telemetry/common/telemetryUtils.ts @@ -238,7 +238,7 @@ export function validateTelemetryData(data?: any): { properties: Properties; mea }; } -const telemetryAllowedAuthorities = new Set(['ssh-remote', 'dev-container', 'attached-container', 'wsl', 'tunnel', 'codespaces']); +const telemetryAllowedAuthorities = new Set(['ssh-remote', 'dev-container', 'attached-container', 'wsl', 'tunnel', 'codespaces', 'amlext']); export function cleanRemoteAuthority(remoteAuthority?: string): string { if (!remoteAuthority) { From b5a4806a03c4e257fe5fa26423bf2b6dc26450b9 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Thu, 23 Feb 2023 11:02:18 -0600 Subject: [PATCH 077/206] respond to config changes of tab focus mode (#175261) fix #174924 --- .../workbench/browser/parts/editor/editorStatus.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 322a661a637..cadd52ac993 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -53,6 +53,7 @@ import { ITelemetryData, ITelemetryService } from 'vs/platform/telemetry/common/ import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; import { AutomaticLanguageDetectionLikelyWrongClassification, AutomaticLanguageDetectionLikelyWrongId, IAutomaticLanguageDetectionLikelyWrongData, ILanguageDetectionService } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { TerminalSettingId } from 'vs/platform/terminal/common/terminal'; class SideBySideEditorEncodingSupport implements IEncodingSupport { constructor(private primary: IEncodingSupport, private secondary: IEncodingSupport) { } @@ -308,7 +309,8 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution { @ITextFileService private readonly textFileService: ITextFileService, @IStatusbarService private readonly statusbarService: IStatusbarService, @IInstantiationService private readonly instantiationService: IInstantiationService, - @IContextKeyService private readonly contextKeyService: IContextKeyService + @IContextKeyService private readonly contextKeyService: IContextKeyService, + @IConfigurationService private readonly configurationService: IConfigurationService ) { super(); @@ -334,6 +336,15 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution { this.onTabFocusModeChange(); } })); + this._register(this.configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration('editor.tabFocusMode')) { + TabFocus.setTabFocusMode(this.configurationService.getValue('editor.tabFocusMode'), TabFocusContext.Editor); + this.onTabFocusModeChange(); + } else if (e.affectsConfiguration(TerminalSettingId.TabFocusMode)) { + TabFocus.setTabFocusMode(this.configurationService.getValue(TerminalSettingId.TabFocusMode), TabFocusContext.Terminal); + this.onTabFocusModeChange(); + } + })); } private registerCommands(): void { @@ -833,7 +844,6 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution { private onTabFocusModeChange(): void { const info: StateDelta = { type: 'tabFocusMode', tabFocusMode: TabFocus.getTabFocusMode(this.contextKeyService.getContextKeyValue('focusedView') === 'terminal' ? TabFocusContext.Terminal : TabFocusContext.Editor) }; - this.updateState(info); } From b94cdd3fc98631dca47310789366e726cabca885 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 23 Feb 2023 19:29:46 +0100 Subject: [PATCH 078/206] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6ac004be40..6489e23c243 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.76.0", - "distro": "30820417178d1e9f8ca7347ab291696ee134692f", + "distro": "7f6bd79ff2c6562093b6e686681a9b873a1b5394", "author": { "name": "Microsoft Corporation" }, From 89781185b9b78834f2e032cf611397b87bcae836 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Thu, 23 Feb 2023 14:25:14 -0600 Subject: [PATCH 079/206] correctly play error audio cue on line / char navigation (#175277) fix #174857 --- .../browser/audioCueLineFeatureContribution.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts index 630452c5ca7..d7b1c8c4327 100644 --- a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts +++ b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts @@ -180,7 +180,7 @@ interface LineFeatureState { class MarkerLineFeature implements LineFeature { public readonly debounceWhileTyping = true; - + private _previousLine: number = 0; constructor( public readonly audioCue: AudioCue, private readonly severity: MarkerSeverity, @@ -195,16 +195,15 @@ class MarkerLineFeature implements LineFeature { ), () => /** @description this.markerService.onMarkerChanged */({ isPresent: (position) => { + const lineChanged = position.lineNumber !== this._previousLine; + this._previousLine = position.lineNumber; const hasMarker = this.markerService .read({ resource: model.uri }) .some( - (m) => - m.severity === this.severity && - m.startLineNumber <= position.lineNumber && - position.lineNumber <= m.endLineNumber && - m.startColumn <= position.column && - position.column <= m.endColumn - ); + (m) => { + const onLine = m.severity === this.severity && m.startLineNumber <= position.lineNumber && position.lineNumber <= m.endLineNumber; + return lineChanged ? onLine : onLine && (position.lineNumber <= m.endLineNumber && m.startColumn <= position.column); + }); return hasMarker; }, }) From 720985f2c68cadb5e375d9ec671476c548f61769 Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Thu, 23 Feb 2023 23:29:30 +0000 Subject: [PATCH 080/206] Followup to #175151 (#175291) --- extensions/github/package.json | 2 +- .../contrib/editSessions/browser/editSessions.contribution.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/github/package.json b/extensions/github/package.json index d56257ec5db..2cdb0307196 100644 --- a/extensions/github/package.json +++ b/extensions/github/package.json @@ -54,7 +54,7 @@ "command": "github.openOnVscodeDev", "when": "github.hasGitHubRepo", "qualifiedName": "Continue Working in vscode.dev", - "group": "Remote Repositories", + "category": "Remote Repositories", "remoteGroup": "virtualfs_44_vscode-vfs_2_web@2" } ], diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts index 567e8a66a68..2394187c0b5 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts @@ -800,7 +800,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo )); if (contribution.qualifiedName) { - this.generateStandaloneOptionCommand(command.id, contribution.qualifiedName, contribution.group ?? command.category, when, contribution.remoteGroup); + this.generateStandaloneOptionCommand(command.id, contribution.qualifiedName, contribution.category ?? command.category, when, contribution.remoteGroup); } } } @@ -988,6 +988,7 @@ interface ICommand { when: string; documentation?: string; qualifiedName?: string; + category?: string; remoteGroup?: string; } From ba158c8e376cc0792e0ccb17a74f715bd40c8e24 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 24 Feb 2023 08:27:16 +0100 Subject: [PATCH 081/206] adds experimental tag to editor.experimental.asyncTokenization (#175296) --- src/vs/editor/common/config/editorConfigurationSchema.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/common/config/editorConfigurationSchema.ts b/src/vs/editor/common/config/editorConfigurationSchema.ts index 0896719878a..a2c3d886017 100644 --- a/src/vs/editor/common/config/editorConfigurationSchema.ts +++ b/src/vs/editor/common/config/editorConfigurationSchema.ts @@ -98,7 +98,8 @@ const editorConfiguration: IConfigurationNode = { 'editor.experimental.asyncTokenization': { type: 'boolean', default: false, - description: nls.localize('editor.experimental.asyncTokenization', "Controls whether the tokenization should happen asynchronously on a web worker.") + description: nls.localize('editor.experimental.asyncTokenization', "Controls whether the tokenization should happen asynchronously on a web worker."), + tags: ['experimental'], }, 'editor.language.brackets': { type: ['array', 'null'], From d2e62228f48960b99272c2b7a4f00caf280e2421 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 24 Feb 2023 11:06:51 +0100 Subject: [PATCH 082/206] Revert "remove EH start delay" (#175315) This reverts commit 21718a1e56b98ae9642471dae4b855ccdcf14a7c. re https://github.com/microsoft/vscode/issues/175275 This change is still good but changes how/what we measure and we should do that with more slack time --- .../extensions/electron-sandbox/nativeExtensionService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts index 19ec27c6417..45022c15cc3 100644 --- a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts +++ b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts @@ -7,6 +7,7 @@ import { CachedExtensionScanner } from 'vs/workbench/services/extensions/electro import { AbstractExtensionService, ExtensionHostCrashTracker, ExtensionRunningPreference, extensionRunningPreferenceToString, filterByRunningLocation } from 'vs/workbench/services/extensions/common/abstractExtensionService'; import * as nls from 'vs/nls'; import * as performance from 'vs/base/common/performance'; +import { runWhenIdle } from 'vs/base/common/async'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IWorkbenchExtensionEnablementService, EnablementState, IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; @@ -116,7 +117,12 @@ export class NativeExtensionService extends AbstractExtensionService implements // some editors require the extension host to restore // and this would result in a deadlock // see https://github.com/microsoft/vscode/issues/41322 - lifecycleService.when(LifecyclePhase.Ready).then(() => this._initialize()); + lifecycleService.when(LifecyclePhase.Ready).then(() => { + // reschedule to ensure this runs after restoring viewlets, panels, and editors + runWhenIdle(() => { + this._initialize(); + }, 50 /*max delay*/); + }); } private _isLocalWebWorkerEnabled(): [boolean, boolean] { From 07d120e10a4d3ac790e65b8a6dc85195546df664 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Fri, 24 Feb 2023 12:33:59 +0100 Subject: [PATCH 083/206] schema URI not resolving in workspace file (#175320) schema URI not resolve in workspace file --- .../client/src/jsonClient.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/extensions/json-language-features/client/src/jsonClient.ts b/extensions/json-language-features/client/src/jsonClient.ts index 598daf78f93..f208747da94 100644 --- a/extensions/json-language-features/client/src/jsonClient.ts +++ b/extensions/json-language-features/client/src/jsonClient.ts @@ -545,11 +545,10 @@ function getSettings(): Settings { } }; - const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[] | undefined, folderUri?: Uri) => { - + const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[] | undefined, folderUri: Uri | undefined = undefined, settingsLocation = folderUri) => { if (schemaSettings) { for (const setting of schemaSettings) { - const url = getSchemaId(setting, folderUri); + const url = getSchemaId(setting, settingsLocation); if (url) { const schemaSetting: JSONSchemaSettings = { url, fileMatch: setting.fileMatch, folderUri: folderUri?.toString(false), schema: setting.schema }; schemas.push(schemaSetting); @@ -558,15 +557,19 @@ function getSettings(): Settings { } }; + const folders = workspace.workspaceFolders; + const schemaConfigInfo = workspace.getConfiguration('json', null).inspect('schemas'); if (schemaConfigInfo) { - if (workspace.workspaceFile) { - collectSchemaSettings(schemaConfigInfo.workspaceValue, workspace.workspaceFile); + if (schemaConfigInfo.workspaceValue && workspace.workspaceFile && folders && folders.length) { + const settingsLocation = Uri.joinPath(workspace.workspaceFile, '..'); + for (const folder of folders) { + collectSchemaSettings(schemaConfigInfo.workspaceValue, folder.uri, settingsLocation); + } } collectSchemaSettings(schemaConfigInfo.globalValue); } - const folders = workspace.workspaceFolders; if (folders) { for (const folder of folders) { const schemaConfigInfo = workspace.getConfiguration('json', folder.uri).inspect('schemas'); @@ -576,14 +579,14 @@ function getSettings(): Settings { return settings; } -function getSchemaId(schema: JSONSchemaSettings, folderUri?: Uri): string | undefined { +function getSchemaId(schema: JSONSchemaSettings, settingsLocation?: Uri): string | undefined { let url = schema.url; if (!url) { if (schema.schema) { url = schema.schema.id || `vscode://schemas/custom/${encodeURIComponent(hash(schema.schema).toString(16))}`; } - } else if (folderUri && (url[0] === '.' || url[0] === '/')) { - url = Uri.joinPath(folderUri, url).toString(false); + } else if (settingsLocation && (url[0] === '.' || url[0] === '/')) { + url = Uri.joinPath(settingsLocation, url).toString(false); } return url; } From fc355cbc81e8d281c70ea7b15af3fd3830e18817 Mon Sep 17 00:00:00 2001 From: "ermin.zem" Date: Fri, 24 Feb 2023 22:36:45 +0800 Subject: [PATCH 084/206] chore: update IPCClient class comment (#175198) Co-authored-by: ermin.zem --- src/vs/base/parts/ipc/common/ipc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index 1d8c4a45efa..d71baaeeeb5 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -949,7 +949,7 @@ export class IPCServer implements IChannelServer, I * An `IPCClient` is both a channel client and a channel server. * * As the owner of a protocol, you should extend both this - * and the `IPCClient` classes to get IPC implementations + * and the `IPCServer` classes to get IPC implementations * for your protocol. */ export class IPCClient implements IChannelClient, IChannelServer, IDisposable { From b8dbdd9064530d18bc702c3b0851c5a43733f410 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 24 Feb 2023 15:38:40 +0100 Subject: [PATCH 085/206] update version to `1.77.0` (#175332) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6489e23c243..5335acfa3fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "code-oss-dev", - "version": "1.76.0", + "version": "1.77.0", "distro": "7f6bd79ff2c6562093b6e686681a9b873a1b5394", "author": { "name": "Microsoft Corporation" From ed6bb0790b236b6732dba147021a2eefe7d94a13 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 24 Feb 2023 15:41:33 +0100 Subject: [PATCH 086/206] sandbox - enable utility process in insiders by default (#175326) --- src/vs/code/electron-main/app.ts | 6 +++--- .../code/node/sharedProcess/sharedProcessMain.ts | 11 ++++++++--- .../sharedProcess/electron-main/sharedProcess.ts | 14 +++++++++++++- .../utilityProcessWorkerMainService.ts | 10 ++++++++-- .../windows/electron-main/windowsMainService.ts | 12 ++++++++++-- .../contrib/files/browser/files.contribution.ts | 7 ------- .../relauncher/browser/relauncher.contribution.ts | 6 ------ .../electron-sandbox/desktop.contribution.ts | 2 +- .../files/electron-sandbox/watcherClient.ts | 4 +--- .../utilityProcessWorkerWorkbenchService.ts | 8 ++++++++ 10 files changed, 52 insertions(+), 28 deletions(-) diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 23c44b398cc..1e2de12ca67 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -1248,13 +1248,13 @@ export class CodeApplication extends Disposable { // Logging switch (type) { case WindowError.PROCESS_GONE: - this.logService.error(`SharedProcess: renderer process gone (reason: ${details?.reason || ''}, code: ${details?.exitCode || ''})`); + this.logService.error(`[SharedProcess] renderer process gone (reason: ${details?.reason || ''}, code: ${details?.exitCode || ''})`); break; case WindowError.UNRESPONSIVE: - this.logService.error('SharedProcess: detected unresponsive'); + this.logService.error('[SharedProcess] detected unresponsive'); break; case WindowError.LOAD: - this.logService.error(`SharedProcess: failed to load (reason: ${details?.reason || ''}, code: ${details?.exitCode || ''})`); + this.logService.error(`[SharedProcess] failed to load (reason: ${details?.reason || ''}, code: ${details?.exitCode || ''})`); break; } diff --git a/src/vs/code/node/sharedProcess/sharedProcessMain.ts b/src/vs/code/node/sharedProcess/sharedProcessMain.ts index 2f602186c76..b289c060ead 100644 --- a/src/vs/code/node/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/node/sharedProcess/sharedProcessMain.ts @@ -145,9 +145,14 @@ class SharedProcessMain extends Disposable { private registerListeners(): void { // Shared process lifecycle - const onExit = async () => { - this.lifecycleService?.fireOnWillShutdown(); - this.dispose(); + let didExit = false; + const onExit = () => { + if (!didExit) { + didExit = true; + + this.lifecycleService?.fireOnWillShutdown(); + this.dispose(); + } }; process.once('exit', onExit); if (isUtilityProcess(process)) { diff --git a/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts b/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts index 0fc12536e0c..cb5d7a3066c 100644 --- a/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts +++ b/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts @@ -42,7 +42,19 @@ export class SharedProcess extends Disposable implements ISharedProcess { private windowCloseListener: ((event: ElectronEvent) => void) | undefined = undefined; private utilityProcess: UtilityProcess | undefined = undefined; - private readonly useUtilityProcess = canUseUtilityProcess && this.configurationService.getValue('window.experimental.sharedProcessUseUtilityProcess'); + private readonly useUtilityProcess = (() => { + let useUtilityProcess = false; + if (canUseUtilityProcess) { + const sharedProcessUseUtilityProcess = this.configurationService.getValue('window.experimental.sharedProcessUseUtilityProcess'); + if (typeof sharedProcessUseUtilityProcess === 'boolean') { + useUtilityProcess = sharedProcessUseUtilityProcess; + } else { + useUtilityProcess = typeof product.quality === 'string' && product.quality !== 'stable'; + } + } + + return useUtilityProcess; + })(); constructor( private readonly machineId: string, diff --git a/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts b/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts index b5e54ffa725..70be47e3b27 100644 --- a/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts +++ b/src/vs/platform/utilityProcess/electron-main/utilityProcessWorkerMainService.ts @@ -58,9 +58,15 @@ export class UtilityProcessWorkerMainService extends Disposable implements IUtil this.workers.set(workerId, worker); const onDidTerminate = new DeferredPromise(); - Event.once(worker.onDidTerminate)(e => { + Event.once(worker.onDidTerminate)(reason => { + if (reason.code === 0) { + this.logService.trace(`[UtilityProcessWorker]: terminated normally with code ${reason.code}, signal: ${reason.signal}`); + } else { + this.logService.error(`[UtilityProcessWorker]: terminated unexpectedly with code ${reason.code}, signal: ${reason.signal}`); + } + this.workers.delete(workerId); - onDidTerminate.complete({ reason: e }); + onDidTerminate.complete({ reason }); }); return onDidTerminate.p; diff --git a/src/vs/platform/windows/electron-main/windowsMainService.ts b/src/vs/platform/windows/electron-main/windowsMainService.ts index 62fa52e0cbb..14d03fb6e26 100644 --- a/src/vs/platform/windows/electron-main/windowsMainService.ts +++ b/src/vs/platform/windows/electron-main/windowsMainService.ts @@ -1312,7 +1312,6 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic private async openInBrowserWindow(options: IOpenBrowserWindowOptions): Promise { const windowConfig = this.configurationService.getValue('window'); - const filesConfig = this.configurationService.getValue<{ experimental?: { watcherUseUtilityProcess?: boolean } } | undefined>('files'); const lastActiveWindow = this.getLastActiveWindow(); const defaultProfile = lastActiveWindow?.profile ?? this.userDataProfilesMainService.defaultProfile; @@ -1325,6 +1324,15 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic } } + let preferUtilityProcess = false; + if (canUseUtilityProcess) { + if (typeof windowConfig?.experimental?.sharedProcessUseUtilityProcess === 'boolean') { + preferUtilityProcess = windowConfig.experimental.sharedProcessUseUtilityProcess; + } else { + preferUtilityProcess = typeof product.quality === 'string' && product.quality !== 'stable'; + } + } + // Build up the window configuration from provided options, config and environment const configuration: INativeWindowConfiguration = { @@ -1390,7 +1398,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic policiesData: this.policyService.serialize(), continueOn: this.environmentMainService.continueOn, - preferUtilityProcess: canUseUtilityProcess ? (filesConfig?.experimental?.watcherUseUtilityProcess ?? windowConfig?.experimental?.sharedProcessUseUtilityProcess ?? false) : false + preferUtilityProcess }; // New window diff --git a/src/vs/workbench/contrib/files/browser/files.contribution.ts b/src/vs/workbench/contrib/files/browser/files.contribution.ts index 54f7839e0d2..ffd76194863 100644 --- a/src/vs/workbench/contrib/files/browser/files.contribution.ts +++ b/src/vs/workbench/contrib/files/browser/files.contribution.ts @@ -260,13 +260,6 @@ configurationRegistry.registerConfiguration({ 'description': nls.localize('watcherInclude', "Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."), 'scope': ConfigurationScope.RESOURCE }, - 'files.experimental.watcherUseUtilityProcess': { // TODO@bpasero remove me once sandbox is enabled by default - type: 'boolean', - description: nls.localize('watcherUseUtilityProcess', "When enabled, the file watcher will be launched using the new UtilityProcess Electron API."), - default: false, //typeof product.quality === 'string' && product.quality !== 'stable', // disabled by default in stable for now - ignoreSync: true, - 'scope': ConfigurationScope.APPLICATION - }, 'files.hotExit': hotExitConfiguration, 'files.defaultLanguage': { 'type': 'string', diff --git a/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts b/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts index 45c9bd63d79..f482f45334a 100644 --- a/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts +++ b/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts @@ -22,7 +22,6 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/ import { IProductService } from 'vs/platform/product/common/productService'; interface IConfiguration extends IWindowsConfiguration { - files?: { experimental?: { watcherUseUtilityProcess?: boolean } }; update?: { mode?: string }; debug?: { console?: { wordWrap?: boolean } }; editor?: { accessibilitySupport?: 'on' | 'off' | 'auto' }; @@ -39,7 +38,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo 'window.experimental.windowControlsOverlay.enabled', 'window.experimental.useSandbox', 'window.experimental.sharedProcessUseUtilityProcess', - 'files.experimental.watcherUseUtilityProcess', 'window.nativeTabs', 'window.nativeFullScreen', 'window.clickThroughInactive', @@ -53,7 +51,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo private readonly titleBarStyle = new ChangeObserver<'native' | 'custom'>('string'); private readonly windowControlsOverlayEnabled = new ChangeObserver('boolean'); private readonly windowSandboxEnabled = new ChangeObserver('boolean'); - private readonly fileWatcherUtilityProcessEnabled = new ChangeObserver('boolean'); private readonly sharedProcessUtilityProcessEnabled = new ChangeObserver('boolean'); private readonly nativeTabs = new ChangeObserver('boolean'); private readonly nativeFullScreen = new ChangeObserver('boolean'); @@ -100,9 +97,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo // Windows: Sandbox processChanged(this.windowSandboxEnabled.handleChange(config.window?.experimental?.useSandbox)); - // File Watcher: Utility Process - processChanged(this.fileWatcherUtilityProcessEnabled.handleChange(config.files?.experimental?.watcherUseUtilityProcess)); - // Shared Process: Utility Process processChanged(this.sharedProcessUtilityProcessEnabled.handleChange(config.window?.experimental?.sharedProcessUseUtilityProcess)); diff --git a/src/vs/workbench/electron-sandbox/desktop.contribution.ts b/src/vs/workbench/electron-sandbox/desktop.contribution.ts index 1c7aa6f610a..a9f40dce969 100644 --- a/src/vs/workbench/electron-sandbox/desktop.contribution.ts +++ b/src/vs/workbench/electron-sandbox/desktop.contribution.ts @@ -270,7 +270,7 @@ import { applicationConfigurationNodeBase } from 'vs/workbench/common/configurat 'window.experimental.sharedProcessUseUtilityProcess': { // TODO@bpasero remove me once sandbox is final type: 'boolean', description: localize('experimentalUseSharedProcessUseUtilityProcess', "Experimental: When enabled, the window will have sandbox mode enabled via Electron API."), - default: false, //typeof product.quality === 'string' && product.quality !== 'stable', // disabled by default in stable for now + default: typeof product.quality === 'string' && product.quality !== 'stable', // disabled by default in stable for now 'scope': ConfigurationScope.APPLICATION, ignoreSync: true } diff --git a/src/vs/workbench/services/files/electron-sandbox/watcherClient.ts b/src/vs/workbench/services/files/electron-sandbox/watcherClient.ts index 961c413d0cd..5f9237fd930 100644 --- a/src/vs/workbench/services/files/electron-sandbox/watcherClient.ts +++ b/src/vs/workbench/services/files/electron-sandbox/watcherClient.ts @@ -45,9 +45,7 @@ export class UniversalWatcherClient extends AbstractUniversalWatcherClient { if (reason?.code === 0) { this.trace(`terminated by itself with code ${reason.code}, signal: ${reason.signal}`); } else { - if (reason) { - this.onError(`terminated by itself unexpectedly with code ${reason.code}, signal: ${reason.signal}`); - } + this.onError(`terminated by itself unexpectedly with code ${reason?.code}, signal: ${reason?.signal}`); } }); diff --git a/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts b/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts index 801b5d805fc..83d57784e70 100644 --- a/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts +++ b/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts @@ -132,6 +132,14 @@ export class UtilityProcessWorkerWorkbenchService extends Disposable implements const client = disposables.add(new MessagePortClient(port, `window:${this.windowId},module:${process.moduleId}`)); this.logService.trace('Renderer->UtilityProcess#createWorkerChannel: connection established'); + onDidTerminate.then(({ reason }) => { + if (reason?.code === 0) { + this.logService.trace(`[UtilityProcessWorker]: terminated normally with code ${reason.code}, signal: ${reason.signal}`); + } else { + this.logService.error(`[UtilityProcessWorker]: terminated unexpectedly with code ${reason?.code}, signal: ${reason?.signal}`); + } + }); + return { client, onDidTerminate, dispose: () => disposables.dispose() }; } From 48922837ccf690341cc2aa796b6859d35a79baa6 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Fri, 24 Feb 2023 15:49:31 +0100 Subject: [PATCH 087/206] Use `ILanguageService` to broker basic or rich language features requests (microsoft/monaco-editor#3534) (#175331) * Use `ILanguageService` to broker basic or rich language features requests (microsoft/monaco-editor#3534) * Remove unnecessary diff --- src/vs/editor/common/languages/language.ts | 29 +++++++++++++- src/vs/editor/common/model/textModel.ts | 3 ++ .../editor/common/services/languageService.ts | 39 +++++++++++++------ .../standalone/browser/standaloneLanguages.ts | 23 ++++++++++- src/vs/monaco.d.ts | 9 ++++- .../codeEditor/browser/editorFeatures.ts | 3 +- .../languageConfigurationExtensionPoint.ts | 7 +--- .../language/common/languageService.ts | 5 ++- ...extMateTokenizationFeature.contribution.ts | 15 +++++++ .../browser/textMateTokenizationFeature.ts | 3 -- .../textMateTokenizationFeatureImpl.ts | 8 +--- 11 files changed, 108 insertions(+), 36 deletions(-) diff --git a/src/vs/editor/common/languages/language.ts b/src/vs/editor/common/languages/language.ts index a6c22e78ae2..f0be928ea73 100644 --- a/src/vs/editor/common/languages/language.ts +++ b/src/vs/editor/common/languages/language.ts @@ -50,9 +50,23 @@ export interface ILanguageService { readonly languageIdCodec: ILanguageIdCodec; /** - * An event emitted when a language is needed for the first time. + * An event emitted when basic language features are requested for the first time. + * This event is emitted when embedded languages are encountered (e.g. JS code block inside Markdown) + * or when a language is associated to a text model. + * + * **Note**: Basic language features refers to language configuration related features. + * **Note**: This event is a superset of `onDidRequestRichLanguageFeatures` */ - onDidEncounterLanguage: Event; + onDidRequestBasicLanguageFeatures: Event; + + /** + * An event emitted when rich language features are requested for the first time. + * This event is emitted when a language is associated to a text model. + * + * **Note**: Rich language features refers to tokenizers, language features based on providers, etc. + * **Note**: This event is a subset of `onDidRequestRichLanguageFeatures` + */ + onDidRequestRichLanguageFeatures: Event; /** * An event emitted when languages have changed. @@ -140,4 +154,15 @@ export interface ILanguageService { * Will fall back to 'plaintext' if the `languageId` cannot be determined. */ createByFilepathOrFirstLine(resource: URI | null, firstLine?: string): ILanguageSelection; + + /** + * Request basic language features for a language. + */ + requestBasicLanguageFeatures(languageId: string): void; + + /** + * Request rich language features for a language. + */ + requestRichLanguageFeatures(languageId: string): void; + } diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index ac1a9821eb4..e7014aab076 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -364,6 +364,8 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati this._onDidChangeDecorations.fire(); this._onDidChangeDecorations.endDeferredEmit(); })); + + this._languageService.requestRichLanguageFeatures(languageId); } public override dispose(): void { @@ -1907,6 +1909,7 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati public setMode(languageId: string, source?: string): void { this.tokenization.setLanguageId(languageId, source); + this._languageService.requestRichLanguageFeatures(languageId); } public getLanguageIdAtPosition(lineNumber: number, column: number): string { diff --git a/src/vs/editor/common/services/languageService.ts b/src/vs/editor/common/services/languageService.ts index 19aed4cd838..6d96f2a2502 100644 --- a/src/vs/editor/common/services/languageService.ts +++ b/src/vs/editor/common/services/languageService.ts @@ -17,20 +17,24 @@ export class LanguageService extends Disposable implements ILanguageService { static instanceCount = 0; - private readonly _encounteredLanguages: Set; - protected readonly _registry: LanguagesRegistry; - public readonly languageIdCodec: ILanguageIdCodec; + private readonly _onDidRequestBasicLanguageFeatures = this._register(new Emitter()); + public readonly onDidRequestBasicLanguageFeatures = this._onDidRequestBasicLanguageFeatures.event; - private readonly _onDidEncounterLanguage = this._register(new Emitter()); - public readonly onDidEncounterLanguage: Event = this._onDidEncounterLanguage.event; + private readonly _onDidRequestRichLanguageFeatures = this._register(new Emitter()); + public readonly onDidRequestRichLanguageFeatures = this._onDidRequestRichLanguageFeatures.event; protected readonly _onDidChange = this._register(new Emitter({ leakWarningThreshold: 200 /* https://github.com/microsoft/vscode/issues/119968 */ })); public readonly onDidChange: Event = this._onDidChange.event; + private readonly _requestedBasicLanguages = new Set(); + private readonly _requestedRichLanguages = new Set(); + + protected readonly _registry: LanguagesRegistry; + public readonly languageIdCodec: ILanguageIdCodec; + constructor(warnOnOverwrite = false) { super(); LanguageService.instanceCount++; - this._encounteredLanguages = new Set(); this._registry = this._register(new LanguagesRegistry(true, warnOnOverwrite)); this.languageIdCodec = this._registry.languageIdCodec; this._register(this._registry.onDidChange(() => this._onDidChange.fire())); @@ -120,17 +124,28 @@ export class LanguageService extends Disposable implements ILanguageService { languageId = PLAINTEXT_LANGUAGE_ID; } - if (!this._encounteredLanguages.has(languageId)) { - this._encounteredLanguages.add(languageId); + return languageId; + } + + public requestBasicLanguageFeatures(languageId: string): void { + if (!this._requestedBasicLanguages.has(languageId)) { + this._requestedBasicLanguages.add(languageId); + this._onDidRequestBasicLanguageFeatures.fire(languageId); + } + } + + public requestRichLanguageFeatures(languageId: string): void { + if (!this._requestedRichLanguages.has(languageId)) { + this._requestedRichLanguages.add(languageId); + + // Ensure basic features are requested + this.requestBasicLanguageFeatures(languageId); // Ensure tokenizers are created TokenizationRegistry.getOrCreate(languageId); - // Fire event - this._onDidEncounterLanguage.fire(languageId); + this._onDidRequestRichLanguageFeatures.fire(languageId); } - - return languageId; } } diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index 56f84726c98..898d17dbb63 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -49,12 +49,30 @@ export function getEncodedLanguageId(languageId: string): number { } /** - * An event emitted when a language is needed for the first time (e.g. a model has it set). + * An event emitted when a language is associated for the first time with a text model. * @event */ export function onLanguage(languageId: string, callback: () => void): IDisposable { const languageService = StandaloneServices.get(ILanguageService); - const disposable = languageService.onDidEncounterLanguage((encounteredLanguageId) => { + const disposable = languageService.onDidRequestRichLanguageFeatures((encounteredLanguageId) => { + if (encounteredLanguageId === languageId) { + // stop listening + disposable.dispose(); + // invoke actual listener + callback(); + } + }); + return disposable; +} + +/** + * An event emitted when a language is associated for the first time with a text model or + * whena language is encountered during the tokenization of another language. + * @event + */ +export function onLanguageEncountered(languageId: string, callback: () => void): IDisposable { + const languageService = StandaloneServices.get(ILanguageService); + const disposable = languageService.onDidRequestBasicLanguageFeatures((encounteredLanguageId) => { if (encounteredLanguageId === languageId) { // stop listening disposable.dispose(); @@ -715,6 +733,7 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages { register: register, getLanguages: getLanguages, onLanguage: onLanguage, + onLanguageEncountered: onLanguageEncountered, getEncodedLanguageId: getEncodedLanguageId, // provider methods diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index ea87b12a731..54756156433 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -5872,11 +5872,18 @@ declare namespace monaco.languages { export function getEncodedLanguageId(languageId: string): number; /** - * An event emitted when a language is needed for the first time (e.g. a model has it set). + * An event emitted when a language is associated for the first time with a text model. * @event */ export function onLanguage(languageId: string, callback: () => void): IDisposable; + /** + * An event emitted when a language is associated for the first time with a text model or + * whena language is encountered during the tokenization of another language. + * @event + */ + export function onLanguageEncountered(languageId: string, callback: () => void): IDisposable; + /** * Set the editing configuration for a language. */ diff --git a/src/vs/workbench/contrib/codeEditor/browser/editorFeatures.ts b/src/vs/workbench/contrib/codeEditor/browser/editorFeatures.ts index e51906b362e..87e94175531 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/editorFeatures.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/editorFeatures.ts @@ -4,14 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { getEditorFeatures } from 'vs/editor/common/editorFeatures'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { IDisposable } from 'xterm'; class EditorFeaturesInstantiator extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts b/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts index 2b49448c7b9..b3894ebcb9b 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.ts @@ -14,7 +14,6 @@ import { ILanguageService } from 'vs/editor/common/languages/language'; import { Extensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { ITextMateTokenizationService } from 'vs/workbench/services/textMate/browser/textMateTokenizationFeature'; import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader'; import { hash } from 'vs/base/common/hash'; @@ -95,7 +94,6 @@ export class LanguageConfigurationFileHandler extends Disposable { private readonly _done = new Map(); constructor( - @ITextMateTokenizationService textMateService: ITextMateTokenizationService, @ILanguageService private readonly _languageService: ILanguageService, @IExtensionResourceLoaderService private readonly _extensionResourceLoaderService: IExtensionResourceLoaderService, @IExtensionService private readonly _extensionService: IExtensionService, @@ -103,7 +101,7 @@ export class LanguageConfigurationFileHandler extends Disposable { ) { super(); - this._register(this._languageService.onDidEncounterLanguage(async (languageIdentifier) => { + this._register(this._languageService.onDidRequestBasicLanguageFeatures(async (languageIdentifier) => { // Modes can be instantiated before the extension points have finished registering this._extensionService.whenInstalledExtensionsRegistered().then(() => { this._loadConfigurationsForMode(languageIdentifier); @@ -115,9 +113,6 @@ export class LanguageConfigurationFileHandler extends Disposable { this._loadConfigurationsForMode(languageId); } })); - this._register(textMateService.onDidEncounterLanguage((languageId) => { - this._loadConfigurationsForMode(languageId); - })); } private async _loadConfigurationsForMode(languageId: string): Promise { diff --git a/src/vs/workbench/services/language/common/languageService.ts b/src/vs/workbench/services/language/common/languageService.ts index 4c5dbafa574..75f708096e8 100644 --- a/src/vs/workbench/services/language/common/languageService.ts +++ b/src/vs/workbench/services/language/common/languageService.ts @@ -178,10 +178,11 @@ export class WorkbenchLanguageService extends LanguageService { this.updateMime(); }); - this.onDidEncounterLanguage((languageId) => { + this._register(this.onDidRequestRichLanguageFeatures((languageId) => { + // extension activation this._extensionService.activateByEvent(`onLanguage:${languageId}`); this._extensionService.activateByEvent(`onLanguage`); - }); + })); } private updateMime(): void { diff --git a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.contribution.ts b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.contribution.ts index f6090e4572f..f2584c7a722 100644 --- a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.contribution.ts +++ b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.contribution.ts @@ -6,5 +6,20 @@ import { registerSingleton, InstantiationType } from 'vs/platform/instantiation/common/extensions'; import { ITextMateTokenizationService } from 'vs/workbench/services/textMate/browser/textMateTokenizationFeature'; import { TextMateTokenizationFeature } from 'vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions } from 'vs/workbench/common/contributions'; +import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; + +/** + * Makes sure the ITextMateTokenizationService is instantiated + */ +class TextMateTokenizationInstantiator implements IWorkbenchContribution { + constructor( + @ITextMateTokenizationService _textMateTokenizationService: ITextMateTokenizationService + ) { } +} registerSingleton(ITextMateTokenizationService, TextMateTokenizationFeature, InstantiationType.Eager); + +const workbenchRegistry = Registry.as(Extensions.Workbench); +workbenchRegistry.registerWorkbenchContribution(TextMateTokenizationInstantiator, LifecyclePhase.Ready); diff --git a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.ts b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.ts index 84c3a9023c3..4b23b569359 100644 --- a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.ts +++ b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeature.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import type { IGrammar } from 'vscode-textmate'; @@ -12,8 +11,6 @@ export const ITextMateTokenizationService = createDecorator; - createGrammar(languageId: string): Promise; startDebugMode(printFn: (str: string) => void, onStop: () => void): void; diff --git a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts index 57d0dd3a125..43b2a1a14ce 100644 --- a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts +++ b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts @@ -7,7 +7,6 @@ import * as dom from 'vs/base/browser/dom'; import { equals as equalArray } from 'vs/base/common/arrays'; import { Color } from 'vs/base/common/color'; import { onUnexpectedError } from 'vs/base/common/errors'; -import { Emitter, Event } from 'vs/base/common/event'; import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { FileAccess, nodeModulesAsarUnpackedPath, nodeModulesPath } from 'vs/base/common/network'; import { isWeb } from 'vs/base/common/platform'; @@ -40,9 +39,6 @@ import type { IGrammar, IOnigLib, IRawTheme } from 'vscode-textmate'; export class TextMateTokenizationFeature extends Disposable implements ITextMateTokenizationService { public _serviceBrand: undefined; - private readonly _onDidEncounterLanguage: Emitter = this._register(new Emitter()); - public readonly onDidEncounterLanguage: Event = this._onDidEncounterLanguage.event; - private readonly _styleElement: HTMLStyleElement; private readonly _createdModes: string[] = []; private readonly _encounteredLanguages: boolean[] = []; @@ -80,7 +76,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate this._updateTheme(this._themeService.getColorTheme(), false); })); - this._languageService.onDidEncounterLanguage((languageId) => { + this._languageService.onDidRequestRichLanguageFeatures((languageId) => { this._createdModes.push(languageId); }); } @@ -284,7 +280,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate if (!this._encounteredLanguages[encodedLanguageId]) { const languageId = this._languageService.languageIdCodec.decodeLanguageId(encodedLanguageId); this._encounteredLanguages[encodedLanguageId] = true; - this._onDidEncounterLanguage.fire(languageId); + this._languageService.requestBasicLanguageFeatures(languageId); } }); From b83565b135a41449ff98586a989e7eb9fe317a51 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 24 Feb 2023 15:58:31 +0100 Subject: [PATCH 088/206] Improve network requests logging (#175258) (#175325) --- src/vs/code/node/cliProcessMain.ts | 2 -- .../electron-main/nativeHostMainService.ts | 7 ++--- .../request/browser/requestService.ts | 10 +++--- .../platform/request/node/requestService.ts | 31 ++++++++++--------- .../node/remoteExtensionHostAgentCli.ts | 1 + 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index dff743e9eac..bf01f4d1811 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -142,8 +142,6 @@ class CliMain extends Disposable { const diskFileSystemProvider = this._register(new DiskFileSystemProvider(logService)); fileService.registerProvider(Schemas.file, diskFileSystemProvider); - // State - // Uri Identity const uriIdentityService = new UriIdentityService(fileService); services.set(IUriIdentityService, uriIdentityService); diff --git a/src/vs/platform/native/electron-main/nativeHostMainService.ts b/src/vs/platform/native/electron-main/nativeHostMainService.ts index 91e1efc080f..70781f7fa86 100644 --- a/src/vs/platform/native/electron-main/nativeHostMainService.ts +++ b/src/vs/platform/native/electron-main/nativeHostMainService.ts @@ -730,11 +730,8 @@ export class NativeHostMainService extends Disposable implements INativeHostMain async resolveProxy(windowId: number | undefined, url: string): Promise { const window = this.windowById(windowId); const session = window?.win?.webContents?.session; - if (session) { - return session.resolveProxy(url); - } else { - return undefined; - } + + return session?.resolveProxy(url); } findFreePort(windowId: number | undefined, startPort: number, giveUpAfter: number, timeout: number, stride = 1): Promise { diff --git a/src/vs/platform/request/browser/requestService.ts b/src/vs/platform/request/browser/requestService.ts index 09c9baec136..95b0c28df12 100644 --- a/src/vs/platform/request/browser/requestService.ts +++ b/src/vs/platform/request/browser/requestService.ts @@ -25,20 +25,20 @@ export class RequestService implements IRequestService { } async request(options: IRequestOptions, token: CancellationToken): Promise { - this.logService.trace('RequestService#request (browser) - begin', options.url); + this.logService.trace(`RequestService#request (browser) - begin: ${options.type} ${options.url}`); if (!options.proxyAuthorization) { options.proxyAuthorization = this.configurationService.getValue('http.proxyAuthorization'); } try { - const res = await request(options, token); + const result = await request(options, token); - this.logService.trace('RequestService#request (browser) - success', options.url); + this.logService.trace(`RequestService#request (browser) - end: ${options.type} ${options.url} ${result.res.statusCode}`); - return res; + return result; } catch (error) { - this.logService.error('RequestService#request (browser) - error', options.url, error); + this.logService.error(`RequestService#request (browser) - error: ${options.type} ${options.url} ${error}`); throw error; } diff --git a/src/vs/platform/request/node/requestService.ts b/src/vs/platform/request/node/requestService.ts index 3cab0d4fd07..684f2644397 100644 --- a/src/vs/platform/request/node/requestService.ts +++ b/src/vs/platform/request/node/requestService.ts @@ -68,13 +68,14 @@ export class RequestService extends Disposable implements IRequestService { private configure() { const config = this.configurationService.getValue('http'); + this.proxyUrl = config?.proxy; this.strictSSL = !!config?.proxyStrictSSL; this.authorization = config?.proxyAuthorization; } async request(options: NodeRequestOptions, token: CancellationToken): Promise { - this.logService.trace('RequestService#request (node) - begin', options.url); + this.logService.trace(`RequestService#request (${options.isChromiumNetwork ? 'electron' : 'nodejs'}) - begin: ${options.type} ${options.url}`); const { proxyUrl, strictSSL } = this; @@ -84,7 +85,7 @@ export class RequestService extends Disposable implements IRequestService { } catch (error) { if (!this.shellEnvErrorLogged) { this.shellEnvErrorLogged = true; - this.logService.error('RequestService#request (node) resolving shell environment failed', error); + this.logService.error(`RequestService#request (${options.isChromiumNetwork ? 'electron' : 'nodejs'}) - resolving shell environment failed: ${error}`); } } @@ -105,13 +106,13 @@ export class RequestService extends Disposable implements IRequestService { } try { - const res = await this._request(options, token); + const result = await this.doRequest(options, token); - this.logService.trace('RequestService#request (node) - success', options.url); + this.logService.trace(`RequestService#request (${options.isChromiumNetwork ? 'electron' : 'nodejs'}) - end: ${options.type} ${options.url} ${result.res.statusCode}`); - return res; + return result; } catch (error) { - this.logService.trace('RequestService#request (node) - error', options.url, error); + this.logService.error(`RequestService#request (${options.isChromiumNetwork ? 'electron' : 'nodejs'}) - error: ${options.type} ${options.url} ${error}`); throw error; } @@ -120,13 +121,12 @@ export class RequestService extends Disposable implements IRequestService { private async getNodeRequest(options: IRequestOptions): Promise { const endpoint = parseUrl(options.url!); const module = endpoint.protocol === 'https:' ? await import('https') : await import('http'); + return module.request; } - private _request(options: NodeRequestOptions, token: CancellationToken): Promise { - - return Promises.withAsyncBody(async (c, e) => { - + private doRequest(options: NodeRequestOptions, token: CancellationToken): Promise { + return Promises.withAsyncBody(async (resolve, reject) => { const endpoint = parseUrl(options.url!); const rawRequest = options.getRawRequest ? options.getRawRequest(options) @@ -150,11 +150,11 @@ export class RequestService extends Disposable implements IRequestService { const req = rawRequest(opts, (res: http.IncomingMessage) => { const followRedirects: number = isNumber(options.followRedirects) ? options.followRedirects : 3; if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && followRedirects > 0 && res.headers['location']) { - this._request({ + this.doRequest({ ...options, url: res.headers['location'], followRedirects: followRedirects - 1 - }, token).then(c, e); + }, token).then(resolve, reject); } else { let stream: streams.ReadableStreamEvents = res; @@ -167,11 +167,11 @@ export class RequestService extends Disposable implements IRequestService { stream = res.pipe(createGunzip()); } - c({ res, stream: streamToBufferReadableStream(stream) } as IRequestContext); + resolve({ res, stream: streamToBufferReadableStream(stream) } as IRequestContext); } }); - req.on('error', e); + req.on('error', reject); if (options.timeout) { req.setTimeout(options.timeout); @@ -194,7 +194,8 @@ export class RequestService extends Disposable implements IRequestService { token.onCancellationRequested(() => { req.abort(); - e(new CancellationError()); + + reject(new CancellationError()); }); }); } diff --git a/src/vs/server/node/remoteExtensionHostAgentCli.ts b/src/vs/server/node/remoteExtensionHostAgentCli.ts index f3512d89ed3..c0a770ad3aa 100644 --- a/src/vs/server/node/remoteExtensionHostAgentCli.ts +++ b/src/vs/server/node/remoteExtensionHostAgentCli.ts @@ -85,6 +85,7 @@ class CliMain extends Disposable { const environmentService = new ServerEnvironmentService(this.args, productService); services.set(IServerEnvironmentService, environmentService); + const logService = new LogService(new SpdLogLogger(RemoteExtensionLogFileName, join(environmentService.logsPath, `${RemoteExtensionLogFileName}.log`), true, false, getLogLevel(environmentService))); services.set(ILogService, logService); logService.trace(`Remote configuration data at ${this.remoteDataFolder}`); From c3100304dd9c46f1c9dd1808790ad6aa7a992f31 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 24 Feb 2023 16:02:20 +0100 Subject: [PATCH 089/206] Reduce layer breakers in shared process (#175333) * move `sharedProcessLifecycleService` * move `remoteTunnelService` * move `ExtensionsProfileScannerService` * move `RequestService` * move extension recommendations * move native host service * move `UserDataAutoSyncService` * move `ExtensionTipsService` * move `IMainProcessService` * move `UserDataProfileStorageService` * more moves * move main process service --- .../issue/issueReporterMain.ts | 2 +- .../processExplorer/processExplorerMain.ts | 2 +- .../contrib/storageDataCleaner.ts | 7 +-- .../node/sharedProcess/sharedProcessMain.ts | 34 ++++++----- .../extensionTipsService.ts | 2 +- .../extensionRecommendationsIpc.ts | 1 - .../mainProcessService.ts | 19 +++++-- .../electron-sandbox/mainProcessService.ts | 2 +- .../platform/ipc/electron-sandbox/services.ts | 9 +-- .../sharedProcessLifecycleService.ts | 0 src/vs/platform/native/common/native.ts | 12 ++++ .../native/electron-sandbox/native.ts | 18 ------ .../electron-sandbox/nativeHostService.ts | 4 +- .../remoteTunnelService.ts | 2 +- .../sharedProcessRequestService.ts | 56 ------------------- .../storageService.ts | 2 +- .../common/userDataProfileStorageService.ts | 49 ++++++++++++++-- .../userDataProfileStorageService.ts | 50 +---------------- .../userDataAutoSyncService.ts | 2 +- .../displayChangeRemeasureFonts.ts | 2 +- .../sleepResumeRepaintMinimap.ts | 2 +- .../debugExtensionHostAction.ts | 2 +- .../extensionProfileService.ts | 2 +- .../extensions.contribution.ts | 2 +- .../electron-sandbox/extensionsActions.ts | 2 +- .../electron-sandbox/extensionsSlowActions.ts | 2 +- .../runtimeExtensionsEditor.ts | 2 +- .../extensionRecommendationsService.test.ts | 2 +- .../extensionsActions.test.ts | 2 +- .../extensionsWorkbenchService.test.ts | 2 +- .../fileActions.contribution.ts | 2 +- .../files/electron-sandbox/fileCommands.ts | 2 +- .../files/electron-sandbox/textFileEditor.ts | 2 +- .../issue/electron-sandbox/issueActions.ts | 2 +- .../electron-sandbox/localHistoryCommands.ts | 2 +- .../logs/electron-sandbox/logsActions.ts | 2 +- .../electron-sandbox/rendererAutoProfiler.ts | 2 +- .../electron-sandbox/startupProfiler.ts | 2 +- .../electron-sandbox/startupTimings.ts | 2 +- .../electron-sandbox/remote.contribution.ts | 2 +- .../electron-sandbox/sandbox.contribution.ts | 2 +- .../electron-sandbox/splash.contribution.ts | 2 +- .../tags/electron-sandbox/workspaceTags.ts | 2 +- .../terminalNativeContribution.ts | 2 +- .../userDataSync.contribution.ts | 2 +- .../electron-sandbox/webviewCommands.ts | 2 +- .../electron-sandbox/webviewElement.ts | 4 +- .../windowIgnoreMenuShortcutsManager.ts | 4 +- .../actions/developerActions.ts | 2 +- .../actions/installActions.ts | 2 +- .../electron-sandbox/actions/windowActions.ts | 2 +- .../electron-sandbox/desktop.contribution.ts | 2 +- .../electron-sandbox/desktop.main.ts | 3 +- .../parts/dialogs/dialog.contribution.ts | 2 +- .../parts/dialogs/dialogHandler.ts | 2 +- .../parts/titlebar/menubarControl.ts | 2 +- .../parts/titlebar/titlebarPart.ts | 2 +- src/vs/workbench/electron-sandbox/window.ts | 2 +- .../electron-sandbox/accessibilityService.ts | 2 +- .../electron-sandbox/clipboardService.ts | 2 +- .../electron-sandbox/fileDialogService.ts | 2 +- .../fileDialogService.test.ts | 2 +- .../localProcessExtensionHost.ts | 2 +- .../nativeExtensionService.ts | 2 +- .../diskFileSystemProvider.ts | 2 +- .../electron-sandbox/elevatedFileService.ts | 2 +- .../electron-sandbox/nativeHostService.ts | 4 +- .../nativeKeyboardLayoutService.ts | 2 +- .../electron-sandbox/lifecycleService.ts | 2 +- .../electron-sandbox/remoteAgentService.ts | 2 +- .../electron-sandbox/requestService.ts | 2 +- .../electron-sandbox/storageService.ts | 4 +- .../nativeHostColorSchemeService.ts | 2 +- .../timer/electron-sandbox/timerService.ts | 2 +- .../url/electron-sandbox/urlService.ts | 4 +- .../utilityProcessWorkerWorkbenchService.ts | 3 +- .../workingCopyBackupTracker.ts | 2 +- .../workingCopyBackupTracker.test.ts | 2 +- .../workspaceEditingService.ts | 2 +- .../electron-sandbox/workspacesService.ts | 4 +- .../electron-browser/workbenchTestServices.ts | 3 +- 81 files changed, 170 insertions(+), 242 deletions(-) rename src/vs/platform/extensionManagement/{electron-sandbox => node}/extensionTipsService.ts (99%) rename src/vs/platform/extensionRecommendations/{electron-sandbox => common}/extensionRecommendationsIpc.ts (99%) rename src/vs/platform/ipc/{electron-browser => common}/mainProcessService.ts (52%) rename src/vs/platform/lifecycle/{electron-browser => node}/sharedProcessLifecycleService.ts (100%) delete mode 100644 src/vs/platform/native/electron-sandbox/native.ts rename src/vs/platform/remoteTunnel/{electron-browser => node}/remoteTunnelService.ts (99%) delete mode 100644 src/vs/platform/request/electron-browser/sharedProcessRequestService.ts rename src/vs/platform/storage/{electron-sandbox => common}/storageService.ts (98%) rename src/vs/platform/userDataSync/{electron-sandbox => node}/userDataAutoSyncService.ts (97%) diff --git a/src/vs/code/electron-sandbox/issue/issueReporterMain.ts b/src/vs/code/electron-sandbox/issue/issueReporterMain.ts index 8936cda23bd..a7687cdc47f 100644 --- a/src/vs/code/electron-sandbox/issue/issueReporterMain.ts +++ b/src/vs/code/electron-sandbox/issue/issueReporterMain.ts @@ -23,7 +23,7 @@ import { isRemoteDiagnosticError, SystemInfo } from 'vs/platform/diagnostics/com import { ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService'; import { IssueReporterData, IssueReporterExtensionData, IssueReporterStyles, IssueReporterWindowConfiguration, IssueType } from 'vs/platform/issue/common/issue'; import { normalizeGitHubUrl } from 'vs/platform/issue/common/issueReporterUtil'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService'; import { applyZoom, zoomIn, zoomOut } from 'vs/platform/window/electron-sandbox/window'; diff --git a/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts b/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts index 67d48b47d23..d5614e59273 100644 --- a/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts +++ b/src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts @@ -19,7 +19,7 @@ import { IRemoteDiagnosticError, isRemoteDiagnosticError } from 'vs/platform/dia import { ByteSize } from 'vs/platform/files/common/files'; import { ElectronIPCMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService'; import { ProcessExplorerData, ProcessExplorerStyles, ProcessExplorerWindowConfiguration } from 'vs/platform/issue/common/issue'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService'; import { getIconsStyleSheet } from 'vs/platform/theme/browser/iconsStyleSheet'; import { applyZoom, zoomIn, zoomOut } from 'vs/platform/window/electron-sandbox/window'; diff --git a/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts b/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts index bdc3d6a6b50..fc3f2eb117a 100644 --- a/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts +++ b/src/vs/code/node/sharedProcess/contrib/storageDataCleaner.ts @@ -13,11 +13,8 @@ import { ILogService } from 'vs/platform/log/common/log'; import { StorageClient } from 'vs/platform/storage/common/storageIpc'; import { EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE } from 'vs/platform/workspace/common/workspace'; import { NON_EMPTY_WORKSPACE_ID_LENGTH } from 'vs/platform/workspaces/node/workspaces'; - -/* eslint-disable local/code-layering, local/code-import-patterns */ -// TODO@bpasero layer is not allowed in utility process -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; export class UnusedWorkspaceStorageDataCleaner extends Disposable { diff --git a/src/vs/code/node/sharedProcess/sharedProcessMain.ts b/src/vs/code/node/sharedProcess/sharedProcessMain.ts index b289c060ead..59c0f2e034b 100644 --- a/src/vs/code/node/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/node/sharedProcess/sharedProcessMain.ts @@ -71,7 +71,7 @@ import { UserDataSyncEnablementService } from 'vs/platform/userDataSync/common/u import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyncService'; import { UserDataSyncChannel } from 'vs/platform/userDataSync/common/userDataSyncServiceIpc'; import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; -import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; +import { IUserDataProfileStorageService, NativeUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; import { ActiveWindowManager } from 'vs/platform/windows/node/windowTracker'; import { ISignService } from 'vs/platform/sign/common/sign'; import { SignService } from 'vs/platform/sign/node/signService'; @@ -103,24 +103,22 @@ import { localize } from 'vs/nls'; import { LogService } from 'vs/platform/log/common/logService'; import { ipcUtilityProcessWorkerChannelName, IUtilityProcessWorkerConfiguration } from 'vs/platform/utilityProcess/common/utilityProcessWorkerService'; import { isUtilityProcess } from 'vs/base/parts/sandbox/node/electronTypes'; +import { ISharedProcessLifecycleService, SharedProcessLifecycleService } from 'vs/platform/lifecycle/node/sharedProcessLifecycleService'; +import { RemoteTunnelService } from 'vs/platform/remoteTunnel/node/remoteTunnelService'; +import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/node/extensionsProfileScannerService'; +import { RequestChannelClient } from 'vs/platform/request/common/requestIpc'; +import { ExtensionRecommendationNotificationServiceChannelClient } from 'vs/platform/extensionRecommendations/common/extensionRecommendationsIpc'; +import { INativeHostService } from 'vs/platform/native/common/native'; +import { UserDataAutoSyncService } from 'vs/platform/userDataSync/node/userDataAutoSyncService'; +import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService'; +import { IMainProcessService, MainProcessService } from 'vs/platform/ipc/common/mainProcessService'; +import { NativeStorageService } from 'vs/platform/storage/common/storageService'; /* eslint-disable local/code-layering, local/code-import-patterns */ -// TODO@bpasero layer is not allowed in utility process +// TODO@bpasero remove these once utility process is the only way import { Server as BrowserWindowMessagePortServer } from 'vs/base/parts/ipc/electron-browser/ipc.mp'; -import { ExtensionTipsService } from 'vs/platform/extensionManagement/electron-sandbox/extensionTipsService'; -import { ExtensionRecommendationNotificationServiceChannelClient } from 'vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc'; -import { MessagePortMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; -import { NativeStorageService } from 'vs/platform/storage/electron-sandbox/storageService'; -import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal'; -import { UserDataAutoSyncService } from 'vs/platform/userDataSync/electron-sandbox/userDataAutoSyncService'; -import { UserDataProfileStorageService } from 'vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService'; import { SharedProcessWorkerService } from 'vs/platform/sharedProcess/electron-browser/sharedProcessWorkerService'; -import { SharedProcessRequestService } from 'vs/platform/request/electron-browser/sharedProcessRequestService'; -import { RemoteTunnelService } from 'vs/platform/remoteTunnel/electron-browser/remoteTunnelService'; -import { ISharedProcessLifecycleService, SharedProcessLifecycleService } from 'vs/platform/lifecycle/electron-browser/sharedProcessLifecycleService'; -import { ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService'; +import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal'; class SharedProcessMain extends Disposable { @@ -222,7 +220,7 @@ class SharedProcessMain extends Disposable { // Main Process const mainRouter = new StaticRouter(ctx => ctx === 'main'); - const mainProcessService = new MessagePortMainProcessService(this.server, mainRouter); + const mainProcessService = new MainProcessService(this.server, mainRouter); services.set(IMainProcessService, mainProcessService); // Policies @@ -294,7 +292,7 @@ class SharedProcessMain extends Disposable { services.set(IUriIdentityService, uriIdentityService); // Request - services.set(IRequestService, new SharedProcessRequestService(mainProcessService, configurationService, logService)); + services.set(IRequestService, new RequestChannelClient(mainProcessService.getChannel('request'))); // Checksum services.set(IChecksumService, new SyncDescriptor(ChecksumService, undefined, false /* proxied to other processes */)); @@ -378,7 +376,7 @@ class SharedProcessMain extends Disposable { services.set(IUserDataSyncBackupStoreService, new SyncDescriptor(UserDataSyncBackupStoreService, undefined, false /* Eagerly cleans up old backups */)); services.set(IUserDataSyncEnablementService, new SyncDescriptor(UserDataSyncEnablementService, undefined, true)); services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService, undefined, false /* Initializes the Sync State */)); - services.set(IUserDataProfileStorageService, new SyncDescriptor(UserDataProfileStorageService, undefined, true)); + services.set(IUserDataProfileStorageService, new SyncDescriptor(NativeUserDataProfileStorageService, undefined, true)); services.set(IUserDataSyncResourceProviderService, new SyncDescriptor(UserDataSyncResourceProviderService, undefined, true)); // Terminal diff --git a/src/vs/platform/extensionManagement/electron-sandbox/extensionTipsService.ts b/src/vs/platform/extensionManagement/node/extensionTipsService.ts similarity index 99% rename from src/vs/platform/extensionManagement/electron-sandbox/extensionTipsService.ts rename to src/vs/platform/extensionManagement/node/extensionTipsService.ts index d96b9c0ee58..33624460484 100644 --- a/src/vs/platform/extensionManagement/electron-sandbox/extensionTipsService.ts +++ b/src/vs/platform/extensionManagement/node/extensionTipsService.ts @@ -19,7 +19,7 @@ import { ExtensionTipsService as BaseExtensionTipsService } from 'vs/platform/ex import { IExtensionRecommendationNotificationService, RecommendationsNotificationResult, RecommendationSource } from 'vs/platform/extensionRecommendations/common/extensionRecommendations'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; import { IFileService } from 'vs/platform/files/common/files'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProductService } from 'vs/platform/product/common/productService'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; diff --git a/src/vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc.ts b/src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.ts similarity index 99% rename from src/vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc.ts rename to src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.ts index 2db0aec2556..4f8e8949972 100644 --- a/src/vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc.ts +++ b/src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.ts @@ -45,4 +45,3 @@ export class ExtensionRecommendationNotificationServiceChannel implements IServe throw new Error(`Call not found: ${command}`); } } - diff --git a/src/vs/platform/ipc/electron-browser/mainProcessService.ts b/src/vs/platform/ipc/common/mainProcessService.ts similarity index 52% rename from src/vs/platform/ipc/electron-browser/mainProcessService.ts rename to src/vs/platform/ipc/common/mainProcessService.ts index 276420e848c..1da49b18862 100644 --- a/src/vs/platform/ipc/electron-browser/mainProcessService.ts +++ b/src/vs/platform/ipc/common/mainProcessService.ts @@ -3,19 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IChannel, IServerChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc'; -import { Server as MessagePortServer } from 'vs/base/parts/ipc/electron-browser/ipc.mp'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IChannel, IPCServer, IServerChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; + +export const IMainProcessService = createDecorator('mainProcessService'); + +export interface IMainProcessService { + readonly _serviceBrand: undefined; + getChannel(channelName: string): IChannel; + registerChannel(channelName: string, channel: IServerChannel): void; +} /** - * An implementation of `IMainProcessService` that leverages MessagePorts. + * An implementation of `IMainProcessService` that leverages `IPCServer`. */ -export class MessagePortMainProcessService implements IMainProcessService { +export class MainProcessService implements IMainProcessService { declare readonly _serviceBrand: undefined; constructor( - private server: MessagePortServer, + private server: IPCServer, private router: StaticRouter ) { } diff --git a/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts b/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts index fc40ab9959f..423919570cd 100644 --- a/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts +++ b/src/vs/platform/ipc/electron-sandbox/mainProcessService.ts @@ -6,7 +6,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; import { Client as IPCElectronClient } from 'vs/base/parts/ipc/electron-sandbox/ipc.electron'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; /** * An implementation of `IMainProcessService` that leverages Electron's IPC. diff --git a/src/vs/platform/ipc/electron-sandbox/services.ts b/src/vs/platform/ipc/electron-sandbox/services.ts index 0c404737c06..193b36f54a4 100644 --- a/src/vs/platform/ipc/electron-sandbox/services.ts +++ b/src/vs/platform/ipc/electron-sandbox/services.ts @@ -7,6 +7,7 @@ import { IChannel, IServerChannel, ProxyChannel } from 'vs/base/parts/ipc/common import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator, IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; type ChannelClientCtor = { new(channel: IChannel, ...args: any[]): T }; type Remote = { getChannel(channelName: string): IChannel }; @@ -44,14 +45,6 @@ function isRemoteServiceWithChannelClientOptions(obj: unknown): obj is IRemot //#region Main Process -export const IMainProcessService = createDecorator('mainProcessService'); - -export interface IMainProcessService { - readonly _serviceBrand: undefined; - getChannel(channelName: string): IChannel; - registerChannel(channelName: string, channel: IServerChannel): void; -} - class MainProcessRemoteServiceStub extends RemoteServiceStub { constructor(channelName: string, options: IRemoteServiceWithChannelClientOptions | IRemoteServiceWithProxyOptions | undefined, @IMainProcessService ipcService: IMainProcessService, @IInstantiationService instantiationService: IInstantiationService) { super(channelName, options, ipcService, instantiationService); diff --git a/src/vs/platform/lifecycle/electron-browser/sharedProcessLifecycleService.ts b/src/vs/platform/lifecycle/node/sharedProcessLifecycleService.ts similarity index 100% rename from src/vs/platform/lifecycle/electron-browser/sharedProcessLifecycleService.ts rename to src/vs/platform/lifecycle/node/sharedProcessLifecycleService.ts diff --git a/src/vs/platform/native/common/native.ts b/src/vs/platform/native/common/native.ts index 776325237e2..26ae8d5876d 100644 --- a/src/vs/platform/native/common/native.ts +++ b/src/vs/platform/native/common/native.ts @@ -9,6 +9,7 @@ import { URI } from 'vs/base/common/uri'; import { MessageBoxOptions, MessageBoxReturnValue, MouseInputEvent, OpenDevToolsOptions, OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from 'vs/base/parts/sandbox/common/electronTypes'; import { ISerializableCommandAction } from 'vs/platform/action/common/action'; import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IV8Profile } from 'vs/platform/profiling/common/profiling'; import { IPartsSplash } from 'vs/platform/theme/common/themeService'; import { IColorScheme, IOpenedWindow, IOpenEmptyWindowOptions, IOpenWindowOptions, IWindowOpenable } from 'vs/platform/window/common/window'; @@ -175,3 +176,14 @@ export interface ICommonNativeHostService { // Registry (windows only) windowsGetStringRegKey(hive: 'HKEY_CURRENT_USER' | 'HKEY_LOCAL_MACHINE' | 'HKEY_CLASSES_ROOT' | 'HKEY_USERS' | 'HKEY_CURRENT_CONFIG', path: string, name: string): Promise; } + +export const INativeHostService = createDecorator('nativeHostService'); + +/** + * A set of methods specific to a native host, i.e. unsupported in web + * environments. + * + * @see {@link IHostService} for methods that can be used in native and web + * hosts. + */ +export interface INativeHostService extends ICommonNativeHostService { } diff --git a/src/vs/platform/native/electron-sandbox/native.ts b/src/vs/platform/native/electron-sandbox/native.ts deleted file mode 100644 index 01f1f94aaef..00000000000 --- a/src/vs/platform/native/electron-sandbox/native.ts +++ /dev/null @@ -1,18 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { ICommonNativeHostService } from 'vs/platform/native/common/native'; - -export const INativeHostService = createDecorator('nativeHostService'); - -/** - * A set of methods specific to a native host, i.e. unsupported in web - * environments. - * - * @see {@link IHostService} for methods that can be used in native and web - * hosts. - */ -export interface INativeHostService extends ICommonNativeHostService { } diff --git a/src/vs/platform/native/electron-sandbox/nativeHostService.ts b/src/vs/platform/native/electron-sandbox/nativeHostService.ts index 65f4c5e30bf..c99768ed82a 100644 --- a/src/vs/platform/native/electron-sandbox/nativeHostService.ts +++ b/src/vs/platform/native/electron-sandbox/nativeHostService.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; +import { INativeHostService } from 'vs/platform/native/common/native'; // @ts-ignore: interface is implemented via proxy export class NativeHostService implements INativeHostService { diff --git a/src/vs/platform/remoteTunnel/electron-browser/remoteTunnelService.ts b/src/vs/platform/remoteTunnel/node/remoteTunnelService.ts similarity index 99% rename from src/vs/platform/remoteTunnel/electron-browser/remoteTunnelService.ts rename to src/vs/platform/remoteTunnel/node/remoteTunnelService.ts index d4fd84e2f2e..a4341af28fe 100644 --- a/src/vs/platform/remoteTunnel/electron-browser/remoteTunnelService.ts +++ b/src/vs/platform/remoteTunnel/node/remoteTunnelService.ts @@ -14,7 +14,7 @@ import { ChildProcess, spawn } from 'child_process'; import { IProductService } from 'vs/platform/product/common/productService'; import { isMacintosh, isWindows } from 'vs/base/common/platform'; import { CancelablePromise, createCancelablePromise, Delayer } from 'vs/base/common/async'; -import { ISharedProcessLifecycleService } from 'vs/platform/lifecycle/electron-browser/sharedProcessLifecycleService'; +import { ISharedProcessLifecycleService } from 'vs/platform/lifecycle/node/sharedProcessLifecycleService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { localize } from 'vs/nls'; import { hostname, homedir } from 'os'; diff --git a/src/vs/platform/request/electron-browser/sharedProcessRequestService.ts b/src/vs/platform/request/electron-browser/sharedProcessRequestService.ts deleted file mode 100644 index 4a286e4eaf2..00000000000 --- a/src/vs/platform/request/electron-browser/sharedProcessRequestService.ts +++ /dev/null @@ -1,56 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 { isBoolean } from 'vs/base/common/types'; -import { IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { ILogService } from 'vs/platform/log/common/log'; -import { RequestService } from 'vs/platform/request/browser/requestService'; -import { IRequestService } from 'vs/platform/request/common/request'; -import { RequestChannelClient } from 'vs/platform/request/common/requestIpc'; - -export class SharedProcessRequestService implements IRequestService { - - declare readonly _serviceBrand: undefined; - - private readonly browserRequestService: IRequestService; - private readonly mainRequestService: IRequestService; - - constructor( - mainProcessService: IMainProcessService, - private readonly configurationService: IConfigurationService, - private readonly logService: ILogService, - ) { - this.browserRequestService = new RequestService(configurationService, logService); - this.mainRequestService = new RequestChannelClient(mainProcessService.getChannel('request')); - } - - request(options: IRequestOptions, token: CancellationToken): Promise { - return this.getRequestService().request(options, token); - } - - async resolveProxy(url: string): Promise { - return this.getRequestService().resolveProxy(url); - } - - private getRequestService(): IRequestService { - if (this.isMainRequestServiceEnabled()) { - this.logService.trace('Using main request service'); - return this.mainRequestService; - } - this.logService.trace('Using browser request service'); - return this.browserRequestService; - } - - private isMainRequestServiceEnabled(): boolean { - const value = this.configurationService.getValue('developer.sharedProcess.redirectRequestsToMain'); - if (isBoolean(value)) { - return value; - } - return true; - } -} diff --git a/src/vs/platform/storage/electron-sandbox/storageService.ts b/src/vs/platform/storage/common/storageService.ts similarity index 98% rename from src/vs/platform/storage/electron-sandbox/storageService.ts rename to src/vs/platform/storage/common/storageService.ts index 70f7b679bb2..ae0679c3ef0 100644 --- a/src/vs/platform/storage/electron-sandbox/storageService.ts +++ b/src/vs/platform/storage/common/storageService.ts @@ -8,7 +8,7 @@ import { DisposableStore } from 'vs/base/common/lifecycle'; import { joinPath } from 'vs/base/common/resources'; import { IStorage, Storage } from 'vs/base/parts/storage/common/storage'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { AbstractStorageService, isProfileUsingDefaultStorage, StorageScope, WillSaveStateReason } from 'vs/platform/storage/common/storage'; import { ApplicationStorageDatabaseClient, ProfileStorageDatabaseClient, WorkspaceStorageDatabaseClient } from 'vs/platform/storage/common/storageIpc'; import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; diff --git a/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts b/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts index b5a25d3b1df..93e9bbe7368 100644 --- a/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts +++ b/src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts @@ -3,12 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; -import { Disposable, isDisposable } from 'vs/base/common/lifecycle'; +import { Disposable, MutableDisposable, isDisposable } from 'vs/base/common/lifecycle'; import { IStorage, IStorageDatabase, Storage } from 'vs/base/parts/storage/common/storage'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { AbstractStorageService, IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { AbstractStorageService, IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget, isProfileUsingDefaultStorage } from 'vs/platform/storage/common/storage'; +import { Emitter, Event } from 'vs/base/common/event'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; +import { ILogService } from 'vs/platform/log/common/log'; +import { ApplicationStorageDatabaseClient, ProfileStorageDatabaseClient } from 'vs/platform/storage/common/storageIpc'; +import { IUserDataProfile, IUserDataProfilesService, reviveProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; export interface IProfileStorageValueChanges { readonly profile: IUserDataProfile; @@ -123,6 +126,44 @@ export abstract class AbstractUserDataProfileStorageService extends Disposable i protected abstract createStorageDatabase(profile: IUserDataProfile): Promise; } +export class NativeUserDataProfileStorageService extends AbstractUserDataProfileStorageService implements IUserDataProfileStorageService { + + private readonly _onDidChange: Emitter; + readonly onDidChange: Event; + + constructor( + @IMainProcessService private readonly mainProcessService: IMainProcessService, + @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, + @IStorageService storageService: IStorageService, + @ILogService logService: ILogService, + ) { + super(storageService); + + const channel = mainProcessService.getChannel('profileStorageListener'); + const disposable = this._register(new MutableDisposable()); + this._onDidChange = this._register(new Emitter({ + // Start listening to profile storage changes only when someone is listening + onWillAddFirstListener: () => { + disposable.value = channel.listen('onDidChange')(e => { + logService.trace('profile storage changes', e); + this._onDidChange.fire({ + targetChanges: e.targetChanges.map(profile => reviveProfile(profile, userDataProfilesService.profilesHome.scheme)), + valueChanges: e.valueChanges.map(e => ({ ...e, profile: reviveProfile(e.profile, userDataProfilesService.profilesHome.scheme) })) + }); + }); + }, + // Stop listening to profile storage changes when no one is listening + onDidRemoveLastListener: () => disposable.value = undefined + })); + this.onDidChange = this._onDidChange.event; + } + + protected async createStorageDatabase(profile: IUserDataProfile): Promise { + const storageChannel = this.mainProcessService.getChannel('storage'); + return isProfileUsingDefaultStorage(profile) ? new ApplicationStorageDatabaseClient(storageChannel) : new ProfileStorageDatabaseClient(storageChannel, profile); + } +} + class StorageService extends AbstractStorageService { private readonly profileStorage: IStorage; diff --git a/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts b/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts index f000b71599d..1c3b057f4a5 100644 --- a/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts +++ b/src/vs/platform/userDataProfile/electron-sandbox/userDataProfileStorageService.ts @@ -3,53 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Emitter, Event } from 'vs/base/common/event'; -import { MutableDisposable } from 'vs/base/common/lifecycle'; -import { IStorageDatabase } from 'vs/base/parts/storage/common/storage'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { ILogService } from 'vs/platform/log/common/log'; -import { AbstractUserDataProfileStorageService, IProfileStorageChanges, IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; -import { isProfileUsingDefaultStorage, IStorageService } from 'vs/platform/storage/common/storage'; -import { ApplicationStorageDatabaseClient, ProfileStorageDatabaseClient } from 'vs/platform/storage/common/storageIpc'; -import { IUserDataProfile, IUserDataProfilesService, reviveProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; +import { IUserDataProfileStorageService, NativeUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -export class UserDataProfileStorageService extends AbstractUserDataProfileStorageService implements IUserDataProfileStorageService { - - private readonly _onDidChange: Emitter; - readonly onDidChange: Event; - - constructor( - @IMainProcessService private readonly mainProcessService: IMainProcessService, - @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, - @IStorageService storageService: IStorageService, - @ILogService logService: ILogService, - ) { - super(storageService); - - const channel = mainProcessService.getChannel('profileStorageListener'); - const disposable = this._register(new MutableDisposable()); - this._onDidChange = this._register(new Emitter({ - // Start listening to profile storage changes only when someone is listening - onWillAddFirstListener: () => { - disposable.value = channel.listen('onDidChange')(e => { - logService.trace('profile storage changes', e); - this._onDidChange.fire({ - targetChanges: e.targetChanges.map(profile => reviveProfile(profile, userDataProfilesService.profilesHome.scheme)), - valueChanges: e.valueChanges.map(e => ({ ...e, profile: reviveProfile(e.profile, userDataProfilesService.profilesHome.scheme) })) - }); - }); - }, - // Stop listening to profile storage changes when no one is listening - onDidRemoveLastListener: () => disposable.value = undefined - })); - this.onDidChange = this._onDidChange.event; - } - - protected async createStorageDatabase(profile: IUserDataProfile): Promise { - const storageChannel = this.mainProcessService.getChannel('storage'); - return isProfileUsingDefaultStorage(profile) ? new ApplicationStorageDatabaseClient(storageChannel) : new ProfileStorageDatabaseClient(storageChannel, profile); - } -} - -registerSingleton(IUserDataProfileStorageService, UserDataProfileStorageService, InstantiationType.Delayed); +registerSingleton(IUserDataProfileStorageService, NativeUserDataProfileStorageService, InstantiationType.Delayed); diff --git a/src/vs/platform/userDataSync/electron-sandbox/userDataAutoSyncService.ts b/src/vs/platform/userDataSync/node/userDataAutoSyncService.ts similarity index 97% rename from src/vs/platform/userDataSync/electron-sandbox/userDataAutoSyncService.ts rename to src/vs/platform/userDataSync/node/userDataAutoSyncService.ts index 3cd12e8b83c..cd1a7719882 100644 --- a/src/vs/platform/userDataSync/electron-sandbox/userDataAutoSyncService.ts +++ b/src/vs/platform/userDataSync/node/userDataAutoSyncService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // import { Event } from 'vs/base/common/event'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProductService } from 'vs/platform/product/common/productService'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; diff --git a/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts b/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts index 4d53ac15383..5600e739d3d 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts @@ -5,7 +5,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { FontMeasurements } from 'vs/editor/browser/config/fontMeasurements'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; diff --git a/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts b/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts index f0e5225baa5..fdf9a4422b3 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts @@ -7,7 +7,7 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { Disposable } from 'vs/base/common/lifecycle'; class SleepResumeRepaintMinimap extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/debugExtensionHostAction.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/debugExtensionHostAction.ts index 3f45dd2e0bf..395aecdf2db 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/debugExtensionHostAction.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/debugExtensionHostAction.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import { IProductService } from 'vs/platform/product/common/productService'; import { Action } from 'vs/base/common/actions'; import { ExtensionHostKind, IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IDebugService } from 'vs/workbench/contrib/debug/common/debug'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { randomPort } from 'vs/base/common/ports'; diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionProfileService.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionProfileService.ts index c15cef8bbd5..e77e9641a59 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionProfileService.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionProfileService.ts @@ -12,7 +12,7 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { StatusbarAlignment, IStatusbarService, IStatusbarEntryAccessor, IStatusbarEntry } from 'vs/workbench/services/statusbar/browser/statusbar'; import { IExtensionHostProfileService, ProfileSessionState } from 'vs/workbench/contrib/extensions/electron-sandbox/runtimeExtensionsEditor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { randomPort } from 'vs/base/common/ports'; import { IProductService } from 'vs/platform/product/common/productService'; diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts index 2cf602e6072..a1304365806 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts @@ -22,7 +22,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { CleanUpExtensionsFolderAction, OpenExtensionsFolderAction } from 'vs/workbench/contrib/extensions/electron-sandbox/extensionsActions'; import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations'; import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { ExtensionRecommendationNotificationServiceChannel } from 'vs/platform/extensionRecommendations/electron-sandbox/extensionRecommendationsIpc'; +import { ExtensionRecommendationNotificationServiceChannel } from 'vs/platform/extensionRecommendations/common/extensionRecommendationsIpc'; import { Codicon } from 'vs/base/common/codicons'; import { RemoteExtensionsInitializerContribution } from 'vs/workbench/contrib/extensions/electron-sandbox/remoteExtensionsInit'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts index b17b217db47..b8bbdd0e6e9 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsActions.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { IFileService } from 'vs/platform/files/common/files'; import { URI } from 'vs/base/common/uri'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { Schemas } from 'vs/base/common/network'; import { Action2 } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts index 3f183025b93..87839a6182f 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensionsSlowActions.ts @@ -15,7 +15,7 @@ import { IRequestService, asText } from 'vs/platform/request/common/request'; import { joinPath } from 'vs/base/common/resources'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { Utils } from 'vs/platform/profiling/common/profiling'; import { IFileService } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/contrib/extensions/electron-sandbox/runtimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/electron-sandbox/runtimeExtensionsEditor.ts index b77362f3c9d..38517c53dba 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/runtimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/runtimeExtensionsEditor.ts @@ -24,7 +24,7 @@ import { AbstractRuntimeExtensionsEditor, IRuntimeExtension } from 'vs/workbench import { VSBuffer } from 'vs/base/common/buffer'; import { URI } from 'vs/base/common/uri'; import { IFileService } from 'vs/platform/files/common/files'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IV8Profile, Utils } from 'vs/platform/profiling/common/profiling'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts index 610fed3f897..31f008d4b12 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts @@ -45,7 +45,7 @@ import { FileService } from 'vs/platform/files/common/fileService'; import { NullLogService, ILogService } from 'vs/platform/log/common/log'; import { IFileService } from 'vs/platform/files/common/files'; import { IProductService } from 'vs/platform/product/common/productService'; -import { ExtensionTipsService } from 'vs/platform/extensionManagement/electron-sandbox/extensionTipsService'; +import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService'; import { ExtensionRecommendationsService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationsService'; import { NoOpWorkspaceTagsService } from 'vs/workbench/contrib/tags/browser/workspaceTagsService'; import { IWorkspaceTagsService } from 'vs/workbench/contrib/tags/common/workspaceTags'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index f57c6024bb0..9376baab4ea 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -44,7 +44,7 @@ import { IProgressService } from 'vs/platform/progress/common/progress'; import { ProgressService } from 'vs/workbench/services/progress/browser/progressService'; import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; import { IExperimentService } from 'vs/workbench/contrib/experiments/common/experimentService'; -import { ExtensionTipsService } from 'vs/platform/extensionManagement/electron-sandbox/extensionTipsService'; +import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService'; import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices'; import { DisposableStore } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index 2af659723d6..98a2bbe6dda 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -45,7 +45,7 @@ import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecy import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IExperimentService } from 'vs/workbench/contrib/experiments/common/experimentService'; import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; -import { ExtensionTipsService } from 'vs/platform/extensionManagement/electron-sandbox/extensionTipsService'; +import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService'; import { Schemas } from 'vs/base/common/network'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; diff --git a/src/vs/workbench/contrib/files/electron-sandbox/fileActions.contribution.ts b/src/vs/workbench/contrib/files/electron-sandbox/fileActions.contribution.ts index 6473ad59136..189d94255c9 100644 --- a/src/vs/workbench/contrib/files/electron-sandbox/fileActions.contribution.ts +++ b/src/vs/workbench/contrib/files/electron-sandbox/fileActions.contribution.ts @@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { isWindows, isMacintosh } from 'vs/base/common/platform'; import { Schemas } from 'vs/base/common/network'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; diff --git a/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts b/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts index b6afa32e4ef..eb3744a25a3 100644 --- a/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts +++ b/src/vs/workbench/contrib/files/electron-sandbox/fileCommands.ts @@ -7,7 +7,7 @@ import { URI } from 'vs/base/common/uri'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { sequence } from 'vs/base/common/async'; import { Schemas } from 'vs/base/common/network'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; // Commands diff --git a/src/vs/workbench/contrib/files/electron-sandbox/textFileEditor.ts b/src/vs/workbench/contrib/files/electron-sandbox/textFileEditor.ts index 60b539e4e60..070274c21b9 100644 --- a/src/vs/workbench/contrib/files/electron-sandbox/textFileEditor.ts +++ b/src/vs/workbench/contrib/files/electron-sandbox/textFileEditor.ts @@ -19,7 +19,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { IExplorerService } from 'vs/workbench/contrib/files/browser/files'; import { IProductService } from 'vs/platform/product/common/productService'; diff --git a/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts b/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts index 11fc64bc1e5..5e63df61e40 100644 --- a/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts +++ b/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts @@ -10,7 +10,7 @@ import { INativeEnvironmentService } from 'vs/platform/environment/common/enviro import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IssueType } from 'vs/platform/issue/common/issue'; import { IIssueService } from 'vs/platform/issue/electron-sandbox/issue'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue'; diff --git a/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts b/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts index 0acd639b851..9ac4e2cd92f 100644 --- a/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts +++ b/src/vs/workbench/contrib/localHistory/electron-sandbox/localHistoryCommands.ts @@ -10,7 +10,7 @@ import { registerAction2, Action2, MenuId } from 'vs/platform/actions/common/act import { LOCAL_HISTORY_MENU_CONTEXT_KEY } from 'vs/workbench/contrib/localHistory/browser/localHistory'; import { findLocalHistoryEntry, ITimelineCommandArgument } from 'vs/workbench/contrib/localHistory/browser/localHistoryCommands'; import { isMacintosh, isWindows } from 'vs/base/common/platform'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Schemas } from 'vs/base/common/network'; import { ResourceContextKey } from 'vs/workbench/common/contextkeys'; diff --git a/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts b/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts index 25a15ac8d9a..beb436ec8e7 100644 --- a/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts +++ b/src/vs/workbench/contrib/logs/electron-sandbox/logsActions.ts @@ -7,7 +7,7 @@ import { Action } from 'vs/base/common/actions'; import { join } from 'vs/base/common/path'; import { URI } from 'vs/base/common/uri'; import * as nls from 'vs/nls'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { IFileService } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts b/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts index 2efc0ec8e66..330a63b5713 100644 --- a/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts +++ b/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts @@ -10,7 +10,7 @@ import { generateUuid } from 'vs/base/common/uuid'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IFileService } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IV8Profile } from 'vs/platform/profiling/common/profiling'; import { IProfileAnalysisWorkerService, ProfilingOutput } from 'vs/platform/profiling/electron-sandbox/profileAnalysisWorkerService'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; diff --git a/src/vs/workbench/contrib/performance/electron-sandbox/startupProfiler.ts b/src/vs/workbench/contrib/performance/electron-sandbox/startupProfiler.ts index b4d78d18157..1c1d8d4203a 100644 --- a/src/vs/workbench/contrib/performance/electron-sandbox/startupProfiler.ts +++ b/src/vs/workbench/contrib/performance/electron-sandbox/startupProfiler.ts @@ -15,7 +15,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { URI } from 'vs/base/common/uri'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProductService } from 'vs/platform/product/common/productService'; import { IFileService } from 'vs/platform/files/common/files'; import { ILabelService } from 'vs/platform/label/common/label'; diff --git a/src/vs/workbench/contrib/performance/electron-sandbox/startupTimings.ts b/src/vs/workbench/contrib/performance/electron-sandbox/startupTimings.ts index 1fe365ec6b3..b5001a8078b 100644 --- a/src/vs/workbench/contrib/performance/electron-sandbox/startupTimings.ts +++ b/src/vs/workbench/contrib/performance/electron-sandbox/startupTimings.ts @@ -11,7 +11,7 @@ import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecy import { IProductService } from 'vs/platform/product/common/productService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUpdateService } from 'vs/platform/update/common/update'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ITimerService } from 'vs/workbench/services/timer/browser/timerService'; import { IFileService } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/contrib/remote/electron-sandbox/remote.contribution.ts b/src/vs/workbench/contrib/remote/electron-sandbox/remote.contribution.ts index f884e73d9da..9cc04b27a86 100644 --- a/src/vs/workbench/contrib/remote/electron-sandbox/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-sandbox/remote.contribution.ts @@ -28,7 +28,7 @@ import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/ import { TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry'; import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils'; import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; class RemoteAgentDiagnosticListener implements IWorkbenchContribution { diff --git a/src/vs/workbench/contrib/sandbox/electron-sandbox/sandbox.contribution.ts b/src/vs/workbench/contrib/sandbox/electron-sandbox/sandbox.contribution.ts index 3bc17ec73fc..7aebdc212ad 100644 --- a/src/vs/workbench/contrib/sandbox/electron-sandbox/sandbox.contribution.ts +++ b/src/vs/workbench/contrib/sandbox/electron-sandbox/sandbox.contribution.ts @@ -8,7 +8,7 @@ import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProductService } from 'vs/platform/product/common/productService'; import { IWindowsConfiguration, IWindowSettings } from 'vs/platform/window/common/window'; diff --git a/src/vs/workbench/contrib/splash/electron-sandbox/splash.contribution.ts b/src/vs/workbench/contrib/splash/electron-sandbox/splash.contribution.ts index a2a88ad20e5..39743527276 100644 --- a/src/vs/workbench/contrib/splash/electron-sandbox/splash.contribution.ts +++ b/src/vs/workbench/contrib/splash/electron-sandbox/splash.contribution.ts @@ -7,7 +7,7 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { ISplashStorageService } from 'vs/workbench/contrib/splash/browser/splash'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { PartsSplash } from 'vs/workbench/contrib/splash/browser/partsSplash'; import { IPartsSplash } from 'vs/platform/theme/common/themeService'; diff --git a/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTags.ts b/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTags.ts index 1bece426aa1..50884995c60 100644 --- a/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTags.ts +++ b/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTags.ts @@ -16,7 +16,7 @@ import { IDiagnosticsService, IWorkspaceInformation } from 'vs/platform/diagnost import { IRequestService } from 'vs/platform/request/common/request'; import { isWindows } from 'vs/base/common/platform'; import { getRemotes, AllowedSecondLevelDomains, getDomainsOfRemotes } from 'vs/platform/extensionManagement/common/configRemotes'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProductService } from 'vs/platform/product/common/productService'; export async function getHashedRemotesFromConfig(text: string, stripEndingDotGit: boolean = false): Promise { diff --git a/src/vs/workbench/contrib/terminal/electron-sandbox/terminalNativeContribution.ts b/src/vs/workbench/contrib/terminal/electron-sandbox/terminalNativeContribution.ts index b08edc2ee90..19dbb559546 100644 --- a/src/vs/workbench/contrib/terminal/electron-sandbox/terminalNativeContribution.ts +++ b/src/vs/workbench/contrib/terminal/electron-sandbox/terminalNativeContribution.ts @@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri'; import { IFileService } from 'vs/platform/files/common/files'; import { registerRemoteContributions } from 'vs/workbench/contrib/terminal/electron-sandbox/terminalRemote'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { Disposable } from 'vs/base/common/lifecycle'; import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; diff --git a/src/vs/workbench/contrib/userDataSync/electron-sandbox/userDataSync.contribution.ts b/src/vs/workbench/contrib/userDataSync/electron-sandbox/userDataSync.contribution.ts index 6840848e322..644e1ad6dec 100644 --- a/src/vs/workbench/contrib/userDataSync/electron-sandbox/userDataSync.contribution.ts +++ b/src/vs/workbench/contrib/userDataSync/electron-sandbox/userDataSync.contribution.ts @@ -14,7 +14,7 @@ import { localize } from 'vs/nls'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IFileService } from 'vs/platform/files/common/files'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { CONTEXT_SYNC_STATE, SYNC_TITLE } from 'vs/workbench/services/userDataSync/common/userDataSync'; diff --git a/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts b/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts index 222d6088bfc..1e9eecf4ebd 100644 --- a/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts +++ b/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { Action2 } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { Categories } from 'vs/platform/action/common/actionCommonCategories'; export class OpenWebviewDeveloperToolsAction extends Action2 { diff --git a/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts index 0e62bf61d04..e10b2a6554c 100644 --- a/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts @@ -13,9 +13,9 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; diff --git a/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts b/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts index 6d6df9c1292..c3265219d37 100644 --- a/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts +++ b/src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts @@ -6,8 +6,8 @@ import { isMacintosh } from 'vs/base/common/platform'; import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IWebviewManagerService } from 'vs/platform/webview/common/webviewManagerService'; export class WindowIgnoreMenuShortcutsManager { diff --git a/src/vs/workbench/electron-sandbox/actions/developerActions.ts b/src/vs/workbench/electron-sandbox/actions/developerActions.ts index acd5350aea4..db2ddfe0f02 100644 --- a/src/vs/workbench/electron-sandbox/actions/developerActions.ts +++ b/src/vs/workbench/electron-sandbox/actions/developerActions.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { Action2, MenuId } from 'vs/platform/actions/common/actions'; import { Categories } from 'vs/platform/action/common/actionCommonCategories'; diff --git a/src/vs/workbench/electron-sandbox/actions/installActions.ts b/src/vs/workbench/electron-sandbox/actions/installActions.ts index ded02b43b52..5e397b97309 100644 --- a/src/vs/workbench/electron-sandbox/actions/installActions.ts +++ b/src/vs/workbench/electron-sandbox/actions/installActions.ts @@ -9,7 +9,7 @@ import { ILocalizedString } from 'vs/platform/action/common/action'; import product from 'vs/platform/product/common/product'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { toErrorMessage } from 'vs/base/common/errorMessage'; import { IProductService } from 'vs/platform/product/common/productService'; diff --git a/src/vs/workbench/electron-sandbox/actions/windowActions.ts b/src/vs/workbench/electron-sandbox/actions/windowActions.ts index 69a709a6ff2..7a348c60a35 100644 --- a/src/vs/workbench/electron-sandbox/actions/windowActions.ts +++ b/src/vs/workbench/electron-sandbox/actions/windowActions.ts @@ -17,7 +17,7 @@ import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; import { ICommandHandler } from 'vs/platform/commands/common/commands'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { Codicon } from 'vs/base/common/codicons'; import { ThemeIcon } from 'vs/base/common/themables'; import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; diff --git a/src/vs/workbench/electron-sandbox/desktop.contribution.ts b/src/vs/workbench/electron-sandbox/desktop.contribution.ts index a9f40dce969..7dad5f006bc 100644 --- a/src/vs/workbench/electron-sandbox/desktop.contribution.ts +++ b/src/vs/workbench/electron-sandbox/desktop.contribution.ts @@ -16,7 +16,7 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IsMacContext } from 'vs/platform/contextkey/common/contextkeys'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { InstallShellScriptAction, UninstallShellScriptAction } from 'vs/workbench/electron-sandbox/actions/installActions'; diff --git a/src/vs/workbench/electron-sandbox/desktop.main.ts b/src/vs/workbench/electron-sandbox/desktop.main.ts index f983c2717c3..e77d86ba257 100644 --- a/src/vs/workbench/electron-sandbox/desktop.main.ts +++ b/src/vs/workbench/electron-sandbox/desktop.main.ts @@ -21,7 +21,8 @@ import { IWorkspaceContextService, isSingleFolderWorkspaceIdentifier, isWorkspac import { IWorkbenchConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { Disposable } from 'vs/base/common/lifecycle'; -import { IMainProcessService, ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { SharedProcessService } from 'vs/workbench/services/sharedProcess/electron-sandbox/sharedProcessService'; import { RemoteAuthorityResolverService } from 'vs/platform/remote/electron-sandbox/remoteAuthorityResolverService'; import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts index 5672b546ccf..4b2949de24c 100644 --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts @@ -9,7 +9,7 @@ import { IDialogHandler, IDialogResult, IDialogService } from 'vs/platform/dialo import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProductService } from 'vs/platform/product/common/productService'; import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts index a81127a3525..dd166f1f3f8 100644 --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts @@ -9,7 +9,7 @@ import { isLinuxSnap } from 'vs/base/common/platform'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { AbstractDialogHandler, IConfirmation, IConfirmationResult, IPrompt, IPromptResult } from 'vs/platform/dialogs/common/dialogs'; import { ILogService } from 'vs/platform/log/common/log'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IProductService } from 'vs/platform/product/common/productService'; import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals'; diff --git a/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts b/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts index 00c58af451d..a5d93553f0b 100644 --- a/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts @@ -20,7 +20,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { IMenubarData, IMenubarMenu, IMenubarKeybinding, IMenubarMenuItemSubmenu, IMenubarMenuItemAction, MenubarMenuItem } from 'vs/platform/menubar/common/menubar'; import { IMenubarService } from 'vs/platform/menubar/electron-sandbox/menubar'; import { withNullAsUndefined } from 'vs/base/common/types'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { ICommandService } from 'vs/platform/commands/common/commands'; diff --git a/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts b/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts index 33a7dd6d486..99309e7f8e0 100644 --- a/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts @@ -16,7 +16,7 @@ import { TitlebarPart as BrowserTitleBarPart } from 'vs/workbench/browser/parts/ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { getTitleBarStyle, useWindowControlsOverlay } from 'vs/platform/window/common/window'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { Codicon } from 'vs/base/common/codicons'; diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index 4bc86f06bd8..a32654bdac6 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -43,7 +43,7 @@ import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storag import { assertIsDefined } from 'vs/base/common/types'; import { IOpenerService, OpenOptions } from 'vs/platform/opener/common/opener'; import { Schemas } from 'vs/base/common/network'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { posix } from 'vs/base/common/path'; import { ITunnelService, extractLocalHostUriMetaDataForPortMapping } from 'vs/platform/tunnel/common/tunnel'; import { IWorkbenchLayoutService, Parts, positionFromString, Position } from 'vs/workbench/services/layout/browser/layoutService'; diff --git a/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts b/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts index 975240757c0..05aa8e55bc2 100644 --- a/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts +++ b/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts @@ -15,7 +15,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IJSONEditingService } from 'vs/workbench/services/configuration/common/jsonEditing'; import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; interface AccessibilityMetrics { diff --git a/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts b/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts index 43443e6cdc5..f4808d9f3a1 100644 --- a/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts +++ b/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts @@ -7,7 +7,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService import { URI } from 'vs/base/common/uri'; import { isMacintosh } from 'vs/base/common/platform'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { VSBuffer } from 'vs/base/common/buffer'; export class NativeClipboardService implements IClipboardService { diff --git a/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts b/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts index bfbc3211a7f..86fa6872ad6 100644 --- a/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts +++ b/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts @@ -15,7 +15,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IFileService } from 'vs/platform/files/common/files'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { AbstractFileDialogService } from 'vs/workbench/services/dialogs/browser/abstractFileDialogService'; import { Schemas } from 'vs/base/common/network'; import { ILanguageService } from 'vs/editor/common/languages/language'; diff --git a/src/vs/workbench/services/dialogs/test/electron-sandbox/fileDialogService.test.ts b/src/vs/workbench/services/dialogs/test/electron-sandbox/fileDialogService.test.ts index e97abfe944e..d14734c312d 100644 --- a/src/vs/workbench/services/dialogs/test/electron-sandbox/fileDialogService.test.ts +++ b/src/vs/workbench/services/dialogs/test/electron-sandbox/fileDialogService.test.ts @@ -22,7 +22,7 @@ import { ILanguageService } from 'vs/editor/common/languages/language'; import { IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILabelService } from 'vs/platform/label/common/label'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; diff --git a/src/vs/workbench/services/extensions/electron-sandbox/localProcessExtensionHost.ts b/src/vs/workbench/services/extensions/electron-sandbox/localProcessExtensionHost.ts index d8a945776a4..35f5ebbf847 100644 --- a/src/vs/workbench/services/extensions/electron-sandbox/localProcessExtensionHost.ts +++ b/src/vs/workbench/services/extensions/electron-sandbox/localProcessExtensionHost.ts @@ -20,7 +20,7 @@ import { ILogService, ILoggerService } from 'vs/platform/log/common/log'; import { IProductService } from 'vs/platform/product/common/productService'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { isUntitledWorkspace, IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { MessageType, isMessageOfType, IExtensionHostInitData, UIKind, NativeLogMarkers } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; import { withNullAsUndefined } from 'vs/base/common/types'; diff --git a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts index 45022c15cc3..cf96f5ac0b3 100644 --- a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts +++ b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts @@ -27,7 +27,7 @@ import { ExtensionKind } from 'vs/platform/environment/common/environment'; import { IFileService } from 'vs/platform/files/common/files'; import { PersistentConnectionEventType } from 'vs/platform/remote/common/remoteAgentConnection'; import { IProductService } from 'vs/platform/product/common/productService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { IRemoteExplorerService } from 'vs/workbench/services/remote/common/remoteExplorerService'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { getRemoteName, parseAuthorityWithPort } from 'vs/platform/remote/common/remoteHosts'; diff --git a/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts b/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts index b90fb8c3bcd..c933f179ff7 100644 --- a/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts +++ b/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts @@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/event'; import { isLinux } from 'vs/base/common/platform'; import { FileSystemProviderCapabilities, IFileDeleteOptions, IStat, FileType, IFileReadStreamOptions, IFileWriteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileAtomicReadOptions, IFileSystemProviderWithFileCloneCapability } from 'vs/platform/files/common/files'; import { AbstractDiskFileSystemProvider } from 'vs/platform/files/common/diskFileSystemProvider'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ReadableStreamEvents } from 'vs/base/common/stream'; import { URI } from 'vs/base/common/uri'; diff --git a/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts b/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts index 189612f7115..a3ed755007c 100644 --- a/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts +++ b/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts @@ -9,7 +9,7 @@ import { Schemas } from 'vs/base/common/network'; import { URI } from 'vs/base/common/uri'; import { IFileService, IFileStatWithMetadata, IWriteFileOptions } from 'vs/platform/files/common/files'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { IElevatedFileService } from 'vs/workbench/services/files/common/elevatedFileService'; diff --git a/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts b/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts index 548df18f2eb..72bb003e22f 100644 --- a/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts +++ b/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts @@ -5,7 +5,7 @@ import { Event } from 'vs/base/common/event'; import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILabelService, Verbosity } from 'vs/platform/label/common/label'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -13,7 +13,7 @@ import { IWindowOpenable, IOpenWindowOptions, isFolderToOpen, isWorkspaceToOpen, import { Disposable } from 'vs/base/common/lifecycle'; import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; class WorkbenchNativeHostService extends NativeHostService { diff --git a/src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayoutService.ts b/src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayoutService.ts index 0e0d4b117c1..68ee8d45ceb 100644 --- a/src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayoutService.ts +++ b/src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayoutService.ts @@ -7,7 +7,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IKeyboardLayoutInfo, IKeyboardMapping, IMacLinuxKeyboardMapping, IWindowsKeyboardMapping, macLinuxKeyboardMappingEquals, windowsKeyboardMappingEquals } from 'vs/platform/keyboardLayout/common/keyboardLayout'; import { Emitter, Event } from 'vs/base/common/event'; import { OperatingSystem, OS } from 'vs/base/common/platform'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { INativeKeyboardLayoutService as IBaseNativeKeyboardLayoutService } from 'vs/platform/keyboardLayout/common/keyboardLayoutService'; import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/services/lifecycle/electron-sandbox/lifecycleService.ts b/src/vs/workbench/services/lifecycle/electron-sandbox/lifecycleService.ts index 7bccbc7fca8..9d4d9418201 100644 --- a/src/vs/workbench/services/lifecycle/electron-sandbox/lifecycleService.ts +++ b/src/vs/workbench/services/lifecycle/electron-sandbox/lifecycleService.ts @@ -10,7 +10,7 @@ import { ipcRenderer } from 'vs/base/parts/sandbox/electron-sandbox/globals'; import { ILogService } from 'vs/platform/log/common/log'; import { AbstractLifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycleService'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { Promises, disposableTimeout, raceCancellation } from 'vs/base/common/async'; import { toErrorMessage } from 'vs/base/common/errorMessage'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts b/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts index 4ab21828920..85a638d5937 100644 --- a/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts +++ b/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts @@ -17,7 +17,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { URI } from 'vs/base/common/uri'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; diff --git a/src/vs/workbench/services/request/electron-sandbox/requestService.ts b/src/vs/workbench/services/request/electron-sandbox/requestService.ts index 2ff418a52e1..70f94928ac3 100644 --- a/src/vs/workbench/services/request/electron-sandbox/requestService.ts +++ b/src/vs/workbench/services/request/electron-sandbox/requestService.ts @@ -8,7 +8,7 @@ import { ILogService } from 'vs/platform/log/common/log'; import { RequestService } from 'vs/platform/request/browser/requestService'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IRequestService } from 'vs/platform/request/common/request'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; export class NativeRequestService extends RequestService { diff --git a/src/vs/workbench/services/storage/electron-sandbox/storageService.ts b/src/vs/workbench/services/storage/electron-sandbox/storageService.ts index ed30c87c45c..52542fcad82 100644 --- a/src/vs/workbench/services/storage/electron-sandbox/storageService.ts +++ b/src/vs/workbench/services/storage/electron-sandbox/storageService.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { NativeStorageService } from 'vs/platform/storage/electron-sandbox/storageService'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; +import { NativeStorageService } from 'vs/platform/storage/common/storageService'; import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; diff --git a/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts b/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts index 10769a87465..aff2bd1cfa1 100644 --- a/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts +++ b/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Emitter } from 'vs/base/common/event'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Disposable } from 'vs/base/common/lifecycle'; import { IHostColorSchemeService } from 'vs/workbench/services/themes/common/hostColorSchemeService'; diff --git a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts index 4048bbf17e3..f30a92552e3 100644 --- a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts +++ b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/services/url/electron-sandbox/urlService.ts b/src/vs/workbench/services/url/electron-sandbox/urlService.ts index 840562f12b7..3b3000abce6 100644 --- a/src/vs/workbench/services/url/electron-sandbox/urlService.ts +++ b/src/vs/workbench/services/url/electron-sandbox/urlService.ts @@ -5,13 +5,13 @@ import { IURLService, IURLHandler, IOpenURLOptions } from 'vs/platform/url/common/url'; import { URI, UriComponents } from 'vs/base/common/uri'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { URLHandlerChannel } from 'vs/platform/url/common/urlIpc'; import { IOpenerService, IOpener, matchesScheme } from 'vs/platform/opener/common/opener'; import { IProductService } from 'vs/platform/product/common/productService'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { NativeURLService } from 'vs/platform/url/common/urlService'; import { ILogService } from 'vs/platform/log/common/log'; diff --git a/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts b/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts index 83d57784e70..5ff45dbcffc 100644 --- a/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts +++ b/src/vs/workbench/services/utilityProcess/electron-sandbox/utilityProcessWorkerWorkbenchService.ts @@ -5,7 +5,8 @@ import { ILogService } from 'vs/platform/log/common/log'; import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IMainProcessService, ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { Client as MessagePortClient } from 'vs/base/parts/ipc/common/ipc.mp'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IPCClient, ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; diff --git a/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupTracker.ts b/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupTracker.ts index 75929084dd7..6994989e01d 100644 --- a/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupTracker.ts +++ b/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupTracker.ts @@ -14,7 +14,7 @@ import { ConfirmResult, IFileDialogService, IDialogService, getFileNamesMessage import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { isMacintosh } from 'vs/base/common/platform'; import { HotExitConfiguration } from 'vs/platform/files/common/files'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { WorkingCopyBackupTracker } from 'vs/workbench/services/workingCopy/common/workingCopyBackupTracker'; import { ILogService } from 'vs/platform/log/common/log'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; diff --git a/src/vs/workbench/services/workingCopy/test/electron-browser/workingCopyBackupTracker.test.ts b/src/vs/workbench/services/workingCopy/test/electron-browser/workingCopyBackupTracker.test.ts index 69e18ce3ace..12ed796a77e 100644 --- a/src/vs/workbench/services/workingCopy/test/electron-browser/workingCopyBackupTracker.test.ts +++ b/src/vs/workbench/services/workingCopy/test/electron-browser/workingCopyBackupTracker.test.ts @@ -28,7 +28,7 @@ import { HotExitConfiguration } from 'vs/platform/files/common/files'; import { ShutdownReason, ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IFileDialogService, ConfirmResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { workbenchInstantiationService, TestServiceAccessor } from 'vs/workbench/test/electron-browser/workbenchTestServices'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; diff --git a/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts b/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts index bbb5cce6be0..40e7be1ac1c 100644 --- a/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts +++ b/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts @@ -25,7 +25,7 @@ import { ILabelService, Verbosity } from 'vs/platform/label/common/label'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { AbstractWorkspaceEditingService } from 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { isMacintosh } from 'vs/base/common/platform'; import { WorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackupService'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; diff --git a/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts b/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts index e5cb1078e35..d4d82c05960 100644 --- a/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts +++ b/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; -import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { IMainProcessService } from 'vs/platform/ipc/common/mainProcessService'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; // @ts-ignore: interface is implemented via proxy export class NativeWorkspacesService implements IWorkspacesService { diff --git a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts index 2bb2ada89e6..f90e494b1a0 100644 --- a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts @@ -7,7 +7,6 @@ import { workbenchInstantiationService as browserWorkbenchInstantiationService, import { Event } from 'vs/base/common/event'; import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; import { NativeTextFileService, } from 'vs/workbench/services/textfile/electron-sandbox/nativeTextFileService'; -import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; import { FileOperationError, IFileService } from 'vs/platform/files/common/files'; import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; @@ -36,7 +35,7 @@ import { TestContextService, TestProductService } from 'vs/workbench/test/common import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { MouseInputEvent } from 'vs/base/parts/sandbox/common/electronTypes'; import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IOSProperties, IOSStatistics } from 'vs/platform/native/common/native'; +import { INativeHostService, IOSProperties, IOSStatistics } from 'vs/platform/native/common/native'; import { homedir, release, tmpdir, hostname } from 'os'; import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; From 2a89851cbc2649d0da73581fcf26479934526154 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 24 Feb 2023 16:31:55 +0100 Subject: [PATCH 090/206] Fixes ci --- .../bracketPairsTree/combineTextEditInfos.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts index 01dec299fd9..29cf5a65271 100644 --- a/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts +++ b/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.ts @@ -5,7 +5,7 @@ import { ArrayQueue } from 'vs/base/common/arrays'; import { TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper'; -import { Length, lengthAdd, lengthDiffNonNegative, lengthEquals, lengthIsZero, lengthLessThanEqual, lengthToObj, lengthZero, sumLengths } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; +import { Length, lengthAdd, lengthDiffNonNegative, lengthEquals, lengthIsZero, lengthToObj, lengthZero, sumLengths } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length'; export function combineTextEditInfos(textEditInfoFirst: TextEditInfo[], textEditInfoSecond: TextEditInfo[]): TextEditInfo[] { if (textEditInfoFirst.length === 0) { From 2f5ef1e59e14b17c4e8e7542a4a861612820968b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 24 Feb 2023 16:55:58 +0100 Subject: [PATCH 091/206] Move some tests out of `electron-browser` (#175336) * move some tests * move more * back to sandbox --- .../experimentService.test.ts | 0 .../experimentalPrompts.test.ts | 2 +- .../extension.test.ts | 0 .../extensionRecommendationsService.test.ts | 4 ++-- .../electron-browser/extensionsActions.test.ts | 5 +++-- .../extensionsWorkbenchService.test.ts | 4 ++-- .../extensionsViews.test.ts | 2 +- .../electron-browser/workbenchTestServices.ts | 12 ------------ .../electron-sandbox/workbenchTestServices.ts | 17 +++++++++++++++++ 9 files changed, 26 insertions(+), 20 deletions(-) rename src/vs/workbench/contrib/experiments/test/{electron-browser => electron-sandbox}/experimentService.test.ts (100%) rename src/vs/workbench/contrib/experiments/test/{electron-browser => electron-sandbox}/experimentalPrompts.test.ts (99%) rename src/vs/workbench/contrib/extensions/test/{electron-browser => browser}/extension.test.ts (100%) rename src/vs/workbench/contrib/extensions/test/{electron-browser => electron-sandbox}/extensionsViews.test.ts (99%) create mode 100644 src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts diff --git a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts b/src/vs/workbench/contrib/experiments/test/electron-sandbox/experimentService.test.ts similarity index 100% rename from src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts rename to src/vs/workbench/contrib/experiments/test/electron-sandbox/experimentService.test.ts diff --git a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts b/src/vs/workbench/contrib/experiments/test/electron-sandbox/experimentalPrompts.test.ts similarity index 99% rename from src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts rename to src/vs/workbench/contrib/experiments/test/electron-sandbox/experimentalPrompts.test.ts index 025369ee34c..ec15df77297 100644 --- a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts +++ b/src/vs/workbench/contrib/experiments/test/electron-sandbox/experimentalPrompts.test.ts @@ -14,7 +14,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { ExperimentalPrompts } from 'vs/workbench/contrib/experiments/browser/experimentalPrompt'; import { ExperimentActionType, ExperimentState, IExperiment, IExperimentActionPromptProperties, IExperimentService, LocalizedPromptText } from 'vs/workbench/contrib/experiments/common/experimentService'; -import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; +import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-sandbox/experimentService.test'; import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TestCommandService } from 'vs/editor/test/browser/editorTestServices'; import { ICommandService } from 'vs/platform/commands/common/commands'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extension.test.ts b/src/vs/workbench/contrib/extensions/test/browser/extension.test.ts similarity index 100% rename from src/vs/workbench/contrib/extensions/test/electron-browser/extension.test.ts rename to src/vs/workbench/contrib/extensions/test/browser/extension.test.ts diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts index 31f008d4b12..4b87d843e84 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionRecommendationsService.test.ts @@ -19,7 +19,7 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TestContextService, TestStorageService } from 'vs/workbench/test/common/workbenchTestServices'; -import { TestSharedProcessService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-sandbox/workbenchTestServices'; import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { URI } from 'vs/base/common/uri'; @@ -37,7 +37,7 @@ import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecy import { INotificationService, Severity, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification'; import { NativeURLService } from 'vs/platform/url/common/urlService'; import { IExperimentService } from 'vs/workbench/contrib/experiments/common/experimentService'; -import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; +import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-sandbox/experimentService.test'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 9376baab4ea..febf21fa14b 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -26,7 +26,8 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil import { IExtensionService, toExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestContextService } from 'vs/workbench/test/common/workbenchTestServices'; -import { TestSharedProcessService, TestEnvironmentService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { TestEnvironmentService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-sandbox/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { NativeURLService } from 'vs/platform/url/common/urlService'; @@ -42,7 +43,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { Schemas } from 'vs/base/common/network'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { ProgressService } from 'vs/workbench/services/progress/browser/progressService'; -import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; +import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-sandbox/experimentService.test'; import { IExperimentService } from 'vs/workbench/contrib/experiments/common/experimentService'; import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService'; import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index 98a2bbe6dda..29790dd21f2 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -25,7 +25,7 @@ import { IPager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestSharedProcessService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-sandbox/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { IProgressService } from 'vs/platform/progress/common/progress'; @@ -44,7 +44,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices'; import { IExperimentService } from 'vs/workbench/contrib/experiments/common/experimentService'; -import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; +import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-sandbox/experimentService.test'; import { ExtensionTipsService } from 'vs/platform/extensionManagement/node/extensionTipsService'; import { Schemas } from 'vs/base/common/network'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionsViews.test.ts similarity index 99% rename from src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts rename to src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionsViews.test.ts index f969305d603..680ad283906 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extensionsViews.test.ts @@ -26,7 +26,7 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil import { IExtensionService, toExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestMenuService } from 'vs/workbench/test/browser/workbenchTestServices'; -import { TestSharedProcessService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { TestSharedProcessService } from 'vs/workbench/test/electron-sandbox/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { NativeURLService } from 'vs/platform/url/common/urlService'; diff --git a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts index f90e494b1a0..1f39b7161e9 100644 --- a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts @@ -5,7 +5,6 @@ import { workbenchInstantiationService as browserWorkbenchInstantiationService, ITestInstantiationService, TestLifecycleService, TestFilesConfigurationService, TestFileService, TestFileDialogService, TestPathService, TestEncodingOracle } from 'vs/workbench/test/browser/workbenchTestServices'; import { Event } from 'vs/base/common/event'; -import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; import { NativeTextFileService, } from 'vs/workbench/services/textfile/electron-sandbox/nativeTextFileService'; import { FileOperationError, IFileService } from 'vs/platform/files/common/files'; import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; @@ -177,17 +176,6 @@ export class TestNativeTextFileServiceWithEncodingOverrides extends NativeTextFi } } -export class TestSharedProcessService implements ISharedProcessService { - - declare readonly _serviceBrand: undefined; - - getChannel(channelName: string): any { return undefined; } - - registerChannel(channelName: string, channel: any): void { } - - notifyRestored(): void { } -} - export class TestNativeHostService implements INativeHostService { declare readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts b/src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts new file mode 100644 index 00000000000..bdf057acfca --- /dev/null +++ b/src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; + +export class TestSharedProcessService implements ISharedProcessService { + + declare readonly _serviceBrand: undefined; + + getChannel(channelName: string): any { return undefined; } + + registerChannel(channelName: string, channel: any): void { } + + notifyRestored(): void { } +} From 6657ec64064b123dc3647f28eca2d45f04e2a3b4 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 24 Feb 2023 17:05:44 +0100 Subject: [PATCH 092/206] fix https://github.com/microsoft/vscode/issues/174562 --- src/vs/editor/contrib/suggest/browser/suggest.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/suggest/browser/suggest.ts b/src/vs/editor/contrib/suggest/browser/suggest.ts index 29c5c470bb3..71f723262cd 100644 --- a/src/vs/editor/contrib/suggest/browser/suggest.ts +++ b/src/vs/editor/contrib/suggest/browser/suggest.ts @@ -397,7 +397,8 @@ CommandsRegistry.registerCommand('_executeCompletionItemProvider', async (access }; const resolving: Promise[] = []; - const completions = await provideSuggestionItems(completionProvider, ref.object.textEditorModel, Position.lift(position), undefined, { triggerCharacter: triggerCharacter ?? undefined, triggerKind: triggerCharacter ? languages.CompletionTriggerKind.TriggerCharacter : languages.CompletionTriggerKind.Invoke }); + const actualPosition = ref.object.textEditorModel.validatePosition(position); + const completions = await provideSuggestionItems(completionProvider, ref.object.textEditorModel, actualPosition, undefined, { triggerCharacter: triggerCharacter ?? undefined, triggerKind: triggerCharacter ? languages.CompletionTriggerKind.TriggerCharacter : languages.CompletionTriggerKind.Invoke }); for (const item of completions.items) { if (resolving.length < (maxItemsToResolve ?? 0)) { resolving.push(item.resolve(CancellationToken.None)); From 9a6bf40e40b14e73b410a6b696b8bf6206cf8315 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 24 Feb 2023 17:10:07 +0100 Subject: [PATCH 093/206] fix https://github.com/microsoft/vscode/issues/173501 --- .../api/browser/mainThreadLanguageFeatures.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 005cf3ea496..6b1959d48e1 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -183,8 +183,15 @@ export class MainThreadLanguageFeatures extends Disposable implements MainThread dispose: () => listDto.cacheId && this._proxy.$releaseCodeLenses(handle, listDto.cacheId) }; }, - resolveCodeLens: (_model: ITextModel, codeLens: languages.CodeLens, token: CancellationToken): Promise => { - return this._proxy.$resolveCodeLens(handle, codeLens, token); + resolveCodeLens: async (model: ITextModel, codeLens: languages.CodeLens, token: CancellationToken): Promise => { + const result = await this._proxy.$resolveCodeLens(handle, codeLens, token); + if (!result) { + return undefined; + } + return { + ...codeLens, + range: model.validateRange(result.range), + }; } }; From e7dbed062599842c380d804997e1c6e3527c9c92 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Fri, 24 Feb 2023 17:11:18 +0100 Subject: [PATCH 094/206] Add support for `ILanguageSelection` directly to the text model (#175344) Add support for `ILanguageSelection` directly to the text model (fixes #155609) --- src/vs/editor/common/model.ts | 11 ++++- src/vs/editor/common/model/textModel.ts | 24 +++++++-- src/vs/editor/common/services/model.ts | 2 - src/vs/editor/common/services/modelService.ts | 49 +++---------------- .../standalone/browser/standaloneEditor.ts | 3 +- .../browser/widget/codeEditorWidget.test.ts | 4 +- .../common/model/textModelWithTokens.test.ts | 4 +- .../api/browser/mainThreadLanguages.ts | 2 +- .../parts/editor/textResourceEditor.ts | 2 +- .../common/editor/textEditorModel.ts | 4 +- .../contrib/debug/browser/breakpointWidget.ts | 4 +- .../workbench/contrib/debug/browser/repl.ts | 2 +- .../emmet/test/browser/emmetAction.test.ts | 2 +- .../interactive/browser/interactiveEditor.ts | 2 +- .../browser/languageDetection.contribution.ts | 2 +- .../browser/model/mergeEditorModel.ts | 10 ++-- .../notebook/browser/notebook.contribution.ts | 2 +- .../common/model/notebookCellTextModel.ts | 2 +- .../performance/browser/perfviewEditor.ts | 2 +- .../browser/commands/fileTemplateSnippets.ts | 4 +- .../textfile/browser/textFileService.ts | 2 +- .../textfile/common/textFileEditorModel.ts | 2 +- .../test/browser/untitledTextEditor.test.ts | 5 +- 23 files changed, 64 insertions(+), 82 deletions(-) diff --git a/src/vs/editor/common/model.ts b/src/vs/editor/common/model.ts index 0df35045e97..846dd034eec 100644 --- a/src/vs/editor/common/model.ts +++ b/src/vs/editor/common/model.ts @@ -22,6 +22,7 @@ import { IGuidesTextModelPart } from 'vs/editor/common/textModelGuides'; import { ITokenizationTextModelPart } from 'vs/editor/common/tokenizationTextModelPart'; import { ThemeColor } from 'vs/base/common/themables'; import { UndoRedoGroup } from 'vs/platform/undoRedo/common/undoRedo'; +import { ILanguageSelection } from 'vs/editor/common/languages/language'; /** * Vertical Lane in the overview ruler of the editor. @@ -871,7 +872,15 @@ export interface ITextModel { * @param source The source of the call that set the language. * @internal */ - setMode(languageId: string, source?: string): void; + setLanguage(languageId: string, source?: string): void; + + /** + * Set the current language mode associated with the model. + * @param languageSelection The new language selection. + * @param source The source of the call that set the language. + * @internal + */ + setLanguage(languageSelection: ILanguageSelection, source?: string): void; /** * Returns the real (inner-most) language mode at a given position. diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index e7014aab076..32ee664464b 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -9,7 +9,7 @@ import { Color } from 'vs/base/common/color'; import { illegalArgument, onUnexpectedError } from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; import { IMarkdownString } from 'vs/base/common/htmlContent'; -import { combinedDisposable, Disposable, IDisposable } from 'vs/base/common/lifecycle'; +import { combinedDisposable, Disposable, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle'; import { listenStream } from 'vs/base/common/stream'; import * as strings from 'vs/base/common/strings'; import { Constants } from 'vs/base/common/uint'; @@ -24,7 +24,7 @@ import { TextChange } from 'vs/editor/common/core/textChange'; import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults'; import { IWordAtPosition } from 'vs/editor/common/core/wordHelper'; import { FormattingOptions } from 'vs/editor/common/languages'; -import { ILanguageService } from 'vs/editor/common/languages/language'; +import { ILanguageSelection, ILanguageService } from 'vs/editor/common/languages/language'; import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; import * as model from 'vs/editor/common/model'; import { BracketPairsTextModelPart } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl'; @@ -243,6 +243,7 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati private _buffer: model.ITextBuffer; private _bufferDisposable: IDisposable; private _options: model.TextModelResolvedOptions; + private _languageSelectionListener = this._register(new MutableDisposable()); private _isDisposed: boolean; private __isDisposing: boolean; @@ -287,7 +288,7 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati constructor( source: string | model.ITextBufferFactory, - languageId: string, + languageIdOrSelection: string | ILanguageSelection, creationOptions: model.ITextModelCreationOptions, associatedResource: URI | null = null, @IUndoRedoService private readonly _undoRedoService: IUndoRedoService, @@ -313,6 +314,11 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati this._options = TextModel.resolveOptions(this._buffer, creationOptions); + const languageId = (typeof languageIdOrSelection === 'string' ? languageIdOrSelection : languageIdOrSelection.languageId); + if (typeof languageIdOrSelection !== 'string') { + this._languageSelectionListener.value = languageIdOrSelection.onDidChange(() => this._setLanguage(languageIdOrSelection.languageId)); + } + this._bracketPairs = this._register(new BracketPairsTextModelPart(this, this._languageConfigurationService)); this._guidesTextModelPart = this._register(new GuidesTextModelPart(this, this._languageConfigurationService)); this._decorationProvider = this._register(new ColorizedBracketPairsDecorationProvider(this)); @@ -1907,7 +1913,17 @@ export class TextModel extends Disposable implements model.ITextModel, IDecorati return this.tokenization.getLanguageId(); } - public setMode(languageId: string, source?: string): void { + public setLanguage(languageIdOrSelection: string | ILanguageSelection, source?: string): void { + if (typeof languageIdOrSelection === 'string') { + this._languageSelectionListener.clear(); + this._setLanguage(languageIdOrSelection, source); + } else { + this._languageSelectionListener.value = languageIdOrSelection.onDidChange(() => this._setLanguage(languageIdOrSelection.languageId, source)); + this._setLanguage(languageIdOrSelection.languageId, source); + } + } + + private _setLanguage(languageId: string, source?: string): void { this.tokenization.setLanguageId(languageId, source); this._languageService.requestRichLanguageFeatures(languageId); } diff --git a/src/vs/editor/common/services/model.ts b/src/vs/editor/common/services/model.ts index de627268e69..17355399606 100644 --- a/src/vs/editor/common/services/model.ts +++ b/src/vs/editor/common/services/model.ts @@ -21,8 +21,6 @@ export interface IModelService { updateModel(model: ITextModel, value: string | ITextBufferFactory): void; - setMode(model: ITextModel, languageSelection: ILanguageSelection, source?: string): void; - destroyModel(resource: URI): void; getModels(): ITextModel[]; diff --git a/src/vs/editor/common/services/modelService.ts b/src/vs/editor/common/services/modelService.ts index 9a8544466d5..4de8d88004d 100644 --- a/src/vs/editor/common/services/modelService.ts +++ b/src/vs/editor/common/services/modelService.ts @@ -40,46 +40,22 @@ function computeModelSha1(model: ITextModel): string { return shaComputer.digest(); } - class ModelData implements IDisposable { - public readonly model: TextModel; - - private _languageSelection: ILanguageSelection | null; - private _languageSelectionListener: IDisposable | null; private readonly _modelEventListeners = new DisposableStore(); constructor( - model: TextModel, + public readonly model: TextModel, onWillDispose: (model: ITextModel) => void, onDidChangeLanguage: (model: ITextModel, e: IModelLanguageChangedEvent) => void ) { this.model = model; - - this._languageSelection = null; - this._languageSelectionListener = null; - this._modelEventListeners.add(model.onWillDispose(() => onWillDispose(model))); this._modelEventListeners.add(model.onDidChangeLanguage((e) => onDidChangeLanguage(model, e))); } - private _disposeLanguageSelection(): void { - if (this._languageSelectionListener) { - this._languageSelectionListener.dispose(); - this._languageSelectionListener = null; - } - } - public dispose(): void { this._modelEventListeners.dispose(); - this._disposeLanguageSelection(); - } - - public setLanguage(languageSelection: ILanguageSelection, source?: string): void { - this._disposeLanguageSelection(); - this._languageSelection = languageSelection; - this._languageSelectionListener = this._languageSelection.onDidChange(() => this.model.setMode(languageSelection.languageId, source)); - this.model.setMode(languageSelection.languageId, source); } } @@ -242,7 +218,8 @@ export class ModelService extends Disposable implements IModelService { return true; } - public getCreationOptions(language: string, resource: URI | undefined, isForSimpleWidget: boolean): ITextModelCreationOptions { + public getCreationOptions(languageIdOrSelection: string | ILanguageSelection, resource: URI | undefined, isForSimpleWidget: boolean): ITextModelCreationOptions { + const language = (typeof languageIdOrSelection === 'string' ? languageIdOrSelection : languageIdOrSelection.languageId); let creationOptions = this._modelCreationOptionsByLanguageAndResource[language + resource]; if (!creationOptions) { const editor = this._configurationService.getValue('editor', { overrideIdentifier: language, resource }); @@ -345,12 +322,12 @@ export class ModelService extends Disposable implements IModelService { } } - private _createModelData(value: string | ITextBufferFactory, languageId: string, resource: URI | undefined, isForSimpleWidget: boolean): ModelData { + private _createModelData(value: string | ITextBufferFactory, languageIdOrSelection: string | ILanguageSelection, resource: URI | undefined, isForSimpleWidget: boolean): ModelData { // create & save the model - const options = this.getCreationOptions(languageId, resource, isForSimpleWidget); + const options = this.getCreationOptions(languageIdOrSelection, resource, isForSimpleWidget); const model: TextModel = new TextModel( value, - languageId, + languageIdOrSelection, options, resource, this._undoRedoService, @@ -478,8 +455,7 @@ export class ModelService extends Disposable implements IModelService { let modelData: ModelData; if (languageSelection) { - modelData = this._createModelData(value, languageSelection.languageId, resource, isForSimpleWidget); - this.setMode(modelData.model, languageSelection); + modelData = this._createModelData(value, languageSelection, resource, isForSimpleWidget); } else { modelData = this._createModelData(value, PLAINTEXT_LANGUAGE_ID, resource, isForSimpleWidget); } @@ -489,17 +465,6 @@ export class ModelService extends Disposable implements IModelService { return modelData.model; } - public setMode(model: ITextModel, languageSelection: ILanguageSelection, source?: string): void { - if (!languageSelection) { - return; - } - const modelData = this._models[MODEL_ID(model.uri)]; - if (!modelData) { - return; - } - modelData.setLanguage(languageSelection, source); - } - public destroyModel(resource: URI): void { // We need to support that not all models get disposed through this service (i.e. model.dispose() should work!) const modelData = this._models[MODEL_ID(resource)]; diff --git a/src/vs/editor/standalone/browser/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts index f976cb4aa5f..6027a2ac7a5 100644 --- a/src/vs/editor/standalone/browser/standaloneEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneEditor.ts @@ -240,9 +240,8 @@ export function createModel(value: string, language?: string, uri?: URI): ITextM */ export function setModelLanguage(model: ITextModel, mimeTypeOrLanguageId: string): void { const languageService = StandaloneServices.get(ILanguageService); - const modelService = StandaloneServices.get(IModelService); const languageId = languageService.getLanguageIdByMimeType(mimeTypeOrLanguageId) || mimeTypeOrLanguageId || PLAINTEXT_LANGUAGE_ID; - modelService.setMode(model, languageService.createById(languageId)); + model.setLanguage(languageService.createById(languageId)); } /** diff --git a/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts b/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts index 7fa0217572a..43a058e3b74 100644 --- a/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts +++ b/src/vs/editor/test/browser/widget/codeEditorWidget.test.ts @@ -41,7 +41,7 @@ suite('CodeEditorWidget', () => { invoked = true; })); - viewModel.model.setMode('testMode'); + viewModel.model.setLanguage('testMode'); assert.deepStrictEqual(invoked, true); @@ -55,7 +55,7 @@ suite('CodeEditorWidget', () => { const languageService = instantiationService.get(ILanguageService); const disposables = new DisposableStore(); disposables.add(languageService.registerLanguage({ id: 'testMode' })); - viewModel.model.setMode('testMode'); + viewModel.model.setLanguage('testMode'); let invoked = false; disposables.add(editor.onDidChangeModelLanguageConfiguration((e) => { diff --git a/src/vs/editor/test/common/model/textModelWithTokens.test.ts b/src/vs/editor/test/common/model/textModelWithTokens.test.ts index 39add3ef287..9406e15adf7 100644 --- a/src/vs/editor/test/common/model/textModelWithTokens.test.ts +++ b/src/vs/editor/test/common/model/textModelWithTokens.test.ts @@ -586,12 +586,12 @@ suite('TextModelWithTokens regression tests', () => { assertViewLineTokens(model, 1, true, [createViewLineToken(12, 1)]); assertViewLineTokens(model, 2, true, [createViewLineToken(9, 1)]); - model.setMode(LANG_ID1); + model.setLanguage(LANG_ID1); assertViewLineTokens(model, 1, true, [createViewLineToken(12, 11)]); assertViewLineTokens(model, 2, true, [createViewLineToken(9, 12)]); - model.setMode(LANG_ID2); + model.setLanguage(LANG_ID2); assertViewLineTokens(model, 1, false, [createViewLineToken(12, 1)]); assertViewLineTokens(model, 2, false, [createViewLineToken(9, 1)]); diff --git a/src/vs/workbench/api/browser/mainThreadLanguages.ts b/src/vs/workbench/api/browser/mainThreadLanguages.ts index c532913bccd..7ec1932f4b0 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguages.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguages.ts @@ -52,7 +52,7 @@ export class MainThreadLanguages implements MainThreadLanguagesShape { const uri = URI.revive(resource); const ref = await this._resolverService.createModelReference(uri); try { - this._modelService.setMode(ref.object.textEditorModel, this._languageService.createById(languageId)); + ref.object.textEditorModel.setLanguage(this._languageService.createById(languageId)); } finally { ref.dispose(); } diff --git a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts index bc637e33a4b..e33f2de8e4e 100644 --- a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts @@ -207,7 +207,7 @@ export class TextResourceEditor extends AbstractTextResourceEditor { // High confidence, set language id at TextEditorModel level to block future auto-detection this.input.model.setLanguageId(candidateLanguage.id); } else { - this.modelService.setMode(textModel, this.languageService.createById(candidateLanguage.id)); + textModel.setLanguage(this.languageService.createById(candidateLanguage.id)); } const opts = this.modelService.getCreationOptions(textModel.getLanguageId(), textModel.uri, textModel.isForSimpleWidget); diff --git a/src/vs/workbench/common/editor/textEditorModel.ts b/src/vs/workbench/common/editor/textEditorModel.ts index c182aa14e4a..591723e24e8 100644 --- a/src/vs/workbench/common/editor/textEditorModel.ts +++ b/src/vs/workbench/common/editor/textEditorModel.ts @@ -95,7 +95,7 @@ export class BaseTextEditorModel extends EditorModel implements ITextEditorModel return; } - this.modelService.setMode(this.textEditorModel, this.languageService.createById(languageId), source); + this.textEditorModel.setLanguage(this.languageService.createById(languageId), source); } protected installModelListeners(model: ITextModel): void { @@ -211,7 +211,7 @@ export class BaseTextEditorModel extends EditorModel implements ITextEditorModel // language (only if specific and changed) if (preferredLanguageId && preferredLanguageId !== PLAINTEXT_LANGUAGE_ID && this.textEditorModel.getLanguageId() !== preferredLanguageId) { - this.modelService.setMode(this.textEditorModel, this.languageService.createById(preferredLanguageId)); + this.textEditorModel.setLanguage(this.languageService.createById(preferredLanguageId)); } } diff --git a/src/vs/workbench/contrib/debug/browser/breakpointWidget.ts b/src/vs/workbench/contrib/debug/browser/breakpointWidget.ts index 38683d90103..a072436bb28 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointWidget.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointWidget.ts @@ -169,7 +169,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi if (this.editor.hasModel()) { // Use plaintext language for log messages, otherwise respect underlying editor language #125619 const languageId = this.context === Context.LOG_MESSAGE ? PLAINTEXT_LANGUAGE_ID : this.editor.getModel().getLanguageId(); - this.input.getModel().setMode(languageId); + this.input.getModel().setLanguage(languageId); } } @@ -229,7 +229,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi CONTEXT_IN_BREAKPOINT_WIDGET.bindTo(scopedContextKeyService).set(true); const model = this.modelService.createModel('', null, uri.parse(`${DEBUG_SCHEME}:${this.editor.getId()}:breakpointinput`), true); if (this.editor.hasModel()) { - model.setMode(this.editor.getModel().getLanguageId()); + model.setLanguage(this.editor.getModel().getLanguageId()); } this.input.setModel(model); this.setInputMode(); diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index 1773c546174..4195e2e3fba 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -342,7 +342,7 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget { this.modelChangeListener.dispose(); this.modelChangeListener = activeEditorControl.onDidChangeModelLanguage(() => this.setMode()); if (this.model && activeEditorControl.hasModel()) { - this.model.setMode(activeEditorControl.getModel().getLanguageId()); + this.model.setLanguage(activeEditorControl.getModel().getLanguageId()); } } } diff --git a/src/vs/workbench/contrib/emmet/test/browser/emmetAction.test.ts b/src/vs/workbench/contrib/emmet/test/browser/emmetAction.test.ts index 41dc18cf8f2..da5770a1d73 100644 --- a/src/vs/workbench/contrib/emmet/test/browser/emmetAction.test.ts +++ b/src/vs/workbench/contrib/emmet/test/browser/emmetAction.test.ts @@ -39,7 +39,7 @@ suite('Emmet', () => { assert.fail('Editor model not found'); } - model.setMode(mode); + model.setLanguage(mode); const langOutput = EmmetEditorAction.getLanguage(editor, new MockGrammarContributions(scopeName)); if (!langOutput) { assert.fail('langOutput not found'); diff --git a/src/vs/workbench/contrib/interactive/browser/interactiveEditor.ts b/src/vs/workbench/contrib/interactive/browser/interactiveEditor.ts index 86dda88474b..e413531c102 100644 --- a/src/vs/workbench/contrib/interactive/browser/interactiveEditor.ts +++ b/src/vs/workbench/contrib/interactive/browser/interactiveEditor.ts @@ -554,7 +554,7 @@ export class InteractiveEditor extends EditorPane { if (selectedOrSuggested) { const language = selectedOrSuggested.supportedLanguages[0]; const newMode = language ? this.#languageService.createById(language).languageId : PLAINTEXT_LANGUAGE_ID; - textModel.setMode(newMode); + textModel.setLanguage(newMode); NOTEBOOK_KERNEL.bindTo(this.#contextKeyService).set(selectedOrSuggested.id); } diff --git a/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts b/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts index 363f76cb570..9211cf9643f 100644 --- a/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts +++ b/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts @@ -139,7 +139,7 @@ registerAction2(class extends Action2 { if (editorUri) { const lang = await languageDetectionService.detectLanguage(editorUri); if (lang) { - editor.getModel()?.setMode(lang, LanguageDetectionLanguageEventSource); + editor.getModel()?.setLanguage(lang, LanguageDetectionLanguageEventSource); } else { notificationService.warn(localize('noDetection', "Unable to detect editor language")); } diff --git a/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts b/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts index 9de532d436b..1e5a2b2f686 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts @@ -10,7 +10,6 @@ import { URI } from 'vs/base/common/uri'; import { Range } from 'vs/editor/common/core/range'; import { ILanguageService } from 'vs/editor/common/languages/language'; import { ITextModel } from 'vs/editor/common/model'; -import { IModelService } from 'vs/editor/common/services/model'; import { localize } from 'vs/nls'; import { IResourceUndoRedoElement, IUndoRedoService, UndoRedoElementType, UndoRedoGroup } from 'vs/platform/undoRedo/common/undoRedo'; import { EditorModel } from 'vs/workbench/common/editor/editorModel'; @@ -59,7 +58,6 @@ export class MergeEditorModel extends EditorModel { private readonly diffComputer: IMergeDiffComputer, private readonly options: { resetResult: boolean }, public readonly telemetry: MergeEditorTelemetry, - @IModelService private readonly modelService: IModelService, @ILanguageService private readonly languageService: ILanguageService, @IUndoRedoService private readonly undoRedoService: IUndoRedoService, ) { @@ -558,10 +556,10 @@ export class MergeEditorModel extends EditorModel { public setLanguageId(languageId: string, source?: string): void { const language = this.languageService.createById(languageId); - this.modelService.setMode(this.base, language, source); - this.modelService.setMode(this.input1.textModel, language, source); - this.modelService.setMode(this.input2.textModel, language, source); - this.modelService.setMode(this.resultTextModel, language, source); + this.base.setLanguage(language, source); + this.input1.textModel.setLanguage(language, source); + this.input2.textModel.setLanguage(language, source); + this.resultTextModel.setLanguage(language, source); } public getInitialResultValue(): string { diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index a461f1e77dc..92ef90c24ad 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -506,7 +506,7 @@ class CellInfoContentProvider { } model.setValue(newResult.content); - model.setMode(newResult.mode.languageId); + model.setLanguage(newResult.mode.languageId); }); const once = model.onWillDispose(() => { diff --git a/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts b/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts index 02865d69aa7..c5d927de580 100644 --- a/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts +++ b/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts @@ -93,7 +93,7 @@ export class NotebookCellTextModel extends Disposable implements ICell { if (this._textModel) { const languageId = this._languageService.createById(newLanguageId); - this._textModel.setMode(languageId.languageId); + this._textModel.setLanguage(languageId.languageId); } if (this._language === newLanguage) { diff --git a/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts b/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts index 1f9d20449ef..377833d6122 100644 --- a/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts +++ b/src/vs/workbench/contrib/performance/browser/perfviewEditor.ts @@ -95,7 +95,7 @@ class PerfModelContentProvider implements ITextModelContentProvider { this._model = this._modelService.getModel(resource) || this._modelService.createModel('Loading...', langId, resource); this._modelDisposables.push(langId.onDidChange(e => { - this._model?.setMode(e); + this._model?.setLanguage(e); })); this._modelDisposables.push(this._extensionService.onDidChangeExtensionsStatus(this._updateModel, this)); diff --git a/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.ts b/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.ts index b96d2b093af..600ff83d1ed 100644 --- a/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.ts +++ b/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.ts @@ -7,7 +7,6 @@ import { groupBy, isFalsyOrEmpty } from 'vs/base/common/arrays'; import { compare } from 'vs/base/common/strings'; import { getCodeEditor } from 'vs/editor/browser/editorBrowser'; import { ILanguageService } from 'vs/editor/common/languages/language'; -import { IModelService } from 'vs/editor/common/services/model'; import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { localize } from 'vs/nls'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; @@ -37,7 +36,6 @@ export class ApplyFileSnippetAction extends SnippetsAction { const quickInputService = accessor.get(IQuickInputService); const editorService = accessor.get(IEditorService); const langService = accessor.get(ILanguageService); - const modelService = accessor.get(IModelService); const editor = getCodeEditor(editorService.activeTextEditorControl); if (!editor || !editor.hasModel()) { @@ -62,7 +60,7 @@ export class ApplyFileSnippetAction extends SnippetsAction { }]); // set language if possible - modelService.setMode(editor.getModel(), langService.createById(selection.langId), ApplyFileSnippetAction.Id); + editor.getModel().setLanguage(langService.createById(selection.langId), ApplyFileSnippetAction.Id); editor.focus(); } diff --git a/src/vs/workbench/services/textfile/browser/textFileService.ts b/src/vs/workbench/services/textfile/browser/textFileService.ts index a78fc891cf9..6920a263671 100644 --- a/src/vs/workbench/services/textfile/browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/browser/textFileService.ts @@ -531,7 +531,7 @@ export abstract class AbstractTextFileService extends Disposable implements ITex const sourceLanguageId = sourceTextModel.getLanguageId(); const targetLanguageId = targetTextModel.getLanguageId(); if (sourceLanguageId !== PLAINTEXT_LANGUAGE_ID && targetLanguageId === PLAINTEXT_LANGUAGE_ID) { - targetTextModel.setMode(sourceLanguageId); // only use if more specific than plain/text + targetTextModel.setLanguage(sourceLanguageId); // only use if more specific than plain/text } // transient properties diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 14d31691b99..ca47e361dbd 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -196,7 +196,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil const firstLineText = this.getFirstLineText(this.textEditorModel); const languageSelection = this.getOrCreateLanguage(this.resource, this.languageService, this.preferredLanguageId, firstLineText); - this.modelService.setMode(this.textEditorModel, languageSelection); + this.textEditorModel.setLanguage(languageSelection); } override setLanguageId(languageId: string, source?: string): void { diff --git a/src/vs/workbench/services/untitled/test/browser/untitledTextEditor.test.ts b/src/vs/workbench/services/untitled/test/browser/untitledTextEditor.test.ts index 9aacd0a6493..7c6b704a56f 100644 --- a/src/vs/workbench/services/untitled/test/browser/untitledTextEditor.test.ts +++ b/src/vs/workbench/services/untitled/test/browser/untitledTextEditor.test.ts @@ -351,7 +351,7 @@ suite('Untitled text editors', () => { await input.resolve(); assert.ok(!input.model.hasLanguageSetExplicitly); - accessor.modelService.setMode(model.textEditorModel!, accessor.languageService.createById(language)); + model.textEditorModel!.setLanguage(accessor.languageService.createById(language)); assert.ok(input.model.hasLanguageSetExplicitly); assert.strictEqual(model.getLanguageId(), language); @@ -373,8 +373,7 @@ suite('Untitled text editors', () => { await input.resolve(); assert.ok(!input.model.hasLanguageSetExplicitly); - accessor.modelService.setMode( - model.textEditorModel!, + model.textEditorModel!.setLanguage( accessor.languageService.createById(language), // This is really what this is testing LanguageDetectionLanguageEventSource); From 2f1866345505804f333531068b515fc85069ed8b Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 24 Feb 2023 17:14:04 +0100 Subject: [PATCH 095/206] fix sizing in extensions runtime editor (#175347) fixes https://github.com/microsoft/vscode/issues/173213 also update milestone of my-work notebook --- .vscode/notebooks/my-work.github-issues | 2 +- .../extensions/browser/abstractRuntimeExtensionsEditor.ts | 2 +- .../extensions/browser/media/runtimeExtensionsEditor.css | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.vscode/notebooks/my-work.github-issues b/.vscode/notebooks/my-work.github-issues index 44b690292ea..2d824f742b2 100644 --- a/.vscode/notebooks/my-work.github-issues +++ b/.vscode/notebooks/my-work.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "// list of repos we work in\r\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-markdown-languageservice\r\n\r\n// current milestone name\r\n$milestone=milestone:\"February 2023\"" + "value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-markdown-languageservice\n\n// current milestone name\n$milestone=milestone:\"March 2023\"" }, { "kind": 1, diff --git a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts index f9b251a5ee1..e85b0e052ae 100644 --- a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts @@ -198,7 +198,7 @@ export abstract class AbstractRuntimeExtensionsEditor extends EditorPane { const delegate = new class implements IListVirtualDelegate{ getHeight(element: IRuntimeExtension): number { - return 62; + return 70; } getTemplateId(element: IRuntimeExtension): string { return TEMPLATE_ID; diff --git a/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css b/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css index 91477a713e0..e1c4ea5afd2 100644 --- a/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css +++ b/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css @@ -37,6 +37,10 @@ opacity: .8; } +.runtime-extensions-editor .monaco-action-bar { + height: unset; +} + .runtime-extensions-editor .monaco-action-bar .actions-container { justify-content: left; } From 6a2e3f7e8bc065e005e4a732a301e448e4cfc9a3 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 24 Feb 2023 17:18:26 +0100 Subject: [PATCH 096/206] (maybe) fix https://github.com/microsoft/vscode/issues/174025 --- src/vs/editor/contrib/suggest/browser/suggest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/suggest/browser/suggest.ts b/src/vs/editor/contrib/suggest/browser/suggest.ts index 71f723262cd..3409fa42392 100644 --- a/src/vs/editor/contrib/suggest/browser/suggest.ts +++ b/src/vs/editor/contrib/suggest/browser/suggest.ts @@ -84,7 +84,7 @@ export class CompletionItem { ) { this.textLabel = typeof completion.label === 'string' ? completion.label - : completion.label.label; + : completion.label?.label; // ensure lower-variants (perf) this.labelLow = this.textLabel.toLowerCase(); From 18b96f483c9ca548a5c1a0295671288c5441a91b Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 24 Feb 2023 17:18:37 +0100 Subject: [PATCH 097/206] Fixes #173997 (#175349) --- extensions/typescript-basics/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/typescript-basics/package.json b/extensions/typescript-basics/package.json index 8d40da15084..07631abc414 100644 --- a/extensions/typescript-basics/package.json +++ b/extensions/typescript-basics/package.json @@ -70,7 +70,8 @@ "storage.type.function.arrow", "keyword.operator.bitwise.shift", "meta.brace.angle", - "punctuation.definition.tag" + "punctuation.definition.tag", + "keyword.operator.assignment.compound.bitwise.ts" ], "tokenTypes": { "meta.template.expression": "other", From cf4acb805047ff9a47e83cf5237b74853dcce6ea Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 24 Feb 2023 17:22:41 +0100 Subject: [PATCH 098/206] Update grammars (#175350) --- extensions/cpp/cgmanifest.json | 4 +- .../cpp.embedded.macro.tmLanguage.json | 528 ++++++------- extensions/cpp/syntaxes/cpp.tmLanguage.json | 726 ++++++++---------- extensions/dart/cgmanifest.json | 2 +- extensions/dart/syntaxes/dart.tmLanguage.json | 8 +- extensions/git-base/cgmanifest.json | 2 +- .../syntaxes/JavaScript.tmLanguage.json | 35 +- .../syntaxes/JavaScriptReact.tmLanguage.json | 35 +- extensions/latex/cgmanifest.json | 4 +- .../latex/syntaxes/LaTeX.tmLanguage.json | 18 +- extensions/latex/syntaxes/TeX.tmLanguage.json | 6 +- extensions/markdown-basics/cgmanifest.json | 2 +- .../syntaxes/markdown.tmLanguage.json | 38 +- extensions/typescript-basics/cgmanifest.json | 2 +- .../syntaxes/TypeScript.tmLanguage.json | 35 +- .../syntaxes/TypeScriptReact.tmLanguage.json | 35 +- .../colorize-results/test-strings_ts.json | 6 +- .../test/colorize-results/test_html.json | 50 +- 18 files changed, 744 insertions(+), 792 deletions(-) diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index 1e88d9a4261..2a52ca43b94 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "jeff-hykin/better-cpp-syntax", "repositoryUrl": "https://github.com/jeff-hykin/better-cpp-syntax", - "commitHash": "e3f51cca7683d2b2b086f889bff586bf9d85eb1f" + "commitHash": "7aef15d9203f0dfeaf075f0673ab3ab382dfb0b1" } }, "license": "MIT", - "version": "1.17.3", + "version": "1.17.4", "description": "The original JSON grammars were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." }, { diff --git a/extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json b/extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json index f8b5550ea46..f5391a200a8 100644 --- a/extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json +++ b/extensions/cpp/syntaxes/cpp.embedded.macro.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/better-cpp-syntax/commit/634bb689da96fb6515b1a688ad3dffede5aa234d", + "version": "https://github.com/jeff-hykin/better-cpp-syntax/commit/7aef15d9203f0dfeaf075f0673ab3ab382dfb0b1", "name": "C++", "scopeName": "source.cpp.embedded.macro", "patterns": [ @@ -130,7 +130,7 @@ ] }, { - "match": "(using)(?:\\s)+((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(\\()", + "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(\\()", "end": "\\)|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(((?>(?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=\\())", + "begin": "\\s*+((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(((?>(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(\\()", + "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(\\()", "end": "\\)|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(\\{)", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(\\{)", "end": "\\}|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(((?>(?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=\\())", + "begin": "((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(((?>(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::))?(?:(?:\\s)+)?((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::))?(?:\\s+)?((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:\\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}))*)\\b(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(\\()", + "begin": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\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*+)?(\\()", "end": "\\)|(?=(?|\\*\\/))\\s*+(?:((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\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*+(?:((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\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*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", + "match": "(?<=^|\\))(?:\\s+)?(->)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", "captures": { "1": { "name": "punctuation.definition.function.return-type.cpp" @@ -3721,8 +3657,8 @@ ] }, "function_pointer": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(\\()", - "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", + "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(\\()", - "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", + "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", + "match": "(?<=protected|virtual|private|public|,|:)(?:\\s+)?(?!(?:(?:(?:protected)|(?:private)|(?:public))|virtual))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", "captures": { "1": { "name": "meta.qualified_type.cpp", @@ -4531,7 +4467,7 @@ ] }, "lambdas": { - "begin": "(?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))(?:(?:\\s)+)?(\\[(?!\\[| *+\"| *+\\d))((?:[^\\[\\]]|((??)++\\]))*+)(\\](?!((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))[\\[\\];]))", + "begin": "(?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))(?:\\s+)?(\\[(?!\\[| *+\"| *+\\d))((?:[^\\[\\]]|((??)++\\]))*+)(\\](?!((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))[\\[\\];=]))", "end": "(?<=[;}])|(?=(?\\*|->)))((?:(?:[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)+)?(\\()", + "begin": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", "end": "\\)|(?=(?|->\\*))(?:(?:\\s)+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?\\*|->)))", + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:\\s+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -4871,7 +4807,7 @@ } }, { - "match": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?\\*|->)))", + "match": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -4962,7 +4898,7 @@ ] }, { - "match": "(using)(?:\\s)+((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)(?:\\s+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(operator)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=))|((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(operator)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|\\+|\\-|!|~|\\*|&|\\*|\\/|%|\\+|\\-|<|>|&|\\^|\\||=))|((?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?|(?=(?|(?=(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(\\()", - "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", + "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?=[{=,);>]|\\n)(?!\\()|(?=(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)?((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.class.cpp" @@ -634,7 +634,7 @@ "11": { "patterns": [ { - "match": "((?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -1395,41 +1395,25 @@ "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "10": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "11": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "12": { - "name": "comment.block.cpp" - }, - "13": { - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - "14": { "name": "storage.type.modifier.calling-convention.cpp" }, - "15": { + "11": { "patterns": [ { "include": "#inline_comment" } ] }, - "16": { + "12": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "17": { + "13": { "name": "comment.block.cpp" }, - "18": { + "14": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, - "19": { + "15": { "name": "entity.name.function.constructor.cpp entity.name.function.definition.special.constructor.cpp" } }, @@ -1451,7 +1435,7 @@ "include": "#ever_present_context" }, { - "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(default)|(delete))", "captures": { "1": { "name": "keyword.operator.assignment.cpp" @@ -1494,7 +1478,7 @@ "endCaptures": {}, "patterns": [ { - "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(\\()", + "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(\\()", "end": "\\)", "beginCaptures": { "1": { @@ -1628,48 +1612,32 @@ ] }, "constructor_root": { - "begin": "\\s*+((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(((?>(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(((?>(?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.function.definition.special.constructor.cpp" }, "1": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "2": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "3": { - "name": "comment.block.cpp" - }, - "4": { - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - "5": { "name": "storage.type.modifier.calling-convention.cpp" }, - "6": { + "2": { "patterns": [ { "include": "#inline_comment" } ] }, - "7": { + "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "8": { + "4": { "name": "comment.block.cpp" }, - "9": { + "5": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, - "10": { + "6": { "patterns": [ { "match": "::", @@ -1684,15 +1652,15 @@ } ] }, - "11": { + "7": { "patterns": [ { "include": "#template_call_range" } ] }, - "12": {}, - "13": { + "8": {}, + "9": { "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}))*(?=:)", @@ -1708,7 +1676,23 @@ } ] }, - "14": {}, + "10": {}, + "11": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "12": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "13": { + "name": "comment.block.cpp" + }, + "14": { + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, "15": { "patterns": [ { @@ -1740,22 +1724,6 @@ }, "22": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - "23": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "24": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "25": { - "name": "comment.block.cpp" - }, - "26": { - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" } }, "endCaptures": {}, @@ -1776,7 +1744,7 @@ "include": "#ever_present_context" }, { - "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(default)|(delete))", "captures": { "1": { "name": "keyword.operator.assignment.cpp" @@ -1819,7 +1787,7 @@ "endCaptures": {}, "patterns": [ { - "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(\\()", + "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(\\()", "end": "\\)", "beginCaptures": { "1": { @@ -1953,7 +1921,7 @@ ] }, "control_flow_keywords": { - "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(\\{)", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(\\{)", "end": "\\}", "beginCaptures": { "1": { @@ -2226,7 +2194,7 @@ ] }, "d9bc4796b0b_module_import": { - "match": "^((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((import))(?:(?:\\s)+)?(?:(?:(?:((<)[^>]*(>?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/)))|((\\\")[^\\\"]*((?:\\\")?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/))))|(((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;)))))|((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;))))(?:(?:\\s)+)?(;?)", + "match": "^((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((import))(?:\\s+)?(?:(?:(?:((<)[^>]*(>?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=\\/\\/)))|((\\\")[^\\\"]*(\\\"?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=\\/\\/))))|(((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=(?:\\/\\/|;)))))|((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=(?:\\/\\/|;))))(?:\\s+)?(;?)", "captures": { "1": { "patterns": [ @@ -2420,7 +2388,7 @@ "endCaptures": {}, "patterns": [ { - "match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?(?:(?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -2801,64 +2769,48 @@ "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "5": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "6": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "7": { - "name": "comment.block.cpp" - }, - "8": { - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - "9": { "name": "storage.type.modifier.calling-convention.cpp" }, - "10": { + "6": { "patterns": [ { "include": "#inline_comment" } ] }, - "11": { + "7": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "12": { + "8": { "name": "comment.block.cpp" }, - "13": { + "9": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, - "14": { + "10": { "patterns": [ { "include": "#functional_specifiers_pre_parameters" } ] }, - "15": { + "11": { "patterns": [ { "include": "#inline_comment" } ] }, - "16": { + "12": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "17": { + "13": { "name": "comment.block.cpp" }, - "18": { + "14": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, - "19": { + "15": { "name": "entity.name.function.destructor.cpp entity.name.function.definition.special.member.destructor.cpp" } }, @@ -2880,7 +2832,7 @@ "include": "#ever_present_context" }, { - "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(default)|(delete))", "captures": { "1": { "name": "keyword.operator.assignment.cpp" @@ -2964,7 +2916,7 @@ ] }, "destructor_root": { - "begin": "((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(((?>(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(((?>(?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -3112,7 +3064,7 @@ "include": "#ever_present_context" }, { - "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(default)|(delete))", "captures": { "1": { "name": "keyword.operator.assignment.cpp" @@ -3196,7 +3148,7 @@ ] }, "diagnostic": { - "begin": "(^((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?((?:error|warning)))\\b(?:(?:\\s)+)?", + "begin": "(^((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(#)(?:\\s+)?((?:error|warning)))\\b(?:\\s+)?", "end": "(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::))?(?:(?:\\s)+)?((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::))?(?:\\s+)?((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.enum.cpp" @@ -3463,7 +3415,7 @@ ] }, "enum_declare": { - "match": "((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(extern)(?=\\s*\\\")", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.extern.cpp" @@ -3992,7 +3944,7 @@ ] }, "function_call": { - "begin": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\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)*+)?(\\()", + "begin": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\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*+)?(\\()", "end": "\\)", "beginCaptures": { "1": { @@ -4066,7 +4018,7 @@ ] }, "function_definition": { - "begin": "(?:(?:^|\\G|(?<=;|\\}))|(?<=>|\\*\\/))\\s*+(?:((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\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*+(?:((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\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(?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -4104,7 +4056,7 @@ "7": { "patterns": [ { - "match": "((?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", + "match": "(?<=^|\\))(?:\\s+)?(->)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", "captures": { "1": { "name": "punctuation.definition.function.return-type.cpp" @@ -4696,8 +4632,8 @@ ] }, "function_pointer": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(\\()", - "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", + "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { "name": "meta.qualified_type.cpp", @@ -4843,7 +4779,7 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))){2,}\\&", + "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))){2,}\\&", "captures": { "1": { "patterns": [ @@ -4975,8 +4911,8 @@ ] }, "function_pointer_parameter": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(\\()", - "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", + "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { "name": "meta.qualified_type.cpp", @@ -5122,7 +5058,7 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))){2,}\\&", + "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))){2,}\\&", "captures": { "1": { "patterns": [ @@ -5290,7 +5226,7 @@ ] }, { - "match": "(using)(?:\\s)+((?]*(>?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/)))|((\\\")[^\\\"]*((?:\\\")?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=\\/\\/))))|(((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;)))))|((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:\\n)|$)|(?=(?:\\/\\/|;))))", + "match": "^((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((#)(?:\\s+)?((?:include|include_next))\\b)(?:\\s+)?(?:(?:(?:((<)[^>]*(>?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=\\/\\/)))|((\\\")[^\\\"]*(\\\"?)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=\\/\\/))))|(((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=(?:\\/\\/|;)))))|((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:\\n|$)|(?=(?:\\/\\/|;))))", "captures": { "1": { "patterns": [ @@ -5586,7 +5522,7 @@ "name": "storage.type.modifier.virtual.cpp" }, { - "match": "(?<=protected|virtual|private|public|,|:)(?:(?:\\s)+)?(?!(?:(?:(?:protected)|(?:private)|(?:public))|virtual))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", + "match": "(?<=protected|virtual|private|public|,|:)(?:\\s+)?(?!(?:(?:(?:protected)|(?:private)|(?:public))|virtual))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", "captures": { "1": { "name": "meta.qualified_type.cpp", @@ -5757,7 +5693,7 @@ ] }, "inline_builtin_storage_type": { - "match": "(?:\\s)*+(?])|(?<=\\Wreturn|^return))(?:(?:\\s)+)?(\\[(?!\\[| *+\"| *+\\d))((?:[^\\[\\]]|((??)++\\]))*+)(\\](?!((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))[\\[\\];]))", + "begin": "(?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))(?:\\s+)?(\\[(?!\\[| *+\"| *+\\d))((?:[^\\[\\]]|((??)++\\]))*+)(\\](?!((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))[\\[\\];=]))", "end": "(?<=[;}])", "beginCaptures": { "1": { @@ -5866,7 +5802,7 @@ "include": "#the_this_keyword" }, { - "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}))*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?=\\]|\\z|$)|(,))|(\\=))", + "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}))*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?=\\]|\\z|$)|(,))|(\\=))", "captures": { "1": { "name": "variable.parameter.capture.cpp" @@ -5993,7 +5929,7 @@ "name": "constant.language.$0.cpp" }, "line": { - "begin": "^((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?line\\b", + "begin": "^((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(#)(?:\\s+)?line\\b", "end": "(?\\*|->)))((?:(?:[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(?!uint_least32_t[^\\w]|uint_least16_t[^\\w]|uint_least64_t[^\\w]|int_least32_t[^\\w]|int_least64_t[^\\w]|uint_fast32_t[^\\w]|uint_fast64_t[^\\w]|uint_least8_t[^\\w]|uint_fast16_t[^\\w]|int_least16_t[^\\w]|int_fast16_t[^\\w]|int_least8_t[^\\w]|uint_fast8_t[^\\w]|int_fast64_t[^\\w]|int_fast32_t[^\\w]|int_fast8_t[^\\w]|suseconds_t[^\\w]|useconds_t[^\\w]|in_addr_t[^\\w]|uintmax_t[^\\w]|uintmax_t[^\\w]|uintmax_t[^\\w]|in_port_t[^\\w]|uintptr_t[^\\w]|blksize_t[^\\w]|uint32_t[^\\w]|uint64_t[^\\w]|u_quad_t[^\\w]|intmax_t[^\\w]|intmax_t[^\\w]|unsigned[^\\w]|blkcnt_t[^\\w]|uint16_t[^\\w]|intptr_t[^\\w]|swblk_t[^\\w]|wchar_t[^\\w]|u_short[^\\w]|qaddr_t[^\\w]|caddr_t[^\\w]|daddr_t[^\\w]|fixpt_t[^\\w]|nlink_t[^\\w]|segsz_t[^\\w]|clock_t[^\\w]|ssize_t[^\\w]|int16_t[^\\w]|int32_t[^\\w]|int64_t[^\\w]|uint8_t[^\\w]|int8_t[^\\w]|mode_t[^\\w]|quad_t[^\\w]|ushort[^\\w]|u_long[^\\w]|u_char[^\\w]|double[^\\w]|signed[^\\w]|time_t[^\\w]|size_t[^\\w]|key_t[^\\w]|div_t[^\\w]|ino_t[^\\w]|uid_t[^\\w]|gid_t[^\\w]|off_t[^\\w]|pid_t[^\\w]|float[^\\w]|dev_t[^\\w]|u_int[^\\w]|short[^\\w]|bool[^\\w]|id_t[^\\w]|uint[^\\w]|long[^\\w]|char[^\\w]|void[^\\w]|auto[^\\w]|id_t[^\\w]|int[^\\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": "(?:((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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(?!uint_least32_t[^\\w]|uint_least16_t[^\\w]|uint_least64_t[^\\w]|int_least32_t[^\\w]|int_least64_t[^\\w]|uint_fast32_t[^\\w]|uint_fast64_t[^\\w]|uint_least8_t[^\\w]|uint_fast16_t[^\\w]|int_least16_t[^\\w]|int_fast16_t[^\\w]|int_least8_t[^\\w]|uint_fast8_t[^\\w]|int_fast64_t[^\\w]|int_fast32_t[^\\w]|int_fast8_t[^\\w]|suseconds_t[^\\w]|useconds_t[^\\w]|in_addr_t[^\\w]|uintmax_t[^\\w]|uintmax_t[^\\w]|uintmax_t[^\\w]|in_port_t[^\\w]|uintptr_t[^\\w]|blksize_t[^\\w]|uint32_t[^\\w]|uint64_t[^\\w]|u_quad_t[^\\w]|intmax_t[^\\w]|intmax_t[^\\w]|unsigned[^\\w]|blkcnt_t[^\\w]|uint16_t[^\\w]|intptr_t[^\\w]|swblk_t[^\\w]|wchar_t[^\\w]|u_short[^\\w]|qaddr_t[^\\w]|caddr_t[^\\w]|daddr_t[^\\w]|fixpt_t[^\\w]|nlink_t[^\\w]|segsz_t[^\\w]|clock_t[^\\w]|ssize_t[^\\w]|int16_t[^\\w]|int32_t[^\\w]|int64_t[^\\w]|uint8_t[^\\w]|int8_t[^\\w]|mode_t[^\\w]|quad_t[^\\w]|ushort[^\\w]|u_long[^\\w]|u_char[^\\w]|double[^\\w]|signed[^\\w]|time_t[^\\w]|size_t[^\\w]|key_t[^\\w]|div_t[^\\w]|ino_t[^\\w]|uid_t[^\\w]|gid_t[^\\w]|off_t[^\\w]|pid_t[^\\w]|float[^\\w]|dev_t[^\\w]|u_int[^\\w]|short[^\\w]|bool[^\\w]|id_t[^\\w]|uint[^\\w]|long[^\\w]|char[^\\w]|void[^\\w]|auto[^\\w]|id_t[^\\w]|int[^\\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(?!\\())", "captures": { "1": { "patterns": [ @@ -6184,7 +6120,7 @@ "7": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:(?:\\s)+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?\\*|->)))", + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:\\s+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6217,7 +6153,7 @@ } }, { - "match": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?\\*|->)))", + "match": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6263,7 +6199,7 @@ } }, "memory_operators": { - "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:(?:(delete)(?:(?:\\s)+)?(\\[\\])|(delete))|(new))(?!\\w))", + "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:(?:(delete)(?:\\s+)?(\\[\\])|(delete))|(new))(?!\\w))", "captures": { "1": { "patterns": [ @@ -6308,7 +6244,7 @@ } }, "method_access": { - "begin": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(\\()", + "begin": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", "end": "\\)", "beginCaptures": { "1": { @@ -6342,7 +6278,7 @@ "9": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:(?:\\s)+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?\\*|->)))", + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))(?:\\s+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6375,7 +6311,7 @@ } }, { - "match": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?\\*|->)))", + "match": "(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?\\*|->)))", "captures": { "1": { "patterns": [ @@ -6434,7 +6370,7 @@ ] }, "misc_keywords": { - "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)(?:\\s+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)(?:\\s+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(operator)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=))|((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(operator)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|\\+|\\-|!|~|\\*|&|\\*|\\/|%|\\+|\\-|<|>|&|\\^|\\||=))|((?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.function.definition.special.operator-overload.cpp" }, "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "3": { + "name": "comment.block.cpp" + }, + "4": { + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + "5": { "name": "meta.qualified_type.cpp", "patterns": [ { @@ -7040,7 +6992,7 @@ } ] }, - "2": { + "6": { "patterns": [ { "include": "#attributes_context" @@ -7050,22 +7002,6 @@ } ] }, - "3": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "4": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "5": { - "name": "comment.block.cpp" - }, - "6": { - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, "7": { "patterns": [ { @@ -7083,6 +7019,22 @@ "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "11": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "12": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "13": { + "name": "comment.block.cpp" + }, + "14": { + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + "15": { "patterns": [ { "match": "::", @@ -7097,39 +7049,39 @@ } ] }, - "12": { + "16": { "patterns": [ { "include": "#template_call_range" } ] }, - "13": {}, - "14": { + "17": {}, + "18": { "patterns": [ { "include": "#inline_comment" } ] }, - "15": { + "19": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "16": { + "20": { "name": "comment.block.cpp" }, - "17": { + "21": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, - "18": {}, - "19": { + "22": {}, + "23": { "patterns": [ { "match": "\\*", "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))){2,}\\&", + "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))){2,}\\&", "captures": { "1": { "patterns": [ @@ -7156,22 +7108,6 @@ } ] }, - "20": { - "patterns": [ - { - "include": "#inline_comment" - } - ] - }, - "21": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" - }, - "22": { - "name": "comment.block.cpp" - }, - "23": { - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, "24": { "patterns": [ { @@ -7333,7 +7269,7 @@ "name": "entity.name.operator.type.pointer.cpp" }, { - "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))){2,}\\&", + "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))){2,}\\&", "captures": { "1": { "patterns": [ @@ -7497,7 +7433,7 @@ "include": "#qualifiers_and_specifiers_post_parameters" }, { - "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "match": "(\\=)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(default)|(delete))", "captures": { "1": { "name": "keyword.operator.assignment.cpp" @@ -7564,7 +7500,7 @@ "operators": { "patterns": [ { - "begin": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.])", + "match": "\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.])", "captures": { "0": { "patterns": [ @@ -10897,12 +10833,12 @@ "name": "meta.qualified_type.cpp" }, "qualifiers_and_specifiers_post_parameters": { - "match": "((?:(?:(?:(?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -10952,7 +10888,7 @@ } }, "scope_resolution_function_call": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -10974,7 +10910,7 @@ } }, "scope_resolution_function_call_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11021,7 +10957,7 @@ } }, "scope_resolution_function_definition": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11043,7 +10979,7 @@ } }, "scope_resolution_function_definition_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11090,7 +11026,7 @@ } }, "scope_resolution_function_definition_operator_overload": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11112,7 +11048,7 @@ } }, "scope_resolution_function_definition_operator_overload_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11159,7 +11095,7 @@ } }, "scope_resolution_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11206,7 +11142,7 @@ } }, "scope_resolution_namespace_alias": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11228,7 +11164,7 @@ } }, "scope_resolution_namespace_alias_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11275,7 +11211,7 @@ } }, "scope_resolution_namespace_block": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11297,7 +11233,7 @@ } }, "scope_resolution_namespace_block_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11344,7 +11280,7 @@ } }, "scope_resolution_namespace_using": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11366,7 +11302,7 @@ } }, "scope_resolution_namespace_using_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11413,7 +11349,7 @@ } }, "scope_resolution_parameter": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11435,7 +11371,7 @@ } }, "scope_resolution_parameter_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11482,7 +11418,7 @@ } }, "scope_resolution_template_call": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11504,7 +11440,7 @@ } }, "scope_resolution_template_call_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11551,7 +11487,7 @@ } }, "scope_resolution_template_definition": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+", + "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -11573,7 +11509,7 @@ } }, "scope_resolution_template_definition_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?(::)", + "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?(::)", "captures": { "1": { "patterns": [ @@ -11624,7 +11560,7 @@ "name": "punctuation.terminator.statement.cpp" }, "simple_type": { - "match": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?", + "match": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?", "captures": { "1": { "name": "meta.qualified_type.cpp", @@ -11797,7 +11733,7 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))){2,}\\&", + "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))){2,}\\&", "captures": { "1": { "patterns": [ @@ -11877,7 +11813,7 @@ } }, "single_line_macro": { - "match": "^((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))#define.*(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.struct.cpp" @@ -13131,7 +13067,7 @@ "11": { "patterns": [ { - "match": "((?|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -13612,7 +13548,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}|\\\\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+)?(\\=)", "captures": { "1": { "name": "storage.type.template.argument.$1.cpp" @@ -13660,7 +13596,7 @@ ] }, "template_call_innards": { - "match": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+", + "match": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+", "captures": { "0": { "patterns": [ @@ -13702,7 +13638,7 @@ ] }, "template_definition": { - "begin": "(?", "beginCaptures": { "1": { @@ -13720,7 +13656,7 @@ "name": "meta.template.definition.cpp", "patterns": [ { - "begin": "(?<=\\w)(?:(?:\\s)+)?<", + "begin": "(?<=\\w)(?:\\s+)?<", "end": ">", "beginCaptures": { "0": { @@ -13744,7 +13680,7 @@ ] }, "template_definition_argument": { - "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(class|typename)(?:(?:\\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)+)?(?:(\\=)(?:(?:\\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}))*)?(?:(,)|(?=>|$))", + "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(class|typename)(?:\\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+)?(?:(\\=)(?:\\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}))*)?(?:(,)|(?=>|$))", "captures": { "1": { "patterns": [ @@ -13843,7 +13779,7 @@ ] }, "template_explicit_instantiation": { - "match": "(?)(?:(?:\\s)+)?$", + "match": "(?)(?:\\s+)?$", "captures": { "1": { "name": "storage.type.template.cpp" @@ -13972,7 +13908,7 @@ "applyEndPatternLast": 1 }, "the_this_keyword": { - "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))|(.*(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))|(.*(?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.class.cpp" @@ -14450,7 +14386,7 @@ "11": { "patterns": [ { - "match": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\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)+)?(\\()", - "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|atomic_commit|atomic_cancel|__has_include|thread_local|dynamic_cast|synchronized|static_cast|const_cast|consteval|co_return|protected|constinit|constexpr|co_return|consteval|namespace|constexpr|constexpr|co_await|explicit|volatile|noexcept|co_yield|noexcept|noexcept|requires|typename|decltype|operator|template|continue|co_await|co_yield|volatile|register|restrict|reflexpr|mutable|alignof|include|private|defined|typedef|_Pragma|__asm__|concept|mutable|warning|default|virtual|alignas|public|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|ifndef|define|pragma|export|import|module|catch|throw|const|or_eq|compl|while|ifdef|const|bitor|union|class|undef|error|break|using|endif|goto|line|enum|this|case|else|elif|else|not|try|for|asm|and|xor|new|do|if|or|if)\\b)(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))(((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))?(?:(?:&|\\*)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*(?:&|\\*))?((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\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+)?(\\()", + "end": "(\\))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { "name": "meta.qualified_type.cpp", @@ -14886,7 +14822,7 @@ "name": "storage.modifier.pointer.cpp" }, { - "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))){2,}\\&", + "match": "(?:\\&((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))){2,}\\&", "captures": { "1": { "patterns": [ @@ -15020,7 +14956,7 @@ ] }, "typedef_struct": { - "begin": "((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.struct.cpp" @@ -15084,7 +15020,7 @@ "11": { "patterns": [ { - "match": "((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.union.cpp" @@ -15427,7 +15363,7 @@ "11": { "patterns": [ { - "match": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z))))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", + "match": "(((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*+)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:atomic_commit)|(?:__has_include)|(?:atomic_cancel)|(?:synchronized)|(?:thread_local)|(?:dynamic_cast)|(?:static_cast)|(?:const_cast)|(?:constexpr)|(?:co_return)|(?:constinit)|(?:namespace)|(?:protected)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:co_return)|(?:consteval)|(?:co_await)|(?:continue)|(?:template)|(?:reflexpr)|(?:volatile)|(?:register)|(?:co_await)|(?:co_yield)|(?:restrict)|(?:noexcept)|(?:volatile)|(?:override)|(?:explicit)|(?:decltype)|(?:operator)|(?:noexcept)|(?:noexcept)|(?:typename)|(?:requires)|(?:co_yield)|(?:nullptr)|(?:alignof)|(?:alignas)|(?:default)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:define)|(?:module)|(?:sizeof)|(?:switch)|(?:delete)|(?:pragma)|(?:and_eq)|(?:inline)|(?:xor_eq)|(?:typeid)|(?:import)|(?:extern)|(?:public)|(?:bitand)|(?:static)|(?:export)|(?:return)|(?:friend)|(?:ifndef)|(?:not_eq)|(?:false)|(?:final)|(?:break)|(?:const)|(?:catch)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:audit)|(?:while)|(?:using)|(?:axiom)|(?:or_eq)|(?:compl)|(?:throw)|(?:bitor)|(?:const)|(?:line)|(?:case)|(?:else)|(?:this)|(?:true)|(?:goto)|(?:else)|(?:NULL)|(?:elif)|(?:new)|(?:asm)|(?:xor)|(?:and)|(?:try)|(?:not)|(?:for)|(?:do)|(?:if)|(?:or)|(?:if))\\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((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)?(?![\\w<:.]))", "captures": { "1": { "name": "storage.modifier.cpp" @@ -15967,7 +15903,7 @@ } }, "undef": { - "match": "(^((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))(#)(?:(?:\\s)+)?undef\\b)((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|(?:\\A)|(?:\\Z)))((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", + "begin": "((?|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { "name": "meta.head.union.cpp" @@ -16086,7 +16022,7 @@ "11": { "patterns": [ { - "match": "((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)(?:\\s)*+)?::)*\\s*+)?((?|(?:(?:[^'\"<>\\/]|\\/[^*])++))*>)\\s*+)?::)*\\s*+)?((??]|,\\s*|\\s+extends\\s+)+>)?[!?]?(\\(|\\s+=>)", + "match": "([_$]*[a-z][a-zA-Z0-9_$]*)(<(?:[a-zA-Z0-9_$<>?]|,\\s*|\\s+extends\\s+)+>)?[!?]?\\(", "captures": { "1": { "name": "entity.name.function.dart" @@ -313,7 +313,7 @@ }, { "name": "keyword.control.dart", - "match": "(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?:&|{\\?]|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "end": "(?=[,);}\\]=>:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", "patterns": [ + { + "include": "#type-arguments" + }, { "include": "#expression" } @@ -3788,7 +3797,7 @@ "name": "keyword.operator.type.annotation.js" } }, - "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -3803,7 +3812,7 @@ "name": "keyword.operator.type.annotation.js" } }, - "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -4650,20 +4659,20 @@ "include": "#template-call" }, { - "name": "string.template.js", + "contentName": "string.template.js", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.js" }, "2": { - "name": "punctuation.definition.string.template.begin.js" + "name": "string.template.js punctuation.definition.string.template.begin.js" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.js" + "name": "string.template.js punctuation.definition.string.template.end.js" } }, "patterns": [ @@ -4680,7 +4689,6 @@ "template-call": { "patterns": [ { - "name": "string.template.js", "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", "end": "(?=`)", "patterns": [ @@ -4703,7 +4711,6 @@ ] }, { - "name": "string.template.js", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", "beginCaptures": { "1": { @@ -4759,20 +4766,20 @@ "include": "#template-call" }, { - "name": "string.template.js", + "contentName": "string.template.js", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.js" }, "2": { - "name": "punctuation.definition.string.template.begin.js" + "name": "string.template.js punctuation.definition.string.template.begin.js" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.js" + "name": "string.template.js punctuation.definition.string.template.end.js" } }, "patterns": [ diff --git a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json b/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json index 6c6e00215e6..299e33321a4 100644 --- a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScriptReact.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/TypeScript-TmLanguage/commit/8e4e371fe8dd57560b16a44474f8cf8ca981e715", + "version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d", "name": "JavaScript (with React support)", "scopeName": "source.js.jsx", "patterns": [ @@ -989,6 +989,9 @@ }, { "include": "#parameter-binding-element" + }, + { + "include": "#paren-expression" } ] }, @@ -1171,7 +1174,7 @@ "name": "keyword.operator.assignment.js.jsx" } }, - "end": "(?=[,);}\\]]|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?:&|{\\?]|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "end": "(?=[,);}\\]=>:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", "patterns": [ + { + "include": "#type-arguments" + }, { "include": "#expression" } @@ -3788,7 +3797,7 @@ "name": "keyword.operator.type.annotation.js.jsx" } }, - "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -3803,7 +3812,7 @@ "name": "keyword.operator.type.annotation.js.jsx" } }, - "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -4650,20 +4659,20 @@ "include": "#template-call" }, { - "name": "string.template.js.jsx", + "contentName": "string.template.js.jsx", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.js.jsx" }, "2": { - "name": "punctuation.definition.string.template.begin.js.jsx" + "name": "string.template.js.jsx punctuation.definition.string.template.begin.js.jsx" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.js.jsx" + "name": "string.template.js.jsx punctuation.definition.string.template.end.js.jsx" } }, "patterns": [ @@ -4680,7 +4689,6 @@ "template-call": { "patterns": [ { - "name": "string.template.js.jsx", "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", "end": "(?=`)", "patterns": [ @@ -4703,7 +4711,6 @@ ] }, { - "name": "string.template.js.jsx", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", "beginCaptures": { "1": { @@ -4759,20 +4766,20 @@ "include": "#template-call" }, { - "name": "string.template.js.jsx", + "contentName": "string.template.js.jsx", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.js.jsx" }, "2": { - "name": "punctuation.definition.string.template.begin.js.jsx" + "name": "string.template.js.jsx punctuation.definition.string.template.begin.js.jsx" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.js.jsx" + "name": "string.template.js.jsx punctuation.definition.string.template.end.js.jsx" } }, "patterns": [ diff --git a/extensions/latex/cgmanifest.json b/extensions/latex/cgmanifest.json index 4aa9afa9391..1765e5f63c2 100644 --- a/extensions/latex/cgmanifest.json +++ b/extensions/latex/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "jlelong/vscode-latex-basics", "repositoryUrl": "https://github.com/jlelong/vscode-latex-basics", - "commitHash": "16ac438ab14488976672c3c948ed29335fcd9dd5" + "commitHash": "eed5b817b757aab3695af437409fcbfdd37bbc59" } }, "license": "MIT", - "version": "1.5.0", + "version": "1.5.1", "description": "The files in syntaxes/ were originally part of https://github.com/James-Yu/LaTeX-Workshop. They have been extracted in the hope that they can useful outside of the LaTeX-Workshop extension.", "licenseDetail": [ "Copyright (c) vscode-latex-basics authors", diff --git a/extensions/latex/syntaxes/LaTeX.tmLanguage.json b/extensions/latex/syntaxes/LaTeX.tmLanguage.json index bfce1b50e8f..945a803dbe9 100644 --- a/extensions/latex/syntaxes/LaTeX.tmLanguage.json +++ b/extensions/latex/syntaxes/LaTeX.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/jlelong/vscode-latex-basics/commit/fcf4cca5b18a4c71ace161cf6af87cf6a50d9abd", + "version": "https://github.com/jlelong/vscode-latex-basics/commit/eed5b817b757aab3695af437409fcbfdd37bbc59", "name": "LaTeX", "scopeName": "text.tex.latex", "patterns": [ @@ -1064,7 +1064,7 @@ ] }, { - "begin": "((?:\\s*)\\\\begin\\{([a-z]*code(?:\\*)?)\\}(?:\\[.*\\])?(?:\\{.*\\})?)", + "begin": "((?:\\s*)\\\\begin\\{([a-zA-Z]*code(?:\\*)?)\\}(?:\\[.*\\])?(?:\\{.*\\})?)", "captures": { "1": { "patterns": [ @@ -1074,7 +1074,9 @@ ] } }, - "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)" + "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)", + "contentName": "meta.function.embedded.latex", + "name": "meta.embedded.block.generic.latex" }, { "begin": "((\\\\)addplot)(?:\\+?)((?:\\[[^\\[]*\\]))*\\s*(gnuplot)\\s*((?:\\[[^\\[]*\\]))*\\s*(\\{)", @@ -1684,7 +1686,7 @@ "name": "meta.scope.item.latex" }, { - "begin": "((\\\\)(?:[aA]uto|foot|full|no|ref|short|[tT]ext|[pP]aren|[sS]mart)?[cC]ite(?:al)?(?:p|s|t|author|year(?:par)?|title)?[ANP]*\\*?)((?:(?:\\([^\\)]*\\)){0,2}(?:\\[[^\\]]*\\]){0,2}\\{[\\w:.]*\\})*)(?:([<\\[])[^\\]<>]*([>\\]]))?(?:(\\[)[^\\]]*(\\]))?(\\{)", + "begin": "((\\\\)(?:[aA]uto|foot|full|no|ref|short|[tT]ext|[pP]aren|[sS]mart)?[cC]ite(?:al)?(?:p|s|t|author|year(?:par)?|title)?[ANP]*\\*?)((?:(?:\\([^\\)]*\\)){0,2}(?:\\[[^\\]]*\\]){0,2}\\{[\\p{Alphabetic}:.]*\\})*)(?:([<\\[])[^\\]<>]*([>\\]]))?(?:(\\[)[^\\]]*(\\]))?(\\{)", "captures": { "1": { "name": "keyword.control.cite.latex" @@ -1735,7 +1737,7 @@ "match": "((%).*)$" }, { - "match": "[\\w:.-]+", + "match": "[\\p{Alphabetic}:.-]+", "name": "constant.other.reference.citation.latex" } ] @@ -1762,7 +1764,7 @@ "name": "meta.citation.latex", "patterns": [ { - "match": "[\\w:.]+", + "match": "[\\p{Alphabetic}:.]+", "name": "constant.other.reference.citation.latex" } ] @@ -1789,7 +1791,7 @@ "name": "meta.reference.label.latex", "patterns": [ { - "match": "[a-zA-Z0-9\\.,:/*!^_-]", + "match": "[\\p{Alphabetic}\\p{Number}\\.,:/*!^_-]", "name": "constant.other.reference.label.latex" } ] @@ -2248,7 +2250,7 @@ ] } }, - "match": "(?:(\\()[^\\)]*(\\))){0,2}(?:(\\[)[^\\]]*(\\])){0,2}(\\{)([\\w:.]+)(\\})(.*)" + "match": "(?:(\\()[^\\)]*(\\))){0,2}(?:(\\[)[^\\]]*(\\])){0,2}(\\{)([\\p{Alphabetic}:.]+)(\\})(.*)" } ] }, diff --git a/extensions/latex/syntaxes/TeX.tmLanguage.json b/extensions/latex/syntaxes/TeX.tmLanguage.json index 4e3e4d697b5..22d47bc8ee1 100644 --- a/extensions/latex/syntaxes/TeX.tmLanguage.json +++ b/extensions/latex/syntaxes/TeX.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/jlelong/vscode-latex-basics/commit/8776a0856846b63d9e5765e8ec42a8a2f4f52219", + "version": "https://github.com/jlelong/vscode-latex-basics/commit/890b6155b82b12c67b350aa99be5637eaa64f222", "name": "TeX", "scopeName": "text.tex", "patterns": [ @@ -14,7 +14,7 @@ "name": "punctuation.definition.keyword.tex" } }, - "match": "(\\\\)(backmatter|else|fi|frontmatter|mainmatter|if(case|cat|dim|eof|false|hbox|hmode|inner|mmode|num|odd|true|undefined|vbox|vmode|void|x)?)(?![a-zA-Z@])", + "match": "(\\\\)(backmatter|csname|else|endcsname|fi|frontmatter|mainmatter|unless|if(case|cat|csname|defined|dim|eof|false|fontchar|hbox|hmode|inner|mmode|num|odd|true|vbox|vmode|void|x)?)(?![a-zA-Z@])", "name": "keyword.control.tex" }, { @@ -176,7 +176,7 @@ "name": "punctuation.definition.constant.math.tex" } }, - "match": "(\\\\)(s(s(earrow|warrow|lash)|h(ort(downarrow|uparrow|parallel|leftarrow|rightarrow|mid)|arp)|tar|i(gma|m(eq)?)|u(cc(sim|n(sim|approx)|curlyeq|eq|approx)?|pset(neq(q)?|plus(eq)?|eq(q)?)?|rd|m|bset(neq(q)?|plus(eq)?|eq(q)?)?)|p(hericalangle|adesuit)|e(tminus|arrow)|q(su(pset(eq)?|bset(eq)?)|c(up|ap)|uare)|warrow|m(ile|all(s(etminus|mile)|frown)))|h(slash|ook(leftarrow|rightarrow)|eartsuit|bar)|R(sh|ightarrow|e|bag)|Gam(e|ma)|n(s(hort(parallel|mid)|im|u(cc(eq)?|pseteq(q)?|bseteq))|Rightarrow|n(earrow|warrow)|cong|triangle(left(eq(slant)?)?|right(eq(slant)?)?)|i(plus)?|u|p(lus|arallel|rec(eq)?)|e(q|arrow|g|xists)|v(dash|Dash)|warrow|le(ss|q(slant|q)?|ft(arrow|rightarrow))|a(tural|bla)|VDash|rightarrow|g(tr|eq(slant|q)?)|mid|Left(arrow|rightarrow))|c(hi|irc(eq|le(d(circ|S|dash|ast)|arrow(left|right)))?|o(ng|prod|lon|mplement)|dot(s|p)?|u(p|r(vearrow(left|right)|ly(eq(succ|prec)|vee(downarrow|uparrow)?|wedge(downarrow|uparrow)?)))|enterdot|lubsuit|ap)|Xi|Maps(to(char)?|from(char)?)|B(ox|umpeq|bbk)|t(h(ick(sim|approx)|e(ta|refore))|imes|op|wohead(leftarrow|rightarrow)|a(u|lloblong)|riangle(down|q|left(eq(slant)?)?|right(eq(slant)?)?)?)|i(n(t(er(cal|leave))?|plus|fty)?|ota|math)|S(igma|u(pset|bset))|zeta|o(slash|times|int|dot|plus|vee|wedge|lessthan|greaterthan|m(inus|ega)|b(slash|long|ar))|d(i(v(ideontimes)?|a(g(down|up)|mond(suit)?)|gamma)|o(t(plus|eq(dot)?)|ublebarwedge|wn(harpoon(left|right)|downarrows|arrow))|d(ots|agger)|elta|a(sh(v|leftarrow|rightarrow)|leth|gger))|Y(down|up|left|right)|C(up|ap)|u(n(lhd|rhd)|p(silon|harpoon(left|right)|downarrow|uparrows|lus|arrow)|lcorner|rcorner)|jmath|Theta|Im|p(si|hi|i(tchfork)?|erp|ar(tial|allel)|r(ime|o(d|pto)|ec(sim|n(sim|approx)|curlyeq|eq|approx)?)|m)|e(t(h|a)|psilon|q(slant(less|gtr)|circ|uiv)|ll|xists|mptyset)|Omega|D(iamond|ownarrow|elta)|v(d(ots|ash)|ee(bar)?|Dash|ar(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|curly(vee|wedge)|t(heta|imes|riangle(left|right)?)|o(slash|circle|times|dot|plus|vee|wedge|lessthan|ast|greaterthan|minus|b(slash|ar))|p(hi|i|ropto)|epsilon|kappa|rho|bigcirc))|kappa|Up(silon|downarrow|arrow)|Join|f(orall|lat|a(t(s(emi|lash)|bslash)|llingdotseq)|rown)|P(si|hi|i)|w(p|edge|r)|l(hd|n(sim|eq(q)?|approx)|ceil|times|ightning|o(ng(left(arrow|rightarrow)|rightarrow|maps(to|from))|zenge|oparrow(left|right))|dot(s|p)|e(ss(sim|dot|eq(qgtr|gtr)|approx|gtr)|q(slant|q)?|ft(slice|harpoon(down|up)|threetimes|leftarrows|arrow(t(ail|riangle))?|right(squigarrow|harpoons|arrow(s|triangle|eq)?))|adsto)|vertneqq|floor|l(c(orner|eil)|floor|l|bracket)?|a(ngle|mbda)|rcorner|bag)|a(s(ymp|t)|ngle|pprox(eq)?|l(pha|eph)|rrownot|malg)|V(dash|vdash)|r(h(o|d)|ceil|times|i(singdotseq|ght(s(quigarrow|lice)|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(t(ail|riangle))?|rightarrows))|floor|angle|r(ceil|parenthesis|floor|bracket)|bag)|g(n(sim|eq(q)?|approx)|tr(sim|dot|eq(qless|less)|less|approx)|imel|eq(slant|q)?|vertneqq|amma|g(g)?)|Finv|xi|m(ho|i(nuso|d)|o(o|dels)|u(ltimap)?|p|e(asuredangle|rge)|aps(to|from(char)?))|b(i(n(dnasrepma|ampersand)|g(s(tar|qc(up|ap))|nplus|c(irc|u(p|rly(vee|wedge))|ap)|triangle(down|up)|interleave|o(times|dot|plus)|uplus|parallel|vee|wedge|box))|o(t|wtie|x(slash|circle|times|dot|plus|empty|ast|minus|b(slash|ox|ar)))|u(llet|mpeq)|e(cause|t(h|ween|a))|lack(square|triangle(down|left|right)?|lozenge)|a(ck(s(im(eq)?|lash)|prime|epsilon)|r(o|wedge))|bslash)|L(sh|ong(left(arrow|rightarrow)|rightarrow|maps(to|from))|eft(arrow|rightarrow)|leftarrow|ambda|bag)|Arrownot)(?=\\b|_)", + "match": "(\\\\)(s(s(earrow|warrow|lash)|h(ort(downarrow|uparrow|parallel|leftarrow|rightarrow|mid)|arp)|tar|i(gma|m(eq)?)|u(cc(sim|n(sim|approx)|curlyeq|eq|approx)?|pset(neq(q)?|plus(eq)?|eq(q)?)?|rd|m|bset(neq(q)?|plus(eq)?|eq(q)?)?)|p(hericalangle|adesuit)|e(tminus|arrow)|q(su(pset(eq)?|bset(eq)?)|c(up|ap)|uare)|warrow|m(ile|all(s(etminus|mile)|frown)))|h(slash|ook(leftarrow|rightarrow)|eartsuit|bar)|R(sh|ightarrow|e|bag)|Gam(e|ma)|n(s(hort(parallel|mid)|im|u(cc(eq)?|pseteq(q)?|bseteq))|Rightarrow|n(earrow|warrow)|cong|triangle(left(eq(slant)?)?|right(eq(slant)?)?)|i(plus)?|u|p(lus|arallel|rec(eq)?)|e(q|arrow|g|xists)|v(dash|Dash)|warrow|le(ss|q(slant|q)?|ft(arrow|rightarrow))|a(tural|bla)|VDash|rightarrow|g(tr|eq(slant|q)?)|mid|Left(arrow|rightarrow))|c(hi|irc(eq|le(d(circ|S|dash|ast)|arrow(left|right)))?|o(ng|prod|lon|mplement)|dot(s|p)?|u(p|r(vearrow(left|right)|ly(eq(succ|prec)|vee(downarrow|uparrow)?|wedge(downarrow|uparrow)?)))|enterdot|lubsuit|ap)|Xi|Maps(to(char)?|from(char)?)|B(ox|umpeq|bbk)|t(h(ick(sim|approx)|e(ta|refore))|imes|op|wohead(leftarrow|rightarrow)|a(u|lloblong)|riangle(down|q|left(eq(slant)?)?|right(eq(slant)?)?)?)|i(n(t(er(cal|leave))?|plus|fty)?|ota|math)|S(igma|u(pset|bset))|zeta|o(slash|times|int|dot|plus|vee|wedge|lessthan|greaterthan|m(inus|ega)|b(slash|long|ar))|d(i(v(ideontimes)?|a(g(down|up)|mond(suit)?)|gamma)|o(t(plus|eq(dot)?)|ublebarwedge|wn(harpoon(left|right)|downarrows|arrow))|d(ots|agger)|elta|a(sh(v|leftarrow|rightarrow)|leth|gger))|Y(down|up|left|right)|C(up|ap)|u(n(lhd|rhd)|p(silon|harpoon(left|right)|downarrow|uparrows|lus|arrow)|lcorner|rcorner)|jmath|Theta|Im|p(si|hi|i(tchfork)?|erp|ar(tial|allel)|r(ime|o(d|pto)|ec(sim|n(sim|approx)|curlyeq|eq|approx)?)|m)|e(t(h|a)|psilon|q(slant(less|gtr)|circ|uiv)|ll|xists|mptyset)|Omega|D(iamond|ownarrow|elta)|v(d(ots|ash)|ee(bar)?|Dash|ar(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|curly(vee|wedge)|t(heta|imes|riangle(left|right)?)|o(slash|circle|times|dot|plus|vee|wedge|lessthan|ast|greaterthan|minus|b(slash|ar))|p(hi|i|ropto)|epsilon|kappa|rho|bigcirc))|kappa|Up(silon|downarrow|arrow)|Join|f(orall|lat|a(t(s(emi|lash)|bslash)|llingdotseq)|rown)|P(si|hi|i)|w(p|edge|r)|l(hd|n(sim|eq(q)?|approx)|ceil|times|ightning|o(ng(left(arrow|rightarrow)|rightarrow|maps(to|from))|zenge|oparrow(left|right))|dot(s|p)|e(ss(sim|dot|eq(qgtr|gtr)|approx|gtr)|q(slant|q)?|ft(slice|harpoon(down|up)|threetimes|leftarrows|arrow(t(ail|riangle))?|right(squigarrow|harpoons|arrow(s|triangle|eq)?))|adsto)|vertneqq|floor|l(c(orner|eil)|floor|l|bracket)?|a(ngle|mbda)|rcorner|bag)|a(s(ymp|t)|ngle|pprox(eq)?|l(pha|eph)|rrownot|malg)|V(dash|vdash)|r(h(o|d)|ceil|times|i(singdotseq|ght(s(quigarrow|lice)|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(t(ail|riangle))?|rightarrows))|floor|angle|r(ceil|parenthesis|floor|bracket)|bag)|g(n(sim|eq(q)?|approx)|tr(sim|dot|eq(qless|less)|less|approx)|imel|eq(slant|q)?|vertneqq|amma|g(g)?)|Finv|xi|m(ho|i(nuso|d)|o(o|dels)|u(ltimap)?|p|e(asuredangle|rge)|aps(to|from(char)?))|b(i(n(dnasrepma|ampersand)|g(s(tar|qc(up|ap))|nplus|c(irc|u(p|rly(vee|wedge))|ap)|triangle(down|up)|interleave|o(times|dot|plus)|uplus|parallel|vee|wedge|box))|o(t|wtie|x(slash|circle|times|dot|plus|empty|ast|minus|b(slash|ox|ar)))|u(llet|mpeq)|e(cause|t(h|ween|a))|lack(square|triangle(down|left|right)?|lozenge)|a(ck(s(im(eq)?|lash)|prime|epsilon)|r(o|wedge))|bslash)|L(sh|ong(left(arrow|rightarrow)|rightarrow|maps(to|from))|eft(arrow|rightarrow)|leftarrow|ambda|bag)|Arrownot)(?![a-zA-Z])", "name": "constant.character.math.tex" }, { diff --git a/extensions/markdown-basics/cgmanifest.json b/extensions/markdown-basics/cgmanifest.json index a74605bb49b..d914bf08dcb 100644 --- a/extensions/markdown-basics/cgmanifest.json +++ b/extensions/markdown-basics/cgmanifest.json @@ -33,7 +33,7 @@ "git": { "name": "microsoft/vscode-markdown-tm-grammar", "repositoryUrl": "https://github.com/microsoft/vscode-markdown-tm-grammar", - "commitHash": "443261e8f75b2eaa8b36a2613fe7c4354208260a" + "commitHash": "ca2caf2157d0674be3d641f71499b84d514e4e5e" } }, "license": "MIT", diff --git a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json index 44287166e4c..57e14e862a5 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/443261e8f75b2eaa8b36a2613fe7c4354208260a", + "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/ca2caf2157d0674be3d641f71499b84d514e4e5e", "name": "Markdown", "scopeName": "text.html.markdown", "patterns": [ @@ -1880,6 +1880,39 @@ } ] }, + "fenced_code_block_twig": { + "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(twig)((\\s+|:|,|\\{|\\?)[^`]*)?$)", + "name": "markup.fenced_code.block.markdown", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.markdown" + }, + "4": { + "name": "fenced_code.block.language.markdown" + }, + "5": { + "name": "fenced_code.block.language.attributes.markdown" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.markdown" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.twig", + "patterns": [ + { + "include": "source.twig" + } + ] + } + ] + }, "fenced_code_block": { "patterns": [ { @@ -2047,6 +2080,9 @@ { "include": "#fenced_code_block_bibtex" }, + { + "include": "#fenced_code_block_twig" + }, { "include": "#fenced_code_block_unknown" } diff --git a/extensions/typescript-basics/cgmanifest.json b/extensions/typescript-basics/cgmanifest.json index d49b4244121..825d91cb611 100644 --- a/extensions/typescript-basics/cgmanifest.json +++ b/extensions/typescript-basics/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "TypeScript-TmLanguage", "repositoryUrl": "https://github.com/microsoft/TypeScript-TmLanguage", - "commitHash": "8e4e371fe8dd57560b16a44474f8cf8ca981e715" + "commitHash": "0d73d1117e0a9b1d6635ebbe9aa37d615171b02d" } }, "license": "MIT", diff --git a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json index ec3599b7fee..cd028501bd6 100644 --- a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScript.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/TypeScript-TmLanguage/commit/8e4e371fe8dd57560b16a44474f8cf8ca981e715", + "version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d", "name": "TypeScript", "scopeName": "source.ts", "patterns": [ @@ -986,6 +986,9 @@ }, { "include": "#parameter-binding-element" + }, + { + "include": "#paren-expression" } ] }, @@ -1168,7 +1171,7 @@ "name": "keyword.operator.assignment.ts" } }, - "end": "(?=[,);}\\]]|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?:&|{\\?]|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "end": "(?=[,);}\\]=>:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", "patterns": [ + { + "include": "#type-arguments" + }, { "include": "#expression" } @@ -3837,7 +3846,7 @@ "name": "keyword.operator.type.annotation.ts" } }, - "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -3852,7 +3861,7 @@ "name": "keyword.operator.type.annotation.ts" } }, - "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -4699,20 +4708,20 @@ "include": "#template-call" }, { - "name": "string.template.ts", + "contentName": "string.template.ts", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.ts" }, "2": { - "name": "punctuation.definition.string.template.begin.ts" + "name": "string.template.ts punctuation.definition.string.template.begin.ts" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.ts" + "name": "string.template.ts punctuation.definition.string.template.end.ts" } }, "patterns": [ @@ -4729,7 +4738,6 @@ "template-call": { "patterns": [ { - "name": "string.template.ts", "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", "end": "(?=`)", "patterns": [ @@ -4752,7 +4760,6 @@ ] }, { - "name": "string.template.ts", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", "beginCaptures": { "1": { @@ -4808,20 +4815,20 @@ "include": "#template-call" }, { - "name": "string.template.ts", + "contentName": "string.template.ts", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.ts" }, "2": { - "name": "punctuation.definition.string.template.begin.ts" + "name": "string.template.ts punctuation.definition.string.template.begin.ts" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.ts" + "name": "string.template.ts punctuation.definition.string.template.end.ts" } }, "patterns": [ diff --git a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json index 5f4c6aae7ef..bc4348140b5 100644 --- a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScriptReact.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/TypeScript-TmLanguage/commit/8e4e371fe8dd57560b16a44474f8cf8ca981e715", + "version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d", "name": "TypeScriptReact", "scopeName": "source.tsx", "patterns": [ @@ -989,6 +989,9 @@ }, { "include": "#parameter-binding-element" + }, + { + "include": "#paren-expression" } ] }, @@ -1171,7 +1174,7 @@ "name": "keyword.operator.assignment.tsx" } }, - "end": "(?=[,);}\\]]|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?:&|{\\?]|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", + "end": "(?=[,);}\\]=>:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))", "patterns": [ + { + "include": "#type-arguments" + }, { "include": "#expression" } @@ -3788,7 +3797,7 @@ "name": "keyword.operator.type.annotation.tsx" } }, - "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -3803,7 +3812,7 @@ "name": "keyword.operator.type.annotation.tsx" } }, - "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "end": "(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", "patterns": [ { "include": "#type" @@ -4650,20 +4659,20 @@ "include": "#template-call" }, { - "name": "string.template.tsx", + "contentName": "string.template.tsx", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.tsx" }, "2": { - "name": "punctuation.definition.string.template.begin.tsx" + "name": "string.template.tsx punctuation.definition.string.template.begin.tsx" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.tsx" + "name": "string.template.tsx punctuation.definition.string.template.end.tsx" } }, "patterns": [ @@ -4680,7 +4689,6 @@ "template-call": { "patterns": [ { - "name": "string.template.tsx", "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", "end": "(?=`)", "patterns": [ @@ -4703,7 +4711,6 @@ ] }, { - "name": "string.template.tsx", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", "beginCaptures": { "1": { @@ -4759,20 +4766,20 @@ "include": "#template-call" }, { - "name": "string.template.tsx", + "contentName": "string.template.tsx", "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", "beginCaptures": { "1": { "name": "entity.name.function.tagged-template.tsx" }, "2": { - "name": "punctuation.definition.string.template.begin.tsx" + "name": "string.template.tsx punctuation.definition.string.template.begin.tsx" } }, "end": "`", "endCaptures": { "0": { - "name": "punctuation.definition.string.template.end.tsx" + "name": "string.template.tsx punctuation.definition.string.template.end.tsx" } }, "patterns": [ diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test-strings_ts.json b/extensions/vscode-colorize-tests/test/colorize-results/test-strings_ts.json index 150fb748f40..72cf1ed35ee 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test-strings_ts.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test-strings_ts.json @@ -393,12 +393,12 @@ }, { "c": "tag", - "t": "source.ts string.template.ts entity.name.function.tagged-template.ts", + "t": "source.ts entity.name.function.tagged-template.ts", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", - "dark_vs": "string: #CE9178", - "light_vs": "string: #A31515", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", "hc_black": "entity.name.function: #DCDCAA", "dark_plus_experimental": "entity.name.function: #DCDCAA", "hc_light": "entity.name.function: #5E2CBC", diff --git a/extensions/vscode-colorize-tests/test/colorize-results/test_html.json b/extensions/vscode-colorize-tests/test/colorize-results/test_html.json index 19bd221616f..e4fab060509 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/test_html.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/test_html.json @@ -2478,8 +2478,22 @@ } }, { - "c": "{ ", - "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js", + "c": "{", + "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js meta.block.js punctuation.definition.block.js", + "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", + "dark_plus_experimental": "meta.embedded: #D4D4D4", + "hc_light": "meta.embedded: #292929", + "light_plus_experimental": "meta.embedded: #000000" + } + }, + { + "c": " ", + "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js meta.block.js", "r": { "dark_plus": "meta.embedded: #D4D4D4", "light_plus": "meta.embedded: #000000", @@ -2493,7 +2507,7 @@ }, { "c": "modules", - "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js variable.other.readwrite.js", + "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js meta.block.js variable.other.readwrite.js", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2507,7 +2521,21 @@ }, { "c": " ", - "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js meta.object.member.js", + "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js meta.block.js", + "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", + "dark_plus_experimental": "meta.embedded: #D4D4D4", + "hc_light": "meta.embedded: #292929", + "light_plus_experimental": "meta.embedded: #000000" + } + }, + { + "c": "}", + "t": "text.html.derivative meta.embedded.block.html source.js meta.objectliteral.js meta.block.js punctuation.definition.block.js", "r": { "dark_plus": "meta.embedded: #D4D4D4", "light_plus": "meta.embedded: #000000", @@ -2533,20 +2561,6 @@ "light_plus_experimental": "meta.embedded: #000000" } }, - { - "c": "}", - "t": "text.html.derivative meta.embedded.block.html source.js", - "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", - "dark_plus_experimental": "meta.embedded: #D4D4D4", - "hc_light": "meta.embedded: #292929", - "light_plus_experimental": "meta.embedded: #000000" - } - }, { "c": ",", "t": "text.html.derivative meta.embedded.block.html source.js punctuation.separator.comma.js", From 8635a5effdfeea74fc92b6b9cda71168adf75726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Fri, 24 Feb 2023 17:33:25 +0100 Subject: [PATCH 099/206] avoid using XDG_RUNTIME_DIR on darwin (#175241) fixes #168321 --- extensions/git/src/ipc/ipcServer.ts | 2 +- src/vs/base/parts/ipc/node/ipc.net.ts | 25 +++++++++---------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/extensions/git/src/ipc/ipcServer.ts b/extensions/git/src/ipc/ipcServer.ts index c9de357b1a6..8481aa4a35d 100644 --- a/extensions/git/src/ipc/ipcServer.ts +++ b/extensions/git/src/ipc/ipcServer.ts @@ -17,7 +17,7 @@ function getIPCHandlePath(id: string): string { return `\\\\.\\pipe\\vscode-git-${id}-sock`; } - if (process.env['XDG_RUNTIME_DIR']) { + if (process.platform !== 'darwin' && process.env['XDG_RUNTIME_DIR']) { return path.join(process.env['XDG_RUNTIME_DIR'] as string, `vscode-git-${id}.sock`); } diff --git a/src/vs/base/parts/ipc/node/ipc.net.ts b/src/vs/base/parts/ipc/node/ipc.net.ts index 80873b97c1f..0a7f31379f6 100644 --- a/src/vs/base/parts/ipc/node/ipc.net.ts +++ b/src/vs/base/parts/ipc/node/ipc.net.ts @@ -772,14 +772,10 @@ export function createRandomIPCHandle(): string { return `\\\\.\\pipe\\vscode-ipc-${randomSuffix}-sock`; } - // Mac/Unix: use socket file and prefer - // XDG_RUNTIME_DIR over tmpDir - let result: string; - if (XDG_RUNTIME_DIR) { - result = join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`); - } else { - result = join(getNodeDependencies().os.tmpdir(), `vscode-ipc-${randomSuffix}.sock`); - } + // Mac & Unix: Use socket file + // Unix: Prefer XDG_RUNTIME_DIR over user data path + const basePath = process.platform !== 'darwin' && XDG_RUNTIME_DIR ? XDG_RUNTIME_DIR : getNodeDependencies().os.tmpdir(); + const result = join(basePath, `vscode-ipc-${randomSuffix}.sock`); // Validate length validateIPCHandleLength(result); @@ -795,20 +791,17 @@ export function createStaticIPCHandle(directoryPath: string, type: string, versi return `\\\\.\\pipe\\${scope}-${version}-${type}-sock`; } - // Mac/Unix: use socket file and prefer - // XDG_RUNTIME_DIR over user data path - // unless portable - // Trim the version and type values for - // the socket to prevent too large - // file names causing issues: - // https://unix.stackexchange.com/questions/367008/why-is-socket-path-length-limited-to-a-hundred-chars + // Mac & Unix: Use socket file + // Unix: Prefer XDG_RUNTIME_DIR over user data path, unless portable + // Trim the version and type values for the socket to prevent too large + // file names causing issues: https://unix.stackexchange.com/q/367008 const versionForSocket = version.substr(0, 4); const typeForSocket = type.substr(0, 6); const scopeForSocket = scope.substr(0, 8); let result: string; - if (XDG_RUNTIME_DIR && !process.env['VSCODE_PORTABLE']) { + if (process.platform !== 'darwin' && XDG_RUNTIME_DIR && !process.env['VSCODE_PORTABLE']) { result = join(XDG_RUNTIME_DIR, `vscode-${scopeForSocket}-${versionForSocket}-${typeForSocket}.sock`); } else { result = join(directoryPath, `${versionForSocket}-${typeForSocket}.sock`); From 529f7d30b7d98e9d2d0e5658a930552726a63257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Fri, 24 Feb 2023 17:33:36 +0100 Subject: [PATCH 100/206] fixes #173330 (#175252) --- src/vs/base/browser/ui/splitview/splitview.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 9b00db6e0f2..531d030f6eb 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -1383,12 +1383,14 @@ export class SplitView extends Disposable { } override dispose(): void { - super.dispose(); + this.sashDragState?.disposable.dispose(); dispose(this.viewItems); this.viewItems = []; this.sashItems.forEach(i => i.disposable.dispose()); this.sashItems = []; + + super.dispose(); } } From 45e8496fba99b29a6d9bae1d78057c898e972679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Fri, 24 Feb 2023 17:33:50 +0100 Subject: [PATCH 101/206] fix npe (#175310) fixes #172785 --- .../workbench/contrib/files/browser/views/emptyView.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vs/workbench/contrib/files/browser/views/emptyView.ts b/src/vs/workbench/contrib/files/browser/views/emptyView.ts index 91288a65d40..f5d418630f5 100644 --- a/src/vs/workbench/contrib/files/browser/views/emptyView.ts +++ b/src/vs/workbench/contrib/files/browser/views/emptyView.ts @@ -26,6 +26,7 @@ export class EmptyView extends ViewPane { static readonly ID: string = 'workbench.explorer.emptyView'; static readonly NAME = nls.localize('noWorkspace', "No Folder Opened"); + private _disposed: boolean = false; constructor( options: IViewletViewOptions, @@ -81,10 +82,19 @@ export class EmptyView extends ViewPane { } private refreshTitle(): void { + if (this._disposed) { + return; + } + if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) { this.updateTitle(EmptyView.NAME); } else { this.updateTitle(this.title); } } + + override dispose(): void { + this._disposed = true; + super.dispose(); + } } From 02fa5bc9806b17d2e6a4994cae7c24e5161c9e9f Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 24 Feb 2023 17:39:54 +0100 Subject: [PATCH 102/206] Move more tests out of `electron-browser` (#175356) * Move more tests out of `electron-browser` * use a safer layer for this one --- .../extension.test.ts | 0 .../lifecycleService.test.ts | 4 +- .../electron-browser/queryBuilder.test.ts | 1 + .../electron-browser/workbenchTestServices.ts | 108 +-------------- .../electron-sandbox/workbenchTestServices.ts | 127 ++++++++++++++++++ 5 files changed, 136 insertions(+), 104 deletions(-) rename src/vs/workbench/contrib/extensions/test/{browser => electron-sandbox}/extension.test.ts (100%) rename src/vs/workbench/services/lifecycle/test/{electron-browser => electron-sandbox}/lifecycleService.test.ts (97%) diff --git a/src/vs/workbench/contrib/extensions/test/browser/extension.test.ts b/src/vs/workbench/contrib/extensions/test/electron-sandbox/extension.test.ts similarity index 100% rename from src/vs/workbench/contrib/extensions/test/browser/extension.test.ts rename to src/vs/workbench/contrib/extensions/test/electron-sandbox/extension.test.ts diff --git a/src/vs/workbench/services/lifecycle/test/electron-browser/lifecycleService.test.ts b/src/vs/workbench/services/lifecycle/test/electron-sandbox/lifecycleService.test.ts similarity index 97% rename from src/vs/workbench/services/lifecycle/test/electron-browser/lifecycleService.test.ts rename to src/vs/workbench/services/lifecycle/test/electron-sandbox/lifecycleService.test.ts index 6c48f109fe9..34604db9ea4 100644 --- a/src/vs/workbench/services/lifecycle/test/electron-browser/lifecycleService.test.ts +++ b/src/vs/workbench/services/lifecycle/test/electron-sandbox/lifecycleService.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { ShutdownReason } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { NativeLifecycleService } from 'vs/workbench/services/lifecycle/electron-sandbox/lifecycleService'; -import { workbenchInstantiationService } from 'vs/workbench/test/electron-browser/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/electron-sandbox/workbenchTestServices'; suite('Lifecycleservice', function () { @@ -28,7 +28,7 @@ suite('Lifecycleservice', function () { setup(async () => { disposables = new DisposableStore(); - const instantiationService = workbenchInstantiationService(disposables); + const instantiationService = workbenchInstantiationService(undefined, disposables); lifecycleService = instantiationService.createInstance(TestLifecycleService); }); diff --git a/src/vs/workbench/services/search/test/electron-browser/queryBuilder.test.ts b/src/vs/workbench/services/search/test/electron-browser/queryBuilder.test.ts index a054777a38d..78aaee606d8 100644 --- a/src/vs/workbench/services/search/test/electron-browser/queryBuilder.test.ts +++ b/src/vs/workbench/services/search/test/electron-browser/queryBuilder.test.ts @@ -2,6 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; diff --git a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts index 1f39b7161e9..715a8781680 100644 --- a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { workbenchInstantiationService as browserWorkbenchInstantiationService, ITestInstantiationService, TestLifecycleService, TestFilesConfigurationService, TestFileService, TestFileDialogService, TestPathService, TestEncodingOracle } from 'vs/workbench/test/browser/workbenchTestServices'; -import { Event } from 'vs/base/common/event'; +import { ITestInstantiationService, TestLifecycleService, TestFilesConfigurationService, TestFileService, TestFileDialogService, TestPathService, TestEncodingOracle } from 'vs/workbench/test/browser/workbenchTestServices'; +import { TestNativeHostService, workbenchInstantiationService as electronSandboxWorkbenchInstantiationService } from 'vs/workbench/test/electron-sandbox/workbenchTestServices'; import { NativeTextFileService, } from 'vs/workbench/services/textfile/electron-sandbox/nativeTextFileService'; import { FileOperationError, IFileService } from 'vs/platform/files/common/files'; import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; @@ -12,14 +12,14 @@ import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecy import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IModelService } from 'vs/editor/common/services/model'; import { INativeWorkbenchEnvironmentService, NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; -import { IDialogService, IFileDialogService, INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; +import { IDialogService, IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { URI } from 'vs/base/common/uri'; import { IReadTextFileOptions, ITextFileStreamContent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel'; -import { IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IOpenedWindow, IColorScheme, INativeWindowConfiguration } from 'vs/platform/window/common/window'; +import { INativeWindowConfiguration } from 'vs/platform/window/common/window'; import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv'; import { LogLevel, ILogService, NullLogService } from 'vs/platform/log/common/log'; import { IPathService } from 'vs/workbench/services/path/common/pathService'; @@ -32,9 +32,8 @@ import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/wo import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { TestContextService, TestProductService } from 'vs/workbench/test/common/workbenchTestServices'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { MouseInputEvent } from 'vs/base/parts/sandbox/common/electronTypes'; import { ILanguageService } from 'vs/editor/common/languages/language'; -import { INativeHostService, IOSProperties, IOSStatistics } from 'vs/platform/native/common/native'; +import { INativeHostService } from 'vs/platform/native/common/native'; import { homedir, release, tmpdir, hostname } from 'os'; import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -43,14 +42,12 @@ import product from 'vs/platform/product/common/product'; import { IElevatedFileService } from 'vs/workbench/services/files/common/elevatedFileService'; import { IDecorationsService } from 'vs/workbench/services/decorations/common/decorations'; import { DisposableStore } from 'vs/base/common/lifecycle'; -import { IPartsSplash } from 'vs/platform/theme/common/themeService'; import { IUserDataProfilesService, UserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; import { FileService } from 'vs/platform/files/common/fileService'; import { joinPath } from 'vs/base/common/resources'; import { UserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfileService'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService'; -import { VSBuffer } from 'vs/base/common/buffer'; const args = parseArgs(process.argv, OPTIONS); @@ -176,105 +173,12 @@ export class TestNativeTextFileServiceWithEncodingOverrides extends NativeTextFi } } -export class TestNativeHostService implements INativeHostService { - declare readonly _serviceBrand: undefined; - - readonly windowId = -1; - - onDidOpenWindow: Event = Event.None; - onDidMaximizeWindow: Event = Event.None; - onDidUnmaximizeWindow: Event = Event.None; - onDidFocusWindow: Event = Event.None; - onDidBlurWindow: Event = Event.None; - onDidResumeOS: Event = Event.None; - onDidChangeColorScheme = Event.None; - onDidChangePassword = Event.None; - onDidTriggerSystemContextMenu: Event<{ windowId: number; x: number; y: number }> = Event.None; - onDidChangeDisplay = Event.None; - - windowCount = Promise.resolve(1); - getWindowCount(): Promise { return this.windowCount; } - - async getWindows(): Promise { return []; } - async getActiveWindowId(): Promise { return undefined; } - - openWindow(options?: IOpenEmptyWindowOptions): Promise; - openWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; - openWindow(arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { - throw new Error('Method not implemented.'); - } - - async toggleFullScreen(): Promise { } - async handleTitleDoubleClick(): Promise { } - async isMaximized(): Promise { return true; } - async maximizeWindow(): Promise { } - async unmaximizeWindow(): Promise { } - async minimizeWindow(): Promise { } - async updateWindowControls(options: { height?: number; backgroundColor?: string; foregroundColor?: string }): Promise { } - async setMinimumSize(width: number | undefined, height: number | undefined): Promise { } - async saveWindowSplash(value: IPartsSplash): Promise { } - async focusWindow(options?: { windowId?: number | undefined } | undefined): Promise { } - async showMessageBox(options: Electron.MessageBoxOptions): Promise { throw new Error('Method not implemented.'); } - async showSaveDialog(options: Electron.SaveDialogOptions): Promise { throw new Error('Method not implemented.'); } - async showOpenDialog(options: Electron.OpenDialogOptions): Promise { throw new Error('Method not implemented.'); } - async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise { } - async pickFileAndOpen(options: INativeOpenDialogOptions): Promise { } - async pickFolderAndOpen(options: INativeOpenDialogOptions): Promise { } - async pickWorkspaceAndOpen(options: INativeOpenDialogOptions): Promise { } - async showItemInFolder(path: string): Promise { } - async setRepresentedFilename(path: string): Promise { } - async isAdmin(): Promise { return false; } - async writeElevated(source: URI, target: URI): Promise { } - async getOSProperties(): Promise { return Object.create(null); } - async getOSStatistics(): Promise { return Object.create(null); } - async getOSVirtualMachineHint(): Promise { return 0; } - async getOSColorScheme(): Promise { return { dark: true, highContrast: false }; } - async hasWSLFeatureInstalled(): Promise { return false; } - async killProcess(): Promise { } - async setDocumentEdited(edited: boolean): Promise { } - async openExternal(url: string): Promise { return false; } - async updateTouchBar(): Promise { } - async moveItemToTrash(): Promise { } - async newWindowTab(): Promise { } - async showPreviousWindowTab(): Promise { } - async showNextWindowTab(): Promise { } - async moveWindowTabToNewWindow(): Promise { } - async mergeAllWindowTabs(): Promise { } - async toggleWindowTabsBar(): Promise { } - async installShellCommand(): Promise { } - async uninstallShellCommand(): Promise { } - async notifyReady(): Promise { } - async relaunch(options?: { addArgs?: string[] | undefined; removeArgs?: string[] | undefined } | undefined): Promise { } - async reload(): Promise { } - async closeWindow(): Promise { } - async closeWindowById(): Promise { } - async quit(): Promise { } - async exit(code: number): Promise { } - async openDevTools(options?: Electron.OpenDevToolsOptions | undefined): Promise { } - async toggleDevTools(): Promise { } - async toggleSharedProcessWindow(): Promise { } - async resolveProxy(url: string): Promise { return undefined; } - async findFreePort(startPort: number, giveUpAfter: number, timeout: number, stride?: number): Promise { return -1; } - async readClipboardText(type?: 'selection' | 'clipboard' | undefined): Promise { return ''; } - async writeClipboardText(text: string, type?: 'selection' | 'clipboard' | undefined): Promise { } - async readClipboardFindText(): Promise { return ''; } - async writeClipboardFindText(text: string): Promise { } - async writeClipboardBuffer(format: string, buffer: VSBuffer, type?: 'selection' | 'clipboard' | undefined): Promise { } - async readClipboardBuffer(format: string): Promise { return VSBuffer.wrap(Uint8Array.from([])); } - async hasClipboard(format: string, type?: 'selection' | 'clipboard' | undefined): Promise { return false; } - async sendInputEvent(event: MouseInputEvent): Promise { } - async windowsGetStringRegKey(hive: 'HKEY_CURRENT_USER' | 'HKEY_LOCAL_MACHINE' | 'HKEY_CLASSES_ROOT' | 'HKEY_USERS' | 'HKEY_CURRENT_CONFIG', path: string, name: string): Promise { return undefined; } - async profileRenderer(): Promise { throw new Error(); } - async enableSandbox(enabled: boolean): Promise { throw new Error('Method not implemented.'); } -} - export function workbenchInstantiationService(disposables = new DisposableStore()): ITestInstantiationService { - const instantiationService = browserWorkbenchInstantiationService({ + const instantiationService = electronSandboxWorkbenchInstantiationService({ textFileService: insta => insta.createInstance(TestTextFileService), pathService: insta => insta.createInstance(TestNativePathService) }, disposables); - instantiationService.stub(INativeHostService, new TestNativeHostService()); instantiationService.stub(IEnvironmentService, TestEnvironmentService); instantiationService.stub(INativeEnvironmentService, TestEnvironmentService); instantiationService.stub(IWorkbenchEnvironmentService, TestEnvironmentService); diff --git a/src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts b/src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts index bdf057acfca..7315a9eb82e 100644 --- a/src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts +++ b/src/vs/workbench/test/electron-sandbox/workbenchTestServices.ts @@ -3,7 +3,25 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { Event } from 'vs/base/common/event'; +import { workbenchInstantiationService as browserWorkbenchInstantiationService, ITestInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices'; import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; +import { INativeHostService, IOSProperties, IOSStatistics } from 'vs/platform/native/common/native'; +import { VSBuffer } from 'vs/base/common/buffer'; +import { DisposableStore } from 'vs/base/common/lifecycle'; +import { URI } from 'vs/base/common/uri'; +import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; +import { IPartsSplash } from 'vs/platform/theme/common/themeService'; +import { IOpenedWindow, IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IColorScheme } from 'vs/platform/window/common/window'; +import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IFileService } from 'vs/platform/files/common/files'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IPathService } from 'vs/workbench/services/path/common/pathService'; +import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService'; +import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; export class TestSharedProcessService implements ISharedProcessService { @@ -15,3 +33,112 @@ export class TestSharedProcessService implements ISharedProcessService { notifyRestored(): void { } } + +export class TestNativeHostService implements INativeHostService { + declare readonly _serviceBrand: undefined; + + readonly windowId = -1; + + onDidOpenWindow: Event = Event.None; + onDidMaximizeWindow: Event = Event.None; + onDidUnmaximizeWindow: Event = Event.None; + onDidFocusWindow: Event = Event.None; + onDidBlurWindow: Event = Event.None; + onDidResumeOS: Event = Event.None; + onDidChangeColorScheme = Event.None; + onDidChangePassword = Event.None; + onDidTriggerSystemContextMenu: Event<{ windowId: number; x: number; y: number }> = Event.None; + onDidChangeDisplay = Event.None; + + windowCount = Promise.resolve(1); + getWindowCount(): Promise { return this.windowCount; } + + async getWindows(): Promise { return []; } + async getActiveWindowId(): Promise { return undefined; } + + openWindow(options?: IOpenEmptyWindowOptions): Promise; + openWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; + openWindow(arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { + throw new Error('Method not implemented.'); + } + + async toggleFullScreen(): Promise { } + async handleTitleDoubleClick(): Promise { } + async isMaximized(): Promise { return true; } + async maximizeWindow(): Promise { } + async unmaximizeWindow(): Promise { } + async minimizeWindow(): Promise { } + async updateWindowControls(options: { height?: number; backgroundColor?: string; foregroundColor?: string }): Promise { } + async setMinimumSize(width: number | undefined, height: number | undefined): Promise { } + async saveWindowSplash(value: IPartsSplash): Promise { } + async focusWindow(options?: { windowId?: number | undefined } | undefined): Promise { } + async showMessageBox(options: Electron.MessageBoxOptions): Promise { throw new Error('Method not implemented.'); } + async showSaveDialog(options: Electron.SaveDialogOptions): Promise { throw new Error('Method not implemented.'); } + async showOpenDialog(options: Electron.OpenDialogOptions): Promise { throw new Error('Method not implemented.'); } + async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise { } + async pickFileAndOpen(options: INativeOpenDialogOptions): Promise { } + async pickFolderAndOpen(options: INativeOpenDialogOptions): Promise { } + async pickWorkspaceAndOpen(options: INativeOpenDialogOptions): Promise { } + async showItemInFolder(path: string): Promise { } + async setRepresentedFilename(path: string): Promise { } + async isAdmin(): Promise { return false; } + async writeElevated(source: URI, target: URI): Promise { } + async getOSProperties(): Promise { return Object.create(null); } + async getOSStatistics(): Promise { return Object.create(null); } + async getOSVirtualMachineHint(): Promise { return 0; } + async getOSColorScheme(): Promise { return { dark: true, highContrast: false }; } + async hasWSLFeatureInstalled(): Promise { return false; } + async killProcess(): Promise { } + async setDocumentEdited(edited: boolean): Promise { } + async openExternal(url: string): Promise { return false; } + async updateTouchBar(): Promise { } + async moveItemToTrash(): Promise { } + async newWindowTab(): Promise { } + async showPreviousWindowTab(): Promise { } + async showNextWindowTab(): Promise { } + async moveWindowTabToNewWindow(): Promise { } + async mergeAllWindowTabs(): Promise { } + async toggleWindowTabsBar(): Promise { } + async installShellCommand(): Promise { } + async uninstallShellCommand(): Promise { } + async notifyReady(): Promise { } + async relaunch(options?: { addArgs?: string[] | undefined; removeArgs?: string[] | undefined } | undefined): Promise { } + async reload(): Promise { } + async closeWindow(): Promise { } + async closeWindowById(): Promise { } + async quit(): Promise { } + async exit(code: number): Promise { } + async openDevTools(options?: Electron.OpenDevToolsOptions | undefined): Promise { } + async toggleDevTools(): Promise { } + async toggleSharedProcessWindow(): Promise { } + async resolveProxy(url: string): Promise { return undefined; } + async findFreePort(startPort: number, giveUpAfter: number, timeout: number, stride?: number): Promise { return -1; } + async readClipboardText(type?: 'selection' | 'clipboard' | undefined): Promise { return ''; } + async writeClipboardText(text: string, type?: 'selection' | 'clipboard' | undefined): Promise { } + async readClipboardFindText(): Promise { return ''; } + async writeClipboardFindText(text: string): Promise { } + async writeClipboardBuffer(format: string, buffer: VSBuffer, type?: 'selection' | 'clipboard' | undefined): Promise { } + async readClipboardBuffer(format: string): Promise { return VSBuffer.wrap(Uint8Array.from([])); } + async hasClipboard(format: string, type?: 'selection' | 'clipboard' | undefined): Promise { return false; } + async sendInputEvent(event: any): Promise { } + async windowsGetStringRegKey(hive: 'HKEY_CURRENT_USER' | 'HKEY_LOCAL_MACHINE' | 'HKEY_CLASSES_ROOT' | 'HKEY_USERS' | 'HKEY_CURRENT_CONFIG', path: string, name: string): Promise { return undefined; } + async profileRenderer(): Promise { throw new Error(); } + async enableSandbox(enabled: boolean): Promise { throw new Error('Method not implemented.'); } +} + +export function workbenchInstantiationService(overrides?: { + environmentService?: (instantiationService: IInstantiationService) => IEnvironmentService; + fileService?: (instantiationService: IInstantiationService) => IFileService; + configurationService?: (instantiationService: IInstantiationService) => TestConfigurationService; + textFileService?: (instantiationService: IInstantiationService) => ITextFileService; + pathService?: (instantiationService: IInstantiationService) => IPathService; + editorService?: (instantiationService: IInstantiationService) => IEditorService; + contextKeyService?: (instantiationService: IInstantiationService) => IContextKeyService; + textEditorService?: (instantiationService: IInstantiationService) => ITextEditorService; +}, disposables = new DisposableStore()): ITestInstantiationService { + const instantiationService = browserWorkbenchInstantiationService(overrides, disposables); + + instantiationService.stub(INativeHostService, new TestNativeHostService()); + + return instantiationService; +} From 756ef3ff47a6deb740c813b73ca9e5dc2374bf9c Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 24 Feb 2023 17:54:04 +0100 Subject: [PATCH 103/206] validate extension-given file system provider (#175357) fixes https://github.com/microsoft/vscode/issues/173502 --- .../workbench/api/common/extHostFileSystem.ts | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostFileSystem.ts b/src/vs/workbench/api/common/extHostFileSystem.ts index 1b47763c98e..41c1f8aa83f 100644 --- a/src/vs/workbench/api/common/extHostFileSystem.ts +++ b/src/vs/workbench/api/common/extHostFileSystem.ts @@ -128,9 +128,11 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape { this._linkProviderRegistration?.dispose(); } - registerFileSystemProvider(extension: IExtensionDescription, scheme: string, provider: vscode.FileSystemProvider, options: { isCaseSensitive?: boolean; isReadonly?: boolean } = {}) { + // validate the given provider is complete + ExtHostFileSystem._validateFileSystemProvider(provider); + if (this._registeredSchemes.has(scheme)) { throw new Error(`a provider for the scheme '${scheme}' is already registered`); } @@ -203,6 +205,36 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape { }); } + private static _validateFileSystemProvider(provider: vscode.FileSystemProvider) { + if (!provider) { + throw new Error('MISSING provider'); + } + if (typeof provider.watch !== 'function') { + throw new Error('Provider does NOT implement watch'); + } + if (typeof provider.stat !== 'function') { + throw new Error('Provider does NOT implement stat'); + } + if (typeof provider.readDirectory !== 'function') { + throw new Error('Provider does NOT implement readDirectory'); + } + if (typeof provider.createDirectory !== 'function') { + throw new Error('Provider does NOT implement createDirectory'); + } + if (typeof provider.readFile !== 'function') { + throw new Error('Provider does NOT implement readFile'); + } + if (typeof provider.writeFile !== 'function') { + throw new Error('Provider does NOT implement writeFile'); + } + if (typeof provider.delete !== 'function') { + throw new Error('Provider does NOT implement delete'); + } + if (typeof provider.rename !== 'function') { + throw new Error('Provider does NOT implement rename'); + } + } + private static _asIStat(stat: vscode.FileStat): files.IStat { const { type, ctime, mtime, size, permissions } = stat; return { type, ctime, mtime, size, permissions }; From ab81ed0b35cb5b1bf059e9a0cc7975f104b6fcbe Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 24 Feb 2023 18:06:28 +0100 Subject: [PATCH 104/206] fix breakage --- src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 6b1959d48e1..418a3b54335 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -189,7 +189,7 @@ export class MainThreadLanguageFeatures extends Disposable implements MainThread return undefined; } return { - ...codeLens, + ...result, range: model.validateRange(result.range), }; } From 28164d0453e2976d93b052632254ad465a148802 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Fri, 24 Feb 2023 11:11:30 -0600 Subject: [PATCH 105/206] check end column of marker against current position (#175362) --- .../audioCues/browser/audioCueLineFeatureContribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts index d7b1c8c4327..2b21f1ff8e2 100644 --- a/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts +++ b/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.ts @@ -202,7 +202,7 @@ class MarkerLineFeature implements LineFeature { .some( (m) => { const onLine = m.severity === this.severity && m.startLineNumber <= position.lineNumber && position.lineNumber <= m.endLineNumber; - return lineChanged ? onLine : onLine && (position.lineNumber <= m.endLineNumber && m.startColumn <= position.column); + return lineChanged ? onLine : onLine && (position.lineNumber <= m.endLineNumber && m.startColumn <= position.column && m.endColumn >= position.column); }); return hasMarker; }, From b9d1118393b1eca51afec371af25656ca3251a8b Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Fri, 24 Feb 2023 18:12:08 +0100 Subject: [PATCH 106/206] increasing the package version of vscode-json-langaugeservice to 5.3.1 --- extensions/json-language-features/server/package.json | 2 +- extensions/json-language-features/server/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index e8c7e50305b..c6eb7bed2e5 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -15,7 +15,7 @@ "@vscode/l10n": "^0.0.11", "jsonc-parser": "^3.2.0", "request-light": "^0.7.0", - "vscode-json-languageservice": "^5.3.0", + "vscode-json-languageservice": "^5.3.1", "vscode-languageserver": "^8.1.0", "vscode-uri": "^3.0.7" }, diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index 076619e16a8..3d079ff3b38 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -27,10 +27,10 @@ request-light@^0.7.0: resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.7.0.tgz#885628bb2f8040c26401ebf258ec51c4ae98ac2a" integrity sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q== -vscode-json-languageservice@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-5.3.0.tgz#b8e8f220f4030af33144182029ac13090d3ceb96" - integrity sha512-yVC2WpAaF1swkUBA7EqG3hmSORxI6EpTBGdGgo5DIfJpG5hrk8PzPODAhQd0gVFtTF5j4yFxFD6V1x2XBqagcg== +vscode-json-languageservice@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-5.3.1.tgz#c36175d05f425fbd8f47dcee6f2a72096bdda36f" + integrity sha512-tPRf/2LOBS6uFflFLABdj8T3ol2/QgZ0kpzZHFCs+cbxpnjBNiCo+rfh3th0dtdytq5dSnWo5iFJj99zF6jZWQ== dependencies: "@vscode/l10n" "^0.0.11" jsonc-parser "^3.2.0" From ffc78442f1cee6fb5d9a054b84f298800ca3f289 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 24 Feb 2023 09:59:00 -0800 Subject: [PATCH 107/206] Fix #174375. Better scrollable check for outputs. (#175367) --- .../browser/view/renderers/webviewPreloads.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts index f9f4c6dcb34..359a5cd9a90 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts @@ -366,11 +366,26 @@ async function webviewPreloads(ctx: PreloadContext) { return false; } + // scroll up if (event.deltaY < 0 && node.scrollTop > 0) { + // there is still some content to scroll return true; } + // scroll down if (event.deltaY > 0 && node.scrollTop + node.clientHeight < node.scrollHeight) { + // per https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight + // scrollTop is not rounded but scrollHeight and clientHeight are + // so we need to check if the difference is less than some threshold + if (node.scrollHeight - node.scrollTop - node.clientHeight < 2) { + continue; + } + + // if the node is not scrollable, we can continue. We don't check the computed style always as it's expensive + if (window.getComputedStyle(node).overflowY === 'hidden' || window.getComputedStyle(node).overflowY === 'visible') { + continue; + } + return true; } } From 99e49049053595b989aa861743faea49f348f14c Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Fri, 24 Feb 2023 10:13:55 -0800 Subject: [PATCH 108/206] Add annotation to a telemetry point (#175370) * Add annotation to a telemetry point * forgot , --- extensions/github-authentication/src/githubServer.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts index 8babd85ab73..dc7278f6d4f 100644 --- a/extensions/github-authentication/src/githubServer.ts +++ b/extensions/github-authentication/src/githubServer.ts @@ -594,6 +594,13 @@ export class GitHubServer implements IGitHubServer { return; } + /* __GDPR__ + "session" : { + "owner": "TylerLeonhardt", + "isEdu": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "isManaged": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ this._telemetryReporter.sendTelemetryEvent('session', { isEdu: edu ?? 'unknown', isManaged: managed ?? 'unknown' From 42062cb3eac92616618520f72bf2f947d50fcffb Mon Sep 17 00:00:00 2001 From: David Dossett Date: Fri, 24 Feb 2023 10:40:00 -0800 Subject: [PATCH 109/206] Fix find highlight background in Light+ V2 (#175372) --- extensions/theme-defaults/themes/light_plus_experimental.json | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/theme-defaults/themes/light_plus_experimental.json b/extensions/theme-defaults/themes/light_plus_experimental.json index 157d78d4024..c1c0729ff8e 100644 --- a/extensions/theme-defaults/themes/light_plus_experimental.json +++ b/extensions/theme-defaults/themes/light_plus_experimental.json @@ -31,7 +31,6 @@ "dropdown.foreground": "#3b3b3b", "dropdown.listBackground": "#ffffff", "editor.background": "#ffffff", - "editor.findMatchBackground": "#9e6a03", "editor.foreground": "#3b3b3b", "editor.inactiveSelectionBackground": "#E5EBF1", "editor.selectionHighlightBackground": "#ADD6FF80", From f7ba39b04ec6e6cc8cad4018159688cd51278208 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Fri, 24 Feb 2023 21:33:25 +0100 Subject: [PATCH 110/206] Adopt `globalThis` (#175381) --- src/vs/base/browser/defaultWorkerFactory.ts | 20 +++++++++------ src/vs/base/browser/mouseEvent.ts | 2 +- src/vs/base/common/worker/simpleWorker.ts | 18 +++++++------ src/vs/base/worker/workerMain.ts | 25 ++++++++++--------- .../common/services/editorSimpleWorker.ts | 3 +-- src/vs/editor/editor.api.ts | 13 ++++++---- src/vs/editor/editor.worker.ts | 6 ++--- .../extensions/worker/polyfillNestedWorker.ts | 10 ++++---- 8 files changed, 53 insertions(+), 44 deletions(-) diff --git a/src/vs/base/browser/defaultWorkerFactory.ts b/src/vs/base/browser/defaultWorkerFactory.ts index f7c76d14b53..4fe7e01e806 100644 --- a/src/vs/base/browser/defaultWorkerFactory.ts +++ b/src/vs/base/browser/defaultWorkerFactory.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { COI } from 'vs/base/common/network'; -import { globals } from 'vs/base/common/platform'; import { IWorker, IWorkerCallback, IWorkerFactory, logOnceWebWorkerWarning } from 'vs/base/common/worker/simpleWorker'; const ttPolicy = window.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value }); @@ -18,12 +17,17 @@ export function createBlobWorker(blobUrl: string, options?: WorkerOptions): Work function getWorker(label: string): Worker | Promise { // Option for hosts to overwrite the worker script (used in the standalone editor) - if (globals.MonacoEnvironment) { - if (typeof globals.MonacoEnvironment.getWorker === 'function') { - return globals.MonacoEnvironment.getWorker('workerMain.js', label); + interface IMonacoEnvironment { + getWorker?(moduleId: string, label: string): Worker | Promise; + getWorkerUrl?(moduleId: string, label: string): string; + } + const monacoEnvironment: IMonacoEnvironment | undefined = (globalThis as any).MonacoEnvironment; + if (monacoEnvironment) { + if (typeof monacoEnvironment.getWorker === 'function') { + return monacoEnvironment.getWorker('workerMain.js', label); } - if (typeof globals.MonacoEnvironment.getWorkerUrl === 'function') { - const workerUrl = globals.MonacoEnvironment.getWorkerUrl('workerMain.js', label); + if (typeof monacoEnvironment.getWorkerUrl === 'function') { + const workerUrl = monacoEnvironment.getWorkerUrl('workerMain.js', label); return new Worker(ttPolicy ? ttPolicy.createScriptURL(workerUrl) as unknown as string : workerUrl, { name: label }); } } @@ -40,12 +44,12 @@ function getWorker(label: string): Worker | Promise { // ESM-comment-begin export function getWorkerBootstrapUrl(scriptPath: string, label: string): string { - if (/^((http:)|(https:)|(file:))/.test(scriptPath) && scriptPath.substring(0, self.origin.length) !== self.origin) { + if (/^((http:)|(https:)|(file:))/.test(scriptPath) && scriptPath.substring(0, globalThis.origin.length) !== globalThis.origin) { // this is the cross-origin case // i.e. the webpage is running at a different origin than where the scripts are loaded from const myPath = 'vs/base/worker/defaultWorkerFactory.js'; const workerBaseUrl = require.toUrl(myPath).slice(0, -myPath.length); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321 - const js = `/*${label}*/self.MonacoEnvironment={baseUrl: '${workerBaseUrl}'};const ttPolicy = self.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });importScripts(ttPolicy?.createScriptURL('${scriptPath}') ?? '${scriptPath}');/*${label}*/`; + const js = `/*${label}*/globalThis.MonacoEnvironment={baseUrl: '${workerBaseUrl}'};const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });importScripts(ttPolicy?.createScriptURL('${scriptPath}') ?? '${scriptPath}');/*${label}*/`; const blob = new Blob([js], { type: 'application/javascript' }); return URL.createObjectURL(blob); } diff --git a/src/vs/base/browser/mouseEvent.ts b/src/vs/base/browser/mouseEvent.ts index e6f5d3b5a4b..db8ba364a86 100644 --- a/src/vs/base/browser/mouseEvent.ts +++ b/src/vs/base/browser/mouseEvent.ts @@ -74,7 +74,7 @@ export class StandardMouseEvent implements IMouseEvent { } // Find the position of the iframe this code is executing in relative to the iframe where the event was captured. - const iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(self, e.view); + const iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(window, e.view); this.posx -= iframeOffsets.left; this.posy -= iframeOffsets.top; } diff --git a/src/vs/base/common/worker/simpleWorker.ts b/src/vs/base/common/worker/simpleWorker.ts index 6a0e4da3099..deefcb96396 100644 --- a/src/vs/base/common/worker/simpleWorker.ts +++ b/src/vs/base/common/worker/simpleWorker.ts @@ -7,7 +7,7 @@ import { transformErrorForSerialization } from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import { getAllMethodNames } from 'vs/base/common/objects'; -import { globals, isWeb } from 'vs/base/common/platform'; +import { isWeb } from 'vs/base/common/platform'; import * as strings from 'vs/base/common/strings'; const INITIALIZE = '$initialize'; @@ -324,12 +324,14 @@ export class SimpleWorkerClient extends Disp // Gather loader configuration let loaderConfiguration: any = null; - if (typeof globals.require !== 'undefined' && typeof globals.require.getConfig === 'function') { + + const globalRequire: { getConfig?(): object } | undefined = (globalThis as any).require; + if (typeof globalRequire !== 'undefined' && typeof globalRequire.getConfig === 'function') { // Get the configuration from the Monaco AMD Loader - loaderConfiguration = globals.require.getConfig(); - } else if (typeof globals.requirejs !== 'undefined') { + loaderConfiguration = globalRequire.getConfig(); + } else if (typeof (globalThis as any).requirejs !== 'undefined') { // Get the configuration from requirejs - loaderConfiguration = globals.requirejs.s.contexts._.config; + loaderConfiguration = (globalThis as any).requirejs.s.contexts._.config; } const hostMethods = getAllMethodNames(host); @@ -527,17 +529,17 @@ export class SimpleWorkerServer { // Since this is in a web worker, enable catching errors loaderConfig.catchError = true; - globals.require.config(loaderConfig); + globalThis.require.config(loaderConfig); } return new Promise((resolve, reject) => { // Use the global require to be sure to get the global config // ESM-comment-begin - const req = (globals.require || require); + const req = (globalThis.require || require); // ESM-comment-end // ESM-uncomment-begin - // const req = globals.require; + // const req = globalThis.require; // ESM-uncomment-end req([moduleId], (module: { create: IRequestHandlerFactory }) => { diff --git a/src/vs/base/worker/workerMain.ts b/src/vs/base/worker/workerMain.ts index 9b4656b31c4..8d322f9cb59 100644 --- a/src/vs/base/worker/workerMain.ts +++ b/src/vs/base/worker/workerMain.ts @@ -5,7 +5,7 @@ (function () { - const MonacoEnvironment = (self).MonacoEnvironment; + const MonacoEnvironment = (globalThis).MonacoEnvironment; const monacoBaseUrl = MonacoEnvironment && MonacoEnvironment.baseUrl ? MonacoEnvironment.baseUrl : '../../../'; const trustedTypesPolicy = ( @@ -29,10 +29,10 @@ try { const func = ( trustedTypesPolicy - ? self.eval(trustedTypesPolicy.createScript('', 'true')) + ? globalThis.eval(trustedTypesPolicy.createScript('', 'true')) : new Function('true') ); - func.call(self); + func.call(globalThis); return true; } catch (err) { return false; @@ -41,12 +41,12 @@ function loadAMDLoader() { return new Promise((resolve, reject) => { - if (typeof (self).define === 'function' && (self).define.amd) { + if (typeof (globalThis).define === 'function' && (globalThis).define.amd) { return resolve(); } const loaderSrc: string | TrustedScriptURL = monacoBaseUrl + 'vs/loader.js'; - const isCrossOrigin = (/^((http:)|(https:)|(file:))/.test(loaderSrc) && loaderSrc.substring(0, self.origin.length) !== self.origin); + const isCrossOrigin = (/^((http:)|(https:)|(file:))/.test(loaderSrc) && loaderSrc.substring(0, globalThis.origin.length) !== globalThis.origin); if (!isCrossOrigin && canUseEval()) { // use `fetch` if possible because `importScripts` // is synchronous and can lead to deadlocks on Safari @@ -59,10 +59,10 @@ text = `${text}\n//# sourceURL=${loaderSrc}`; const func = ( trustedTypesPolicy - ? self.eval(trustedTypesPolicy.createScript('', text) as unknown as string) + ? globalThis.eval(trustedTypesPolicy.createScript('', text) as unknown as string) : new Function(text) ); - func.call(self); + func.call(globalThis); resolve(); }).then(undefined, reject); return; @@ -92,12 +92,13 @@ require([moduleId], function (ws) { setTimeout(function () { const messageHandler = ws.create((msg: any, transfer?: Transferable[]) => { - (self).postMessage(msg, transfer); + (globalThis).postMessage(msg, transfer); }, null); - self.onmessage = (e: MessageEvent) => messageHandler.onmessage(e.data, e.ports); + globalThis.onmessage = (e: MessageEvent) => messageHandler.onmessage(e.data, e.ports); while (beforeReadyMessages.length > 0) { - self.onmessage(beforeReadyMessages.shift()!); + const e = beforeReadyMessages.shift()!; + messageHandler.onmessage(e.data, e.ports); } }, 0); }); @@ -107,13 +108,13 @@ // If the loader is already defined, configure it immediately // This helps in the bundled case, where we must load nls files // and they need a correct baseUrl to be loaded. - if (typeof (self).define === 'function' && (self).define.amd) { + if (typeof (globalThis).define === 'function' && (globalThis).define.amd) { configureAMDLoader(); } let isFirstMessage = true; const beforeReadyMessages: MessageEvent[] = []; - self.onmessage = (message: MessageEvent) => { + globalThis.onmessage = (message: MessageEvent) => { if (!isFirstMessage) { beforeReadyMessages.push(message); return; diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index 8864a766527..2d8062f2117 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -5,7 +5,6 @@ import { stringDiff } from 'vs/base/common/diff/diff'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { globals } from 'vs/base/common/platform'; import { URI } from 'vs/base/common/uri'; import { IRequestHandler } from 'vs/base/common/worker/simpleWorker'; import { IPosition, Position } from 'vs/editor/common/core/position'; @@ -702,5 +701,5 @@ declare function importScripts(...urls: string[]): void; if (typeof importScripts === 'function') { // Running in a web worker - globals.monaco = createMonacoBaseAPI(); + globalThis.monaco = createMonacoBaseAPI(); } diff --git a/src/vs/editor/editor.api.ts b/src/vs/editor/editor.api.ts index 2378f8508ef..a9fc0b29404 100644 --- a/src/vs/editor/editor.api.ts +++ b/src/vs/editor/editor.api.ts @@ -7,7 +7,6 @@ import { EditorOptions, WrappingIndent, EditorAutoIndentStrategy } from 'vs/edit import { createMonacoBaseAPI } from 'vs/editor/common/services/editorBaseApi'; import { createMonacoEditorAPI } from 'vs/editor/standalone/browser/standaloneEditor'; import { createMonacoLanguagesAPI } from 'vs/editor/standalone/browser/standaloneLanguages'; -import { globals } from 'vs/base/common/platform'; import { FormattingConflicts } from 'vs/editor/contrib/format/browser/format'; // Set defaults for standalone editor @@ -38,12 +37,16 @@ export const Token = api.Token; export const editor = api.editor; export const languages = api.languages; -if (globals.MonacoEnvironment?.globalAPI || (typeof define === 'function' && (define).amd)) { - self.monaco = api; +interface IMonacoEnvironment { + globalAPI?: boolean; +} +const monacoEnvironment: IMonacoEnvironment | undefined = (globalThis as any).MonacoEnvironment; +if (monacoEnvironment?.globalAPI || (typeof define === 'function' && (define).amd)) { + globalThis.monaco = api; } -if (typeof self.require !== 'undefined' && typeof self.require.config === 'function') { - self.require.config({ +if (typeof globalThis.require !== 'undefined' && typeof globalThis.require.config === 'function') { + globalThis.require.config({ ignoreDuplicateModules: [ 'vscode-languageserver-types', 'vscode-languageserver-types/main', diff --git a/src/vs/editor/editor.worker.ts b/src/vs/editor/editor.worker.ts index e5931ee62ba..7c53a6094b2 100644 --- a/src/vs/editor/editor.worker.ts +++ b/src/vs/editor/editor.worker.ts @@ -16,15 +16,15 @@ export function initialize(foreignModule: any) { initialized = true; const simpleWorker = new SimpleWorkerServer((msg) => { - (self).postMessage(msg); + globalThis.postMessage(msg); }, (host: IEditorWorkerHost) => new EditorSimpleWorker(host, foreignModule)); - self.onmessage = (e: MessageEvent) => { + globalThis.onmessage = (e: MessageEvent) => { simpleWorker.onmessage(e.data); }; } -self.onmessage = (e: MessageEvent) => { +globalThis.onmessage = (e: MessageEvent) => { // Ignore first message in this case and initialize if not yet initialized if (!initialized) { initialize(null); diff --git a/src/vs/workbench/services/extensions/worker/polyfillNestedWorker.ts b/src/vs/workbench/services/extensions/worker/polyfillNestedWorker.ts index da0a8f5a574..4ee6faa7a52 100644 --- a/src/vs/workbench/services/extensions/worker/polyfillNestedWorker.ts +++ b/src/vs/workbench/services/extensions/worker/polyfillNestedWorker.ts @@ -13,14 +13,14 @@ const _bootstrapFnSource = (function _bootstrapFn(workerUrl: string) { const listener: EventListener = (event: Event): void => { // uninstall handler - self.removeEventListener('message', listener); + globalThis.removeEventListener('message', listener); // get data const port = (event).data; // postMessage // onmessage - Object.defineProperties(self, { + Object.defineProperties(globalThis, { 'postMessage': { value(data: any, transferOrOptions?: any) { port.postMessage(data, transferOrOptions); @@ -38,19 +38,19 @@ const _bootstrapFnSource = (function _bootstrapFn(workerUrl: string) { }); port.addEventListener('message', msg => { - self.dispatchEvent(new MessageEvent('message', { data: msg.data })); + globalThis.dispatchEvent(new MessageEvent('message', { data: msg.data })); }); port.start(); // fake recursively nested worker - self.Worker = class { constructor() { throw new TypeError('Nested workers from within nested worker are NOT supported.'); } }; + globalThis.Worker = class { constructor() { throw new TypeError('Nested workers from within nested worker are NOT supported.'); } }; // load module importScripts(workerUrl); }; - self.addEventListener('message', listener); + globalThis.addEventListener('message', listener); }).toString(); From def1c0dc472cfc6eb03244c9a6c4e5d911ca6699 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 24 Feb 2023 21:35:41 +0100 Subject: [PATCH 111/206] smoke test - try to unblock CI (#175382) * smoke test - try to fix runs * comment --- test/automation/src/application.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/automation/src/application.ts b/test/automation/src/application.ts index 83e7a76ace7..e6e149dd0fe 100644 --- a/test/automation/src/application.ts +++ b/test/automation/src/application.ts @@ -117,7 +117,7 @@ export class Application { private async checkWindowReady(code: Code): Promise { // We need a rendered workbench - await measureAndLog(() => code.didFinishLoad(), 'Application#checkWindowReady: wait for navigation to be committed', this.logger); + // await measureAndLog(() => code.didFinishLoad(), 'Application#checkWindowReady: wait for navigation to be committed', this.logger); // TODO this seems to fail ever since utility process is on by default await measureAndLog(() => code.waitForElement('.monaco-workbench'), 'Application#checkWindowReady: wait for .monaco-workbench element', this.logger); // Remote but not web: wait for a remote connection state change From f0195104abd5ba9e95bb54e0789c30bb09cb748d Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Fri, 24 Feb 2023 22:02:49 +0100 Subject: [PATCH 112/206] Adopt latest loader (#175379) * Adopt latest loader * Update to latest loader --- src/vs/loader.js | 1154 ++++++++++++++++++++++------------------------ 1 file changed, 544 insertions(+), 610 deletions(-) diff --git a/src/vs/loader.js b/src/vs/loader.js index 67ef8665099..5c71e7aacf5 100644 --- a/src/vs/loader.js +++ b/src/vs/loader.js @@ -18,13 +18,33 @@ *--------------------------------------------------------------------------------------------- *--------------------------------------------------------------------------------------------- *--------------------------------------------------------------------------------------------*/ -var _amdLoaderGlobal = this; -var _commonjsGlobal = typeof global === 'object' ? global : {}; +const _amdLoaderGlobal = this; +const _commonjsGlobal = typeof global === 'object' ? global : {}; var AMDLoader; (function (AMDLoader) { AMDLoader.global = _amdLoaderGlobal; - var Environment = /** @class */ (function () { - function Environment() { + class Environment { + get isWindows() { + this._detect(); + return this._isWindows; + } + get isNode() { + this._detect(); + return this._isNode; + } + get isElectronRenderer() { + this._detect(); + return this._isElectronRenderer; + } + get isWebWorker() { + this._detect(); + return this._isWebWorker; + } + get isElectronNodeIntegrationWebWorker() { + this._detect(); + return this._isElectronNodeIntegrationWebWorker; + } + constructor() { this._detected = false; this._isWindows = false; this._isNode = false; @@ -32,47 +52,7 @@ var AMDLoader; this._isWebWorker = false; this._isElectronNodeIntegrationWebWorker = false; } - Object.defineProperty(Environment.prototype, "isWindows", { - get: function () { - this._detect(); - return this._isWindows; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Environment.prototype, "isNode", { - get: function () { - this._detect(); - return this._isNode; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Environment.prototype, "isElectronRenderer", { - get: function () { - this._detect(); - return this._isElectronRenderer; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Environment.prototype, "isWebWorker", { - get: function () { - this._detect(); - return this._isWebWorker; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Environment.prototype, "isElectronNodeIntegrationWebWorker", { - get: function () { - this._detect(); - return this._isElectronNodeIntegrationWebWorker; - }, - enumerable: false, - configurable: true - }); - Environment.prototype._detect = function () { + _detect() { if (this._detected) { return; } @@ -82,8 +62,8 @@ var AMDLoader; this._isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); this._isWebWorker = (typeof AMDLoader.global.importScripts === 'function'); this._isElectronNodeIntegrationWebWorker = this._isWebWorker && (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'worker'); - }; - Environment._isWindows = function () { + } + static _isWindows() { if (typeof navigator !== 'undefined') { if (navigator.userAgent && navigator.userAgent.indexOf('Windows') >= 0) { return true; @@ -93,9 +73,8 @@ var AMDLoader; return (process.platform === 'win32'); } return false; - }; - return Environment; - }()); + } + } AMDLoader.Environment = Environment; })(AMDLoader || (AMDLoader = {})); /*--------------------------------------------------------------------------------------------- @@ -104,40 +83,35 @@ var AMDLoader; *--------------------------------------------------------------------------------------------*/ var AMDLoader; (function (AMDLoader) { - var LoaderEvent = /** @class */ (function () { - function LoaderEvent(type, detail, timestamp) { + class LoaderEvent { + constructor(type, detail, timestamp) { this.type = type; this.detail = detail; this.timestamp = timestamp; } - return LoaderEvent; - }()); + } AMDLoader.LoaderEvent = LoaderEvent; - var LoaderEventRecorder = /** @class */ (function () { - function LoaderEventRecorder(loaderAvailableTimestamp) { - this._events = [new LoaderEvent(1 /* LoaderAvailable */, '', loaderAvailableTimestamp)]; + class LoaderEventRecorder { + constructor(loaderAvailableTimestamp) { + this._events = [new LoaderEvent(1 /* LoaderEventType.LoaderAvailable */, '', loaderAvailableTimestamp)]; } - LoaderEventRecorder.prototype.record = function (type, detail) { + record(type, detail) { this._events.push(new LoaderEvent(type, detail, AMDLoader.Utilities.getHighPerformanceTimestamp())); - }; - LoaderEventRecorder.prototype.getEvents = function () { - return this._events; - }; - return LoaderEventRecorder; - }()); - AMDLoader.LoaderEventRecorder = LoaderEventRecorder; - var NullLoaderEventRecorder = /** @class */ (function () { - function NullLoaderEventRecorder() { } - NullLoaderEventRecorder.prototype.record = function (type, detail) { + getEvents() { + return this._events; + } + } + AMDLoader.LoaderEventRecorder = LoaderEventRecorder; + class NullLoaderEventRecorder { + record(type, detail) { // Nothing to do - }; - NullLoaderEventRecorder.prototype.getEvents = function () { + } + getEvents() { return []; - }; - NullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder(); - return NullLoaderEventRecorder; - }()); + } + } + NullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder(); AMDLoader.NullLoaderEventRecorder = NullLoaderEventRecorder; })(AMDLoader || (AMDLoader = {})); /*--------------------------------------------------------------------------------------------- @@ -146,13 +120,11 @@ var AMDLoader; *--------------------------------------------------------------------------------------------*/ var AMDLoader; (function (AMDLoader) { - var Utilities = /** @class */ (function () { - function Utilities() { - } + class Utilities { /** * This method does not take care of / vs \ */ - Utilities.fileUriToFilePath = function (isWindows, uri) { + static fileUriToFilePath(isWindows, uri) { uri = decodeURI(uri).replace(/%23/g, '#'); if (isWindows) { if (/^file:\/\/\//.test(uri)) { @@ -170,41 +142,41 @@ var AMDLoader; } // Not sure... return uri; - }; - Utilities.startsWith = function (haystack, needle) { + } + static startsWith(haystack, needle) { return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle; - }; - Utilities.endsWith = function (haystack, needle) { + } + static endsWith(haystack, needle) { return haystack.length >= needle.length && haystack.substr(haystack.length - needle.length) === needle; - }; + } // only check for "?" before "#" to ensure that there is a real Query-String - Utilities.containsQueryString = function (url) { + static containsQueryString(url) { return /^[^\#]*\?/gi.test(url); - }; + } /** * Does `url` start with http:// or https:// or file:// or / ? */ - Utilities.isAbsolutePath = function (url) { + static isAbsolutePath(url) { return /^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(url); - }; - Utilities.forEachProperty = function (obj, callback) { + } + static forEachProperty(obj, callback) { if (obj) { - var key = void 0; + let key; for (key in obj) { if (obj.hasOwnProperty(key)) { callback(key, obj[key]); } } } - }; - Utilities.isEmpty = function (obj) { - var isEmpty = true; - Utilities.forEachProperty(obj, function () { + } + static isEmpty(obj) { + let isEmpty = true; + Utilities.forEachProperty(obj, () => { isEmpty = false; }); return isEmpty; - }; - Utilities.recursiveClone = function (obj) { + } + static recursiveClone(obj) { if (!obj || typeof obj !== 'object' || obj instanceof RegExp) { return obj; } @@ -212,8 +184,8 @@ var AMDLoader; // only clone "simple" objects return obj; } - var result = Array.isArray(obj) ? [] : {}; - Utilities.forEachProperty(obj, function (key, value) { + let result = Array.isArray(obj) ? [] : {}; + Utilities.forEachProperty(obj, (key, value) => { if (value && typeof value === 'object') { result[key] = Utilities.recursiveClone(value); } @@ -222,25 +194,24 @@ var AMDLoader; } }); return result; - }; - Utilities.generateAnonymousModule = function () { + } + static generateAnonymousModule() { return '===anonymous' + (Utilities.NEXT_ANONYMOUS_ID++) + '==='; - }; - Utilities.isAnonymousModule = function (id) { + } + static isAnonymousModule(id) { return Utilities.startsWith(id, '===anonymous'); - }; - Utilities.getHighPerformanceTimestamp = function () { + } + static getHighPerformanceTimestamp() { if (!this.PERFORMANCE_NOW_PROBED) { this.PERFORMANCE_NOW_PROBED = true; this.HAS_PERFORMANCE_NOW = (AMDLoader.global.performance && typeof AMDLoader.global.performance.now === 'function'); } return (this.HAS_PERFORMANCE_NOW ? AMDLoader.global.performance.now() : Date.now()); - }; - Utilities.NEXT_ANONYMOUS_ID = 1; - Utilities.PERFORMANCE_NOW_PROBED = false; - Utilities.HAS_PERFORMANCE_NOW = false; - return Utilities; - }()); + } + } + Utilities.NEXT_ANONYMOUS_ID = 1; + Utilities.PERFORMANCE_NOW_PROBED = false; + Utilities.HAS_PERFORMANCE_NOW = false; AMDLoader.Utilities = Utilities; })(AMDLoader || (AMDLoader = {})); /*--------------------------------------------------------------------------------------------- @@ -253,7 +224,7 @@ var AMDLoader; if (err instanceof Error) { return err; } - var result = new Error(err.message || String(err) || 'Unknown Error'); + const result = new Error(err.message || String(err) || 'Unknown Error'); if (err.stack) { result.stack = err.stack; } @@ -261,13 +232,11 @@ var AMDLoader; } AMDLoader.ensureError = ensureError; ; - var ConfigurationOptionsUtil = /** @class */ (function () { - function ConfigurationOptionsUtil() { - } + class ConfigurationOptionsUtil { /** * Ensure configuration options make sense */ - ConfigurationOptionsUtil.validateConfigurationOptions = function (options) { + static validateConfigurationOptions(options) { function defaultOnError(err) { if (err.phase === 'loading') { console.error('Loading "' + err.moduleId + '" failed'); @@ -331,138 +300,134 @@ var AMDLoader; options.nodeCachedData.writeDelay = 1000 * 7; } if (!options.nodeCachedData.path || typeof options.nodeCachedData.path !== 'string') { - var err = ensureError(new Error('INVALID cached data configuration, \'path\' MUST be set')); + const err = ensureError(new Error('INVALID cached data configuration, \'path\' MUST be set')); err.phase = 'configuration'; options.onError(err); options.nodeCachedData = undefined; } } return options; - }; - ConfigurationOptionsUtil.mergeConfigurationOptions = function (overwrite, base) { - if (overwrite === void 0) { overwrite = null; } - if (base === void 0) { base = null; } - var result = AMDLoader.Utilities.recursiveClone(base || {}); + } + static mergeConfigurationOptions(overwrite = null, base = null) { + let result = AMDLoader.Utilities.recursiveClone(base || {}); // Merge known properties and overwrite the unknown ones - AMDLoader.Utilities.forEachProperty(overwrite, function (key, value) { + AMDLoader.Utilities.forEachProperty(overwrite, (key, value) => { if (key === 'ignoreDuplicateModules' && typeof result.ignoreDuplicateModules !== 'undefined') { result.ignoreDuplicateModules = result.ignoreDuplicateModules.concat(value); } else if (key === 'paths' && typeof result.paths !== 'undefined') { - AMDLoader.Utilities.forEachProperty(value, function (key2, value2) { return result.paths[key2] = value2; }); + AMDLoader.Utilities.forEachProperty(value, (key2, value2) => result.paths[key2] = value2); } else if (key === 'config' && typeof result.config !== 'undefined') { - AMDLoader.Utilities.forEachProperty(value, function (key2, value2) { return result.config[key2] = value2; }); + AMDLoader.Utilities.forEachProperty(value, (key2, value2) => result.config[key2] = value2); } else { result[key] = AMDLoader.Utilities.recursiveClone(value); } }); return ConfigurationOptionsUtil.validateConfigurationOptions(result); - }; - return ConfigurationOptionsUtil; - }()); + } + } AMDLoader.ConfigurationOptionsUtil = ConfigurationOptionsUtil; - var Configuration = /** @class */ (function () { - function Configuration(env, options) { + class Configuration { + constructor(env, options) { this._env = env; this.options = ConfigurationOptionsUtil.mergeConfigurationOptions(options); this._createIgnoreDuplicateModulesMap(); this._createSortedPathsRules(); if (this.options.baseUrl === '') { if (this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename && this._env.isNode) { - var nodeMain = this.options.nodeRequire.main.filename; - var dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\')); + let nodeMain = this.options.nodeRequire.main.filename; + let dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\')); this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1); } } } - Configuration.prototype._createIgnoreDuplicateModulesMap = function () { + _createIgnoreDuplicateModulesMap() { // Build a map out of the ignoreDuplicateModules array this.ignoreDuplicateModulesMap = {}; - for (var i = 0; i < this.options.ignoreDuplicateModules.length; i++) { + for (let i = 0; i < this.options.ignoreDuplicateModules.length; i++) { this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[i]] = true; } - }; - Configuration.prototype._createSortedPathsRules = function () { - var _this = this; + } + _createSortedPathsRules() { // Create an array our of the paths rules, sorted descending by length to // result in a more specific -> less specific order this.sortedPathsRules = []; - AMDLoader.Utilities.forEachProperty(this.options.paths, function (from, to) { + AMDLoader.Utilities.forEachProperty(this.options.paths, (from, to) => { if (!Array.isArray(to)) { - _this.sortedPathsRules.push({ + this.sortedPathsRules.push({ from: from, to: [to] }); } else { - _this.sortedPathsRules.push({ + this.sortedPathsRules.push({ from: from, to: to }); } }); - this.sortedPathsRules.sort(function (a, b) { + this.sortedPathsRules.sort((a, b) => { return b.from.length - a.from.length; }); - }; + } /** * Clone current configuration and overwrite options selectively. * @param options The selective options to overwrite with. * @result A new configuration */ - Configuration.prototype.cloneAndMerge = function (options) { + cloneAndMerge(options) { return new Configuration(this._env, ConfigurationOptionsUtil.mergeConfigurationOptions(options, this.options)); - }; + } /** * Get current options bag. Useful for passing it forward to plugins. */ - Configuration.prototype.getOptionsLiteral = function () { + getOptionsLiteral() { return this.options; - }; - Configuration.prototype._applyPaths = function (moduleId) { - var pathRule; - for (var i = 0, len = this.sortedPathsRules.length; i < len; i++) { + } + _applyPaths(moduleId) { + let pathRule; + for (let i = 0, len = this.sortedPathsRules.length; i < len; i++) { pathRule = this.sortedPathsRules[i]; if (AMDLoader.Utilities.startsWith(moduleId, pathRule.from)) { - var result = []; - for (var j = 0, lenJ = pathRule.to.length; j < lenJ; j++) { + let result = []; + for (let j = 0, lenJ = pathRule.to.length; j < lenJ; j++) { result.push(pathRule.to[j] + moduleId.substr(pathRule.from.length)); } return result; } } return [moduleId]; - }; - Configuration.prototype._addUrlArgsToUrl = function (url) { + } + _addUrlArgsToUrl(url) { if (AMDLoader.Utilities.containsQueryString(url)) { return url + '&' + this.options.urlArgs; } else { return url + '?' + this.options.urlArgs; } - }; - Configuration.prototype._addUrlArgsIfNecessaryToUrl = function (url) { + } + _addUrlArgsIfNecessaryToUrl(url) { if (this.options.urlArgs) { return this._addUrlArgsToUrl(url); } return url; - }; - Configuration.prototype._addUrlArgsIfNecessaryToUrls = function (urls) { + } + _addUrlArgsIfNecessaryToUrls(urls) { if (this.options.urlArgs) { - for (var i = 0, len = urls.length; i < len; i++) { + for (let i = 0, len = urls.length; i < len; i++) { urls[i] = this._addUrlArgsToUrl(urls[i]); } } return urls; - }; + } /** * Transform a module id to a location. Appends .js to module ids */ - Configuration.prototype.moduleIdToPaths = function (moduleId) { + moduleIdToPaths(moduleId) { if (this._env.isNode) { - var isNodeModule = (this.options.amdModulesPattern instanceof RegExp + const isNodeModule = (this.options.amdModulesPattern instanceof RegExp && !this.options.amdModulesPattern.test(moduleId)); if (isNodeModule) { // This is a node module... @@ -476,11 +441,11 @@ var AMDLoader; } } } - var result = moduleId; - var results; + let result = moduleId; + let results; if (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.isAbsolutePath(result)) { results = this._applyPaths(result); - for (var i = 0, len = results.length; i < len; i++) { + for (let i = 0, len = results.length; i < len; i++) { if (this.isBuild() && results[i] === 'empty:') { continue; } @@ -499,12 +464,12 @@ var AMDLoader; results = [result]; } return this._addUrlArgsIfNecessaryToUrls(results); - }; + } /** * Transform a module id or url to a location. */ - Configuration.prototype.requireToUrl = function (url) { - var result = url; + requireToUrl(url) { + let result = url; if (!AMDLoader.Utilities.isAbsolutePath(result)) { result = this._applyPaths(result)[0]; if (!AMDLoader.Utilities.isAbsolutePath(result)) { @@ -512,14 +477,14 @@ var AMDLoader; } } return this._addUrlArgsIfNecessaryToUrl(result); - }; + } /** * Flag to indicate if current execution is as part of a build. */ - Configuration.prototype.isBuild = function () { + isBuild() { return this.options.isBuild; - }; - Configuration.prototype.shouldInvokeFactory = function (strModuleId) { + } + shouldInvokeFactory(strModuleId) { if (!this.options.isBuild) { // outside of a build, all factories should be invoked return true; @@ -532,41 +497,40 @@ var AMDLoader; return true; } return false; - }; + } /** * Test if module `moduleId` is expected to be defined multiple times */ - Configuration.prototype.isDuplicateMessageIgnoredFor = function (moduleId) { + isDuplicateMessageIgnoredFor(moduleId) { return this.ignoreDuplicateModulesMap.hasOwnProperty(moduleId); - }; + } /** * Get the configuration settings for the provided module id */ - Configuration.prototype.getConfigForModule = function (moduleId) { + getConfigForModule(moduleId) { if (this.options.config) { return this.options.config[moduleId]; } - }; + } /** * Should errors be caught when executing module factories? */ - Configuration.prototype.shouldCatchError = function () { + shouldCatchError() { return this.options.catchError; - }; + } /** * Should statistics be recorded? */ - Configuration.prototype.shouldRecordStats = function () { + shouldRecordStats() { return this.options.recordStats; - }; + } /** * Forward an error to the error handler. */ - Configuration.prototype.onError = function (err) { + onError(err) { this.options.onError(err); - }; - return Configuration; - }()); + } + } AMDLoader.Configuration = Configuration; })(AMDLoader || (AMDLoader = {})); /*--------------------------------------------------------------------------------------------- @@ -578,20 +542,19 @@ var AMDLoader; /** * Load `scriptSrc` only once (avoid multiple