diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 9050664fcee..7fd5854208c 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,6 +1,6 @@ # Code - OSS Development Container -[![Open in Remote - Containers](https://img.shields.io/static/v1?label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) +[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) This repository includes configuration for a development container for working with Code - OSS in a local container or using [GitHub Codespaces](https://github.com/features/codespaces). @@ -8,7 +8,7 @@ This repository includes configuration for a development container for working w ## Quick start - local -If you already have VS Code and Docker installed, you can click the badge above or [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. Clicking these links will cause VS Code to automatically install the Remote - Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. +If you already have VS Code and Docker installed, you can click the badge above or [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. Clicking these links will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. 1. Install Docker Desktop or Docker for Linux on your local machine. (See [docs](https://aka.ms/vscode-remote/containers/getting-started) for additional details.) @@ -16,13 +16,13 @@ If you already have VS Code and Docker installed, you can click the badge above > **Note:** The [Resource Monitor](https://marketplace.visualstudio.com/items?itemName=mutantdino.resourcemonitor) extension is included in the container so you can keep an eye on CPU/Memory in the status bar. -3. Install [Visual Studio Code Stable](https://code.visualstudio.com/) or [Insiders](https://code.visualstudio.com/insiders/) and the [Remote - Containers](https://aka.ms/vscode-remote/download/containers) extension. +3. Install [Visual Studio Code Stable](https://code.visualstudio.com/) or [Insiders](https://code.visualstudio.com/insiders/) and the [Dev Containers](https://aka.ms/vscode-remote/download/containers) extension. - ![Image of Remote - Containers extension](https://microsoft.github.io/vscode-remote-release/images/remote-containers-extn.png) + ![Image of Dev Containers extension](https://microsoft.github.io/vscode-remote-release/images/remote-containers-extn.png) - > **Note:** The Remote - Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details. + > **Note:** The Dev Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details. -4. Press Ctrl/Cmd + Shift + P or F1 and select **Remote-Containers: Clone Repository in Container Volume...**. +4. Press Ctrl/Cmd + Shift + P or F1 and select **Dev Containers: Clone Repository in Container Volume...**. > **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or when using the Hyper-V engine on Windows. We recommend the "clone repository in container" approach instead since it uses "named volume" rather than the local filesystem. diff --git a/.github/classifier.json b/.github/classifier.json index 99bdbe96a29..179d8dafcdd 100644 --- a/.github/classifier.json +++ b/.github/classifier.json @@ -18,7 +18,7 @@ "callhierarchy": {"assign": ["jrieken"]}, "code-lens": {"assign": ["jrieken"]}, "color-palette": {"assign": []}, - "comments": {"assign": ["rebornix"]}, + "comments": {"assign": ["alexr00"]}, "config": {"assign": ["sandy081"]}, "context-keys": {"assign": []}, "css-less-scss": {"assign": ["aeschli"]}, diff --git a/.vscode/cgmanifest.schema.json b/.vscode/cgmanifest.schema.json deleted file mode 100644 index 2e719b02396..00000000000 --- a/.vscode/cgmanifest.schema.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "type": "object", - "properties": { - "registrations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "component": { - "oneOf": [ - { - "type": "object", - "required": [ - "type", - "git" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "git" - ] - }, - "git": { - "type": "object", - "required": [ - "name", - "repositoryUrl", - "commitHash" - ], - "properties": { - "name": { - "type": "string" - }, - "repositoryUrl": { - "type": "string" - }, - "commitHash": { - "type": "string" - } - } - } - } - }, - { - "type": "object", - "required": [ - "type", - "npm" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "npm" - ] - }, - "npm": { - "type": "object", - "required": [ - "name", - "version" - ], - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - } - }, - { - "type": "object", - "required": [ - "type", - "other" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "other" - ] - }, - "other": { - "type": "object", - "required": [ - "name", - "downloadUrl", - "version" - ], - "properties": { - "name": { - "type": "string" - }, - "downloadUrl": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - } - } - ] - }, - "repositoryUrl": { - "type": "string", - "description": "The git url of the component" - }, - "version": { - "type": "string", - "description": "The version of the component" - }, - "license": { - "type": "string", - "description": "The name of the license" - }, - "developmentDependency": { - "type": "boolean", - "description": "This component is inlined in the vscode repo and **is not shipped**." - }, - "isOnlyProductionDependency": { - "type": "boolean", - "description": "This component is shipped and **is not inlined in the vscode repo**." - }, - "licenseDetail": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The license text" - } - } - } - } - } -} diff --git a/.vscode/launch.json b/.vscode/launch.json index ab98af7d3d2..d0c0ed97f49 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -322,6 +322,33 @@ "order": 3 } }, + { + "type": "chrome", + "request": "launch", + "outFiles": [], + "perScriptSourcemaps": "yes", + "name": "VS Code Web (Chrome)", + "url": "http://localhost:8080", + "preLaunchTask": "Run code web", + "presentation": { + "group": "0_vscode", + "order": 3 + } + }, + { + "type": "msedge", + "request": "launch", + "outFiles": [], + "perScriptSourcemaps": "yes", + "name": "VS Code Web (Edge)", + "url": "http://localhost:8080", + "pauseForSourceMap": false, + "preLaunchTask": "Run code web", + "presentation": { + "group": "0_vscode", + "order": 3 + } + }, { "type": "node", "request": "launch", diff --git a/.vscode/notebooks/api.github-issues b/.vscode/notebooks/api.github-issues index fd582d87cf1..9bf483dbbcc 100644 --- a/.vscode/notebooks/api.github-issues +++ b/.vscode/notebooks/api.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"September 2022\"" + "value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"October 2022\"" }, { "kind": 1, diff --git a/.vscode/notebooks/endgame.github-issues b/.vscode/notebooks/endgame.github-issues index a9a74d1af88..e30128e3b7f 100644 --- a/.vscode/notebooks/endgame.github-issues +++ b/.vscode/notebooks/endgame.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-remotehub repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-unpkg\n\n$MILESTONE=milestone:\"September 2022\"" + "value": "$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-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n\n\n$MILESTONE=milestone:\"September 2022\"" }, { "kind": 1, @@ -32,7 +32,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS -$MILESTONE is:issue is:closed label:bug label:insiders-released -label:verified -label:*duplicate -label:*as-designed -label:z-author-verified -label:on-testplan" + "value": "$REPOS -$MILESTONE is:issue is:closed reason:completed label:bug label:insiders-released -label:verified -label:*duplicate -label:*as-designed -label:z-author-verified -label:on-testplan" }, { "kind": 1, @@ -42,7 +42,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS -$MILESTONE is:issue is:closed label:feature-request label:insiders-released -label:on-testplan -label:verified -label:*duplicate" + "value": "$REPOS -$MILESTONE is:issue is:closed reason:completed label:feature-request label:insiders-released -label:on-testplan -label:verified -label:*duplicate" }, { "kind": 1, @@ -62,7 +62,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE is:issue is:closed label:feature-request -label:verification-needed -label:on-testplan -label:verified -label:*duplicate" + "value": "$REPOS $MILESTONE is:issue is:closed reason:completed label:feature-request -label:verification-needed -label:on-testplan -label:verified -label:*duplicate" }, { "kind": 1, @@ -97,7 +97,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE is:issue is:closed label:verification-needed -label:verified" + "value": "$REPOS $MILESTONE is:issue is:closed reason:completed label:verification-needed -label:verified" }, { "kind": 1, @@ -112,7 +112,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE is:issue is:closed sort:updated-asc label:bug -label:verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -label:z-author-verified -label:unreleased" + "value": "$REPOS $MILESTONE is:issue is:closed reason:completed sort:updated-asc label:bug -label:verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -label:z-author-verified -label:unreleased" }, { "kind": 1, @@ -122,7 +122,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE is:issue is:closed sort:updated-asc label:bug -label:verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -label:z-author-verified label:unreleased" + "value": "$REPOS $MILESTONE is:issue is:closed reason:completed sort:updated-asc label:bug -label:verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -label:z-author-verified label:unreleased" }, { "kind": 1, diff --git a/.vscode/notebooks/my-endgame.github-issues b/.vscode/notebooks/my-endgame.github-issues index 4fb0550ed8d..6464e61afa6 100644 --- a/.vscode/notebooks/my-endgame.github-issues +++ b/.vscode/notebooks/my-endgame.github-issues @@ -7,7 +7,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remotehub repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal\n\n$MILESTONE=milestone:\"September 2022\"\n\n$MINE=assignee:@me" + "value": "$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-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n\n\n$MILESTONE=milestone:\"September 2022\"\n\n$MINE=assignee:@me" }, { "kind": 1, @@ -42,7 +42,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE $MINE is:issue is:closed label:feature-request -label:verification-needed -label:on-testplan -label:verified -label:*duplicate" + "value": "$REPOS $MILESTONE $MINE is:issue is:closed reason:completed label:feature-request -label:verification-needed -label:on-testplan -label:verified -label:*duplicate" }, { "kind": 1, @@ -62,7 +62,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE $MINE is:issue is:closed label:feature-request label:verification-needed -label:verified" + "value": "$REPOS $MILESTONE $MINE is:issue is:closed reason:completed label:feature-request label:verification-needed -label:verified" }, { "kind": 1, @@ -87,7 +87,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE -$MINE is:issue is:closed -assignee:@me -label:verified -label:z-author-verified label:feature-request label:verification-needed" + "value": "$REPOS $MILESTONE -$MINE is:issue is:closed reason:completed -assignee:@me -label:verified -label:z-author-verified label:feature-request label:verification-needed -label:verification-steps-needed -label:unreleased" }, { "kind": 1, @@ -147,7 +147,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE -$MINE is:issue is:closed author:@me sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:triage-needed -label:verification-found" + "value": "$REPOS $MILESTONE -$MINE is:issue is:closed reason:completed author:@me sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:triage-needed -label:verification-found" }, { "kind": 1, @@ -157,7 +157,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE -$MINE is:issue is:closed sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:andreamah -author:bamurtaugh -author:bpasero -author:chrisdias -author:chrmarti -author:Chuxel -author:claudiaregio -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:DonJayamanne -author:egamma -author:fiveisprime -author:gregvanl -author:hediet -author:IanMatthewHuff -author:isidorn -author:joaomoreno -author:joyceerhl -author:jrieken -author:karrtikr -author:kieferrm -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:roblourens -author:rzhao271 -author:sandy081 -author:sbatten -author:stevencl -author:tanhakabir -author:TylerLeonhardt -author:Tyriar -author:weinand -author:amunger" + "value": "$REPOS $MILESTONE -$MINE is:issue is:closed reason:completed sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:andreamah -author:bamurtaugh -author:bpasero -author:chrisdias -author:chrmarti -author:Chuxel -author:claudiaregio -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:DonJayamanne -author:egamma -author:fiveisprime -author:gregvanl -author:hediet -author:IanMatthewHuff -author:isidorn -author:joaomoreno -author:joyceerhl -author:jrieken -author:karrtikr -author:kieferrm -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:roblourens -author:rzhao271 -author:sandy081 -author:sbatten -author:stevencl -author:tanhakabir -author:TylerLeonhardt -author:Tyriar -author:weinand -author:amunger" }, { "kind": 1, @@ -167,7 +167,7 @@ { "kind": 2, "language": "github-issues", - "value": "$REPOS $MILESTONE -$MINE is:issue is:closed -author:@me sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found" + "value": "$REPOS $MILESTONE -$MINE is:issue is:closed reason:completed -author:@me sort:updated-asc label:bug -label:unreleased -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found" }, { "kind": 1, @@ -177,6 +177,6 @@ { "kind": 2, "language": "github-issues", - "value": "repo:microsoft/vscode $MILESTONE $MINE is:issue is:closed label:feature-request -label:on-release-notes" + "value": "repo:microsoft/vscode $MILESTONE $MINE is:issue is:closed reason:completed label:feature-request -label:on-release-notes" } ] \ No newline at end of file diff --git a/.vscode/notebooks/my-work.github-issues b/.vscode/notebooks/my-work.github-issues index 4562f07797d..69d50e05965 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\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\n\n// current milestone name\n$milestone=milestone:\"September 2022\"" + "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-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n\n\n// current milestone name\n$milestone=milestone:\"October 2022\"" }, { "kind": 1, diff --git a/.vscode/notebooks/verification.github-issues b/.vscode/notebooks/verification.github-issues index 7015a401be5..5c6354a4e72 100644 --- a/.vscode/notebooks/verification.github-issues +++ b/.vscode/notebooks/verification.github-issues @@ -2,7 +2,7 @@ { "kind": 1, "language": "markdown", - "value": "### Bug Verification Queries\n\nBefore shipping we want to verify _all_ bugs. That means when a bug is fixed we check that the fix actually works. It's always best to start with bugs that you have filed and the proceed with bugs that have been filed from users outside the development team. " + "value": "### Bug Verification Queries\r\n\r\nBefore shipping we want to verify _all_ bugs. That means when a bug is fixed we check that the fix actually works. It's always best to start with bugs that you have filed and the proceed with bugs that have been filed from users outside the development team. " }, { "kind": 1, @@ -12,7 +12,7 @@ { "kind": 2, "language": "github-issues", - "value": "$repos=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev 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-emmet-helper repo:microsoft/vscode-jupyter repo:microsoft/vscode-python\n$milestone=milestone:\"May 2022\"" + "value": "$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-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n\n$milestone=milestone:\"May 2022\"" }, { "kind": 1, @@ -22,7 +22,7 @@ { "kind": 2, "language": "github-issues", - "value": "$repos $milestone is:closed -assignee:@me label:bug -label:verified -label:*duplicate author:@me" + "value": "$repos $milestone is:closed reason:completed -assignee:@me label:bug -label:verified -label:*duplicate author:@me" }, { "kind": 1, @@ -32,7 +32,7 @@ { "kind": 2, "language": "github-issues", - "value": "$repos $milestone is:closed -assignee:@me label:bug -label:verified -label:*duplicate -author:@me -assignee:@me label:bug -label:verified -author:@me -author:aeschli -author:alexdima -author:alexr00 -author:bpasero -author:chrisdias -author:chrmarti -author:connor4312 -author:dbaeumer -author:deepak1556 -author:eamodio -author:egamma -author:gregvanl -author:isidorn -author:JacksonKearl -author:joaomoreno -author:jrieken -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:RMacfarlane -author:roblourens -author:sana-ajani -author:sandy081 -author:sbatten -author:Tyriar -author:weinand -author:rzhao271 -author:kieferrm -author:TylerLeonhardt -author:bamurtaugh -author:hediet -author:joyceerhl -author:rchiodo -author:IanMatthewHuff" + "value": "$repos $milestone is:closed reason:completed -assignee:@me label:bug -label:verified -label:*duplicate -author:@me -assignee:@me label:bug -label:verified -author:@me -author:aeschli -author:alexdima -author:alexr00 -author:bpasero -author:chrisdias -author:chrmarti -author:connor4312 -author:dbaeumer -author:deepak1556 -author:eamodio -author:egamma -author:gregvanl -author:isidorn -author:JacksonKearl -author:joaomoreno -author:jrieken -author:lramos15 -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:rebornix -author:RMacfarlane -author:roblourens -author:sana-ajani -author:sandy081 -author:sbatten -author:Tyriar -author:weinand -author:rzhao271 -author:kieferrm -author:TylerLeonhardt -author:bamurtaugh -author:hediet -author:joyceerhl -author:rchiodo -author:IanMatthewHuff" }, { "kind": 1, @@ -42,6 +42,6 @@ { "kind": 2, "language": "github-issues", - "value": "$repos $milestone is:closed -assignee:@me label:bug -label:verified -label:*duplicate" + "value": "$repos $milestone is:closed reason:completed -assignee:@me label:bug -label:verified -label:*duplicate" } ] \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 33056829dde..98692309488 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -53,7 +53,7 @@ "fileMatch": [ "cgmanifest.json" ], - "url": "./.vscode/cgmanifest.schema.json" + "url": "https://json.schemastore.org/component-detection-manifest.json", }, { "fileMatch": [ @@ -65,11 +65,12 @@ "git.ignoreLimitWarning": true, "git.branchProtection": [ "main", + "distro", "release/*" ], "git.branchProtectionPrompt": "alwaysCommitToNewBranch", "git.branchRandomName.enable": true, - "git.fetchBeforeCheckout": true, + "git.pullBeforeCheckout": true, "git.mergeEditor": true, "remote.extensionKind": { "msjsdiag.debugger-for-chrome": "workspace" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 885f825cc2e..59b1893c293 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -203,6 +203,28 @@ "reveal": "never" } }, + { + "type": "shell", + "command": "./scripts/code-web.sh", + "windows": { + "command": ".\\scripts\\code-web.bat" + }, + "args": ["--port", "8080", "--browser", "none"], + "label": "Run code web", + "isBackground": true, + "problemMatcher": { + "pattern": { + "regexp": "" + }, + "background": { + "beginsPattern": ".*node .*", + "endsPattern": "Listening on .*" + } + }, + "presentation": { + "reveal": "never" + } + }, { "type": "npm", "script": "eslint", diff --git a/README.md b/README.md index eb76f98421e..0c7c6236c42 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ VS Code includes a set of built-in extensions located in the [extensions](extens ## Development Container -This repository includes a Visual Studio Code Remote - Containers / GitHub Codespaces development container. +This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container. -- For [Remote - Containers](https://aka.ms/vscode-remote/download/containers), use the **Remote-Containers: Clone Repository in Container Volume...** command which creates a Docker volume for better disk I/O on macOS and Windows. - - If you already have VS Code and Docker installed, you can also click [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. This will cause VS Code to automatically install the Remote - Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. +- For [Dev Containers](https://aka.ms/vscode-remote/download/containers), use the **Dev Containers: Clone Repository in Container Volume...** command which creates a Docker volume for better disk I/O on macOS and Windows. + - If you already have VS Code and Docker installed, you can also click [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. - For Codespaces, install the [GitHub Codespaces](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) extension in VS Code, and use the **Codespaces: Create New Codespace** command. Docker / the Codespace should have at least **4 Cores and 6 GB of RAM (8 GB recommended)** to run full build. See the [development container README](.devcontainer/README.md) for more information. diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 5c36a652b4b..9326900f1b4 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -1,86 +1,14 @@ -microsoft-vscode +NOTICES -THIRD-PARTY SOFTWARE NOTICES AND INFORMATION -Do Not Translate or Localize - -This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise. - -1. atom/language-clojure version 0.22.8 (https://github.com/atom/language-clojure) -2. atom/language-coffee-script version 0.49.3 (https://github.com/atom/language-coffee-script) -3. atom/language-css version 0.45.1 (https://github.com/atom/language-css) -4. atom/language-java version 0.32.1 (https://github.com/atom/language-java) -5. atom/language-sass version 0.62.1 (https://github.com/atom/language-sass) -6. atom/language-shellscript version 0.28.2 (https://github.com/atom/language-shellscript) -7. atom/language-xml version 0.35.2 (https://github.com/atom/language-xml) -8. better-go-syntax version 1.0.0 (https://github.com/jeff-hykin/better-go-syntax/ ) -9. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes) -10. daaain/Handlebars version 1.8.0 (https://github.com/daaain/Handlebars) -11. dart-lang/dart-syntax-highlight (https://github.com/dart-lang/dart-syntax-highlight) -12. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle) -13. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped) -14. demyte/language-cshtml version 0.3.0 (https://github.com/demyte/language-cshtml) -15. Document Object Model version 4.0.0 (https://www.w3.org/DOM/) -16. dompurify version 2.3.1 (https://github.com/cure53/DOMPurify) -17. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage) -18. expand-abbreviation version 0.5.8 (https://github.com/emmetio/expand-abbreviation) -19. fadeevab/make.tmbundle (https://github.com/fadeevab/make.tmbundle) -20. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift) -21. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/) -22. Ikuyadeu/vscode-R version 2.3.8 (https://github.com/Ikuyadeu/vscode-R) -23. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site) -24. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar) -25. James-Yu/LaTeX-Workshop version 8.19.1 (https://github.com/James-Yu/LaTeX-Workshop) -26. jeff-hykin/better-c-syntax version 1.13.2 (https://github.com/jeff-hykin/better-c-syntax) -27. jeff-hykin/better-cpp-syntax version 1.15.18 (https://github.com/jeff-hykin/better-cpp-syntax) -28. jeff-hykin/better-objc-syntax version 0.2.0 (https://github.com/jeff-hykin/better-objc-syntax) -29. jeff-hykin/better-objcpp-syntax version 0.1.0 (https://github.com/jeff-hykin/better-objcpp-syntax) -30. jlelong/vscode-latex-basics version 1.3.0 (https://github.com/jlelong/vscode-latex-basics) -31. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) -32. JuliaEditorSupport/atom-language-julia version 0.22.1 (https://github.com/JuliaEditorSupport/atom-language-julia) -33. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) -34. language-docker (https://github.com/moby/moby) -35. language-less version 0.34.2 (https://github.com/atom/language-less) -36. language-php version 0.48.1 (https://github.com/atom/language-php) -37. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython) -38. marked version 4.0.16 (https://github.com/markedjs/marked) -39. mdn-data version 1.1.12 (https://github.com/mdn/data) -40. microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/microsoft/TypeScript-TmLanguage) -41. microsoft/vscode-JSON.tmLanguage (https://github.com/microsoft/vscode-JSON.tmLanguage) -42. microsoft/vscode-markdown-tm-grammar version 1.0.0 (https://github.com/microsoft/vscode-markdown-tm-grammar) -43. microsoft/vscode-mssql version 1.16.0 (https://github.com/microsoft/vscode-mssql) -44. mmims/language-batchfile version 0.7.6 (https://github.com/mmims/language-batchfile) -45. NVIDIA/cuda-cpp-grammar (https://github.com/NVIDIA/cuda-cpp-grammar) -46. PowerShell/EditorSyntax version 1.0.0 (https://github.com/PowerShell/EditorSyntax) -47. rust-syntax version 0.5.0 (https://github.com/dustypomerleau/rust-syntax) -48. semver version 5.5.0 (https://github.com/npm/node-semver) -49. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui) -50. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage) -51. sumneko/lua.tmbundle version 1.0.0 (https://github.com/sumneko/lua.tmbundle) -52. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle) -53. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle) -54. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle) -55. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle) -56. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle) -57. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle) -58. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle) -59. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle) -60. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle) -61. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle) -62. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle) -63. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle) -64. trond-snekvik/vscode-rst version 1.5.1 (https://github.com/trond-snekvik/vscode-rst) -65. TypeScript-TmLanguage version 0.1.8 (https://github.com/microsoft/TypeScript-TmLanguage) -66. TypeScript-TmLanguage version 1.0.0 (https://github.com/microsoft/TypeScript-TmLanguage) -67. Unicode version 12.0.0 (https://home.unicode.org/) -68. vscode-codicons version 0.0.14 (https://github.com/microsoft/vscode-codicons) -69. vscode-logfile-highlighter version 2.15.0 (https://github.com/emilast/vscode-logfile-highlighter) -70. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) -71. vscode-win32-app-container-tokens (https://github.com/microsoft/vscode-win32-app-container-tokens) -72. Web Background Synchronization (https://github.com/WICG/background-sync) +This repository incorporates material as listed below or described in the code. -%% atom/language-clojure NOTICES AND INFORMATION BEGIN HERE -========================================= + +--------------------------------------------------------- + +atom/language-clojure 0.22.8 - MIT +https://github.com/atom/language-clojure + Copyright (c) 2014 GitHub Inc. Permission is hereby granted, free of charge, to any person obtaining @@ -128,11 +56,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF atom/language-clojure NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +atom/language-coffee-script 0.49.3 - MIT +https://github.com/atom/language-coffee-script -%% atom/language-coffee-script NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 GitHub Inc. @@ -183,11 +113,13 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF atom/language-coffee-script NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +atom/language-css 0.45.1 - GitHub License +https://github.com/atom/language-css -%% atom/language-css NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) 2014 GitHub Inc. Permission is hereby granted, free of charge, to any person obtaining @@ -219,11 +151,13 @@ Permission to copy, use, modify, sell and distribute this software is granted. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose. -========================================= -END OF atom/language-css NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +atom/language-java 0.32.1 - MIT +https://github.com/atom/language-java -%% atom/language-java NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 GitHub Inc. @@ -256,11 +190,13 @@ Permission to copy, use, modify, sell and distribute this software is granted. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose. -========================================= -END OF atom/language-java NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +atom/language-sass 0.61.4 - MIT +https://github.com/atom/language-sass -%% atom/language-sass NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 GitHub Inc. @@ -309,11 +245,13 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF atom/language-sass NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +atom/language-shellscript 0.28.2 - MIT +https://github.com/atom/language-shellscript -%% atom/language-shellscript NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 GitHub Inc. @@ -346,11 +284,13 @@ Permission to copy, use, modify, sell and distribute this software is granted. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose. -========================================= -END OF atom/language-shellscript NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +atom/language-xml 0.35.2 - MIT +https://github.com/atom/language-xml -%% atom/language-xml NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 GitHub Inc. @@ -383,11 +323,13 @@ Permission to copy, use, modify, sell and distribute this software is granted. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose. -========================================= -END OF atom/language-xml NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +better-go-syntax 1.0.0 - MIT +https://github.com/jeff-hykin/better-go-syntax/ -%% better-go-syntax NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2019 Jeff Hykin @@ -409,11 +351,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF better-go-syntax NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +Colorsublime-Themes 0.1.0 +https://github.com/Colorsublime/Colorsublime-Themes -%% Colorsublime-Themes NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) 2015 Colorsublime.com Permission is hereby granted, free of charge, to any person obtaining a copy @@ -433,11 +377,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF Colorsublime-Themes NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +daaain/Handlebars 1.8.0 - MIT +https://github.com/daaain/Handlebars -%% daaain/Handlebars NOTICES AND INFORMATION BEGIN HERE -========================================= -- Credits Adapted from the great sublime-text-handlebars package by Nicholas Westlake. @@ -455,11 +401,13 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF daaain/Handlebars NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +dart-lang/dart-syntax-highlight 0.0.0 - BSD +https://github.com/dart-lang/dart-syntax-highlight -%% dart-lang/dart-syntax-highlight NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright 2020, the Dart project authors. Redistribution and use in source and binary forms, with or without @@ -487,11 +435,13 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -========================================= -END OF dart-lang/dart-syntax-highlight NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +davidrios/pug-tmbundle 0.0.0 - MIT +https://github.com/davidrios/pug-tmbundle -%% davidrios/pug-tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2016 David Rios @@ -512,11 +462,13 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF davidrios/pug-tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +definitelytyped - MIT +https://github.com/DefinitelyTyped/DefinitelyTyped -%% definitelytyped NOTICES AND INFORMATION BEGIN HERE -========================================= This project is licensed under the MIT license. Copyrights are respective of each contributor listed at the beginning of each definition file. @@ -525,11 +477,13 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF definitelytyped NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +demyte/language-cshtml 0.3.0 - MIT +https://github.com/demyte/language-cshtml -%% demyte/language-cshtml NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 James Summerton @@ -552,11 +506,13 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF demyte/language-cshtml NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +Document Object Model 4.0.0 - W3C License +https://www.w3.org/DOM/ -%% Document Object Model NOTICES AND INFORMATION BEGIN HERE -========================================= W3C License This work is being provided by the copyright holders under the following license. By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. @@ -573,11 +529,13 @@ FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT W COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders. -========================================= -END OF Document Object Model NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +dompurify 2.3.1 - Apache 2.0 +https://github.com/cure53/DOMPurify -%% dompurify NOTICES AND INFORMATION BEGIN HERE -========================================= DOMPurify Copyright 2015 Mario Heiderich @@ -955,11 +913,13 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -========================================= -END OF dompurify NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +dotnet/csharp-tmLanguage 0.1.0 - MIT +https://github.com/dotnet/csharp-tmLanguage -%% dotnet/csharp-tmLanguage NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2016 .NET Foundation @@ -981,11 +941,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF dotnet/csharp-tmLanguage NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +expand-abbreviation 0.5.8 - MIT +https://github.com/emmetio/expand-abbreviation -%% expand-abbreviation NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2017 Emmet.io @@ -1007,11 +969,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF expand-abbreviation NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +fadeevab/make.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/fadeevab/make.tmbundle -%% fadeevab/make.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-make.tmbundle project authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -1025,11 +989,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF fadeevab/make.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +freebroccolo/atom-language-swift 0.0.0 - MIT +https://github.com/freebroccolo/atom-language-swift -%% freebroccolo/atom-language-swift NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 Darin Morrison @@ -1050,11 +1016,13 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF freebroccolo/atom-language-swift NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +HTML 5.1 W3C Working Draft 08 October 2015 - W3C Document License +http://www.w3.org/TR/2015/WD-html51-20151008/ -%% HTML 5.1 W3C Working Draft NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang). This software or document includes material copied from or derived from HTML 5.1 W3C Working Draft (http://www.w3.org/TR/2015/WD-html51-20151008/.) @@ -1068,11 +1036,13 @@ DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF. The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to this document or its contents without specific, written prior permission. Title to copyright in this document will at all times remain with copyright holders. -========================================= -END OF HTML 5.1 W3C Working Draft NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +Ikuyadeu/vscode-R 2.3.8 - MIT +https://github.com/Ikuyadeu/vscode-R -%% Ikuyadeu/vscode-R NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2022 REditorSupport @@ -1094,11 +1064,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF Ikuyadeu/vscode-R NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +Ionic documentation 1.2.4 - Apache2 +https://github.com/ionic-team/ionic-site -%% Ionic documentation NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright Drifty Co. http://drifty.com/. Apache License @@ -1156,11 +1128,13 @@ If the Work includes a "NOTICE" text file as part of its distribution, then any 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS -========================================= -END OF Ionic documentation NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +ionide/ionide-fsgrammar 0.0.0 - MIT +https://github.com/ionide/ionide-fsgrammar -%% ionide/ionide-fsgrammar NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2015 Krzysztof Cieslak @@ -1182,11 +1156,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF ionide/ionide-fsgrammar NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +James-Yu/LaTeX-Workshop 8.19.1 - MIT +https://github.com/James-Yu/LaTeX-Workshop -%% James-Yu/LaTeX-Workshop NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2016 James Yu @@ -1208,11 +1184,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF James-Yu/LaTeX-Workshop NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +jeff-hykin/better-c-syntax 1.13.2 - MIT +https://github.com/jeff-hykin/better-c-syntax -%% jeff-hykin/better-c-syntax NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2019 Jeff Hykin @@ -1234,11 +1212,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF jeff-hykin/better-c-syntax NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +jeff-hykin/better-cpp-syntax 1.15.18 - MIT +https://github.com/jeff-hykin/better-cpp-syntax -%% jeff-hykin/better-cpp-syntax NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2019 Jeff Hykin @@ -1260,11 +1240,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF jeff-hykin/better-cpp-syntax NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +jeff-hykin/better-objc-syntax 0.2.0 - MIT +https://github.com/jeff-hykin/better-objc-syntax -%% jeff-hykin/better-objc-syntax NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2019 Jeff Hykin @@ -1286,11 +1268,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF jeff-hykin/better-objc-syntax NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +jeff-hykin/better-objcpp-syntax 0.1.0 - MIT +https://github.com/jeff-hykin/better-objcpp-syntax -%% jeff-hykin/better-objcpp-syntax NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2019 Jeff Hykin @@ -1312,11 +1296,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF jeff-hykin/better-objcpp-syntax NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +jlelong/vscode-latex-basics 1.3.0 - MIT +https://github.com/jlelong/vscode-latex-basics -%% jlelong/vscode-latex-basics NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) vscode-latex-basics authors If not otherwise specified (see below), files in this repository fall under the MIT License @@ -1335,11 +1321,13 @@ included in VSCode and falls under the license described in markdown-latex-combi The file syntaxes/cpp-grammar-bailout.tmLanguage.json is generated from https://github.com/jeff-hykin/better-cpp-syntax and falls under the license described in cpp-bailout-license.txt. -========================================= -END OF jlelong/vscode-latex-basics NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +js-beautify 1.6.8 - MIT +https://github.com/beautify-web/js-beautify -%% js-beautify NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. @@ -1349,11 +1337,13 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF js-beautify NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +JuliaEditorSupport/atom-language-julia 0.22.1 - MIT +https://github.com/JuliaEditorSupport/atom-language-julia -%% JuliaEditorSupport/atom-language-julia NOTICES AND INFORMATION BEGIN HERE -========================================= The atom-language-julia package is licensed under the MIT "Expat" License: > Copyright (c) 2015 @@ -1376,11 +1366,13 @@ The atom-language-julia package is licensed under the MIT "Expat" License: > CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, > TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE > SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF JuliaEditorSupport/atom-language-julia NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +Jxck/assert 1.0.0 - MIT +https://github.com/Jxck/assert -%% Jxck/assert NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2011 Jxck @@ -1404,11 +1396,13 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF Jxck/assert NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +language-docker 0.0.0 - Apache2 +https://github.com/moby/moby -%% language-docker NOTICES AND INFORMATION BEGIN HERE -========================================= Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ @@ -1599,11 +1593,13 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -========================================= -END OF language-docker NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +language-less 0.34.2 - MIT +https://github.com/atom/language-less -%% language-less NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 GitHub Inc. @@ -1651,11 +1647,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF language-less NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +language-php 0.48.1 - MIT +https://github.com/atom/language-php -%% language-php NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2014 GitHub Inc. @@ -1688,11 +1686,13 @@ Permission to copy, use, modify, sell and distribute this software is granted. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose. -========================================= -END OF language-php NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +MagicStack/MagicPython 1.1.1 - MIT +https://github.com/MagicStack/MagicPython -%% MagicStack/MagicPython NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License Copyright (c) 2015-present MagicStack Inc. http://magic.io @@ -1714,11 +1714,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF MagicStack/MagicPython NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +marked 4.1.0 - MIT +https://github.com/markedjs/marked -%% marked NOTICES AND INFORMATION BEGIN HERE -========================================= information ## Contribution License Agreement @@ -1763,11 +1765,13 @@ Redistribution and use in source and binary forms, with or without modification, * Neither the name "Markdown" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. -========================================= -END OF marked NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +mdn-data 1.1.12 - MPL +https://github.com/mdn/data -%% mdn-data NOTICES AND INFORMATION BEGIN HERE -========================================= Mozilla Public License Version 2.0 Copyright (c) 2018 Mozilla Corporation @@ -2144,11 +2148,13 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -========================================= -END OF mdn-data NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +microsoft/TypeScript-TmLanguage 0.0.1 - MIT +https://github.com/microsoft/TypeScript-TmLanguage -%% microsoft/TypeScript-TmLanguage NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) Microsoft Corporation All rights reserved. @@ -2171,11 +2177,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF microsoft/TypeScript-TmLanguage NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +microsoft/vscode-JSON.tmLanguage 0.0.0 - MIT +https://github.com/microsoft/vscode-JSON.tmLanguage -%% microsoft/vscode-JSON.tmLanguage NOTICES AND INFORMATION BEGIN HERE -========================================= vscode-JSON.tmLanguage Copyright (c) Microsoft Corporation @@ -2195,11 +2203,13 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF microsoft/vscode-JSON.tmLanguage NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +microsoft/vscode-markdown-tm-grammar 1.0.0 - MIT +https://github.com/microsoft/vscode-markdown-tm-grammar -%% microsoft/vscode-markdown-tm-grammar NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) Microsoft 2018 @@ -2221,11 +2231,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF microsoft/vscode-markdown-tm-grammar NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +microsoft/vscode-mssql 1.16.0 - MIT +https://github.com/microsoft/vscode-mssql -%% microsoft/vscode-mssql NOTICES AND INFORMATION BEGIN HERE -========================================= ------------------------------------------ START OF LICENSE ----------------------------------------- vscode-mssql Copyright (c) Microsoft Corporation @@ -2236,11 +2248,13 @@ Copyright (c) 2016 Microsoft The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------- END OF LICENSE ----------------------------------------- -========================================= -END OF microsoft/vscode-mssql NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +mmims/language-batchfile 0.7.6 - MIT +https://github.com/mmims/language-batchfile -%% mmims/language-batchfile NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2021 Michael Mims @@ -2262,11 +2276,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF mmims/language-batchfile NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +NVIDIA/cuda-cpp-grammar 0.0.0 - MIT +https://github.com/NVIDIA/cuda-cpp-grammar -%% NVIDIA/cuda-cpp-grammar NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright 2021 NVIDIA Corporation @@ -2276,11 +2292,13 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF NVIDIA/cuda-cpp-grammar NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +PowerShell/EditorSyntax 1.0.0 - MIT +https://github.com/PowerShell/EditorSyntax -%% PowerShell/EditorSyntax NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) Microsoft Corporation All rights reserved. @@ -2304,11 +2322,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF PowerShell/EditorSyntax NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +rust-syntax 0.5.0 - MIT +https://github.com/dustypomerleau/rust-syntax -%% rust-syntax NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2020 Dustin Pomerleau @@ -2330,11 +2350,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF rust-syntax NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +semver 5.5.0 - The ISC License +https://github.com/npm/node-semver -%% semver NOTICES AND INFORMATION BEGIN HERE -========================================= The ISC License Copyright (c) Isaac Z. Schlueter and Contributors @@ -2350,11 +2372,13 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -========================================= -END OF semver NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +seti-ui 0.1.0 +https://github.com/jesseweed/seti-ui -%% seti-ui NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) 2014 Jesse Weed Permission is hereby granted, free of charge, to any person obtaining @@ -2375,11 +2399,13 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF seti-ui NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +shaders-tmLanguage 0.1.0 - MIT +https://github.com/tgjones/shaders-tmLanguage -%% shaders-tmLanguage NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) 2017 Tim Jones @@ -2401,11 +2427,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF shaders-tmLanguage NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +sumneko/lua.tmbundle 1.0.0 - TextMate Bundle License +https://github.com/sumneko/lua.tmbundle -%% sumneko/lua.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) sumneko-lua.tmbundle project authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2419,11 +2447,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF sumneko/lua.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/asp.vb.net.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/asp.vb.net.tmbundle -%% textmate/asp.vb.net.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-asp.vb.net.tmbundle project authors If not otherwise specified (see below), files in this folder fall under the following license: @@ -2437,11 +2467,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/asp.vb.net.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/c.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/c.tmbundle -%% textmate/c.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-c.tmbundle authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2455,11 +2487,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/c.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/diff.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/diff.tmbundle -%% textmate/diff.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-diff.tmbundle project authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2473,11 +2507,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/diff.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/git.tmbundle 0.0.0 - MIT +https://github.com/textmate/git.tmbundle -%% textmate/git.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2008 Tim Harper @@ -2500,11 +2536,13 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF textmate/git.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/groovy.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/groovy.tmbundle -%% textmate/groovy.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-groovy.tmbundle project authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2518,11 +2556,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/groovy.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/html.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/html.tmbundle -%% textmate/html.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-html.tmbundle project authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2536,11 +2576,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/html.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/ini.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/ini.tmbundle -%% textmate/ini.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-ini.tmbundle project authors If not otherwise specified (see below), files in this folder fall under the following license: @@ -2554,11 +2596,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/ini.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/javascript.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/javascript.tmbundle -%% textmate/javascript.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-javascript.tmbundle project authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2572,11 +2616,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/javascript.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/markdown.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/markdown.tmbundle -%% textmate/markdown.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) markdown.tmbundle authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2590,11 +2636,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/markdown.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/perl.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/perl.tmbundle -%% textmate/perl.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-perl.tmbundle project authors If not otherwise specified (see below), files in this repository fall under the following license: @@ -2608,11 +2656,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/perl.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/ruby.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/ruby.tmbundle -%% textmate/ruby.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) textmate-ruby.tmbundle project authors If not otherwise specified (see below), files in this folder fall under the following license: @@ -2626,11 +2676,13 @@ An exception is made for files in readable text which contain their own license or files where an accompanying file exists (in the same directory) with a "-license" suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example "tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/ruby.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +textmate/yaml.tmbundle 0.0.0 - TextMate Bundle License +https://github.com/textmate/yaml.tmbundle -%% textmate/yaml.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) 2015 FichteFoll Permission is hereby granted, free of charge, to any person obtaining a copy @@ -2649,11 +2701,13 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF textmate/yaml.tmbundle NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +trond-snekvik/vscode-rst 1.5.1 - MIT +https://github.com/trond-snekvik/vscode-rst -%% trond-snekvik/vscode-rst NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright 2021 Trond Snekvik @@ -2663,11 +2717,14 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF trond-snekvik/vscode-rst NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +TypeScript-TmLanguage 0.1.8 - MIT +TypeScript-TmLanguage 1.0.0 - MIT +https://github.com/microsoft/TypeScript-TmLanguage -%% TypeScript-TmLanguage NOTICES AND INFORMATION BEGIN HERE -========================================= Copyright (c) Microsoft Corporation All rights reserved. @@ -2690,11 +2747,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF TypeScript-TmLanguage NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +Unicode 12.0.0 - UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +https://home.unicode.org/ -%% Unicode NOTICES AND INFORMATION BEGIN HERE -========================================= Unicode Data Files include all data files under the directories https://www.unicode.org/Public/, https://www.unicode.org/reports/, https://cldr.unicode.org, https://github.com/unicode-org/icu, and @@ -2750,11 +2809,13 @@ Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder. -========================================= -END OF Unicode NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +vscode-codicons 0.0.14 - MIT and Creative Commons Attribution 4.0 +https://github.com/microsoft/vscode-codicons -%% vscode-codicons NOTICES AND INFORMATION BEGIN HERE -========================================= Attribution 4.0 International ======================================================================= @@ -3150,11 +3211,13 @@ the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at creativecommons.org. -========================================= -END OF vscode-codicons NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +vscode-logfile-highlighter 2.15.0 - MIT +https://github.com/emilast/vscode-logfile-highlighter -%% vscode-logfile-highlighter NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2015 emilast @@ -3176,11 +3239,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF vscode-logfile-highlighter NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +vscode-swift 0.0.1 - MIT +https://github.com/owensd/vscode-swift -%% vscode-swift NOTICES AND INFORMATION BEGIN HERE -========================================= The MIT License (MIT) Copyright (c) 2015 David Owens II @@ -3201,11 +3266,13 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -========================================= -END OF vscode-swift NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +vscode-win32-app-container-tokens +https://github.com/microsoft/vscode-win32-app-container-tokens -%% vscode-win32-app-container-tokens NOTICES AND INFORMATION BEGIN HERE -========================================= MIT License Copyright (c) Microsoft Corporation. @@ -3227,11 +3294,13 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -========================================= -END OF vscode-win32-app-container-tokens NOTICES AND INFORMATION +--------------------------------------------------------- + +--------------------------------------------------------- + +Web Background Synchronization - Apache2 +https://github.com/WICG/background-sync -%% Web Background Synchronization NOTICES AND INFORMATION BEGIN HERE -========================================= Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -3433,5 +3502,4 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -========================================= -END OF Web Background Synchronization NOTICES AND INFORMATION \ No newline at end of file +--------------------------------------------------------- \ No newline at end of file diff --git a/build/azure-pipelines/common/releaseBuild.js b/build/azure-pipelines/common/releaseBuild.js index 9e96781eb67..eba9b2dc8b7 100644 --- a/build/azure-pipelines/common/releaseBuild.js +++ b/build/azure-pipelines/common/releaseBuild.js @@ -28,22 +28,25 @@ async function getConfig(client, quality) { } return res.resources[0]; } -async function main() { +async function main(force) { const commit = process.env['VSCODE_DISTRO_COMMIT'] || getEnv('BUILD_SOURCEVERSION'); const quality = getEnv('VSCODE_QUALITY'); const aadCredentials = new identity_1.ClientSecretCredential(process.env['AZURE_TENANT_ID'], process.env['AZURE_CLIENT_ID'], process.env['AZURE_CLIENT_SECRET']); const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], aadCredentials }); - const config = await getConfig(client, quality); - console.log('Quality config:', config); - if (config.frozen) { - console.log(`Skipping release because quality ${quality} is frozen.`); - return; + if (!force) { + const config = await getConfig(client, quality); + console.log('Quality config:', config); + if (config.frozen) { + console.log(`Skipping release because quality ${quality} is frozen.`); + return; + } } console.log(`Releasing build ${commit}...`); const scripts = client.database('builds').container(quality).scripts; await (0, retry_1.retry)(() => scripts.storedProcedure('releaseBuild').execute('', [commit])); } -main().then(() => { +const [, , force] = process.argv; +main(force === 'true').then(() => { console.log('Build successfully released'); process.exit(0); }, err => { diff --git a/build/azure-pipelines/common/releaseBuild.ts b/build/azure-pipelines/common/releaseBuild.ts index 3b163b6b619..68476cc2952 100644 --- a/build/azure-pipelines/common/releaseBuild.ts +++ b/build/azure-pipelines/common/releaseBuild.ts @@ -41,19 +41,22 @@ async function getConfig(client: CosmosClient, quality: string): Promise return res.resources[0] as Config; } -async function main(): Promise { +async function main(force: boolean): Promise { const commit = process.env['VSCODE_DISTRO_COMMIT'] || getEnv('BUILD_SOURCEVERSION'); const quality = getEnv('VSCODE_QUALITY'); const aadCredentials = new ClientSecretCredential(process.env['AZURE_TENANT_ID']!, process.env['AZURE_CLIENT_ID']!, process.env['AZURE_CLIENT_SECRET']!); const client = new CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT']!, aadCredentials }); - const config = await getConfig(client, quality); - console.log('Quality config:', config); + if (!force) { + const config = await getConfig(client, quality); - if (config.frozen) { - console.log(`Skipping release because quality ${quality} is frozen.`); - return; + console.log('Quality config:', config); + + if (config.frozen) { + console.log(`Skipping release because quality ${quality} is frozen.`); + return; + } } console.log(`Releasing build ${commit}...`); @@ -62,7 +65,9 @@ async function main(): Promise { await retry(() => scripts.storedProcedure('releaseBuild').execute('', [commit])); } -main().then(() => { +const [, , force] = process.argv; + +main(force === 'true').then(() => { console.log('Build successfully released'); process.exit(0); }, err => { diff --git a/build/azure-pipelines/product-build-pr.yml b/build/azure-pipelines/product-build-pr.yml index b332ec7b3f8..dde81a9cf6b 100644 --- a/build/azure-pipelines/product-build-pr.yml +++ b/build/azure-pipelines/product-build-pr.yml @@ -26,10 +26,7 @@ jobs: - ${{ if ne(variables['VSCODE_CIBUILD'], true) }}: - job: Compile displayName: Compile & Hygiene - pool: - name: vscode-1es-vscode-linux-20.04 - demands: - - ImageVersionOverride -equals 40.0.0 + pool: vscode-1es-vscode-linux-20.04 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -40,10 +37,7 @@ jobs: - job: Linuxx64UnitTest displayName: Linux (Unit Tests) - pool: - name: vscode-1es-vscode-linux-20.04 - demands: - - ImageVersionOverride -equals 40.0.0 + pool: vscode-1es-vscode-linux-20.04 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -60,10 +54,7 @@ jobs: - job: Linuxx64IntegrationTest displayName: Linux (Integration Tests) - pool: - name: vscode-1es-vscode-linux-20.04 - demands: - - ImageVersionOverride -equals 40.0.0 + pool: vscode-1es-vscode-linux-20.04 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -80,10 +71,7 @@ jobs: - job: Linuxx64SmokeTest displayName: Linux (Smoke Tests) - pool: - name: vscode-1es-vscode-linux-20.04 - demands: - - ImageVersionOverride -equals 40.0.0 + pool: vscode-1es-vscode-linux-20.04 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 @@ -101,10 +89,7 @@ jobs: - ${{ if eq(variables['VSCODE_CIBUILD'], true) }}: - job: Linuxx64MaintainNodeModulesCache displayName: Linux (Maintain node_modules cache) - pool: - name: vscode-1es-vscode-linux-20.04 - demands: - - ImageVersionOverride -equals 40.0.0 + pool: vscode-1es-vscode-linux-20.04 timeoutInMinutes: 30 variables: VSCODE_ARCH: x64 diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index ff74581068b..750dd018ac0 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -749,13 +749,33 @@ stages: steps: - template: product-publish.yml + - ${{ if and(parameters.VSCODE_RELEASE, eq(parameters.VSCODE_DISTRO_REF, ' ')) }}: + - stage: ApproveRelease + dependsOn: [] # run in parallel to compile stage + pool: vscode-1es-linux + jobs: + - deployment: ApproveRelease + displayName: "Approve Release" + environment: "vscode" + variables: + skipComponentGovernanceDetection: true + strategy: + runOnce: + deploy: + steps: + - checkout: none + - ${{ if or(and(parameters.VSCODE_RELEASE, eq(parameters.VSCODE_DISTRO_REF, ' ')), and(in(parameters.VSCODE_QUALITY, 'insider', 'exploration'), eq(variables['VSCODE_SCHEDULEDBUILD'], true))) }}: - stage: Release dependsOn: - Publish + - ${{ if and(parameters.VSCODE_RELEASE, eq(parameters.VSCODE_DISTRO_REF, ' ')) }}: + - ApproveRelease pool: vscode-1es-linux jobs: - job: ReleaseBuild displayName: Release Build steps: - template: product-release.yml + parameters: + VSCODE_RELEASE: ${{ parameters.VSCODE_RELEASE }} diff --git a/build/azure-pipelines/product-publish.ps1 b/build/azure-pipelines/product-publish.ps1 index 5006ec61a30..4e47d7d6cb2 100644 --- a/build/azure-pipelines/product-publish.ps1 +++ b/build/azure-pipelines/product-publish.ps1 @@ -62,12 +62,15 @@ do { if($set.Add($artifactName)) { Write-Host "Processing artifact: '$artifactName. Downloading from: $($_.resource.downloadUrl)" + $extractPath = "$env:AGENT_TEMPDIRECTORY/$artifactName.zip" try { - Invoke-RestMethod $_.resource.downloadUrl -OutFile "$env:AGENT_TEMPDIRECTORY/$artifactName.zip" -Headers @{ + Invoke-RestMethod $_.resource.downloadUrl -OutFile $extractPath -Headers @{ Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" - } -MaximumRetryCount 5 -RetryIntervalSec 1 | Out-Null + } -MaximumRetryCount 5 -RetryIntervalSec 1 -TimeoutSec 300 | Out-Null - Expand-Archive -Path "$env:AGENT_TEMPDIRECTORY/$artifactName.zip" -DestinationPath $env:AGENT_TEMPDIRECTORY | Out-Null + Write-Host "Extracting artifact: '$extractPath'" + + Expand-Archive -Path $extractPath -DestinationPath $env:AGENT_TEMPDIRECTORY | Out-Null } catch { Write-Warning $_ $set.Remove($artifactName) | Out-Null @@ -76,6 +79,13 @@ do { $null,$product,$os,$arch,$type = $artifactName -split '_' $asset = Get-ChildItem -rec "$env:AGENT_TEMPDIRECTORY/$artifactName" + + if ($asset.Size -ne $_.resource.properties.artifactsize) { + Write-Warning "Artifact size mismatch for '$artifactName'. Expected: $($_.resource.properties.artifactsize). Actual: $($asset.Size)" + $set.Remove($artifactName) | Out-Null + continue + } + Write-Host "Processing artifact with the following values:" # turning in into an object just to log nicely @{ diff --git a/build/azure-pipelines/product-release.yml b/build/azure-pipelines/product-release.yml index a1086945595..8be900a9b41 100644 --- a/build/azure-pipelines/product-release.yml +++ b/build/azure-pipelines/product-release.yml @@ -1,3 +1,7 @@ +parameters: + - name: VSCODE_RELEASE + type: boolean + steps: - task: NodeTool@0 inputs: @@ -20,4 +24,4 @@ steps: AZURE_TENANT_ID="$(AZURE_TENANT_ID)" \ AZURE_CLIENT_ID="$(AZURE_CLIENT_ID)" \ AZURE_CLIENT_SECRET="$(AZURE_CLIENT_SECRET)" \ - node build/azure-pipelines/common/releaseBuild.js + node build/azure-pipelines/common/releaseBuild.js ${{ parameters.VSCODE_RELEASE }} diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 4023b3860e9..07033b9c960 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -46,7 +46,6 @@ const compilations = [ 'gulp/tsconfig.json', 'html-language-features/client/tsconfig.json', 'html-language-features/server/tsconfig.json', - 'image-preview/tsconfig.json', 'ipynb/tsconfig.json', 'jake/tsconfig.json', 'json-language-features/client/tsconfig.json', @@ -55,6 +54,7 @@ const compilations = [ 'markdown-language-features/server/tsconfig.json', 'markdown-language-features/tsconfig.json', 'markdown-math/tsconfig.json', + 'media-preview/tsconfig.json', 'merge-conflict/tsconfig.json', 'microsoft-authentication/tsconfig.json', 'npm/tsconfig.json', diff --git a/build/npm/dirs.js b/build/npm/dirs.js index 6e5ba3ca9a4..f820f39e222 100644 --- a/build/npm/dirs.js +++ b/build/npm/dirs.js @@ -23,7 +23,6 @@ exports.dirs = [ 'extensions/gulp', 'extensions/html-language-features', 'extensions/html-language-features/server', - 'extensions/image-preview', 'extensions/ipynb', 'extensions/jake', 'extensions/json-language-features', @@ -31,6 +30,7 @@ exports.dirs = [ 'extensions/markdown-language-features/server', 'extensions/markdown-language-features', 'extensions/markdown-math', + 'extensions/media-preview', 'extensions/merge-conflict', 'extensions/microsoft-authentication', 'extensions/notebook-renderers', diff --git a/build/npm/preinstall.js b/build/npm/preinstall.js index a839653f75c..afefc404267 100644 --- a/build/npm/preinstall.js +++ b/build/npm/preinstall.js @@ -21,12 +21,19 @@ const path = require('path'); const fs = require('fs'); const cp = require('child_process'); const yarnVersion = cp.execSync('yarn -v', { encoding: 'utf8' }).trim(); -const parsedYarnVersion = /^(\d+)\.(\d+)\./.exec(yarnVersion); +const parsedYarnVersion = /^(\d+)\.(\d+)\.(\d+)/.exec(yarnVersion); const majorYarnVersion = parseInt(parsedYarnVersion[1]); const minorYarnVersion = parseInt(parsedYarnVersion[2]); +const patchYarnVersion = parseInt(parsedYarnVersion[3]); -if (majorYarnVersion < 1 || minorYarnVersion < 10) { - console.error('\033[1;31m*** Please use yarn >=1.10.1.\033[0;0m'); +if ( + majorYarnVersion < 1 || + majorYarnVersion === 1 && ( + minorYarnVersion < 10 || (minorYarnVersion === 10 && patchYarnVersion < 1) + ) || + majorYarnVersion >= 2 +) { + console.error('\033[1;31m*** Please use yarn >=1.10.1 and <2.\033[0;0m'); err = true; } diff --git a/build/win32/Cargo.toml b/build/win32/Cargo.toml new file mode 100644 index 00000000000..decae65f9e6 --- /dev/null +++ b/build/win32/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "inno_updater" +version = "0.9.0" +authors = ["Microsoft "] +build = "build.rs" + +[dependencies] +byteorder = "1" +crc = "^1.0.0" +slog = "2.1.1" +slog-async = "2.2.0" +slog-term = "2.3.0" + +[target.'cfg(windows)'.dependencies] +winapi = { version = "^0.3.9", features = ["winuser", "libloaderapi", "commctrl", "processthreadsapi", "tlhelp32", "handleapi", "psapi", "errhandlingapi", "winbase", "shellapi"] } + +[profile.release] +lto = true +panic = 'abort' diff --git a/cglicenses.json b/cglicenses.json index f80a3fac7fc..0ce05392959 100644 --- a/cglicenses.json +++ b/cglicenses.json @@ -220,5 +220,104 @@ "", "THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." ] + }, + { + // Reason: The substack org has been deleted on GH + "name": "concat-map", + "fullLicenseText": [ + "This software is released under the MIT license:", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy of", + "this software and associated documentation files (the \"Software\"), to deal in", + "the Software without restriction, including without limitation the rights to", + "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of", + "the Software, and to permit persons to whom the Software is furnished to do so,", + "subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in all", + "copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS", + "FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR", + "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER", + "IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN", + "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + ] + }, + { + // Reason: The substack org has been deleted on GH + "name": "github-from-package", + "fullLicenseText": [ + "This software is released under the MIT license:", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy of", + "this software and associated documentation files (the \"Software\"), to deal in", + "the Software without restriction, including without limitation the rights to", + "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of", + "the Software, and to permit persons to whom the Software is furnished to do so,", + "subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in all", + "copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS", + "FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR", + "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER", + "IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN", + "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + ] + }, + { + // Reason: The substack org has been deleted on GH + "name": "minimist", + "fullLicenseText": [ + "This software is released under the MIT license:", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy of", + "this software and associated documentation files (the \"Software\"), to deal in", + "the Software without restriction, including without limitation the rights to", + "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of", + "the Software, and to permit persons to whom the Software is furnished to do so,", + "subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in all", + "copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS", + "FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR", + "COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER", + "IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN", + "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + ] + }, + { + // Reason: The substack org has been deleted on GH + "name": "mkdirp", + "fullLicenseText": [ + "Copyright 2010 James Halliday (mail@substack.net)", + "", + "This project is free software released under the MIT/X11 license:", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and associated documentation files (the \"Software\"), to deal", + "in the Software without restriction, including without limitation the rights", + "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + "copies of the Software, and to permit persons to whom the Software is", + "furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in", + "all copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN", + "THE SOFTWARE." + ] } ] diff --git a/cli/CONTRIBUTING.md b/cli/CONTRIBUTING.md index 88effa62a32..d119f1ac98a 100644 --- a/cli/CONTRIBUTING.md +++ b/cli/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Setup 0. Clone, and then run `git submodule update --init --recursive` -1. Get the extensions: [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer) and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) +1. Get the extensions: [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) 2. Ensure your workspace is set to the `launcher` folder being the root. ## Building the CLI on Windows diff --git a/extensions/configuration-editing/package.json b/extensions/configuration-editing/package.json index a124a0432e6..37a5a9137bb 100644 --- a/extensions/configuration-editing/package.json +++ b/extensions/configuration-editing/package.json @@ -21,7 +21,7 @@ }, "dependencies": { "jsonc-parser": "^2.2.1", - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "capabilities": { "virtualWorkspaces": true, @@ -71,6 +71,10 @@ "fileMatch": "%APP_SETTINGS_HOME%/keybindings.json", "url": "vscode://schemas/keybindings" }, + { + "fileMatch": "%APP_SETTINGS_HOME%/profiles/*/keybindings.json", + "url": "vscode://schemas/keybindings" + }, { "fileMatch": "vscode://defaultsettings/*.json", "url": "vscode://schemas/settings/default" @@ -119,6 +123,10 @@ "fileMatch": "%APP_SETTINGS_HOME%/snippets/*.json", "url": "vscode://schemas/snippets" }, + { + "fileMatch": "%APP_SETTINGS_HOME%/profiles/*/snippets/.json", + "url": "vscode://schemas/snippets" + }, { "fileMatch": "%APP_SETTINGS_HOME%/sync/snippets/preview/*.json", "url": "vscode://schemas/snippets" diff --git a/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json b/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json index d224f919109..681ca6105cf 100644 --- a/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json +++ b/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json @@ -173,6 +173,13 @@ ] } } + }, + "openFiles": { + "type": "array", + "description": "The paths to the files to open when the codespace is created. Paths are relative to the workspace.", + "items": { + "type": "string" + } } } } diff --git a/extensions/configuration-editing/schemas/devContainer.schema.generated.json b/extensions/configuration-editing/schemas/devContainer.schema.generated.json index 4ae5033f3f1..f94a40021e1 100644 --- a/extensions/configuration-editing/schemas/devContainer.schema.generated.json +++ b/extensions/configuration-editing/schemas/devContainer.schema.generated.json @@ -62,24 +62,6 @@ ] } }, - "containerEnv": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Container environment variables." - }, - "containerUser": { - "type": "string", - "description": "The user the container will be started with. The default is the user on the Docker image." - }, - "mounts": { - "type": "array", - "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", - "items": { - "type": "string" - } - }, "runArgs": { "type": "array", "description": "The arguments required when starting in the container.", @@ -278,6 +260,83 @@ "type": "boolean", "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder." }, + "containerEnv": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Container environment variables." + }, + "containerUser": { + "type": "string", + "description": "The user the container will be started with. The default is the user on the Docker image." + }, + "mounts": { + "type": "array", + "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "bind", + "volume" + ], + "description": "Mount type." + }, + "source": { + "type": "string", + "description": "Mount source." + }, + "target": { + "type": "string", + "description": "Mount target." + } + }, + "required": [ + "type", + "source", + "target" + ], + "additionalProperties": false + }, + { + "type": "string" + } + ] + } + }, + "init": { + "type": "boolean", + "description": "Passes the --init flag when creating the dev container." + }, + "privileged": { + "type": "boolean", + "description": "Passes the --privileged flag when creating the dev container." + }, + "capAdd": { + "type": "array", + "description": "Passes docker capabilities to include when creating the dev container.", + "examples": [ + "SYS_PTRACE" + ], + "items": { + "type": "string" + } + }, + "securityOpt": { + "type": "array", + "description": "Passes docker security options to include when creating the dev container.", + "examples": [ + "seccomp=unconfined" + ], + "items": { + "type": "string" + } + }, "remoteEnv": { "type": "object", "additionalProperties": { @@ -600,6 +659,13 @@ } }, "additionalProperties": false + }, + "openFiles": { + "type": "array", + "description": "The paths to the files to open when the codespace is created. Paths are relative to the workspace.", + "items": { + "type": "string" + } } }, "additionalProperties": false @@ -672,24 +738,6 @@ ] } }, - "containerEnv": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Container environment variables." - }, - "containerUser": { - "type": "string", - "description": "The user the container will be started with. The default is the user on the Docker image." - }, - "mounts": { - "type": "array", - "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", - "items": { - "type": "string" - } - }, "runArgs": { "type": "array", "description": "The arguments required when starting in the container.", @@ -888,6 +936,83 @@ "type": "boolean", "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder." }, + "containerEnv": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Container environment variables." + }, + "containerUser": { + "type": "string", + "description": "The user the container will be started with. The default is the user on the Docker image." + }, + "mounts": { + "type": "array", + "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "bind", + "volume" + ], + "description": "Mount type." + }, + "source": { + "type": "string", + "description": "Mount source." + }, + "target": { + "type": "string", + "description": "Mount target." + } + }, + "required": [ + "type", + "source", + "target" + ], + "additionalProperties": false + }, + { + "type": "string" + } + ] + } + }, + "init": { + "type": "boolean", + "description": "Passes the --init flag when creating the dev container." + }, + "privileged": { + "type": "boolean", + "description": "Passes the --privileged flag when creating the dev container." + }, + "capAdd": { + "type": "array", + "description": "Passes docker capabilities to include when creating the dev container.", + "examples": [ + "SYS_PTRACE" + ], + "items": { + "type": "string" + } + }, + "securityOpt": { + "type": "array", + "description": "Passes docker security options to include when creating the dev container.", + "examples": [ + "seccomp=unconfined" + ], + "items": { + "type": "string" + } + }, "remoteEnv": { "type": "object", "additionalProperties": { @@ -1210,6 +1335,13 @@ } }, "additionalProperties": false + }, + "openFiles": { + "type": "array", + "description": "The paths to the files to open when the codespace is created. Paths are relative to the workspace.", + "items": { + "type": "string" + } } }, "additionalProperties": false @@ -1248,24 +1380,6 @@ ] } }, - "containerEnv": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Container environment variables." - }, - "containerUser": { - "type": "string", - "description": "The user the container will be started with. The default is the user on the Docker image." - }, - "mounts": { - "type": "array", - "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", - "items": { - "type": "string" - } - }, "runArgs": { "type": "array", "description": "The arguments required when starting in the container.", @@ -1464,6 +1578,83 @@ "type": "boolean", "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder." }, + "containerEnv": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Container environment variables." + }, + "containerUser": { + "type": "string", + "description": "The user the container will be started with. The default is the user on the Docker image." + }, + "mounts": { + "type": "array", + "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "bind", + "volume" + ], + "description": "Mount type." + }, + "source": { + "type": "string", + "description": "Mount source." + }, + "target": { + "type": "string", + "description": "Mount target." + } + }, + "required": [ + "type", + "source", + "target" + ], + "additionalProperties": false + }, + { + "type": "string" + } + ] + } + }, + "init": { + "type": "boolean", + "description": "Passes the --init flag when creating the dev container." + }, + "privileged": { + "type": "boolean", + "description": "Passes the --privileged flag when creating the dev container." + }, + "capAdd": { + "type": "array", + "description": "Passes docker capabilities to include when creating the dev container.", + "examples": [ + "SYS_PTRACE" + ], + "items": { + "type": "string" + } + }, + "securityOpt": { + "type": "array", + "description": "Passes docker security options to include when creating the dev container.", + "examples": [ + "seccomp=unconfined" + ], + "items": { + "type": "string" + } + }, "remoteEnv": { "type": "object", "additionalProperties": { @@ -1786,6 +1977,13 @@ } }, "additionalProperties": false + }, + "openFiles": { + "type": "array", + "description": "The paths to the files to open when the codespace is created. Paths are relative to the workspace.", + "items": { + "type": "string" + } } }, "additionalProperties": false @@ -2014,6 +2212,83 @@ "type": "boolean", "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder." }, + "containerEnv": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Container environment variables." + }, + "containerUser": { + "type": "string", + "description": "The user the container will be started with. The default is the user on the Docker image." + }, + "mounts": { + "type": "array", + "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "bind", + "volume" + ], + "description": "Mount type." + }, + "source": { + "type": "string", + "description": "Mount source." + }, + "target": { + "type": "string", + "description": "Mount target." + } + }, + "required": [ + "type", + "source", + "target" + ], + "additionalProperties": false + }, + { + "type": "string" + } + ] + } + }, + "init": { + "type": "boolean", + "description": "Passes the --init flag when creating the dev container." + }, + "privileged": { + "type": "boolean", + "description": "Passes the --privileged flag when creating the dev container." + }, + "capAdd": { + "type": "array", + "description": "Passes docker capabilities to include when creating the dev container.", + "examples": [ + "SYS_PTRACE" + ], + "items": { + "type": "string" + } + }, + "securityOpt": { + "type": "array", + "description": "Passes docker security options to include when creating the dev container.", + "examples": [ + "seccomp=unconfined" + ], + "items": { + "type": "string" + } + }, "remoteEnv": { "type": "object", "additionalProperties": { @@ -2336,6 +2611,13 @@ } }, "additionalProperties": false + }, + "openFiles": { + "type": "array", + "description": "The paths to the files to open when the codespace is created. Paths are relative to the workspace.", + "items": { + "type": "string" + } } }, "additionalProperties": false @@ -2529,6 +2811,83 @@ "type": "boolean", "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder." }, + "containerEnv": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Container environment variables." + }, + "containerUser": { + "type": "string", + "description": "The user the container will be started with. The default is the user on the Docker image." + }, + "mounts": { + "type": "array", + "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "bind", + "volume" + ], + "description": "Mount type." + }, + "source": { + "type": "string", + "description": "Mount source." + }, + "target": { + "type": "string", + "description": "Mount target." + } + }, + "required": [ + "type", + "source", + "target" + ], + "additionalProperties": false + }, + { + "type": "string" + } + ] + } + }, + "init": { + "type": "boolean", + "description": "Passes the --init flag when creating the dev container." + }, + "privileged": { + "type": "boolean", + "description": "Passes the --privileged flag when creating the dev container." + }, + "capAdd": { + "type": "array", + "description": "Passes docker capabilities to include when creating the dev container.", + "examples": [ + "SYS_PTRACE" + ], + "items": { + "type": "string" + } + }, + "securityOpt": { + "type": "array", + "description": "Passes docker security options to include when creating the dev container.", + "examples": [ + "seccomp=unconfined" + ], + "items": { + "type": "string" + } + }, "remoteEnv": { "type": "object", "additionalProperties": { @@ -2851,6 +3210,13 @@ } }, "additionalProperties": false + }, + "openFiles": { + "type": "array", + "description": "The paths to the files to open when the codespace is created. Paths are relative to the workspace.", + "items": { + "type": "string" + } } }, "additionalProperties": false diff --git a/extensions/configuration-editing/schemas/devContainer.schema.src.json b/extensions/configuration-editing/schemas/devContainer.schema.src.json index 73456101bb9..f908f29ac59 100644 --- a/extensions/configuration-editing/schemas/devContainer.schema.src.json +++ b/extensions/configuration-editing/schemas/devContainer.schema.src.json @@ -177,6 +177,55 @@ "type": "boolean", "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder." }, + "containerEnv": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Container environment variables." + }, + "containerUser": { + "type": "string", + "description": "The user the container will be started with. The default is the user on the Docker image." + }, + "mounts": { + "type": "array", + "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/Mount" + }, + { + "type": "string" + } + ] + } + }, + "init": { + "type": "boolean", + "description": "Passes the --init flag when creating the dev container." + }, + "privileged": { + "type": "boolean", + "description": "Passes the --privileged flag when creating the dev container." + }, + "capAdd": { + "type": "array", + "description": "Passes docker capabilities to include when creating the dev container.", + "examples": [ "SYS_PTRACE" ], + "items": { + "type": "string" + } + }, + "securityOpt": { + "type": "array", + "description": "Passes docker security options to include when creating the dev container.", + "examples": [ "seccomp=unconfined" ], + "items": { + "type": "string" + } + }, "remoteEnv": { "type": "object", "additionalProperties": { @@ -501,6 +550,13 @@ ] } } + }, + "openFiles": { + "type": "array", + "description": "The paths to the files to open when the codespace is created. Paths are relative to the workspace.", + "items": { + "type": "string" + } } } } @@ -529,24 +585,6 @@ ] } }, - "containerEnv": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Container environment variables." - }, - "containerUser": { - "type": "string", - "description": "The user the container will be started with. The default is the user on the Docker image." - }, - "mounts": { - "type": "array", - "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.", - "items": { - "type": "string" - } - }, "runArgs": { "type": "array", "description": "The arguments required when starting in the container.", @@ -728,6 +766,33 @@ "service", "workspaceFolder" ] + }, + "Mount": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "bind", + "volume" + ], + "description": "Mount type." + }, + "source": { + "type": "string", + "description": "Mount source." + }, + "target": { + "type": "string", + "description": "Mount target." + } + }, + "required": [ + "type", + "source", + "target" + ], + "additionalProperties": false } }, "oneOf": [ diff --git a/extensions/configuration-editing/yarn.lock b/extensions/configuration-editing/yarn.lock index e8272098f1e..5bb8132d373 100644 --- a/extensions/configuration-editing/yarn.lock +++ b/extensions/configuration-editing/yarn.lock @@ -12,7 +12,7 @@ jsonc-parser@^2.2.1: resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index 79c46dad831..92d0016b0e6 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": "924295fc44bde1a00fab60da3a2caca4509adb25" + "commitHash": "32be139c7d3cdf07195af4b3a5c639ebf4e3b356" } }, "license": "MIT", - "version": "1.15.18", + "version": "1.15.23", "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 b8a6aa53111..f109e7ea778 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/924295fc44bde1a00fab60da3a2caca4509adb25", + "version": "https://github.com/jeff-hykin/better-cpp-syntax/commit/32be139c7d3cdf07195af4b3a5c639ebf4e3b356", "name": "C++", "scopeName": "source.cpp.embedded.macro", "patterns": [ @@ -519,7 +519,7 @@ "name": "comment.block.cpp" }, "builtin_storage_type_initilizer": { - "begin": "(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "begin": "\\s*+((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\{)", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\{)", "end": "\\}|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))~\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))~\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?(::))?(?:(?:\\s)+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?(::))?(?:(?:\\s)+)?((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))|(?=(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?(\\()", "end": "\\)|(?=(?))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\()", + "begin": "(?:(?:^|\\G|(?<=;|\\}))|(?<=>))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\()", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)?(?![\\w<:.]))", + "match": "(?<=^|\\))(?:(?:\\s)+)?(->)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)?(?![\\w<:.]))", "captures": { "1": { "name": "punctuation.definition.function.return-type.cpp" @@ -4240,7 +4240,7 @@ ] }, "function_pointer": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)?(?![\\w<:.]))", + "match": "(?<=protected|virtual|private|public|,|:)(?:(?:\\s)+)?(?!(?:(?:(?:protected)|(?:private)|(?:public))|virtual))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)?(?![\\w<:.]))", "captures": { "1": { "name": "meta.qualified_type.cpp", @@ -5334,15 +5334,23 @@ "name": "storage.modifier.lambda.$0.cpp" }, { - "match": "(->)((?:.+?(?=\\{|$))?)", - "captures": { - "1": { + "begin": "->", + "end": "(?=\\{)|(?=(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<4>?)+>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<4>?)+>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(operator)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:new)|(?:\\->\\*)|(?:<<=)|(?:>>=)|(?:<=>)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:\\-\\-)|(?:<<)|(?:>>)|(?:<=)|(?:>=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|(?:\\/=)|(?:%=)|(?:&=)|(?:\\^=)|(?:\\|=)|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=|,))|((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\<|\\()", + "begin": "(?:(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(operator)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=))|((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\<|\\()", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))|(?=(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "source.cpp#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.function.cpp" + }, + "7": { + "name": "keyword.other.delete.function.cpp" + } + } + }, { "include": "$self" } @@ -6971,7 +7018,7 @@ "include": "source.cpp#vararg_ellipses" }, { - "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", + "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -7351,7 +7398,7 @@ "include": "source.cpp#vararg_ellipses" }, { - "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", + "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -8827,7 +8874,7 @@ "name": "storage.type.template.cpp" }, "2": { - "name": "punctuation.section.angle-brackets.start.template.definition.cpp" + "name": "punctuation.section.angle-brackets.begin.template.definition.cpp" } }, "endCaptures": { @@ -8847,7 +8894,7 @@ }, "endCaptures": { "0": { - "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + "name": "punctuation.section.angle-brackets.end.template.call.cpp" } }, "patterns": [ @@ -9428,7 +9475,7 @@ "endCaptures": {}, "patterns": [ { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()|(?=(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<6>?)+>)(?:\\s)*+)?::)*\\s*+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<6>?)+>)(?:\\s)*+)?::)*\\s*+)?((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "begin": "\\s*+((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -2025,10 +2025,10 @@ ] }, "6": { - "name": "keyword.other.default.constructor.cpp" + "name": "keyword.other.default.function.cpp keyword.other.default.constructor.cpp" }, "7": { - "name": "keyword.other.delete.constructor.cpp" + "name": "keyword.other.delete.function.cpp keyword.other.delete.constructor.cpp" } } }, @@ -2176,7 +2176,7 @@ ] }, "control_flow_keywords": { - "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\{)", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\{)", "end": "\\}", "beginCaptures": { "1": { @@ -3296,10 +3296,10 @@ ] }, "6": { - "name": "keyword.other.default.constructor.cpp" + "name": "keyword.other.default.function.cpp keyword.other.default.constructor.cpp keyword.other.default.destructor.cpp" }, "7": { - "name": "keyword.other.delete.constructor.cpp" + "name": "keyword.other.delete.function.cpp keyword.other.delete.constructor.cpp keyword.other.delete.destructor.cpp" } } }, @@ -3363,7 +3363,7 @@ ] }, "destructor_root": { - "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))~\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", + "begin": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)(((?>(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))::((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))~\\14((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\())", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -3587,10 +3587,10 @@ ] }, "6": { - "name": "keyword.other.default.constructor.cpp" + "name": "keyword.other.default.function.cpp keyword.other.default.constructor.cpp keyword.other.default.destructor.cpp" }, "7": { - "name": "keyword.other.delete.constructor.cpp" + "name": "keyword.other.delete.function.cpp keyword.other.delete.constructor.cpp keyword.other.delete.destructor.cpp" } } }, @@ -3784,7 +3784,7 @@ "match": "(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?(::))?(?:(?:\\s)+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?(::))?(?:(?:\\s)+)?((?|\\?\\?>)(?:(?:\\s)+)?(;)|(;))|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -4519,7 +4519,7 @@ ] }, "function_call": { - "begin": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?(\\()", "end": "\\)", "beginCaptures": { "1": { @@ -4593,7 +4593,7 @@ ] }, "function_definition": { - "begin": "(?:(?:^|\\G|(?<=;|\\}))|(?<=>))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\()", + "begin": "(?:(?:^|\\G|(?<=;|\\}))|(?<=>))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((::)?(?:(?!\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<60>?)+>)(?:\\s)*+)?::)*\\s*+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)\\b(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\()", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -5156,7 +5156,7 @@ ] }, { - "match": "(?<=^|\\))(?:(?:\\s)+)?(->)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)?(?![\\w<:.]))", + "match": "(?<=^|\\))(?:(?:\\s)+)?(->)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<23>?)+>)?(?![\\w<:.]))", "captures": { "1": { "name": "punctuation.definition.function.return-type.cpp" @@ -5404,7 +5404,7 @@ ] }, "function_pointer": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { @@ -5755,7 +5755,7 @@ ] }, "function_pointer_parameter": { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { @@ -6510,7 +6510,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)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)?(?![\\w<:.]))", + "match": "(?<=protected|virtual|private|public|,|:)(?:(?:\\s)+)?(?!(?:(?:(?:protected)|(?:private)|(?:public))|virtual))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)?(?![\\w<:.]))", "captures": { "1": { "name": "meta.qualified_type.cpp", @@ -6708,7 +6708,7 @@ ] }, "inline_builtin_storage_type": { - "match": "(?:\\s)*+(?)((?:.+?(?=\\{|$))?)", - "captures": { - "1": { + "begin": "->", + "end": "(?=\\{)", + "beginCaptures": { + "0": { "name": "punctuation.definition.lambda.return-type.cpp" + } + }, + "endCaptures": {}, + "patterns": [ + { + "include": "#comments" }, - "2": { + { + "match": "\\S+", "name": "storage.type.return-type.lambda.cpp" } - } + ] }, { "begin": "\\{", @@ -7148,7 +7156,7 @@ "name": "entity.name.function.preprocessor.cpp" }, "member_access": { - "match": "(?:((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:(?:\\s)+)?(?:(?:\\.\\*|\\.)|(?:->\\*|->))(?:(?:\\s)+)?)*)(?:(?:\\s)+)?(\\b(?!uint_least16_t[^\\w]|uint_least32_t[^\\w]|uint_least64_t[^\\w]|int_least16_t[^\\w]|int_least32_t[^\\w]|int_least64_t[^\\w]|uint_least8_t[^\\w]|uint_fast16_t[^\\w]|uint_fast32_t[^\\w]|uint_fast64_t[^\\w]|int_least8_t[^\\w]|int_fast16_t[^\\w]|int_fast32_t[^\\w]|int_fast64_t[^\\w]|uint_fast8_t[^\\w]|suseconds_t[^\\w]|int_fast8_t[^\\w]|useconds_t[^\\w]|blksize_t[^\\w]|in_addr_t[^\\w]|in_port_t[^\\w]|uintptr_t[^\\w]|uintmax_t[^\\w]|uintmax_t[^\\w]|uintmax_t[^\\w]|unsigned[^\\w]|u_quad_t[^\\w]|blkcnt_t[^\\w]|uint16_t[^\\w]|uint32_t[^\\w]|uint64_t[^\\w]|intptr_t[^\\w]|intmax_t[^\\w]|intmax_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]|swblk_t[^\\w]|clock_t[^\\w]|ssize_t[^\\w]|int16_t[^\\w]|int32_t[^\\w]|int64_t[^\\w]|uint8_t[^\\w]|signed[^\\w]|double[^\\w]|u_char[^\\w]|u_long[^\\w]|ushort[^\\w]|quad_t[^\\w]|mode_t[^\\w]|size_t[^\\w]|time_t[^\\w]|int8_t[^\\w]|short[^\\w]|float[^\\w]|u_int[^\\w]|div_t[^\\w]|dev_t[^\\w]|gid_t[^\\w]|ino_t[^\\w]|key_t[^\\w]|pid_t[^\\w]|off_t[^\\w]|uid_t[^\\w]|auto[^\\w]|void[^\\w]|char[^\\w]|long[^\\w]|bool[^\\w]|uint[^\\w]|id_t[^\\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)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:(?:\\s)+)?(?:(?:\\.\\*|\\.)|(?:->\\*|->))(?:(?:\\s)+)?)*)(?:(?:\\s)+)?(\\b(?!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": [ @@ -7609,7 +7617,7 @@ ] }, "namespace_alias": { - "match": "(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<8>?)+>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<8>?)+>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<4>?)+>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<4>?)+>)(?:\\s)*+)?::)*\\s*+)(?:(?:\\s)+)?((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(operator)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:new)|(?:\\->\\*)|(?:<<=)|(?:>>=)|(?:<=>)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:\\-\\-)|(?:<<)|(?:>>)|(?:<=)|(?:>=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|(?:\\/=)|(?:%=)|(?:&=)|(?:\\^=)|(?:\\|=)|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=|,))|((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\<|\\()", + "begin": "(?:(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:__cdecl|__clrcall|__stdcall|__fastcall|__thiscall|__vectorcall)?)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:::)?(?:(?!\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(operator)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<55>?)+>)(?:\\s)*+)?::)*+)(?:(?:((?:(?:delete\\[\\])|(?:delete)|(?:new\\[\\])|(?:<=>)|(?:<<=)|(?:new)|(?:>>=)|(?:\\->\\*)|(?:\\/=)|(?:%=)|(?:&=)|(?:>=)|(?:\\|=)|(?:\\+\\+)|(?:\\-\\-)|(?:\\(\\))|(?:\\[\\])|(?:\\->)|(?:\\+\\+)|(?:<<)|(?:>>)|(?:\\-\\-)|(?:<=)|(?:\\^=)|(?:==)|(?:!=)|(?:&&)|(?:\\|\\|)|(?:\\+=)|(?:\\-=)|(?:\\*=)|,|(?:\\+)|(?:\\-)|!|~|(?:\\*)|&|(?:\\*)|(?:\\/)|%|(?:\\+)|(?:\\-)|<|>|&|(?:\\^)|(?:\\|)|=))|((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:\\[\\])?)))|(\"\")((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=\\<|\\()", "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "beginCaptures": { "0": { @@ -8736,6 +8744,45 @@ { "include": "#qualifiers_and_specifiers_post_parameters" }, + { + "match": "(\\=)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(default)|(delete))", + "captures": { + "1": { + "name": "keyword.operator.assignment.cpp" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" + }, + "4": { + "name": "comment.block.cpp" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.cpp punctuation.definition.comment.end.cpp" + }, + { + "match": "\\*", + "name": "comment.block.cpp" + } + ] + }, + "6": { + "name": "keyword.other.default.function.cpp" + }, + "7": { + "name": "keyword.other.delete.function.cpp" + } + } + }, { "include": "$self" } @@ -10475,7 +10522,7 @@ "include": "#vararg_ellipses" }, { - "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", + "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -11513,7 +11560,7 @@ "include": "#vararg_ellipses" }, { - "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", + "match": "((?:((?:(?:thread_local)|(?:volatile)|(?:register)|(?:restrict)|(?:static)|(?:extern)|(?:const)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))+)((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:\\s)*+(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=,|\\)|=)", "captures": { "1": { "patterns": [ @@ -12848,7 +12895,7 @@ ] }, "qualified_type": { - "match": "\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)?(?![\\w<:.])", + "match": "\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<11>?)+>)?(?![\\w<:.])", "captures": { "0": { "patterns": [ @@ -13042,27 +13089,27 @@ "name": "meta.qualified_type.cpp" }, "qualifiers_and_specifiers_post_parameters": { - "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?:((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))(?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", + "match": "((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))((?(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))", - "captures": { - "1": { - "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, - "2": { - "name": "comment.block.cpp" - }, - "3": { - "patterns": [ - { - "match": "\\*\\/", - "name": "comment.block.cpp punctuation.definition.comment.end.cpp" - }, - { - "match": "\\*", - "name": "comment.block.cpp" - } - ] + "5": { + "name": "storage.modifier.specifier.functional.post-parameters.$5.cpp" } } } @@ -13118,7 +13131,7 @@ } }, "scope_resolution": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13140,7 +13153,7 @@ } }, "scope_resolution_function_call": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13162,7 +13175,7 @@ } }, "scope_resolution_function_call_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13200,7 +13213,7 @@ } }, "scope_resolution_function_definition": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13222,7 +13235,7 @@ } }, "scope_resolution_function_definition_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13260,7 +13273,7 @@ } }, "scope_resolution_function_definition_operator_overload": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13282,7 +13295,7 @@ } }, "scope_resolution_function_definition_operator_overload_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13320,7 +13333,7 @@ } }, "scope_resolution_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13358,7 +13371,7 @@ } }, "scope_resolution_namespace_alias": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13380,7 +13393,7 @@ } }, "scope_resolution_namespace_alias_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13418,7 +13431,7 @@ } }, "scope_resolution_namespace_block": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13440,7 +13453,7 @@ } }, "scope_resolution_namespace_block_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13478,7 +13491,7 @@ } }, "scope_resolution_namespace_using": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13500,7 +13513,7 @@ } }, "scope_resolution_namespace_using_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13538,7 +13551,7 @@ } }, "scope_resolution_parameter": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13560,7 +13573,7 @@ } }, "scope_resolution_parameter_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13598,7 +13611,7 @@ } }, "scope_resolution_template_call": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13620,7 +13633,7 @@ } }, "scope_resolution_template_call_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13658,7 +13671,7 @@ } }, "scope_resolution_template_definition": { - "match": "(::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<3>?)+>)(?:\\s)*+)?::)*\\s*+", "captures": { "0": { "patterns": [ @@ -13680,7 +13693,7 @@ } }, "scope_resolution_template_definition_inner_generated": { - "match": "((::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?::)*\\s*+)((?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<7>?)+>)(?:\\s)*+)?(::)", "captures": { "1": { "patterns": [ @@ -13722,7 +13735,7 @@ "name": "punctuation.terminator.statement.cpp" }, "simple_type": { - "match": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)?(?![\\w<:.]))(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?", + "match": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<12>?)+>)?(?![\\w<:.]))(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?", "captures": { "1": { "name": "meta.qualified_type.cpp", @@ -16160,10 +16173,10 @@ ] }, "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.cpp" + "name": "storage.type.template.argument.$1.cpp" }, "2": { "name": "entity.name.type.template.cpp" @@ -16248,7 +16261,7 @@ "name": "storage.type.template.cpp" }, "2": { - "name": "punctuation.section.angle-brackets.start.template.definition.cpp" + "name": "punctuation.section.angle-brackets.begin.template.definition.cpp" } }, "endCaptures": { @@ -16268,7 +16281,7 @@ }, "endCaptures": { "0": { - "name": "punctuation.section.angle-brackets.begin.template.call.cpp" + "name": "punctuation.section.angle-brackets.end.template.call.cpp" } }, "patterns": [ @@ -16283,7 +16296,7 @@ ] }, "template_definition_argument": { - "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\s)+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)(?:(?:\\s)+)?(\\.\\.\\.)(?:(?:\\s)+)?((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))(?:(?:\\s)+)?(?:(,)|(?=>|$))", + "match": "((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?:\\s)+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)(?:(?:\\s)+)?(\\.\\.\\.)(?:(?:\\s)+)?((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*))|(?)(?:(?:\\s)+)?(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": [ @@ -16334,7 +16347,7 @@ "name": "entity.name.type.template.cpp" }, "6": { - "name": "storage.type.template.cpp" + "name": "storage.type.template.argument.$6.cpp" }, "7": { "name": "punctuation.vararg-ellipses.template.definition.cpp" @@ -16343,6 +16356,30 @@ "name": "entity.name.type.template.cpp" }, "9": { + "name": "storage.type.template.cpp" + }, + "10": { + "name": "punctuation.section.angle-brackets.begin.template.definition.cpp" + }, + "11": { + "name": "storage.type.template.argument.$11.cpp" + }, + "12": { + "name": "entity.name.type.template.cpp" + }, + "13": { + "name": "punctuation.section.angle-brackets.end.template.definition.cpp" + }, + "14": { + "name": "storage.type.template.argument.$14.cpp" + }, + "15": { + "name": "entity.name.type.template.cpp" + }, + "16": { + "name": "keyword.operator.assignment.cpp" + }, + "17": { "name": "punctuation.separator.delimiter.comma.template.argument.cpp" } } @@ -16367,13 +16404,13 @@ ] }, "template_isolated_definition": { - "match": "(?(?:(?:\\s)+)?$)", + "match": "(?)(?:(?:\\s)+)?$", "captures": { "1": { "name": "storage.type.template.cpp" }, "2": { - "name": "punctuation.section.angle-brackets.start.template.definition.cpp" + "name": "punctuation.section.angle-brackets.begin.template.definition.cpp" }, "3": { "name": "meta.template.definition.cpp", @@ -16526,7 +16563,7 @@ } }, "type_alias": { - "match": "(using)(?:(?:\\s)+)?(?!namespace)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)?(?![\\w<:.]))(?:(?:\\s)+)?(\\=)(?:(?:\\s)+)?((?:typename)?)(?:(?:\\s)+)?((?:(?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)?(?![\\w<:.]))|(.*(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)?(?:(?:\\s)+)?(?:(;)|\\n)", + "match": "(using)(?:(?:\\s)+)?(?!namespace)(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)?(?![\\w<:.]))(?:(?:\\s)+)?(\\=)(?:(?:\\s)+)?((?:typename)?)(?:(?:\\s)+)?((?:(?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<29>?)+>)?(?![\\w<:.]))|(.*(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)?(?:(?:\\s)+)?(?:(;)|\\n)", "captures": { "1": { "name": "keyword.other.using.directive.cpp" @@ -17616,7 +17653,7 @@ "endCaptures": {}, "patterns": [ { - "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", + "begin": "(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)(?:\\s)*+)?::)*+)?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<18>?)+>)?(?![\\w<:.]))(((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))?(?:(?:&|(?:\\*))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*(?:&|(?:\\*)))?((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\()(\\*)(?:(?:\\s)+)?((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*)?)(?:(?:\\s)+)?(?:(\\[)(\\w*)(\\])(?:(?:\\s)+)?)*(\\))(?:(?:\\s)+)?(\\()", "end": "(\\))((?:(?:(?:(?>(?:\\s)+)|(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/)))+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?=[{=,);>]|\\n)(?!\\()", "beginCaptures": { "1": { @@ -18901,7 +18938,7 @@ ] }, "typename": { - "match": "(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z))))*((?:::)?(?:(?!\\b(?:__has_cpp_attribute|reinterpret_cast|atomic_noexcept|__has_include|atomic_cancel|atomic_commit|dynamic_cast|thread_local|synchronized|static_cast|const_cast|co_return|constexpr|consteval|constexpr|constexpr|consteval|protected|namespace|constinit|co_return|noexcept|noexcept|continue|co_await|co_yield|volatile|register|restrict|explicit|volatile|noexcept|template|operator|decltype|typename|requires|co_await|co_yield|reflexpr|alignof|alignas|default|mutable|virtual|mutable|private|include|warning|_Pragma|defined|typedef|__asm__|concept|sizeof|delete|not_eq|bitand|and_eq|xor_eq|typeid|switch|return|struct|static|extern|inline|friend|public|ifndef|define|pragma|export|import|module|compl|bitor|throw|or_eq|while|catch|break|class|union|const|const|endif|ifdef|undef|error|using|else|goto|case|enum|elif|else|line|this|not|new|xor|and|for|try|asm|or|do|if|if)\\b)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<17>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?!(?:(?:transaction_safe_dynamic)|(?:__has_cpp_attribute)|(?:reinterpret_cast)|(?:transaction_safe)|(?:atomic_noexcept)|(?:__has_include)|(?:atomic_cancel)|(?:atomic_commit)|(?:dynamic_cast)|(?:thread_local)|(?:synchronized)|(?:static_cast)|(?:const_cast)|(?:co_return)|(?:constexpr)|(?:consteval)|(?:constexpr)|(?:constexpr)|(?:consteval)|(?:protected)|(?:namespace)|(?:constinit)|(?:co_return)|(?:noexcept)|(?:noexcept)|(?:continue)|(?:co_await)|(?:co_yield)|(?:volatile)|(?:register)|(?:restrict)|(?:explicit)|(?:override)|(?:volatile)|(?:noexcept)|(?:template)|(?:operator)|(?:decltype)|(?:typename)|(?:requires)|(?:co_await)|(?:co_yield)|(?:reflexpr)|(?:alignof)|(?:alignas)|(?:default)|(?:nullptr)|(?:mutable)|(?:virtual)|(?:mutable)|(?:private)|(?:include)|(?:warning)|(?:_Pragma)|(?:defined)|(?:typedef)|(?:__asm__)|(?:concept)|(?:sizeof)|(?:delete)|(?:not_eq)|(?:bitand)|(?:and_eq)|(?:xor_eq)|(?:typeid)|(?:switch)|(?:return)|(?:static)|(?:extern)|(?:inline)|(?:friend)|(?:public)|(?:ifndef)|(?:define)|(?:pragma)|(?:export)|(?:import)|(?:module)|(?:compl)|(?:bitor)|(?:throw)|(?:or_eq)|(?:while)|(?:catch)|(?:break)|(?:false)|(?:const)|(?:final)|(?:const)|(?:endif)|(?:ifdef)|(?:undef)|(?:error)|(?:using)|(?:audit)|(?:axiom)|(?:else)|(?:goto)|(?:case)|(?:NULL)|(?:true)|(?:elif)|(?:else)|(?:line)|(?:this)|(?:not)|(?:new)|(?:xor)|(?:and)|(?:for)|(?:try)|(?:asm)|(?:or)|(?:do)|(?:if)|(?: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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<17>?)+>)?(?![\\w<:.]))", + "match": "(((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(\\s*+((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\A)|(?:\\Z)))(?:(?:(?:(?:unsigned)|(?:signed)|(?:short)|(?:long))|(?:(?:struct)|(?:class)|(?:union)|(?:enum)))((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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)(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<17>?)+>)(?:\\s)*+)?::)*+)?((?:((?:(?>(?:\\s)+)|\\/\\*(?:[^\\*]|(?:\\*)++[^\\/])*+(?:\\*)++\\/)+)|(?:\\b)|(?=\\W)|(?<=\\W)|(?:\\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((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<17>?)+>)?(?![\\w<:.]))", "captures": { "1": { "name": "storage.modifier.cpp" @@ -19790,7 +19827,7 @@ } }, "using_namespace": { - "begin": "(?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<6>?)+>)(?:\\s)*+)?::)*\\s*+)?((?]*+|\"(?:[^\"]*|\\\\\")\")|'(?:[^']*|\\\\')')\\g<6>?)+>)(?:\\s)*+)?::)*\\s*+)?((?('fetchBeforeCheckout', false) === true; + const pullBeforeCheckout = config.get('pullBeforeCheckout', false) === true; - if (fetchBeforeCheckout) { + if (pullBeforeCheckout) { await this.repository.fastForwardBranch(this.ref.name!); } @@ -599,7 +599,7 @@ export class CommandCenter { choices.push(addToWorkspace); } - const result = await window.showInformationMessage(message, ...choices); + const result = await window.showInformationMessage(message, { modal: true }, ...choices); action = result === open ? PostCloneAction.Open : result === openNewWindow ? PostCloneAction.OpenNewWindow @@ -1162,7 +1162,7 @@ export class CommandCenter { const repository = this.model.getRepository(uri); if (!repository) { - console.log(`FAILED to accept merge because uri ${uri.toString()} doesn't belong to any repository`); + console.log(`FAILED to complete merge because uri ${uri.toString()} doesn't belong to any repository`); return; } @@ -1183,7 +1183,7 @@ export class CommandCenter { // make sure to save the merged document const doc = workspace.textDocuments.find(doc => doc.uri.toString() === uri.toString()); if (!doc) { - console.log(`FAILED to accept merge because uri ${uri.toString()} doesn't match a document`); + console.log(`FAILED to complete merge because uri ${uri.toString()} doesn't match a document`); return; } if (doc.isDirty) { diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts index c10a9d6a193..1914f1fb134 100644 --- a/extensions/git/src/model.ts +++ b/extensions/git/src/model.ts @@ -5,7 +5,7 @@ import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento, commands } from 'vscode'; import TelemetryReporter from '@vscode/extension-telemetry'; -import { Repository, RepositoryState } from './repository'; +import { Operation, Repository, RepositoryState } from './repository'; import { memoize, sequentialize, debounce } from './decorators'; import { dispose, anyEvent, filterEvent, isDescendant, pathEquals, toDisposable, eventToPromise } from './util'; import { Git } from './git'; @@ -450,14 +450,45 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand .forEach(p => this.eventuallyScanPossibleGitRepository(p)); }; - const statusListener = repository.onDidRunGitStatus(checkForSubmodules); + const updateMergeChanges = () => { + // set mergeChanges context + const mergeChanges: Uri[] = []; + for (const { repository } of this.openRepositories.values()) { + for (const state of repository.mergeGroup.resourceStates) { + mergeChanges.push(state.resourceUri); + } + } + commands.executeCommand('setContext', 'git.mergeChanges', mergeChanges); + }; + + const statusListener = repository.onDidRunGitStatus(() => { + checkForSubmodules(); + updateMergeChanges(); + }); checkForSubmodules(); + const updateCommitInProgressContext = () => { + let commitInProgress = false; + for (const { repository } of this.openRepositories.values()) { + if (repository.operations.isRunning(Operation.Commit)) { + commitInProgress = true; + break; + } + } + + commands.executeCommand('setContext', 'commitInProgress', commitInProgress); + }; + + const operationEvent = anyEvent(repository.onDidRunOperation as Event, repository.onRunOperation as Event); + const operationListener = operationEvent(() => updateCommitInProgressContext()); + updateCommitInProgressContext(); + const dispose = () => { disappearListener.dispose(); changeListener.dispose(); originalResourceChangeListener.dispose(); statusListener.dispose(); + operationListener.dispose(); repository.dispose(); this.openRepositories = this.openRepositories.filter(e => e !== openRepository); @@ -466,6 +497,7 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand const openRepository = { repository, dispose }; this.openRepositories.push(openRepository); + updateMergeChanges(); this._onDidOpenRepository.fire(repository); } diff --git a/extensions/git/src/protocolHandler.ts b/extensions/git/src/protocolHandler.ts index 3dccfa48665..9ed1f3639ec 100644 --- a/extensions/git/src/protocolHandler.ts +++ b/extensions/git/src/protocolHandler.ts @@ -12,6 +12,7 @@ import * as querystring from 'querystring'; import { OutputChannelLogger } from './log'; const schemes = new Set(['file', 'git', 'http', 'https', 'ssh']); +const refRegEx = /^$|[~\^:\\\*\s\[\]]|^-|^\.|\/\.|\.\.|\.lock\/|\.lock$|\/$|\.$/; export class GitProtocolHandler implements UriHandler { @@ -44,7 +45,7 @@ export class GitProtocolHandler implements UriHandler { } if (ref !== undefined && typeof ref !== 'string') { - this.outputChannelLogger.logWarning('Failed to open URI:' + uri.toString()); + this.outputChannelLogger.logWarning('Failed to open URI due to multiple references:' + uri.toString()); return; } @@ -62,6 +63,11 @@ export class GitProtocolHandler implements UriHandler { if (!schemes.has(cloneUri.scheme.toLowerCase())) { throw new Error('Unsupported scheme.'); } + + // Validate the reference + if (typeof ref === 'string' && refRegEx.test(ref)) { + throw new Error('Invalid reference.'); + } } catch (ex) { this.outputChannelLogger.logWarning('Invalid URI:' + uri.toString()); diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index d622fd23c87..48dbdd5065d 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -460,10 +460,8 @@ class ProgressManager { this.updateEnablement(); this.repository.onDidChangeOperations(() => { - const commitInProgress = this.repository.operations.isRunning(Operation.Commit); - - this.repository.sourceControl.inputBox.enabled = !commitInProgress; - commands.executeCommand('setContext', 'commitInProgress', commitInProgress); + // Disable input box when the commit operation is running + this.repository.sourceControl.inputBox.enabled = !this.repository.operations.isRunning(Operation.Commit); }); } @@ -2103,9 +2101,6 @@ export class Repository implements Disposable { // set count badge this.setCountBadge(); - // set mergeChanges context - commands.executeCommand('setContext', 'git.mergeChanges', merge.map(item => item.resourceUri)); - this._onDidChangeStatus.fire(); this._sourceControl.commitTemplate = await this.getInputTemplate(); diff --git a/extensions/git/yarn.lock b/extensions/git/yarn.lock index 502b35d9c38..b5a79f3f238 100644 --- a/extensions/git/yarn.lock +++ b/extensions/git/yarn.lock @@ -186,10 +186,10 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== vscode-uri@^2.0.0: version "2.0.0" diff --git a/extensions/github-authentication/package.json b/extensions/github-authentication/package.json index 35a95e4354d..7e4f7dde431 100644 --- a/extensions/github-authentication/package.json +++ b/extensions/github-authentication/package.json @@ -65,7 +65,7 @@ "node-fetch": "2.6.7", "uuid": "8.1.0", "@vscode/extension-telemetry": "0.6.2", - "vscode-nls": "^5.1.0", + "vscode-nls": "^5.2.0", "vscode-tas-client": "^0.1.47" }, "devDependencies": { diff --git a/extensions/github-authentication/yarn.lock b/extensions/github-authentication/yarn.lock index 6ebb79992dc..330255ba858 100644 --- a/extensions/github-authentication/yarn.lock +++ b/extensions/github-authentication/yarn.lock @@ -143,10 +143,10 @@ uuid@8.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.1.0.tgz#6f1536eb43249f473abc6bd58ff983da1ca30d8d" integrity sha512-CI18flHDznR0lq54xBycOVmphdCYnQLKn8abKn7PXUiKUGdEd+/l9LWNJmugXel4hXq7S+RMNl34ecyC9TntWg== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== vscode-tas-client@^0.1.47: version "0.1.47" diff --git a/extensions/github/package.json b/extensions/github/package.json index 1b21d4b52a1..a262e352a11 100644 --- a/extensions/github/package.json +++ b/extensions/github/package.json @@ -135,7 +135,7 @@ "dependencies": { "@octokit/rest": "19.0.4", "tunnel": "^0.0.6", - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/github/yarn.lock b/extensions/github/yarn.lock index c199d2f7553..8db5da00683 100644 --- a/extensions/github/yarn.lock +++ b/extensions/github/yarn.lock @@ -152,10 +152,10 @@ universal-user-agent@^6.0.0: resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== webidl-conversions@^3.0.0: version "3.0.1" diff --git a/extensions/groovy/package.json b/extensions/groovy/package.json index a7000f89e20..1f50ff6caf7 100644 --- a/extensions/groovy/package.json +++ b/extensions/groovy/package.json @@ -30,7 +30,7 @@ "Jenkinsfile" ], "filenamePatterns": [ - "Jenkinsfile.*" + "Jenkinsfile*" ], "firstLine": "^#!.*\\bgroovy\\b", "configuration": "./language-configuration.json" diff --git a/extensions/grunt/package.json b/extensions/grunt/package.json index 245fd717f8c..0f5e605bcf9 100644 --- a/extensions/grunt/package.json +++ b/extensions/grunt/package.json @@ -17,7 +17,7 @@ "watch": "gulp watch-extension:grunt" }, "dependencies": { - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/grunt/yarn.lock b/extensions/grunt/yarn.lock index 90475ddc7e0..8b8c7a6c15b 100644 --- a/extensions/grunt/yarn.lock +++ b/extensions/grunt/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/gulp/package.json b/extensions/gulp/package.json index 062dc4a788f..41c23eb1145 100644 --- a/extensions/gulp/package.json +++ b/extensions/gulp/package.json @@ -17,7 +17,7 @@ "watch": "gulp watch-extension:gulp" }, "dependencies": { - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/gulp/yarn.lock b/extensions/gulp/yarn.lock index 90475ddc7e0..8b8c7a6c15b 100644 --- a/extensions/gulp/yarn.lock +++ b/extensions/gulp/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index 527932fd7d8..5a46ebe48bd 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -261,7 +261,7 @@ "@vscode/extension-telemetry": "0.6.2", "vscode-languageclient": "^8.1.0-next.1", "vscode-nls": "^5.2.0", - "vscode-uri": "^3.0.5" + "vscode-uri": "^3.0.6" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index 00d2fe73472..7dc7e70a2f0 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -14,7 +14,7 @@ "vscode-languageserver": "^8.1.0-next.1", "vscode-languageserver-textdocument": "^1.0.7", "vscode-nls": "^5.2.0", - "vscode-uri": "^3.0.5" + "vscode-uri": "^3.0.6" }, "devDependencies": { "@types/mocha": "^9.1.1", diff --git a/extensions/html-language-features/server/src/modes/embeddedSupport.ts b/extensions/html-language-features/server/src/modes/embeddedSupport.ts index 9cc401fdf38..c3398f8f80f 100644 --- a/extensions/html-language-features/server/src/modes/embeddedSupport.ts +++ b/extensions/html-language-features/server/src/modes/embeddedSupport.ts @@ -196,9 +196,9 @@ function getSuffix(c: EmbeddedRegion) { } function substituteWithWhitespace(result: string, start: number, end: number, oldContent: string, before: string, after: string) { - let accumulatedWS = 0; result += before; - for (let i = start + before.length; i < end; i++) { + let accumulatedWS = -before.length; // start with a negative value to account for the before string + for (let i = start; i < end; i++) { const ch = oldContent[i]; if (ch === '\n' || ch === '\r') { // only write new lines, skip the whitespace diff --git a/extensions/html-language-features/server/src/test/embedded.test.ts b/extensions/html-language-features/server/src/test/embedded.test.ts index 1e63a72ec89..722578cb07c 100644 --- a/extensions/html-language-features/server/src/test/embedded.test.ts +++ b/extensions/html-language-features/server/src/test/embedded.test.ts @@ -122,7 +122,7 @@ suite('HTML Embedded Support', () => { assertEmbeddedLanguageContent('
', 'javascript', ' foo(); bar(); '); assertEmbeddedLanguageContent('
', 'javascript', ' return; '); - + assertEmbeddedLanguageContent('
', 'javascript', ' return;\n foo(); '); }); }); diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index c467e1ac9b4..2532ccb506a 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -67,12 +67,7 @@ vscode-nls@^5.2.0: resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== -vscode-uri@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.4.tgz#703c6dd7c0b727ee1c34a1287434138fb52d054f" - integrity sha512-aEmKD6H8Sg8gaQAUrnadG0BMeWXtiWhRsj1a94n2FYsMkDpgnK7BRVzZjOUYIvkv2B+bp5Bmt4ImZCpYbnJwkg== - -vscode-uri@^3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.5.tgz#3dd5a9e154e7c9a40de5eaa450a0ce59b435e584" - integrity sha512-bBp2pi1o6ynwlnGL8Tt6UBL1w3VsVZtHCU/Sl73bRfqjno3jMcVSCybdY+hj+31A8FQOELZJWwY+shLVLtcNew== +vscode-uri@^3.0.6, vscode-uri@^3.0.4: + version "3.0.6" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.6.tgz#5e6e2e1a4170543af30151b561a41f71db1d6f91" + integrity sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ== diff --git a/extensions/html-language-features/yarn.lock b/extensions/html-language-features/yarn.lock index cfe8b8f7ad1..478e8548591 100644 --- a/extensions/html-language-features/yarn.lock +++ b/extensions/html-language-features/yarn.lock @@ -116,10 +116,10 @@ vscode-nls@^5.2.0: resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== -vscode-uri@^3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.5.tgz#3dd5a9e154e7c9a40de5eaa450a0ce59b435e584" - integrity sha512-bBp2pi1o6ynwlnGL8Tt6UBL1w3VsVZtHCU/Sl73bRfqjno3jMcVSCybdY+hj+31A8FQOELZJWwY+shLVLtcNew== +vscode-uri@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.6.tgz#5e6e2e1a4170543af30151b561a41f71db1d6f91" + integrity sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ== yallist@^4.0.0: version "4.0.0" diff --git a/extensions/html/package.json b/extensions/html/package.json index aad035c05cc..238f1348955 100644 --- a/extensions/html/package.json +++ b/extensions/html/package.json @@ -76,6 +76,12 @@ "meta.tag string.quoted": "other" } } + ], + "snippets": [ + { + "language": "html", + "path": "./snippets/html.code-snippets" + } ] }, "repository": { diff --git a/extensions/html/snippets/html.code-snippets b/extensions/html/snippets/html.code-snippets new file mode 100644 index 00000000000..62d61b43b7b --- /dev/null +++ b/extensions/html/snippets/html.code-snippets @@ -0,0 +1,18 @@ +{ + "html doc": { + "isFileTemplate": true, + "body": [ + "", + "", + "", + "\t", + "\t${1:title}", + "", + "", + "\t$0", + "", + "" + ], + "description": "HTML Document" + } +} diff --git a/extensions/image-preview/README.md b/extensions/image-preview/README.md deleted file mode 100644 index d3f0bd6cb6c..00000000000 --- a/extensions/image-preview/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Image Preview - -**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled. - -## Features - -This extension provides VS Code's built-in image preview functionality. - -Supported image formats: - -- `*.jpg`, `*.jpe`, `*.jpeg` -- `*.png` -- `*.bmp` -- `*.gif` -- `*.ico` -- `*.webp` diff --git a/extensions/ipynb/src/notebookAttachmentCleaner.ts b/extensions/ipynb/src/notebookAttachmentCleaner.ts index 265c284d984..a72761754df 100644 --- a/extensions/ipynb/src/notebookAttachmentCleaner.ts +++ b/extensions/ipynb/src/notebookAttachmentCleaner.ts @@ -153,16 +153,16 @@ export class AttachmentCleaner implements vscode.CodeActionProvider { this.saveAllAttachmentsToCache(cell.metadata, notebookUri, cellFragment); } - if (this.checkMetadataAttachmentsExistence(cell.metadata)) { + if (this.checkMetadataHasAttachmentsField(cell.metadata)) { // the cell metadata contains attachments, check if any are used in the markdown source - for (const currFilename of Object.keys(cell.metadata.attachments)) { + for (const [currFilename, attachment] of Object.entries(cell.metadata.attachments)) { // means markdown reference is present in the metadata, rendering will work properly // therefore, we don't need to check it in the next loop either if (markdownAttachmentsRefedInCell.has(currFilename)) { // attachment reference is present in the markdown source, no need to cache it markdownAttachmentsRefedInCell.get(currFilename)!.valid = true; - markdownAttachmentsInUse[currFilename] = cell.metadata.attachments[currFilename]; + markdownAttachmentsInUse[currFilename] = attachment as IAttachmentData; } else { // attachment reference is not present in the markdown source, cache it this.saveAttachmentToCache(notebookUri, cellFragment, currFilename, cell.metadata); @@ -227,7 +227,7 @@ export class AttachmentCleaner implements vscode.CodeActionProvider { const diagnostics: IAttachmentDiagnostic[] = []; const markdownAttachments = this.getAttachmentNames(document); - if (this.checkMetadataAttachmentsExistence(activeCell.metadata)) { + if (this.checkMetadataHasAttachmentsField(activeCell.metadata)) { for (const [currFilename, attachment] of markdownAttachments) { if (!activeCell.metadata.attachments[currFilename]) { // no attachment reference in the metadata @@ -295,8 +295,8 @@ export class AttachmentCleaner implements vscode.CodeActionProvider { * @param metadata metadata of cell * @returns boolean representing the presence of any attachments */ - private checkMetadataAttachmentsExistence(metadata: { [key: string]: any }): boolean { - return !!(metadata.attachments); + private checkMetadataHasAttachmentsField(metadata: { [key: string]: unknown }): metadata is { readonly attachments: Record } { + return !!metadata.attachments && typeof metadata.attachments === 'object'; } /** @@ -305,14 +305,16 @@ export class AttachmentCleaner implements vscode.CodeActionProvider { * @param notebookUri uri for the notebook being edited * @param cellFragment fragment of cell being edited */ - private saveAllAttachmentsToCache(metadata: { [key: string]: any }, notebookUri: string, cellFragment: string): void { + private saveAllAttachmentsToCache(metadata: { [key: string]: unknown }, notebookUri: string, cellFragment: string): void { const documentCache = this._attachmentCache.get(notebookUri) ?? new Map(); this._attachmentCache.set(notebookUri, documentCache); const cellCache = documentCache.get(cellFragment) ?? new Map(); documentCache.set(cellFragment, cellCache); - for (const currFilename of Object.keys(metadata.attachments)) { - cellCache.set(currFilename, metadata.attachments[currFilename]); + if (metadata.attachments && typeof metadata.attachments === 'object') { + for (const [currFilename, attachment] of Object.entries(metadata.attachments)) { + cellCache.set(currFilename, attachment); + } } } diff --git a/extensions/jake/package.json b/extensions/jake/package.json index 5ffa78e3981..4e6a94a8b24 100644 --- a/extensions/jake/package.json +++ b/extensions/jake/package.json @@ -17,7 +17,7 @@ "watch": "gulp watch-extension:jake" }, "dependencies": { - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/jake/yarn.lock b/extensions/jake/yarn.lock index 90475ddc7e0..8b8c7a6c15b 100644 --- a/extensions/jake/yarn.lock +++ b/extensions/jake/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json index 1695f820fcc..ed2e78282ca 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScript.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/73af17bf3e45339df06d92751ab366ce96c38516", + "version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/c2744520e325330d0608fc1d1993d7fe98e66202", "name": "JavaScript (with React support)", "scopeName": "source.js", "patterns": [ @@ -2674,7 +2674,7 @@ { "name": "meta.object.member.js meta.object-literal.key.js", "begin": "(?=[\\'\\\"\\`])", - "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as)\\s+))))", + "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", "patterns": [ { "include": "#comment" @@ -2687,7 +2687,7 @@ { "name": "meta.object.member.js meta.object-literal.key.js", "begin": "(?x)(?=(\\b(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?( + const alwaysItem: vscode.MessageItem = { + title: localize('always.title', "Always automatically update Markdown Links"), + }; + + const neverItem: vscode.MessageItem = { + title: localize('never.title', "Never automatically update Markdown Links"), + }; + + const choice = await vscode.window.showInformationMessage( newResources.length === 1 ? localize('prompt', "Update Markdown links for '{0}'?", path.basename(newResources[0].fsPath)) : this.getConfirmMessage(localize('promptMoreThanOne', "Update Markdown link for the following {0} files?", newResources.length), newResources), { modal: true, - }, { - title: localize('reject.title', "No"), - choice: Choice.Reject, - isCloseAffordance: true, - }, { - title: localize('accept.title', "Yes"), - choice: Choice.Accept, - }, { - title: localize('always.title', "Always automatically update Markdown Links"), - choice: Choice.Always, - }, { - title: localize('never.title', "Never automatically update Markdown Links"), - choice: Choice.Never, - }); + }, rejectItem, acceptItem, alwaysItem, neverItem); - if (!response) { - return false; - } - - switch (response.choice) { - case Choice.Accept: { + switch (choice) { + case acceptItem: { return true; } - case Choice.Reject: { + case rejectItem: { return false; } - case Choice.Always: { + case alwaysItem: { const config = vscode.workspace.getConfiguration('markdown', newResources[0]); config.update( settingNames.enabled, @@ -174,7 +162,7 @@ class UpdateLinksOnFileRenameHandler extends Disposable { this.getConfigTargetScope(config, settingNames.enabled)); return true; } - case Choice.Never: { + case neverItem: { const config = vscode.workspace.getConfiguration('markdown', newResources[0]); config.update( settingNames.enabled, @@ -182,9 +170,10 @@ class UpdateLinksOnFileRenameHandler extends Disposable { this.getConfigTargetScope(config, settingNames.enabled)); return false; } + default: { + return false; + } } - - return false; } private async getEditsForFileRename(renames: readonly RenameAction[], token: vscode.CancellationToken): Promise<{ edit: vscode.WorkspaceEdit; resourcesBeingRenamed: vscode.Uri[] } | undefined> { diff --git a/extensions/markdown-language-features/src/preview/preview.ts b/extensions/markdown-language-features/src/preview/preview.ts index 26f94614ad8..51348bd7128 100644 --- a/extensions/markdown-language-features/src/preview/preview.ts +++ b/extensions/markdown-language-features/src/preview/preview.ts @@ -158,7 +158,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider { this._register(watcher.onDidChange(uri => { if (this.isPreviewOf(uri)) { // Only use the file system event when VS Code does not already know about the file - if (!vscode.workspace.textDocuments.some(doc => doc.uri.toString() !== uri.toString())) { + if (!vscode.workspace.textDocuments.some(doc => doc.uri.toString() === uri.toString())) { this.refresh(); } } diff --git a/extensions/markdown-language-features/yarn.lock b/extensions/markdown-language-features/yarn.lock index 5ffe3ff4b82..6bd778ed899 100644 --- a/extensions/markdown-language-features/yarn.lock +++ b/extensions/markdown-language-features/yarn.lock @@ -258,10 +258,10 @@ vscode-nls@^5.0.1: resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.1.tgz#ba23fc4d4420d25e7f886c8e83cbdcec47aa48b2" integrity sha512-hHQV6iig+M21lTdItKPkJAaWrxALQb/nqpVffakO4knJOh3DrU2SXOMzUzNgo1eADPzu3qSsJY1weCzvR52q9A== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== vscode-uri@^3.0.3: version "3.0.3" diff --git a/extensions/image-preview/.vscodeignore b/extensions/media-preview/.vscodeignore similarity index 100% rename from extensions/image-preview/.vscodeignore rename to extensions/media-preview/.vscodeignore diff --git a/extensions/media-preview/README.md b/extensions/media-preview/README.md new file mode 100644 index 00000000000..30bb44b87a1 --- /dev/null +++ b/extensions/media-preview/README.md @@ -0,0 +1,29 @@ +# Media Preview + +**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled. + +## Features + +This extension provides basic preview for images, audio and video files. + +### Supported image file extensions + +- `.jpg`, `.jpe`, `.jpeg` +- `.png` +- `.bmp` +- `.gif` +- `.ico` +- `.webp` +- `.avif` + + +### Supported audio formats + +- `.mp3` +- `.wav` +- `.ogg` + +### Supported video formats + +- `.mp4` (does not support `aac` audio track) +- `.webm` (vp8 only) diff --git a/extensions/image-preview/extension-browser.webpack.config.js b/extensions/media-preview/extension-browser.webpack.config.js similarity index 100% rename from extensions/image-preview/extension-browser.webpack.config.js rename to extensions/media-preview/extension-browser.webpack.config.js diff --git a/extensions/image-preview/extension.webpack.config.js b/extensions/media-preview/extension.webpack.config.js similarity index 100% rename from extensions/image-preview/extension.webpack.config.js rename to extensions/media-preview/extension.webpack.config.js diff --git a/extensions/image-preview/icon.png b/extensions/media-preview/icon.png similarity index 100% rename from extensions/image-preview/icon.png rename to extensions/media-preview/icon.png diff --git a/extensions/image-preview/media/audioPreview.css b/extensions/media-preview/media/audioPreview.css similarity index 100% rename from extensions/image-preview/media/audioPreview.css rename to extensions/media-preview/media/audioPreview.css diff --git a/extensions/image-preview/media/audioPreview.js b/extensions/media-preview/media/audioPreview.js similarity index 100% rename from extensions/image-preview/media/audioPreview.js rename to extensions/media-preview/media/audioPreview.js diff --git a/extensions/image-preview/media/imagePreview.css b/extensions/media-preview/media/imagePreview.css similarity index 100% rename from extensions/image-preview/media/imagePreview.css rename to extensions/media-preview/media/imagePreview.css diff --git a/extensions/image-preview/media/imagePreview.js b/extensions/media-preview/media/imagePreview.js similarity index 100% rename from extensions/image-preview/media/imagePreview.js rename to extensions/media-preview/media/imagePreview.js diff --git a/extensions/image-preview/media/loading-dark.svg b/extensions/media-preview/media/loading-dark.svg similarity index 100% rename from extensions/image-preview/media/loading-dark.svg rename to extensions/media-preview/media/loading-dark.svg diff --git a/extensions/image-preview/media/loading-hc.svg b/extensions/media-preview/media/loading-hc.svg similarity index 100% rename from extensions/image-preview/media/loading-hc.svg rename to extensions/media-preview/media/loading-hc.svg diff --git a/extensions/image-preview/media/loading.svg b/extensions/media-preview/media/loading.svg similarity index 100% rename from extensions/image-preview/media/loading.svg rename to extensions/media-preview/media/loading.svg diff --git a/extensions/image-preview/media/videoPreview.css b/extensions/media-preview/media/videoPreview.css similarity index 100% rename from extensions/image-preview/media/videoPreview.css rename to extensions/media-preview/media/videoPreview.css diff --git a/extensions/image-preview/media/videoPreview.js b/extensions/media-preview/media/videoPreview.js similarity index 98% rename from extensions/image-preview/media/videoPreview.js rename to extensions/media-preview/media/videoPreview.js index a8f1f6955fd..54aa60ad86f 100644 --- a/extensions/image-preview/media/videoPreview.js +++ b/extensions/media-preview/media/videoPreview.js @@ -30,6 +30,7 @@ if (settings.src !== null) { video.src = settings.src; } + video.playsInline = true; video.controls = true; function onLoaded() { diff --git a/extensions/image-preview/package.json b/extensions/media-preview/package.json similarity index 90% rename from extensions/image-preview/package.json rename to extensions/media-preview/package.json index 03c2784a533..b82a4eef836 100644 --- a/extensions/image-preview/package.json +++ b/extensions/media-preview/package.json @@ -1,5 +1,5 @@ { - "name": "image-preview", + "name": "media-preview", "displayName": "%displayName%", "description": "%description%", "extensionKind": [ @@ -50,7 +50,7 @@ "priority": "builtin", "selector": [ { - "filenamePattern": "*.{mp3,wav,opus,aac}" + "filenamePattern": "*.{mp3,wav,ogg}" } ] }, @@ -93,16 +93,16 @@ } }, "scripts": { - "compile": "gulp compile-extension:image-preview", - "watch": "npm run build-preview && gulp watch-extension:image-preview", + "compile": "gulp compile-extension:media-preview", + "watch": "npm run build-preview && gulp watch-extension:media-preview", "vscode:prepublish": "npm run build-ext", - "build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:image-preview ./tsconfig.json", + "build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:media-preview ./tsconfig.json", "compile-web": "npx webpack-cli --config extension-browser.webpack.config --mode none", "watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose" }, "dependencies": { "@vscode/extension-telemetry": "0.6.2", - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "repository": { "type": "git", diff --git a/extensions/image-preview/package.nls.json b/extensions/media-preview/package.nls.json similarity index 67% rename from extensions/image-preview/package.nls.json rename to extensions/media-preview/package.nls.json index 423aaf0c82b..3e45e4d0d2e 100644 --- a/extensions/image-preview/package.nls.json +++ b/extensions/media-preview/package.nls.json @@ -1,6 +1,6 @@ { - "displayName": "Image Preview", - "description": "Provides VS Code's built-in image preview", + "displayName": "Media Preview", + "description": "Provides VS Code's built-in previews for images, audio, and video", "customEditor.audioPreview.displayName": "Audio Preview", "customEditor.imagePreview.displayName": "Image Preview", "customEditor.videoPreview.displayName": "Video Preview", diff --git a/extensions/image-preview/src/audioPreview.ts b/extensions/media-preview/src/audioPreview.ts similarity index 100% rename from extensions/image-preview/src/audioPreview.ts rename to extensions/media-preview/src/audioPreview.ts diff --git a/extensions/image-preview/src/binarySizeStatusBarEntry.ts b/extensions/media-preview/src/binarySizeStatusBarEntry.ts similarity index 100% rename from extensions/image-preview/src/binarySizeStatusBarEntry.ts rename to extensions/media-preview/src/binarySizeStatusBarEntry.ts diff --git a/extensions/image-preview/src/extension.ts b/extensions/media-preview/src/extension.ts similarity index 100% rename from extensions/image-preview/src/extension.ts rename to extensions/media-preview/src/extension.ts diff --git a/extensions/image-preview/src/imagePreview/index.ts b/extensions/media-preview/src/imagePreview/index.ts similarity index 100% rename from extensions/image-preview/src/imagePreview/index.ts rename to extensions/media-preview/src/imagePreview/index.ts diff --git a/extensions/image-preview/src/imagePreview/sizeStatusBarEntry.ts b/extensions/media-preview/src/imagePreview/sizeStatusBarEntry.ts similarity index 100% rename from extensions/image-preview/src/imagePreview/sizeStatusBarEntry.ts rename to extensions/media-preview/src/imagePreview/sizeStatusBarEntry.ts diff --git a/extensions/image-preview/src/imagePreview/zoomStatusBarEntry.ts b/extensions/media-preview/src/imagePreview/zoomStatusBarEntry.ts similarity index 100% rename from extensions/image-preview/src/imagePreview/zoomStatusBarEntry.ts rename to extensions/media-preview/src/imagePreview/zoomStatusBarEntry.ts diff --git a/extensions/image-preview/src/mediaPreview.ts b/extensions/media-preview/src/mediaPreview.ts similarity index 100% rename from extensions/image-preview/src/mediaPreview.ts rename to extensions/media-preview/src/mediaPreview.ts diff --git a/extensions/image-preview/src/ownedStatusBarEntry.ts b/extensions/media-preview/src/ownedStatusBarEntry.ts similarity index 100% rename from extensions/image-preview/src/ownedStatusBarEntry.ts rename to extensions/media-preview/src/ownedStatusBarEntry.ts diff --git a/extensions/image-preview/src/util/dispose.ts b/extensions/media-preview/src/util/dispose.ts similarity index 100% rename from extensions/image-preview/src/util/dispose.ts rename to extensions/media-preview/src/util/dispose.ts diff --git a/extensions/image-preview/src/util/dom.ts b/extensions/media-preview/src/util/dom.ts similarity index 100% rename from extensions/image-preview/src/util/dom.ts rename to extensions/media-preview/src/util/dom.ts diff --git a/extensions/image-preview/src/videoPreview.ts b/extensions/media-preview/src/videoPreview.ts similarity index 100% rename from extensions/image-preview/src/videoPreview.ts rename to extensions/media-preview/src/videoPreview.ts diff --git a/extensions/image-preview/tsconfig.json b/extensions/media-preview/tsconfig.json similarity index 100% rename from extensions/image-preview/tsconfig.json rename to extensions/media-preview/tsconfig.json diff --git a/extensions/image-preview/yarn.lock b/extensions/media-preview/yarn.lock similarity index 92% rename from extensions/image-preview/yarn.lock rename to extensions/media-preview/yarn.lock index 61a6bb946db..a9af1f07de4 100644 --- a/extensions/image-preview/yarn.lock +++ b/extensions/media-preview/yarn.lock @@ -46,7 +46,7 @@ "@microsoft/1ds-core-js" "^3.2.3" "@microsoft/1ds-post-js" "^3.2.3" -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/merge-conflict/package.json b/extensions/merge-conflict/package.json index 978341508f8..caba136ce52 100644 --- a/extensions/merge-conflict/package.json +++ b/extensions/merge-conflict/package.json @@ -166,7 +166,7 @@ } }, "dependencies": { - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/merge-conflict/yarn.lock b/extensions/merge-conflict/yarn.lock index 90475ddc7e0..8b8c7a6c15b 100644 --- a/extensions/merge-conflict/yarn.lock +++ b/extensions/merge-conflict/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/microsoft-authentication/package.json b/extensions/microsoft-authentication/package.json index 07f803a5930..8bf6cd70855 100644 --- a/extensions/microsoft-authentication/package.json +++ b/extensions/microsoft-authentication/package.json @@ -62,7 +62,7 @@ "stream": "0.0.2", "uuid": "^8.2.0", "@vscode/extension-telemetry": "0.6.2", - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "repository": { "type": "git", diff --git a/extensions/microsoft-authentication/yarn.lock b/extensions/microsoft-authentication/yarn.lock index 6706f6a4aae..8d01670e906 100644 --- a/extensions/microsoft-authentication/yarn.lock +++ b/extensions/microsoft-authentication/yarn.lock @@ -198,10 +198,10 @@ uuid@^8.2.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.2.0.tgz#cb10dd6b118e2dada7d0cd9730ba7417c93d920e" integrity sha512-CYpGiFTUrmI6OBMkAdjSDM0k5h8SkkiTP4WAjQgDgNB1S3Ou9VBEvr6q0Kv2H1mMk7IWfxYGpMH5sd5AvcIV2Q== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== webidl-conversions@^3.0.0: version "3.0.1" diff --git a/extensions/npm/package.json b/extensions/npm/package.json index 9cc9ac5dedb..cae1fd7eab1 100644 --- a/extensions/npm/package.json +++ b/extensions/npm/package.json @@ -22,7 +22,7 @@ "jsonc-parser": "^2.2.1", "minimatch": "^3.0.4", "request-light": "^0.5.7", - "vscode-nls": "^5.1.0", + "vscode-nls": "^5.2.0", "which": "^2.0.2", "which-pm": "^2.0.0" }, diff --git a/extensions/npm/yarn.lock b/extensions/npm/yarn.lock index 3479f1c58b6..bfd3b4b3de1 100644 --- a/extensions/npm/yarn.lock +++ b/extensions/npm/yarn.lock @@ -192,10 +192,10 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== which-pm@^2.0.0: version "2.0.0" diff --git a/extensions/package.json b/extensions/package.json index 8f1df05f4e5..e12225cc76f 100644 --- a/extensions/package.json +++ b/extensions/package.json @@ -4,7 +4,7 @@ "license": "MIT", "description": "Dependencies shared by all extensions", "dependencies": { - "typescript": "4.8.3" + "typescript": "4.8.4" }, "scripts": { "postinstall": "node ./postinstall.mjs" diff --git a/extensions/php-language-features/package.json b/extensions/php-language-features/package.json index 8782b3d83b4..dd7f6445d1a 100644 --- a/extensions/php-language-features/package.json +++ b/extensions/php-language-features/package.json @@ -74,7 +74,7 @@ "watch": "npx gulp watch-extension:php-language-features" }, "dependencies": { - "vscode-nls": "^5.1.0", + "vscode-nls": "^5.2.0", "which": "^2.0.2" }, "devDependencies": { diff --git a/extensions/php-language-features/yarn.lock b/extensions/php-language-features/yarn.lock index 62c8b33e55d..baafbeb7ca3 100644 --- a/extensions/php-language-features/yarn.lock +++ b/extensions/php-language-features/yarn.lock @@ -17,10 +17,10 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== which@^2.0.2: version "2.0.2" diff --git a/extensions/php/snippets/php.code-snippets b/extensions/php/snippets/php.code-snippets index 9c061291647..3c213765b4b 100644 --- a/extensions/php/snippets/php.code-snippets +++ b/extensions/php/snippets/php.code-snippets @@ -12,6 +12,7 @@ }, "PHPDoc class …": { "prefix": "doc_class", + "isFileTemplate": true, "body": [ "/**", " * ${6:undocumented class}", @@ -42,6 +43,7 @@ }, "PHPDoc function …": { "prefix": "doc_f", + "isFileTemplate": true, "body": [ "/**", " * ${1:undocumented function summary}", diff --git a/extensions/python/test/colorize-fixtures/test.py b/extensions/python/test/colorize-fixtures/test.py index c92f2c70a8b..c32f12e4f8b 100644 --- a/extensions/python/test/colorize-fixtures/test.py +++ b/extensions/python/test/colorize-fixtures/test.py @@ -19,13 +19,10 @@ class Monkey: }=42): pass -if 1900 < year < 2100 and 1 <= month <= 12 \ - and 1 <= day <= 31 and 0 <= hour < 24 \ - and 0 <= minute < 60 and 0 <= second < 60: # Looks like a valid date - return 1 +pass def firstn(g, n): - for i in range(n): + for _ in range(n): yield g.next() reduce(lambda x,y: x+y, [47,11,42,13]) @@ -37,15 +34,14 @@ mydictionary = { } def steuern(einkommen): - """Berechnung der zu zahlenden Steuern fuer ein zu versteuerndes Einkommen von x""" - if einkommen <= 8004: - steuer = 0 - elif einkommen <= 13469: - y = (einkommen -8004.0)/10000.0 - steuer = (912.17 * y + 1400)*y - else: - steuer = einkommen * 0.44 - 15694 - return steuer + """Berechnung der zu zahlenden Steuern fuer ein zu versteuerndes Einkommen von x""" + if einkommen <= 8004: + return 0 + elif einkommen <= 13469: + y = (einkommen -8004.0)/10000.0 + return (912.17 * y + 1400)*y + else: + return einkommen * 0.44 - 15694 def beliebig(x, y, *mehr): print "x=", x, ", x=", y diff --git a/extensions/razor/cgmanifest.json b/extensions/razor/cgmanifest.json index 2ad1d82c1ea..c0de1392dd5 100644 --- a/extensions/razor/cgmanifest.json +++ b/extensions/razor/cgmanifest.json @@ -10,8 +10,32 @@ } }, "license": "MIT", - "version": "0.3.0" + "version": "0.3.0", + "licenseDetail": [ + "The MIT License (MIT)", + "", + "Copyright (c) 2014 James Summerton", + "", + "Permission is hereby granted, free of charge, to any person obtaining", + "a copy of this software and associated documentation files (the", + "\"Software\"), to deal in the Software without restriction, including", + "without limitation the rights to use, copy, modify, merge, publish,", + "distribute, sublicense, and/or sell copies of the Software, and to", + "permit persons to whom the Software is furnished to do so, subject to", + "the following conditions:", + "", + "The above copyright notice and this permission notice shall be", + "included in all copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,", + "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF", + "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND", + "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE", + "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION", + "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION", + "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + ] } ], "version": 1 -} \ No newline at end of file +} diff --git a/extensions/references-view/package.json b/extensions/references-view/package.json index 4176cda3d1a..d3fcadcbffd 100644 --- a/extensions/references-view/package.json +++ b/extensions/references-view/package.json @@ -407,7 +407,7 @@ "watch": "npx gulp watch-extension:references-view" }, "dependencies": { - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "devDependencies": { "@types/node": "16.x" diff --git a/extensions/references-view/yarn.lock b/extensions/references-view/yarn.lock index 76eaba8dd6f..1661be7c5d2 100644 --- a/extensions/references-view/yarn.lock +++ b/extensions/references-view/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.33.tgz#566713b1b626f781c5c58fe3531307283e00720c" integrity sha512-0PJ0vg+JyU0MIan58IOIFRtSvsb7Ri+7Wltx2qAg94eMOrpg4+uuP3aUHCpxXc1i0jCXiC+zIamSZh3l9AbcQA== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/scss/cgmanifest.json b/extensions/scss/cgmanifest.json index a67a4f54609..12247769ce2 100644 --- a/extensions/scss/cgmanifest.json +++ b/extensions/scss/cgmanifest.json @@ -6,12 +6,12 @@ "git": { "name": "atom/language-sass", "repositoryUrl": "https://github.com/atom/language-sass", - "commitHash": "303bbf0c250fe380b9e57375598cfd916110758b" + "commitHash": "f52ab12f7f9346cc2568129d8c4419bd3d506b47" } }, "license": "MIT", "description": "The file syntaxes/scss.json was derived from the Atom package https://github.com/atom/language-sass which was originally converted from the TextMate bundle https://github.com/alexsancho/SASS.tmbundle.", - "version": "0.61.4" + "version": "0.62.1" } ], "version": 1 diff --git a/extensions/shared.webpack.config.js b/extensions/shared.webpack.config.js index a8f24c1a572..8be35296ddf 100644 --- a/extensions/shared.webpack.config.js +++ b/extensions/shared.webpack.config.js @@ -113,15 +113,6 @@ function withBrowserDefaults(/**@type WebpackConfig*/extConfig, /** @type Additi test: /\.ts$/, exclude: /node_modules/, use: [ - // TODO: bring this back once vscode-nls-dev supports browser - // { - // // vscode-nls-dev loader: - // // * rewrite nls-calls - // loader: 'vscode-nls-dev/lib/webpack-loader', - // options: { - // base: path.join(extConfig.context, 'src') - // } - // }, { // configure TypeScript loader: // * enable sources maps for end-to-end source maps @@ -137,7 +128,6 @@ function withBrowserDefaults(/**@type WebpackConfig*/extConfig, /** @type Additi }, externals: { 'vscode': 'commonjs vscode', // ignored because it doesn't exist, - 'vscode-nls-web-data': 'commonjs vscode-nls-web-data', // ignored because this is injected by the webworker extension host 'applicationinsights-native-metrics': 'commonjs applicationinsights-native-metrics', // ignored because we don't ship native module '@opentelemetry/tracing': 'commonjs @opentelemetry/tracing' // ignored because we don't ship this module }, diff --git a/extensions/simple-browser/package.json b/extensions/simple-browser/package.json index fe3f4de2a5f..2db456cb387 100644 --- a/extensions/simple-browser/package.json +++ b/extensions/simple-browser/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "@vscode/extension-telemetry": "0.6.2", - "vscode-nls": "^5.1.0" + "vscode-nls": "^5.2.0" }, "devDependencies": { "@types/vscode-webview": "^1.57.0", diff --git a/extensions/simple-browser/yarn.lock b/extensions/simple-browser/yarn.lock index 32215e9059b..97902582dea 100644 --- a/extensions/simple-browser/yarn.lock +++ b/extensions/simple-browser/yarn.lock @@ -56,7 +56,7 @@ vscode-codicons@^0.0.14: resolved "https://registry.yarnpkg.com/vscode-codicons/-/vscode-codicons-0.0.14.tgz#e0d05418e2e195564ff6f6a2199d70415911c18f" integrity sha512-6CEH5KT9ct5WMw7n5dlX7rB8ya4CUI2FSq1Wk36XaW+c5RglFtAanUV0T+gvZVVFhl/WxfjTvFHq06Hz9c1SLA== -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== diff --git a/extensions/theme-abyss/themes/abyss-color-theme.json b/extensions/theme-abyss/themes/abyss-color-theme.json index 3157d39b234..7ce14d2de22 100644 --- a/extensions/theme-abyss/themes/abyss-color-theme.json +++ b/extensions/theme-abyss/themes/abyss-color-theme.json @@ -409,6 +409,7 @@ // "activityBar.foreground": "", // "activityBarBadge.background": "", // "activityBarBadge.foreground": "", + "activityBarItem.settingsProfilesBackground": "#082877", // Workbench: Panel // "panel.background": "", diff --git a/extensions/theme-defaults/themes/light_vs.json b/extensions/theme-defaults/themes/light_vs.json index 7a80ebf00e0..0a6eaf61703 100644 --- a/extensions/theme-defaults/themes/light_vs.json +++ b/extensions/theme-defaults/themes/light_vs.json @@ -2,6 +2,7 @@ "$schema": "vscode://schemas/color-theme", "name": "Light (Visual Studio)", "colors": { + "activityBarItem.settingsProfilesBackground": "#4d4d4d", "editor.background": "#FFFFFF", "editor.foreground": "#000000", "editor.inactiveSelectionBackground": "#E5EBF1", diff --git a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json index 76cdb8a9753..8208d90f102 100644 --- a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json +++ b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json @@ -32,6 +32,7 @@ "ports.iconRunningProcessForeground": "#369432", "activityBar.background": "#221a0f", "activityBar.foreground": "#d3af86", + "activityBarItem.settingsProfilesBackground": "#47351d", "sideBar.background": "#362712", "menu.background": "#362712", "menu.foreground": "#CCCCCC", diff --git a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json index eef990db889..45f1a1d55b0 100644 --- a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json +++ b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json @@ -36,6 +36,7 @@ "statusBar.noFolderBackground": "#001126", "statusBar.debuggingBackground": "#001126", "activityBar.background": "#001733", + "activityBarItem.settingsProfilesBackground": "#003271", "progressBar.background": "#bbdaffcc", "badge.background": "#bbdaffcc", "badge.foreground": "#001733", diff --git a/extensions/typescript-basics/cgmanifest.json b/extensions/typescript-basics/cgmanifest.json index cf253fb2b95..7e93b3d9ab0 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": "73af17bf3e45339df06d92751ab366ce96c38516" + "commitHash": "c2744520e325330d0608fc1d1993d7fe98e66202" } }, "license": "MIT", diff --git a/extensions/typescript-basics/snippets/typescript.code-snippets b/extensions/typescript-basics/snippets/typescript.code-snippets index 0162ef50975..35b2aa1711c 100644 --- a/extensions/typescript-basics/snippets/typescript.code-snippets +++ b/extensions/typescript-basics/snippets/typescript.code-snippets @@ -14,6 +14,7 @@ }, "Class Definition": { "prefix": "class", + "isFileTemplate": true, "body": [ "class ${1:name} {", "\tconstructor(${2:parameters}) {", diff --git a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json index 681581e93d6..636fad5e441 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/73af17bf3e45339df06d92751ab366ce96c38516", + "version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/c2744520e325330d0608fc1d1993d7fe98e66202", "name": "TypeScript", "scopeName": "source.ts", "patterns": [ @@ -2671,7 +2671,7 @@ { "name": "meta.object.member.ts meta.object-literal.key.ts", "begin": "(?=[\\'\\\"\\`])", - "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as)\\s+))))", + "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", "patterns": [ { "include": "#comment" @@ -2684,7 +2684,7 @@ { "name": "meta.object.member.ts meta.object-literal.key.ts", "begin": "(?x)(?=(\\b(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?( + const neverItem: vscode.MessageItem = { + title: localize('never.title', "Never automatically update imports"), + }; + + const response = await vscode.window.showInformationMessage( newResources.length === 1 ? localize('prompt', "Update imports for '{0}'?", path.basename(newResources[0].fsPath)) : this.getConfirmMessage(localize('promptMoreThanOne', "Update imports for the following {0} files?", newResources.length), newResources), { modal: true, - }, { - title: localize('reject.title', "No"), - choice: Choice.Reject, - isCloseAffordance: true, - }, { - title: localize('accept.title', "Yes"), - choice: Choice.Accept, - }, { - title: localize('always.title', "Always automatically update imports"), - choice: Choice.Always, - }, { - title: localize('never.title', "Never automatically update imports"), - choice: Choice.Never, - }); + }, rejectItem, acceptItem, alwaysItem, neverItem); - if (!response) { - return false; - } - switch (response.choice) { - case Choice.Accept: - { - return true; - } - case Choice.Reject: - { - return false; - } - case Choice.Always: - { - const config = this.getConfiguration(newResources[0]); - config.update( - updateImportsOnFileMoveName, - UpdateImportsOnFileMoveSetting.Always, - this.getConfigTargetScope(config, updateImportsOnFileMoveName)); - return true; - } - case Choice.Never: + switch (response) { + case acceptItem: { + return true; + } + case rejectItem: { + return false; + } + case alwaysItem: { + const config = this.getConfiguration(newResources[0]); + config.update( + updateImportsOnFileMoveName, + UpdateImportsOnFileMoveSetting.Always, + this.getConfigTargetScope(config, updateImportsOnFileMoveName)); + return true; + } + case neverItem: { const config = this.getConfiguration(newResources[0]); config.update( @@ -211,9 +196,10 @@ class UpdateImportsOnFileRenameHandler extends Disposable { this.getConfigTargetScope(config, updateImportsOnFileMoveName)); return false; } + default: { + return false; + } } - - return false; } private async getJsTsFileBeingMoved(resource: vscode.Uri): Promise { diff --git a/extensions/typescript-language-features/yarn.lock b/extensions/typescript-language-features/yarn.lock index 08e22bf4c15..89f3521b9b6 100644 --- a/extensions/typescript-language-features/yarn.lock +++ b/extensions/typescript-language-features/yarn.lock @@ -85,10 +85,10 @@ tas-client@0.1.58: dependencies: axios "^0.26.1" -vscode-nls@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.1.0.tgz#443b301a7465d88c81c0f4e1914f9857f0dce1e4" - integrity sha512-37Ha44QrLFwR2IfSSYdOArzUvOyoWbOYTwQC+wS0NfqKjhW7s0WQ1lMy5oJXgSZy9sAiZS5ifELhbpXodeMR8w== +vscode-nls@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f" + integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng== vscode-tas-client@^0.1.63: version "0.1.63" diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts index a445753483d..d02e5a44442 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts @@ -32,7 +32,7 @@ suite('vscode API - env', () => { test('env.remoteName', function () { const remoteName = env.remoteName; const knownWorkspaceExtension = extensions.getExtension('vscode.git'); - const knownUiAndWorkspaceExtension = extensions.getExtension('vscode.image-preview'); + const knownUiAndWorkspaceExtension = extensions.getExtension('vscode.media-preview'); if (typeof remoteName === 'undefined') { // not running in remote, so we expect both extensions assert.ok(knownWorkspaceExtension); diff --git a/extensions/yarn.lock b/extensions/yarn.lock index 919cf0aa6a8..619417cb66c 100644 --- a/extensions/yarn.lock +++ b/extensions/yarn.lock @@ -42,10 +42,10 @@ node-gyp-build@^4.3.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== -typescript@4.8.3: - version "4.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88" - integrity sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig== +typescript@4.8.4: + version "4.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" + integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== vscode-grammar-updater@^1.1.0: version "1.1.0" diff --git a/package.json b/package.json index 6aef60a69eb..e741661bd4a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.72.0", - "distro": "d9fc5ec0abd44d6d2eab4ad5c0cf4ca9c4e839e1", + "distro": "d4b1b117d224d627ec65bb0fd0b02fdee65303aa", "author": { "name": "Microsoft Corporation" }, @@ -86,13 +86,13 @@ "vscode-proxy-agent": "^0.12.0", "vscode-regexpp": "^3.1.0", "vscode-textmate": "7.0.1", - "xterm": "5.1.0-beta.10", + "xterm": "5.1.0-beta.15", "xterm-addon-canvas": "0.3.0-beta.1", "xterm-addon-search": "0.11.0-beta.1", "xterm-addon-serialize": "0.9.0-beta.2", "xterm-addon-unicode11": "0.5.0-beta.1", "xterm-addon-webgl": "0.14.0-beta.8", - "xterm-headless": "5.1.0-beta.10", + "xterm-headless": "5.1.0-beta.15", "yauzl": "^2.9.2", "yazl": "^2.4.3" }, diff --git a/product.json b/product.json index d97f6cc80b5..6e124afcf90 100644 --- a/product.json +++ b/product.json @@ -46,7 +46,7 @@ }, { "name": "ms-vscode.js-debug", - "version": "1.71.1", + "version": "1.72.0", "repo": "https://github.com/microsoft/vscode-js-debug", "metadata": { "id": "25629058-ddac-4e17-abba-74678e126c5d", diff --git a/remote/package.json b/remote/package.json index 399771595e0..5a2b2bb40a5 100644 --- a/remote/package.json +++ b/remote/package.json @@ -24,13 +24,13 @@ "vscode-proxy-agent": "^0.12.0", "vscode-regexpp": "^3.1.0", "vscode-textmate": "7.0.1", - "xterm": "5.1.0-beta.10", + "xterm": "5.1.0-beta.15", "xterm-addon-canvas": "0.3.0-beta.1", "xterm-addon-search": "0.11.0-beta.1", "xterm-addon-serialize": "0.9.0-beta.2", "xterm-addon-unicode11": "0.5.0-beta.1", "xterm-addon-webgl": "0.14.0-beta.8", - "xterm-headless": "5.1.0-beta.10", + "xterm-headless": "5.1.0-beta.15", "yauzl": "^2.9.2", "yazl": "^2.4.3" }, diff --git a/remote/web/package.json b/remote/web/package.json index ced3eb18679..090bd1fb4ce 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -11,7 +11,7 @@ "tas-client-umd": "0.1.6", "vscode-oniguruma": "1.6.1", "vscode-textmate": "7.0.1", - "xterm": "5.1.0-beta.10", + "xterm": "5.1.0-beta.15", "xterm-addon-canvas": "0.3.0-beta.1", "xterm-addon-search": "0.11.0-beta.1", "xterm-addon-unicode11": "0.5.0-beta.1", diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 72a9a2160ac..246b60bc896 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -88,7 +88,7 @@ xterm-addon-webgl@0.14.0-beta.8: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.14.0-beta.8.tgz#486ae22b2eb88a12ebded366c4019ee26409cbb8" integrity sha512-G0F70f6zGWtXuZxKiTn9BQswaVz85wcCuadnWRdPFDBlgdEfcboCvVZgQetklOIkluVpt8tYYK013/25iMRKTA== -xterm@5.1.0-beta.10: - version "5.1.0-beta.10" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.1.0-beta.10.tgz#2f55e4e6d63b45152c768857accc06c47920f898" - integrity sha512-McztCKJJ2QvY28oXwK9ACMbbNTKiKQSbli+tZJIROkICmA7QFizwsQBQDoOtAw0po0dP1CInLJXwurqZmfCymQ== +xterm@5.1.0-beta.15: + version "5.1.0-beta.15" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.1.0-beta.15.tgz#146b70c81fd286dbb003d18449918326fa355b6b" + integrity sha512-fO87pEPFMr+h7eo51+6+ew3OhzLm2wwSYz6w/y5lH986rD1lgAeEqFuzjr64pjBzwAihnoaTpumYg5lTZDQpSA== diff --git a/remote/yarn.lock b/remote/yarn.lock index f1b96db5bb3..09e066c08c8 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -813,15 +813,15 @@ xterm-addon-webgl@0.14.0-beta.8: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.14.0-beta.8.tgz#486ae22b2eb88a12ebded366c4019ee26409cbb8" integrity sha512-G0F70f6zGWtXuZxKiTn9BQswaVz85wcCuadnWRdPFDBlgdEfcboCvVZgQetklOIkluVpt8tYYK013/25iMRKTA== -xterm-headless@5.1.0-beta.10: - version "5.1.0-beta.10" - resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.1.0-beta.10.tgz#2a747a1fa96a877c26aea3311b0a62ddae7e2578" - integrity sha512-tRoXL1e87XOIuZ5yIjK43q3x9/MqZ+K24Na7UTl+AqmkXjb5svXfShMV3x8HiNAyxcrnL/MXNilfLoniQGacIA== +xterm-headless@5.1.0-beta.15: + version "5.1.0-beta.15" + resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.1.0-beta.15.tgz#fba76c8e95b552e922354409864c0f55d3b499f7" + integrity sha512-LVtB+KkHs1R2RG8ug3IfOOU0J+qEGttfXagGxfzNq8zxxoSsgoY4D0YvLpM7M/5FK6eGK5K8/yol9XAK63ENog== -xterm@5.1.0-beta.10: - version "5.1.0-beta.10" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.1.0-beta.10.tgz#2f55e4e6d63b45152c768857accc06c47920f898" - integrity sha512-McztCKJJ2QvY28oXwK9ACMbbNTKiKQSbli+tZJIROkICmA7QFizwsQBQDoOtAw0po0dP1CInLJXwurqZmfCymQ== +xterm@5.1.0-beta.15: + version "5.1.0-beta.15" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.1.0-beta.15.tgz#146b70c81fd286dbb003d18449918326fa355b6b" + integrity sha512-fO87pEPFMr+h7eo51+6+ew3OhzLm2wwSYz6w/y5lH986rD1lgAeEqFuzjr64pjBzwAihnoaTpumYg5lTZDQpSA== yallist@^4.0.0: version "4.0.0" diff --git a/src/vs/base/browser/defaultWorkerFactory.ts b/src/vs/base/browser/defaultWorkerFactory.ts index 9d2a34494be..87103de1a54 100644 --- a/src/vs/base/browser/defaultWorkerFactory.ts +++ b/src/vs/base/browser/defaultWorkerFactory.ts @@ -43,11 +43,20 @@ export function getWorkerBootstrapUrl(scriptPath: string, label: string): string return URL.createObjectURL(blob); } - const result = new URL(scriptPath); - COI.addSearchParam(result.searchParams, true, true); - result.hash = label; - return result.href; + const start = scriptPath.lastIndexOf('?'); + const end = scriptPath.lastIndexOf('#', start); + const params = start > 0 + ? new URLSearchParams(scriptPath.substring(start + 1, ~end ? end : undefined)) + : new URLSearchParams(); + COI.addSearchParam(params, true, true); + const search = params.toString(); + + if (!search) { + return `${scriptPath}#${label}`; + } else { + return `${scriptPath}?${params.toString()}#${label}`; + } } // ESM-comment-end diff --git a/src/vs/base/browser/globalPointerMoveMonitor.ts b/src/vs/base/browser/globalPointerMoveMonitor.ts index d5c432114d7..0348db2528f 100644 --- a/src/vs/base/browser/globalPointerMoveMonitor.ts +++ b/src/vs/base/browser/globalPointerMoveMonitor.ts @@ -64,7 +64,17 @@ export class GlobalPointerMoveMonitor implements IDisposable { try { initialElement.setPointerCapture(pointerId); this._hooks.add(toDisposable(() => { - initialElement.releasePointerCapture(pointerId); + try { + initialElement.releasePointerCapture(pointerId); + } catch (err) { + // See https://github.com/microsoft/vscode/issues/161731 + // + // `releasePointerCapture` sometimes fails when being invoked with the exception: + // DOMException: Failed to execute 'releasePointerCapture' on 'Element': + // No active pointer with the given id is found. + // + // There's no need to do anything in case of failure + } })); } catch (err) { // See https://github.com/microsoft/vscode/issues/144584 diff --git a/src/vs/base/browser/ui/codicons/codicon/codicon.ttf b/src/vs/base/browser/ui/codicons/codicon/codicon.ttf index d8ac87cba86..bab11139af8 100644 Binary files a/src/vs/base/browser/ui/codicons/codicon/codicon.ttf and b/src/vs/base/browser/ui/codicons/codicon/codicon.ttf differ diff --git a/src/vs/base/browser/ui/inputbox/inputBox.ts b/src/vs/base/browser/ui/inputbox/inputBox.ts index ae89cb33f38..a9f2b326c28 100644 --- a/src/vs/base/browser/ui/inputbox/inputBox.ts +++ b/src/vs/base/browser/ui/inputbox/inputBox.ts @@ -58,7 +58,7 @@ export interface IInputValidator { } export interface IMessage { - readonly content: string; + readonly content?: string; readonly formatContent?: boolean; // defaults to false readonly type?: MessageType; } @@ -396,7 +396,7 @@ export class InputBox extends Widget { const styles = this.stylesForType(this.message.type); this.element.style.border = styles.border ? `1px solid ${styles.border}` : ''; - if (this.hasFocus() || force) { + if (this.message.content && (this.hasFocus() || force)) { this._showMessage(); } } @@ -477,8 +477,8 @@ export class InputBox extends Widget { }; const spanElement = (this.message.formatContent - ? renderFormattedText(this.message.content, renderOptions) - : renderText(this.message.content, renderOptions)); + ? renderFormattedText(this.message.content!, renderOptions) + : renderText(this.message.content!, renderOptions)); spanElement.classList.add(this.classForType(this.message.type)); const styles = this.stylesForType(this.message.type); diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts index 4bc8ff1b8ee..5cbf7e6f192 100644 --- a/src/vs/base/browser/ui/sash/sash.ts +++ b/src/vs/base/browser/ui/sash/sash.ts @@ -5,7 +5,7 @@ import { $, append, createStyleSheet, EventHelper, EventLike } from 'vs/base/browser/dom'; import { DomEmitter } from 'vs/base/browser/event'; -import { EventType, Gesture, GestureEvent } from 'vs/base/browser/touch'; +import { EventType, Gesture } from 'vs/base/browser/touch'; import { Delayer } from 'vs/base/common/async'; import { memoize } from 'vs/base/common/decorators'; import { Emitter, Event } from 'vs/base/common/event'; @@ -155,6 +155,7 @@ interface PointerEvent extends EventLike { readonly pageY: number; readonly altKey: boolean; readonly target: EventTarget | null; + readonly initialTarget?: EventTarget | undefined; } interface IPointerEventFactory { @@ -419,17 +420,22 @@ export class Sash extends Disposable { this._register(Gesture.addTarget(this.el)); - const onTouchStart = Event.map(this._register(new DomEmitter(this.el, EventType.Start)).event, e => ({ ...e, target: e.initialTarget ?? null })); + const onTouchStart = this._register(new DomEmitter(this.el, EventType.Start)).event; this._register(onTouchStart(e => this.onPointerStart(e, new GestureEventFactory(this.el)), this)); const onTap = this._register(new DomEmitter(this.el, EventType.Tap)).event; - const onDoubleTap = Event.map( - Event.filter( - Event.debounce(onTap, (res, event) => ({ event, count: (res?.count ?? 0) + 1 }), 250), - ({ count }) => count === 2 - ), - ({ event }) => ({ ...event, target: event.initialTarget ?? null }) - ); - this._register(onDoubleTap(this.onPointerDoublePress, this)); + + let doubleTapTimeout: any = undefined; + this._register(onTap(event => { + if (doubleTapTimeout) { + clearTimeout(doubleTapTimeout); + doubleTapTimeout = undefined; + this.onPointerDoublePress(event); + return; + } + + clearTimeout(doubleTapTimeout); + doubleTapTimeout = setTimeout(() => doubleTapTimeout = undefined, 250); + }, this)); if (typeof options.size === 'number') { this.size = options.size; @@ -645,12 +651,14 @@ export class Sash extends Disposable { } private getOrthogonalSash(e: PointerEvent): Sash | undefined { - if (!e.target || !(e.target instanceof HTMLElement)) { + const target = e.initialTarget ?? e.target; + + if (!target || !(target instanceof HTMLElement)) { return undefined; } - if (e.target.classList.contains('orthogonal-drag-handle')) { - return e.target.classList.contains('start') ? this.orthogonalStartSash : this.orthogonalEndSash; + if (target.classList.contains('orthogonal-drag-handle')) { + return target.classList.contains('start') ? this.orthogonalStartSash : this.orthogonalEndSash; } return undefined; diff --git a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts index cc09126b530..cfdaca03d75 100644 --- a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts +++ b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts @@ -15,7 +15,7 @@ import { ISelectBoxDelegate, ISelectBoxOptions, ISelectBoxStyles, ISelectData, I import * as arrays from 'vs/base/common/arrays'; import { Emitter, Event } from 'vs/base/common/event'; import { KeyCode, KeyCodeUtils } from 'vs/base/common/keyCodes'; -import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import { isMacintosh } from 'vs/base/common/platform'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import 'vs/css!./selectBoxCustom'; @@ -31,7 +31,6 @@ interface ISelectListTemplateData { text: HTMLElement; detail: HTMLElement; decoratorRight: HTMLElement; - disposables: IDisposable[]; } class SelectListRenderer implements IListRenderer { @@ -40,7 +39,6 @@ class SelectListRenderer implements IListRenderer implements IListRenderer private hideTwistiesOfChildlessElements: boolean = false; private shouldRenderIndentGuides: boolean = false; - private renderedIndentGuides = new SetMap, HTMLDivElement>(); private activeIndentNodes = new Set>(); private indentGuidesDisposable: IDisposable = Disposable.None; @@ -348,6 +347,7 @@ class TreeRenderer implements IListRenderer private modelProvider: () => ITreeModel, onDidChangeCollapseState: Event>, private activeNodes: Collection>, + private renderedIndentGuides: SetMap, HTMLDivElement>, options: ITreeRendererOptions = {} ) { this.templateId = renderer.templateId; @@ -695,6 +695,14 @@ class FindWidget extends Disposable { this.findInput.inputBox.setPlaceHolder(mode === TreeFindMode.Filter ? localize('type to filter', "Type to filter") : localize('type to search', "Type to search")); } + get value(): string { + return this.findInput.inputBox.value; + } + + set value(value: string) { + this.findInput.inputBox.value = value; + } + private readonly modeToggle: ModeToggle; private readonly findInput: FindInput; private readonly actionbar: ActionBar; @@ -876,6 +884,7 @@ class FindController implements IDisposable { private _pattern = ''; get pattern(): string { return this._pattern; } + private previousPattern = ''; private _mode: TreeFindMode; get mode(): TreeFindMode { return this._mode; } @@ -940,6 +949,9 @@ class FindController implements IDisposable { this.widget.layout(this.width); this.widget.focus(); + this.widget.value = this.previousPattern; + this.widget.select(); + this._onDidChangeOpenState.fire(true); } @@ -953,6 +965,7 @@ class FindController implements IDisposable { this.enabledDisposables.dispose(); this.enabledDisposables = new DisposableStore(); + this.previousPattern = this.pattern; this.onDidChangeValue(''); this.tree.domFocus(); @@ -996,7 +1009,11 @@ class FindController implements IDisposable { const noMatches = this.filter.totalCount > 0 && this.filter.matchCount === 0; if (this.pattern && noMatches) { - this.widget?.showMessage({ type: MessageType.WARNING, content: localize('not found', "No elements found.") }); + if (this.tree.options.showNotFoundMessage ?? true) { + this.widget?.showMessage({ type: MessageType.WARNING, content: localize('not found', "No elements found.") }); + } else { + this.widget?.showMessage({ type: MessageType.WARNING }); + } } else { this.widget?.clearMessage(); } @@ -1062,6 +1079,7 @@ export interface IAbstractTreeOptionsUpdate extends ITreeRendererOptions { readonly typeNavigationEnabled?: boolean; readonly typeNavigationMode?: TypeNavigationMode; readonly defaultFindMode?: TreeFindMode; + readonly showNotFoundMessage?: boolean; readonly smoothScrolling?: boolean; readonly horizontalScrolling?: boolean; readonly mouseWheelScrollSensitivity?: number; @@ -1430,7 +1448,8 @@ export abstract class AbstractTree implements IDisposable const onDidChangeCollapseStateRelay = new Relay>(); const onDidChangeActiveNodes = new Relay[]>(); const activeNodes = this.disposables.add(new EventCollection(onDidChangeActiveNodes.event)); - this.renderers = renderers.map(r => new TreeRenderer(r, () => this.model, onDidChangeCollapseStateRelay.event, activeNodes, _options)); + const renderedIndentGuides = new SetMap, HTMLDivElement>(); + this.renderers = renderers.map(r => new TreeRenderer(r, () => this.model, onDidChangeCollapseStateRelay.event, activeNodes, renderedIndentGuides, _options)); for (const r of this.renderers) { this.disposables.add(r); } diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index 2a78f7afb18..1c2e42bba59 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -576,12 +576,16 @@ export class TernarySearchTree { if (!node.mid && !node.value) { if (node.left && node.right) { // full node + // replace deleted-node with the min-node of the right branch. + // If there is no true min-node leave things as they are const min = this._min(node.right); - const { key, value, segment } = min; - this._delete(min.key!, false); - node.key = key; - node.value = value; - node.segment = segment; + if (min.key) { + const { key, value, segment } = min; + this._delete(min.key!, false); + node.key = key; + node.value = value; + node.segment = segment; + } } else { // empty or half empty diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts index 243bb3b82d3..648a6391131 100644 --- a/src/vs/base/common/network.ts +++ b/src/vs/base/common/network.ts @@ -150,7 +150,7 @@ class RemoteAuthoritiesImpl { } const authority = uri.authority; let host = this._hosts[authority]; - if (host && host.indexOf(':') !== -1) { + if (host && host.indexOf(':') !== -1 && host.indexOf('[') === -1) { host = `[${host}]`; } const port = this._ports[authority]; diff --git a/src/vs/base/parts/ipc/node/ipc.net.ts b/src/vs/base/parts/ipc/node/ipc.net.ts index bff8e41d8e5..810ba41d106 100644 --- a/src/vs/base/parts/ipc/node/ipc.net.ts +++ b/src/vs/base/parts/ipc/node/ipc.net.ts @@ -32,6 +32,9 @@ export class NodeSocket implements ISocket { public readonly debugLabel: string; public readonly socket: Socket; private readonly _errorListener: (err: any) => void; + private readonly _closeListener: (hadError: boolean) => void; + private readonly _endListener: () => void; + private _canWrite = true; public traceSocketEvent(type: SocketDiagnosticsEventType, data?: VSBuffer | Uint8Array | ArrayBuffer | ArrayBufferView | any): void { SocketDiagnostics.traceSocketEvent(this.socket, this.debugLabel, type, data); @@ -57,10 +60,24 @@ export class NodeSocket implements ISocket { } }; this.socket.on('error', this._errorListener); + + this._closeListener = (hadError: boolean) => { + this.traceSocketEvent(SocketDiagnosticsEventType.Close, { hadError }); + this._canWrite = false; + }; + this.socket.on('close', this._closeListener); + + this._endListener = () => { + this.traceSocketEvent(SocketDiagnosticsEventType.NodeEndReceived); + this._canWrite = false; + }; + this.socket.on('end', this._endListener); } public dispose(): void { this.socket.off('error', this._errorListener); + this.socket.off('close', this._closeListener); + this.socket.off('end', this._endListener); this.socket.destroy(); } @@ -77,7 +94,6 @@ export class NodeSocket implements ISocket { public onClose(listener: (e: SocketCloseEvent) => void): IDisposable { const adapter = (hadError: boolean) => { - this.traceSocketEvent(SocketDiagnosticsEventType.Close, { hadError }); listener({ type: SocketCloseEventType.NodeSocketCloseEvent, hadError: hadError, @@ -92,7 +108,6 @@ export class NodeSocket implements ISocket { public onEnd(listener: () => void): IDisposable { const adapter = () => { - this.traceSocketEvent(SocketDiagnosticsEventType.NodeEndReceived); listener(); }; this.socket.on('end', adapter); @@ -103,7 +118,7 @@ export class NodeSocket implements ISocket { public write(buffer: VSBuffer): void { // return early if socket has been destroyed in the meantime - if (this.socket.destroyed) { + if (this.socket.destroyed || !this._canWrite) { return; } diff --git a/src/vs/base/parts/quickinput/browser/quickInput.ts b/src/vs/base/parts/quickinput/browser/quickInput.ts index 41e7da28efa..ec55bbc810b 100644 --- a/src/vs/base/parts/quickinput/browser/quickInput.ts +++ b/src/vs/base/parts/quickinput/browser/quickInput.ts @@ -1166,11 +1166,14 @@ class InputBox extends QuickInput implements IInputBox { if (!this.visible) { return; } + + this.ui.container.classList.remove('hidden-input'); const visibilities: Visibilities = { title: !!this.title || !!this.step || !!this.buttons.length, description: !!this.description || !!this.step, inputBox: true, message: true }; + this.ui.setVisibilities(visibilities); super.update(); if (this.ui.inputBox.value !== this.value) { @@ -1186,7 +1189,6 @@ class InputBox extends QuickInput implements IInputBox { if (this.ui.inputBox.password !== this.password) { this.ui.inputBox.password = this.password; } - } } diff --git a/src/vs/base/test/common/event.test.ts b/src/vs/base/test/common/event.test.ts index 79816c693e2..d87a96adda5 100644 --- a/src/vs/base/test/common/event.test.ts +++ b/src/vs/base/test/common/event.test.ts @@ -9,6 +9,7 @@ import { errorHandler, setUnexpectedErrorHandler } from 'vs/base/common/errors'; import { AsyncEmitter, DebounceEmitter, Emitter, Event, EventBufferer, EventMultiplexer, IWaitUntil, MicrotaskEmitter, PauseableEmitter, Relay } from 'vs/base/common/event'; import { DisposableStore, IDisposable, isDisposable, setDisposableTracker, toDisposable } from 'vs/base/common/lifecycle'; import { observableValue, transaction } from 'vs/base/common/observable'; +import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; import { DisposableTracker, ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; namespace Samples { @@ -317,26 +318,29 @@ suite('Event', function () { }); test('DebounceEmitter', async function () { - let callCount = 0; - let sum = 0; - const emitter = new DebounceEmitter({ - merge: arr => { - callCount += 1; - return arr.reduce((p, c) => p + c); - } + return runWithFakedTimers({}, async function () { + + let callCount = 0; + let sum = 0; + const emitter = new DebounceEmitter({ + merge: arr => { + callCount += 1; + return arr.reduce((p, c) => p + c); + } + }); + + emitter.event(e => { sum = e; }); + + const p = Event.toPromise(emitter.event); + + emitter.fire(1); + emitter.fire(2); + + await p; + + assert.strictEqual(callCount, 1); + assert.strictEqual(sum, 3); }); - - emitter.event(e => { sum = e; }); - - const p = Event.toPromise(emitter.event); - - emitter.fire(1); - emitter.fire(2); - - await p; - - assert.strictEqual(callCount, 1); - assert.strictEqual(sum, 3); }); test('Microtask Emitter', (done) => { @@ -410,59 +414,64 @@ suite('AsyncEmitter', function () { }); test('sequential delivery', async function () { + return runWithFakedTimers({}, async function () { - interface E extends IWaitUntil { - foo: boolean; - } + interface E extends IWaitUntil { + foo: boolean; + } - let globalState = 0; - const emitter = new AsyncEmitter(); + let globalState = 0; + const emitter = new AsyncEmitter(); - emitter.event(e => { - e.waitUntil(timeout(10).then(_ => { - assert.strictEqual(globalState, 0); - globalState += 1; - })); + emitter.event(e => { + e.waitUntil(timeout(10).then(_ => { + assert.strictEqual(globalState, 0); + globalState += 1; + })); + }); + + emitter.event(e => { + e.waitUntil(timeout(1).then(_ => { + assert.strictEqual(globalState, 1); + globalState += 1; + })); + }); + + await emitter.fireAsync({ foo: true }, CancellationToken.None); + assert.strictEqual(globalState, 2); }); - - emitter.event(e => { - e.waitUntil(timeout(1).then(_ => { - assert.strictEqual(globalState, 1); - globalState += 1; - })); - }); - - await emitter.fireAsync({ foo: true }, CancellationToken.None); - assert.strictEqual(globalState, 2); }); test('sequential, in-order delivery', async function () { - interface E extends IWaitUntil { - foo: number; - } - const events: number[] = []; - let done = false; - const emitter = new AsyncEmitter(); + return runWithFakedTimers({}, async function () { - // e1 - emitter.event(e => { - e.waitUntil(timeout(10).then(async _ => { - if (e.foo === 1) { - await emitter.fireAsync({ foo: 2 }, CancellationToken.None); - assert.deepStrictEqual(events, [1, 2]); - done = true; - } - })); + interface E extends IWaitUntil { + foo: number; + } + const events: number[] = []; + let done = false; + const emitter = new AsyncEmitter(); + + // e1 + emitter.event(e => { + e.waitUntil(timeout(10).then(async _ => { + if (e.foo === 1) { + await emitter.fireAsync({ foo: 2 }, CancellationToken.None); + assert.deepStrictEqual(events, [1, 2]); + done = true; + } + })); + }); + + // e2 + emitter.event(e => { + events.push(e.foo); + e.waitUntil(timeout(7)); + }); + + await emitter.fireAsync({ foo: 1 }, CancellationToken.None); + assert.ok(done); }); - - // e2 - emitter.event(e => { - events.push(e.foo); - e.waitUntil(timeout(7)); - }); - - await emitter.fireAsync({ foo: 1 }, CancellationToken.None); - assert.ok(done); }); test('catch errors', async function () { diff --git a/src/vs/base/test/common/map.test.ts b/src/vs/base/test/common/map.test.ts index 896d06ec812..0d3f3dfe131 100644 --- a/src/vs/base/test/common/map.test.ts +++ b/src/vs/base/test/common/map.test.ts @@ -862,6 +862,49 @@ suite('Map', () => { } }); + test('TernarySearchTree: Cannot read properties of undefined (reading \'length\'): #161618 (simple)', function () { + const raw = 'config.debug.toolBarLocation,floating,config.editor.renderControlCharacters,true,config.editor.renderWhitespace,selection,config.files.autoSave,off,config.git.enabled,true,config.notebook.globalToolbar,true,config.terminal.integrated.tabs.enabled,true,config.terminal.integrated.tabs.showActions,singleTerminalOrNarrow,config.terminal.integrated.tabs.showActiveTerminal,singleTerminalOrNarrow,config.workbench.activityBar.visible,true,config.workbench.experimental.settingsProfiles.enabled,true,config.workbench.layoutControl.type,both,config.workbench.sideBar.location,left,config.workbench.statusBar.visible,true'; + const array = raw.split(','); + const tuples: [string, string][] = []; + for (let i = 0; i < array.length; i += 2) { + tuples.push([array[i], array[i + 1]]); + } + + const map = TernarySearchTree.forConfigKeys(); + map.fill(tuples); + + assert.strictEqual([...map].join(), raw); + assert.ok(map.has('config.editor.renderWhitespace')); + + const len = [...map].length; + map.delete('config.editor.renderWhitespace'); + assert.ok(map._isBalanced()); + assert.strictEqual([...map].length, len - 1); + }); + + test('TernarySearchTree: Cannot read properties of undefined (reading \'length\'): #161618 (random)', function () { + const raw = 'config.debug.toolBarLocation,floating,config.editor.renderControlCharacters,true,config.editor.renderWhitespace,selection,config.files.autoSave,off,config.git.enabled,true,config.notebook.globalToolbar,true,config.terminal.integrated.tabs.enabled,true,config.terminal.integrated.tabs.showActions,singleTerminalOrNarrow,config.terminal.integrated.tabs.showActiveTerminal,singleTerminalOrNarrow,config.workbench.activityBar.visible,true,config.workbench.experimental.settingsProfiles.enabled,true,config.workbench.layoutControl.type,both,config.workbench.sideBar.location,left,config.workbench.statusBar.visible,true'; + const array = raw.split(','); + const tuples: [string, string][] = []; + for (let i = 0; i < array.length; i += 2) { + tuples.push([array[i], array[i + 1]]); + } + + for (let round = 100; round >= 0; round--) { + shuffle(tuples); + const map = TernarySearchTree.forConfigKeys(); + map.fill(tuples); + + assert.strictEqual([...map].join(), raw); + assert.ok(map.has('config.editor.renderWhitespace')); + + const len = [...map].length; + map.delete('config.editor.renderWhitespace'); + assert.ok(map._isBalanced()); + assert.strictEqual([...map].length, len - 1); + } + }); + test('TernarySearchTree (PathSegments) - lookup', function () { const map = new TernarySearchTree(new PathIterator()); diff --git a/src/vs/editor/browser/services/bulkEditService.ts b/src/vs/editor/browser/services/bulkEditService.ts index 12d1417489a..4f06c9ca68b 100644 --- a/src/vs/editor/browser/services/bulkEditService.ts +++ b/src/vs/editor/browser/services/bulkEditService.ts @@ -108,6 +108,7 @@ export interface IBulkEditOptions { export interface IBulkEditResult { ariaSummary: string; + isApplied: boolean; } export type IBulkEditPreviewHandler = (edits: ResourceEdit[], options?: IBulkEditOptions) => Promise; diff --git a/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts b/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts index 48f52d6d231..87057ba9ce6 100644 --- a/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts +++ b/src/vs/editor/browser/viewParts/blockDecorations/blockDecorations.ts @@ -82,10 +82,20 @@ export class BlockDecorations extends ViewPart { block = this.blocks[count] = createFastDomNode(document.createElement('div')); this.domNode.appendChild(block); } - const top = ctx.getVerticalOffsetForLineNumber(decoration.range.startLineNumber, true); - const bottom = decoration.range.isEmpty() - ? ctx.getVerticalOffsetForLineNumber(decoration.range.startLineNumber, false) - : ctx.getVerticalOffsetAfterLineNumber(decoration.range.endLineNumber, true); + + let top: number; + let bottom: number; + + if (decoration.options.blockIsAfterEnd) { + // range must be empty + top = ctx.getVerticalOffsetAfterLineNumber(decoration.range.endLineNumber, false); + bottom = ctx.getVerticalOffsetAfterLineNumber(decoration.range.endLineNumber, true); + } else { + top = ctx.getVerticalOffsetForLineNumber(decoration.range.startLineNumber, true); + bottom = decoration.range.isEmpty() + ? ctx.getVerticalOffsetForLineNumber(decoration.range.startLineNumber, false) + : ctx.getVerticalOffsetAfterLineNumber(decoration.range.endLineNumber, true); + } block.setClassName('blockDecorations-block ' + decoration.options.blockClassName); block.setLeft(ctx.scrollLeft); diff --git a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts index f45578d9f15..37c8f7ac5d0 100644 --- a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts +++ b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts @@ -432,6 +432,12 @@ class Widget { } } + // Left-align widgets that should appear :before content + if (this._affinity === PositionAffinity.LeftOfInjectedText && + this._viewRange.startColumn === 1) { + firstLineMinLeft = 0; + } + let lastLineMinLeft = Constants.MAX_SAFE_SMALL_INTEGER;//lastLine.Constants.MAX_SAFE_SMALL_INTEGER; for (const visibleRange of lastLine.ranges) { if (visibleRange.left < lastLineMinLeft) { diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.css b/src/vs/editor/browser/viewParts/lines/viewLines.css index 315306d65f2..f83ea79dd02 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.css +++ b/src/vs/editor/browser/viewParts/lines/viewLines.css @@ -25,6 +25,15 @@ user-select: none; -webkit-user-select: none; } +/* Use user-select: text for lookup feature on macOS */ +/* https://github.com/microsoft/vscode/issues/85632 */ +.monaco-editor.mac .lines-content:hover, +.monaco-editor.mac .view-line:hover, +.monaco-editor.mac .view-lines:hover { + user-select: text; + -webkit-user-select: text; + -ms-user-select: text; +} .monaco-editor.enable-user-select { user-select: initial; diff --git a/src/vs/editor/common/diff/standardLinesDiffComputer.ts b/src/vs/editor/common/diff/standardLinesDiffComputer.ts index ce0b07c8a2e..464d33592fb 100644 --- a/src/vs/editor/common/diff/standardLinesDiffComputer.ts +++ b/src/vs/editor/common/diff/standardLinesDiffComputer.ts @@ -57,13 +57,45 @@ export class StandardLinesDiffComputer implements ILinesDiffComputer { })(); const alignments: RangeMapping[] = []; + + const scanForWhitespaceChanges = (equalLinesCount: number) => { + for (let i = 0; i < equalLinesCount; i++) { + const seq1Offset = seq1LastStart + i; + const seq2Offset = seq2LastStart + i; + if (originalLines[seq1Offset] !== modifiedLines[seq2Offset]) { + // This is because of whitespace changes, diff these lines + const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff( + new OffsetRange(seq1Offset, seq1Offset + 1), + new OffsetRange(seq2Offset, seq2Offset + 1) + )); + for (const a of characterDiffs) { + alignments.push(a); + } + } + } + }; + + let seq1LastStart = 0; + let seq2LastStart = 0; + for (const diff of lineAlignments) { + assertFn(() => diff.seq1Range.start - seq1LastStart === diff.seq2Range.start - seq2LastStart); + + const equalLinesCount = diff.seq1Range.start - seq1LastStart; + + scanForWhitespaceChanges(equalLinesCount); + + seq1LastStart = diff.seq1Range.endExclusive; + seq2LastStart = diff.seq2Range.endExclusive; + const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff); for (const a of characterDiffs) { alignments.push(a); } } + scanForWhitespaceChanges(originalLines.length - seq1LastStart); + const changes: LineRangeMapping[] = lineRangeMappingFromRangeMappings(alignments); return { diff --git a/src/vs/editor/common/model.ts b/src/vs/editor/common/model.ts index 5cefe83dfc8..6c7badf0b8a 100644 --- a/src/vs/editor/common/model.ts +++ b/src/vs/editor/common/model.ts @@ -92,6 +92,11 @@ export interface IModelDecorationOptions { */ className?: string | null; blockClassName?: string | null; + /** + * Indicates if this block should be rendered after the last line. + * In this case, the range must be empty and set to the last line. + */ + blockIsAfterEnd?: boolean | null; /** * Message to be rendered when hovering over the glyph margin decoration. */ diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 102dc04c973..27ee2e71319 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -2231,6 +2231,7 @@ export class ModelDecorationOptions implements model.IModelDecorationOptions { readonly description: string; readonly blockClassName: string | null; + readonly blockIsAfterEnd: boolean | null; readonly stickiness: model.TrackedRangeStickiness; readonly zIndex: number; readonly className: string | null; @@ -2258,6 +2259,7 @@ export class ModelDecorationOptions implements model.IModelDecorationOptions { private constructor(options: model.IModelDecorationOptions) { this.description = options.description; this.blockClassName = options.blockClassName ? cleanClassName(options.blockClassName) : null; + this.blockIsAfterEnd = options.blockIsAfterEnd ?? null; this.stickiness = options.stickiness || model.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges; this.zIndex = options.zIndex || 0; this.className = options.className ? cleanClassName(options.className) : null; diff --git a/src/vs/editor/common/services/languageFeatureDebounce.ts b/src/vs/editor/common/services/languageFeatureDebounce.ts index e4e67bd700f..417a2d9dc08 100644 --- a/src/vs/editor/common/services/languageFeatureDebounce.ts +++ b/src/vs/editor/common/services/languageFeatureDebounce.ts @@ -8,7 +8,7 @@ import { LRUCache } from 'vs/base/common/map'; import { clamp, MovingAverage, SlidingWindowAverage } from 'vs/base/common/numbers'; import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; import { ITextModel } from 'vs/editor/common/model'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/platform/log/common/log'; import { matchesScheme } from 'vs/platform/opener/common/opener'; @@ -136,4 +136,4 @@ export class LanguageFeatureDebounceService implements ILanguageFeatureDebounceS } } -registerSingleton(ILanguageFeatureDebounceService, LanguageFeatureDebounceService, true); +registerSingleton(ILanguageFeatureDebounceService, LanguageFeatureDebounceService, InstantiationType.Delayed); diff --git a/src/vs/editor/common/services/languageFeaturesService.ts b/src/vs/editor/common/services/languageFeaturesService.ts index 4059a90b370..35d321b4ef2 100644 --- a/src/vs/editor/common/services/languageFeaturesService.ts +++ b/src/vs/editor/common/services/languageFeaturesService.ts @@ -7,7 +7,7 @@ import { URI } from 'vs/base/common/uri'; import { LanguageFeatureRegistry, NotebookInfo, NotebookInfoResolver } from 'vs/editor/common/languageFeatureRegistry'; import { CodeActionProvider, CodeLensProvider, CompletionItemProvider, DocumentPasteEditProvider, DeclarationProvider, DefinitionProvider, DocumentColorProvider, DocumentFormattingEditProvider, DocumentHighlightProvider, DocumentOnDropEditProvider, DocumentRangeFormattingEditProvider, DocumentRangeSemanticTokensProvider, DocumentSemanticTokensProvider, DocumentSymbolProvider, EvaluatableExpressionProvider, FoldingRangeProvider, HoverProvider, ImplementationProvider, InlayHintsProvider, InlineCompletionsProvider, InlineValuesProvider, LinkedEditingRangeProvider, LinkProvider, OnTypeFormattingEditProvider, ReferenceProvider, RenameProvider, SelectionRangeProvider, SignatureHelpProvider, TypeDefinitionProvider } from 'vs/editor/common/languages'; import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; export class LanguageFeaturesService implements ILanguageFeaturesService { @@ -55,4 +55,4 @@ export class LanguageFeaturesService implements ILanguageFeaturesService { } -registerSingleton(ILanguageFeaturesService, LanguageFeaturesService, true); +registerSingleton(ILanguageFeaturesService, LanguageFeaturesService, InstantiationType.Delayed); diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionUi.ts b/src/vs/editor/contrib/codeAction/browser/codeActionUi.ts index 13e0d5fe187..3066ae54574 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionUi.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionUi.ts @@ -15,6 +15,7 @@ import { CodeActionTriggerType } from 'vs/editor/common/languages'; import { CodeActionItem, CodeActionSet } from 'vs/editor/contrib/codeAction/browser/codeAction'; import { MessageController } from 'vs/editor/contrib/message/browser/messageController'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { CodeActionsState } from './codeActionModel'; import { CodeActionShowOptions, CodeActionWidget } from './codeActionWidget'; @@ -34,8 +35,9 @@ export class CodeActionUi extends Disposable { private readonly delegate: { applyCodeAction: (action: CodeActionItem, regtriggerAfterApply: boolean, preview: boolean) => Promise; }, - @IInstantiationService private readonly _instantiationService: IInstantiationService, @IConfigurationService private readonly _configurationService: IConfigurationService, + @IContextKeyService private readonly _contextKeyService: IContextKeyService, + @IInstantiationService private readonly _instantiationService: IInstantiationService, ) { super(); @@ -166,7 +168,7 @@ export class CodeActionUi extends Disposable { onHide: () => { this._editor?.focus(); }, - }); + }, this._contextKeyService); } private toCoords(position: IPosition): IAnchor { diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionWidget.css b/src/vs/editor/contrib/codeAction/browser/codeActionWidget.css index 2561c7f4f04..c788bfe5d1e 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionWidget.css +++ b/src/vs/editor/contrib/codeAction/browser/codeActionWidget.css @@ -12,10 +12,8 @@ display: block; width: 100%; border: 1px solid var(--vscode-editorWidget-border) !important; - border-color: none; background-color: var(--vscode-editorWidget-background); - color: var(--vscode--editorWidget-foreground); - box-shadow: var(--vscode-widget-shadow) 0 2px 8px; + color: var(--vscode-editorWidget-foreground); } .codeActionWidget .monaco-list { @@ -42,7 +40,7 @@ width: 100%; } -.codeActionWidget .monaco-list .monaco-list-row.code-action.focused:not(.option-disabled) { +.codeActionWidget .monaco-list .monaco-list-row.code-action.focused:not(.option-disabled) { background-color: var(--vscode-quickInputList-focusBackground); color: var(--vscode-quickInputList-focusForeground); outline: 1px solid var(--vscode-menu-selectionBorder, transparent); @@ -51,7 +49,7 @@ .codeActionWidget .monaco-list-row.group-header { color: var(--vscode-pickerGroup-foreground); - font-weight: bold; + font-weight: 600; } .codeActionWidget .monaco-list .group-header, @@ -72,7 +70,7 @@ .codeActionWidget .monaco-list-row.code-action { display: flex; - gap: 10px; + gap: 6px; align-items: center; } @@ -98,28 +96,30 @@ .codeActionWidget .codeActionWidget-action-bar { margin-top: 4px; - margin-bottom: 4px; + background-color: var(--vscode-editorHoverWidget-statusBarBackground); + border-top: 1px solid var(--vscode-editorHoverWidget-border); } .codeActionWidget .codeActionWidget-action-bar::before { display: block; content: ""; width: 100%; - margin-bottom: 4px; - border-bottom: 1px solid var(--vscode-menu-separatorBackground); } .codeActionWidget .codeActionWidget-action-bar .actions-container { - padding: 0 10px; + padding: 0 8px; } .codeActionWidget-action-bar .action-label { color: var(--vscode-textLink-activeForeground); + font-size: 12px; + line-height: 22px; + padding: 0; pointer-events: all; } .codeActionWidget-action-bar .action-item { - margin-right: 10px; + margin-right: 16px; pointer-events: none; } diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionWidget.ts b/src/vs/editor/contrib/codeAction/browser/codeActionWidget.ts index 7c3180aa563..a35cb65a441 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionWidget.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionWidget.ts @@ -20,7 +20,7 @@ import { CodeActionKind, CodeActionTrigger, CodeActionTriggerSource } from 'vs/e import 'vs/editor/contrib/symbolIcons/browser/symbolIcons'; // The codicon symbol colors are defined here and must be loaded to get colors import { localize } from 'vs/nls'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; @@ -369,40 +369,44 @@ export class CodeActionWidget extends Disposable { readonly container: HTMLElement | undefined; readonly codeActions: CodeActionSet; readonly delegate: CodeActionWidgetDelegate; + readonly contextKeyService: IContextKeyService; }; - private readonly _ctxMenuWidgetVisible: IContextKey; - constructor( @ICommandService private readonly _commandService: ICommandService, - @IContextKeyService private readonly _contextKeyService: IContextKeyService, @IContextViewService private readonly _contextViewService: IContextViewService, @IKeybindingService private readonly _keybindingService: IKeybindingService, @ITelemetryService private readonly _telemetryService: ITelemetryService, ) { super(); - - this._ctxMenuWidgetVisible = Context.Visible.bindTo(this._contextKeyService); } get isVisible(): boolean { return !!this.currentShowingContext; } - public async show(trigger: CodeActionTrigger, codeActions: CodeActionSet, anchor: IAnchor, container: HTMLElement | undefined, options: CodeActionShowOptions, delegate: CodeActionWidgetDelegate): Promise { + public async show(trigger: CodeActionTrigger, codeActions: CodeActionSet, anchor: IAnchor, container: HTMLElement | undefined, options: CodeActionShowOptions, delegate: CodeActionWidgetDelegate, contextKeyService: IContextKeyService): Promise { this.currentShowingContext = undefined; + const visibleContext = Context.Visible.bindTo(contextKeyService); const actionsToShow = options.includeDisabledActions && (showDisabled || codeActions.validActions.length === 0) ? codeActions.allActions : codeActions.validActions; if (!actionsToShow.length) { + visibleContext.reset(); return; } - this.currentShowingContext = { trigger, codeActions, anchor, container, delegate, options }; + this.currentShowingContext = { trigger, codeActions, anchor, container, delegate, options, contextKeyService }; this._contextViewService.showContextView({ getAnchor: () => anchor, - render: (container: HTMLElement) => this.renderWidget(container, trigger, codeActions, options, actionsToShow, delegate), - onHide: (didCancel: boolean) => this.onWidgetClosed(trigger, options, codeActions, didCancel, delegate), + render: (container: HTMLElement) => { + visibleContext.set(true); + return this.renderWidget(container, trigger, codeActions, options, actionsToShow, delegate); + }, + onHide: (didCancel: boolean) => { + visibleContext.reset(); + return this.onWidgetClosed(trigger, options, codeActions, didCancel, delegate); + }, }, container, false); } @@ -419,7 +423,6 @@ export class CodeActionWidget extends Disposable { } public hide() { - this._ctxMenuWidgetVisible.reset(); this.codeActionList.clear(); this._contextViewService.hideContextView(); } @@ -488,8 +491,6 @@ export class CodeActionWidget extends Disposable { const focusTracker = renderDisposables.add(dom.trackFocus(element)); renderDisposables.add(focusTracker.onDidBlur(() => this.hide())); - this._ctxMenuWidgetVisible.set(true); - return renderDisposables; } @@ -504,7 +505,7 @@ export class CodeActionWidget extends Disposable { showDisabled = newShowDisabled; if (previousCtx) { - this.show(previousCtx.trigger, previousCtx.codeActions, previousCtx.anchor, previousCtx.container, previousCtx.options, previousCtx.delegate); + this.show(previousCtx.trigger, previousCtx.codeActions, previousCtx.anchor, previousCtx.container, previousCtx.options, previousCtx.delegate, previousCtx.contextKeyService); } } @@ -530,6 +531,7 @@ export class CodeActionWidget extends Disposable { }); this.currentShowingContext = undefined; + delegate.onHide(cancelled); } diff --git a/src/vs/editor/contrib/codelens/browser/codeLensCache.ts b/src/vs/editor/contrib/codelens/browser/codeLensCache.ts index f6696e42746..4ab8835ae2f 100644 --- a/src/vs/editor/contrib/codelens/browser/codeLensCache.ts +++ b/src/vs/editor/contrib/codelens/browser/codeLensCache.ts @@ -10,7 +10,7 @@ import { Range } from 'vs/editor/common/core/range'; import { ITextModel } from 'vs/editor/common/model'; import { CodeLens, CodeLensList, CodeLensProvider } from 'vs/editor/common/languages'; import { CodeLensModel } from 'vs/editor/contrib/codelens/browser/codelens'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage'; @@ -129,4 +129,4 @@ export class CodeLensCache implements ICodeLensCache { } } -registerSingleton(ICodeLensCache, CodeLensCache, true); +registerSingleton(ICodeLensCache, CodeLensCache, InstantiationType.Delayed); diff --git a/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts b/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts index bbebc0a585e..e9746fec571 100644 --- a/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts +++ b/src/vs/editor/contrib/documentSymbols/browser/outlineModel.ts @@ -17,7 +17,7 @@ import { DocumentSymbol, DocumentSymbolProvider } from 'vs/editor/common/languag import { MarkerSeverity } from 'vs/platform/markers/common/markers'; import { IFeatureDebounceInformation, ILanguageFeatureDebounceService } from 'vs/editor/common/services/languageFeatureDebounce'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IModelService } from 'vs/editor/common/services/model'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; @@ -485,4 +485,4 @@ export class OutlineModelService implements IOutlineModelService { } } -registerSingleton(IOutlineModelService, OutlineModelService, true); +registerSingleton(IOutlineModelService, OutlineModelService, InstantiationType.Delayed); diff --git a/src/vs/editor/contrib/find/browser/findOptionsWidget.ts b/src/vs/editor/contrib/find/browser/findOptionsWidget.ts index ca04b53497d..7169c362279 100644 --- a/src/vs/editor/contrib/find/browser/findOptionsWidget.ts +++ b/src/vs/editor/contrib/find/browser/findOptionsWidget.ts @@ -43,6 +43,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { this._domNode.className = 'findOptionsWidget'; this._domNode.style.display = 'none'; this._domNode.style.top = '10px'; + this._domNode.style.zIndex = '12'; this._domNode.setAttribute('role', 'presentation'); this._domNode.setAttribute('aria-hidden', 'true'); diff --git a/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts b/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts index 8e7e0bb70d6..1162ef145ea 100644 --- a/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts +++ b/src/vs/editor/contrib/gotoError/browser/markerNavigationService.ts @@ -12,7 +12,7 @@ import { URI } from 'vs/base/common/uri'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { ITextModel } from 'vs/editor/common/model'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IMarker, IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -221,4 +221,4 @@ class MarkerNavigationService implements IMarkerNavigationService, IMarkerListPr } } -registerSingleton(IMarkerNavigationService, MarkerNavigationService, true); +registerSingleton(IMarkerNavigationService, MarkerNavigationService, InstantiationType.Delayed); diff --git a/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts b/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts index cc7d0b8c67a..c3f073892da 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts @@ -79,9 +79,11 @@ export abstract class SymbolNavigationAction extends EditorAction2 { private static _allSymbolNavigationCommands = new Map(); private static _activeAlternativeCommands = new Set(); - readonly configuration: SymbolNavigationActionConfig; + static all(): IterableIterator { + return SymbolNavigationAction._allSymbolNavigationCommands.values(); + } - private static aaa(opts: IAction2Options): IAction2Options { + private static _patchConfig(opts: IAction2Options): IAction2Options { const result = { ...opts, f1: true }; // patch context menu when clause if (result.menu) { @@ -95,8 +97,10 @@ export abstract class SymbolNavigationAction extends EditorAction2 { return result; } + readonly configuration: SymbolNavigationActionConfig; + constructor(configuration: SymbolNavigationActionConfig, opts: IAction2Options) { - super(SymbolNavigationAction.aaa(opts)); + super(SymbolNavigationAction._patchConfig(opts)); this.configuration = configuration; SymbolNavigationAction._allSymbolNavigationCommands.set(opts.id, this); } diff --git a/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts b/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts index c11b578b773..78b3bdbfed5 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts @@ -25,9 +25,11 @@ export class ClickLinkMouseEvent { public readonly hasTriggerModifier: boolean; public readonly hasSideBySideModifier: boolean; public readonly isNoneOrSingleMouseDown: boolean; + public readonly hasRightClick: boolean; constructor(source: IEditorMouseEvent, opts: ClickLinkOptions) { this.target = source.target; + this.hasRightClick = source.event.rightButton; this.hasTriggerModifier = hasModifier(source.event, opts.triggerModifier); this.hasSideBySideModifier = hasModifier(source.event, opts.triggerSideBySideModifier); this.isNoneOrSingleMouseDown = (source.event.detail <= 1); diff --git a/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts b/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts index e0ff47c0935..2c7046f3d31 100644 --- a/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts +++ b/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.ts @@ -15,7 +15,7 @@ import { OneReference, ReferencesModel } from 'vs/editor/contrib/gotoSymbol/brow import { localize } from 'vs/nls'; import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -149,7 +149,7 @@ class SymbolNavigationService implements ISymbolNavigationService { } } -registerSingleton(ISymbolNavigationService, SymbolNavigationService, true); +registerSingleton(ISymbolNavigationService, SymbolNavigationService, InstantiationType.Delayed); registerEditorCommand(new class extends EditorCommand { diff --git a/src/vs/editor/contrib/hover/browser/contentHover.ts b/src/vs/editor/contrib/hover/browser/contentHover.ts index e827d2cec6c..30de80e0952 100644 --- a/src/vs/editor/contrib/hover/browser/contentHover.ts +++ b/src/vs/editor/contrib/hover/browser/contentHover.ts @@ -13,7 +13,7 @@ import { ContentWidgetPositionPreference, IActiveCodeEditor, ICodeEditor, IConte import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { IModelDecoration } from 'vs/editor/common/model'; +import { IModelDecoration, PositionAffinity } from 'vs/editor/common/model'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; import { TokenizationRegistry } from 'vs/editor/common/languages'; import { HoverOperation, HoverStartMode, IHoverComputer } from 'vs/editor/contrib/hover/browser/hoverOperation'; @@ -129,8 +129,8 @@ export class ContentHoverController extends Disposable { } // The hover is currently visible - - const isGettingCloser = (mouseEvent && this._widget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy)); + const hoverIsSticky = this._editor.getOption(EditorOption.hover).sticky; + const isGettingCloser = (hoverIsSticky && mouseEvent && this._widget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy)); if (isGettingCloser) { // The mouse is getting closer to the hover, so we will keep the hover untouched // But we will kick off a hover update at the new anchor, insisting on keeping the hover visible. @@ -261,6 +261,9 @@ export class ContentHoverController extends Disposable { disposables.add(participant.renderHoverParts(context, hoverParts)); } } + + const isBeforeContent = messages.some(m => m.isBeforeContent); + if (statusBar.hasContent) { fragment.appendChild(statusBar.hoverElement); } @@ -283,6 +286,7 @@ export class ContentHoverController extends Disposable { showAtRange, this._editor.getOption(EditorOption.hover).above, this._computer.shouldFocus, + isBeforeContent, anchor.initialMousePosX, anchor.initialMousePosY, disposables @@ -368,6 +372,7 @@ class ContentHoverVisibleData { public readonly showAtRange: Range, public readonly preferAbove: boolean, public readonly stoleFocus: boolean, + public readonly isBeforeContent: boolean, public initialMousePosX: number | undefined, public initialMousePosY: number | undefined, public readonly disposables: DisposableStore @@ -439,6 +444,10 @@ export class ContentHoverWidget extends Disposable implements IContentWidget { // Prefer rendering above if the suggest widget is visible preferAbove = true; } + + // :before content can align left of the text content + const affinity = this._visibleData.isBeforeContent ? PositionAffinity.LeftOfInjectedText : undefined; + return { position: this._visibleData.showAtPosition, range: this._visibleData.showAtRange, @@ -447,6 +456,7 @@ export class ContentHoverWidget extends Disposable implements IContentWidget { ? [ContentWidgetPositionPreference.ABOVE, ContentWidgetPositionPreference.BELOW] : [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE] ), + positionAffinity: affinity }; } diff --git a/src/vs/editor/contrib/hover/browser/hoverTypes.ts b/src/vs/editor/contrib/hover/browser/hoverTypes.ts index 2f74d533f26..f07090dea59 100644 --- a/src/vs/editor/contrib/hover/browser/hoverTypes.ts +++ b/src/vs/editor/contrib/hover/browser/hoverTypes.ts @@ -26,6 +26,11 @@ export interface IHoverPart { * even in the case of multiple hover parts. */ readonly forceShowAtRange?: boolean; + + /** + * If true, the hover item should appear before content + */ + readonly isBeforeContent?: boolean; /** * Is this hover part still valid for this new anchor? */ diff --git a/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts b/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts index c2e2f56a91e..19d151cf757 100644 --- a/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts +++ b/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts @@ -30,6 +30,7 @@ export class MarkdownHover implements IHoverPart { public readonly owner: IEditorHoverParticipant, public readonly range: Range, public readonly contents: IMarkdownString[], + public readonly isBeforeContent: boolean, public readonly ordinal: number ) { } @@ -55,7 +56,7 @@ export class MarkdownHoverParticipant implements IEditorHoverParticipant= maxTokenizationLineLength) { result.push(new MarkdownHover(this, anchor.range, [{ value: nls.localize('too many characters', "Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.") - }], index++)); + }], false, index++)); } + let isBeforeContent = false; + for (const d of lineDecorations) { const startColumn = (d.range.startLineNumber === lineNumber) ? d.range.startColumn : 1; const endColumn = (d.range.endLineNumber === lineNumber) ? d.range.endColumn : maxColumn; @@ -90,8 +93,12 @@ export class MarkdownHoverParticipant implements IEditorHoverParticipant !isEmptyMarkdownString(item.hover.contents)) .map(item => { const rng = item.hover.range ? Range.lift(item.hover.range) : anchor.range; - return new MarkdownHover(this, rng, item.hover.contents, item.ordinal); + return new MarkdownHover(this, rng, item.hover.contents, false, item.ordinal); }); } diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts index 0e59778b739..4e7cce9783d 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts @@ -29,7 +29,7 @@ import { ClickLinkGesture, ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSym import { InlayHintAnchor, InlayHintItem, InlayHintsFragments } from 'vs/editor/contrib/inlayHints/browser/inlayHints'; import { goToDefinitionWithLocation, showGoToContextMenu } from 'vs/editor/contrib/inlayHints/browser/inlayHintsLocations'; import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import * as colors from 'vs/platform/theme/common/colorRegistry'; @@ -60,7 +60,7 @@ class InlayHintsCache { interface IInlayHintsCache extends InlayHintsCache { } const IInlayHintsCache = createDecorator('IInlayHintsCache'); -registerSingleton(IInlayHintsCache, InlayHintsCache, true); +registerSingleton(IInlayHintsCache, InlayHintsCache, InstantiationType.Delayed); // --- rendered label diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts index e04c6514d7a..f9781fcf029 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.ts @@ -92,11 +92,11 @@ export class InlayHintsHover extends MarkdownHoverParticipant implements IEditor itemTooltip = part.item.hint.tooltip; } if (itemTooltip) { - executor.emitOne(new MarkdownHover(this, anchor.range, [itemTooltip], 0)); + executor.emitOne(new MarkdownHover(this, anchor.range, [itemTooltip], false, 0)); } // (1.2) Inlay dbl-click gesture if (isNonEmptyArray(part.item.hint.textEdits)) { - executor.emitOne(new MarkdownHover(this, anchor.range, [new MarkdownString().appendText(localize('hint.dbl', "Double click to insert"))], 10001)); + executor.emitOne(new MarkdownHover(this, anchor.range, [new MarkdownString().appendText(localize('hint.dbl', "Double click to insert"))], false, 10001)); } // (2) Inlay Label Part Tooltip @@ -107,7 +107,7 @@ export class InlayHintsHover extends MarkdownHoverParticipant implements IEditor partTooltip = part.part.tooltip; } if (partTooltip) { - executor.emitOne(new MarkdownHover(this, anchor.range, [partTooltip], 1)); + executor.emitOne(new MarkdownHover(this, anchor.range, [partTooltip], false, 1)); } // (2.2) Inlay Label Part Help Hover @@ -130,7 +130,7 @@ export class InlayHintsHover extends MarkdownHoverParticipant implements IEditor linkHint = new MarkdownString(`[${localize('hint.cmd', "Execute Command")}](${asCommandLink(part.part.command)} "${part.part.command.title}") (${kb})`, { isTrusted: true }); } if (linkHint) { - executor.emitOne(new MarkdownHover(this, anchor.range, [linkHint], 10000)); + executor.emitOne(new MarkdownHover(this, anchor.range, [linkHint], false, 10000)); } } @@ -156,7 +156,7 @@ export class InlayHintsHover extends MarkdownHoverParticipant implements IEditor } return getHover(this._languageFeaturesService.hoverProvider, model, new Position(range.startLineNumber, range.startColumn), token) .filter(item => !isEmptyMarkdownString(item.hover.contents)) - .map(item => new MarkdownHover(this, part.item.anchor.range, item.hover.contents, 2 + item.ordinal)); + .map(item => new MarkdownHover(this, part.item.anchor.range, item.hover.contents, false, 2 + item.ordinal)); } finally { ref.dispose(); } diff --git a/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts b/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts index 89f650807bb..77706619c1c 100644 --- a/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts +++ b/src/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.ts @@ -7,7 +7,6 @@ import * as dom from 'vs/base/browser/dom'; import { Action, IAction, Separator } from 'vs/base/common/actions'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IActiveCodeEditor, ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { EditorExtensionsRegistry } from 'vs/editor/browser/editorExtensions'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; import { Range } from 'vs/editor/common/core/range'; import { Location } from 'vs/editor/common/languages'; @@ -16,7 +15,7 @@ import { DefinitionAction, SymbolNavigationAction, SymbolNavigationAnchor } from import { ClickLinkMouseEvent } from 'vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture'; import { RenderedInlayHintLabelPart } from 'vs/editor/contrib/inlayHints/browser/inlayHintsController'; import { PeekContext } from 'vs/editor/contrib/peekView/browser/peekView'; -import { isIMenuItem, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; +import { isIMenuItem, MenuId, MenuItemAction, MenuRegistry } from 'vs/platform/actions/common/actions'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -41,13 +40,13 @@ export async function showGoToContextMenu(accessor: ServicesAccessor, editor: IC const menuActions: IAction[] = []; // from all registered (not active) context menu actions select those - // that are a symbol navigation action + // that are a symbol navigation actions const filter = new Set(MenuRegistry.getMenuItems(MenuId.EditorContext) .map(item => isIMenuItem(item) ? item.command.id : '')); - for (const delegate of EditorExtensionsRegistry.getEditorActions()) { - if (delegate instanceof SymbolNavigationAction && filter.has(delegate.id)) { - menuActions.push(new Action(delegate.id, delegate.label, undefined, true, async () => { + for (const delegate of SymbolNavigationAction.all()) { + if (filter.has(delegate.desc.id)) { + menuActions.push(new Action(delegate.desc.id, MenuItemAction.label(delegate.desc, { renderShortTitle: true }), undefined, true, async () => { const ref = await resolverService.createModelReference(location.uri); try { await instaService.invokeFunction(delegate.run.bind(delegate), editor, new SymbolNavigationAnchor(ref.object.textEditorModel, Range.getStartPosition(location.range))); diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css index 78ce346f864..f3dc213f679 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css @@ -29,7 +29,7 @@ .monaco-editor .sticky-widget { width : 100%; - box-shadow : var(--vscode-scrollbar-shadow) 0 2px 6px -2px; + box-shadow : var(--vscode-scrollbar-shadow) 0 3px 2px -2px; z-index : 2; background-color : var(--vscode-editorStickyScroll-background); } diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts index a1c6cac5baf..6f0c4adff12 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.ts @@ -5,6 +5,7 @@ import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { localize } from 'vs/nls'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Action2, MenuId } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; @@ -16,15 +17,19 @@ export class ToggleStickyScroll extends Action2 { id: 'editor.action.toggleStickyScroll', title: { value: localize('toggleStickyScroll', "Toggle Sticky Scroll"), - mnemonicTitle: localize('miStickyScroll', "&&Sticky Scroll"), + mnemonicTitle: localize('mitoggleStickyScroll', "&&Toggle Sticky Scroll"), original: 'Toggle Sticky Scroll', }, - // Hardcoding due to import violation - category: { value: localize('view', "View"), original: 'View' }, - toggled: ContextKeyExpr.equals('config.editor.stickyScroll.enabled', true), + category: Categories.View, + toggled: { + condition: ContextKeyExpr.equals('config.editor.stickyScroll.enabled', true), + title: localize('stickyScroll', "Sticky Scroll"), + mnemonicTitle: localize('miStickyScroll', "&&Sticky Scroll"), + }, menu: [ { id: MenuId.CommandPalette }, { id: MenuId.MenubarViewMenu, group: '5_editor', order: 6 }, + { id: MenuId.StickyScrollContext } ] }); } diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts index 47fbfec59b9..a5dc15c6e41 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts @@ -12,6 +12,9 @@ import { StickyScrollWidget, StickyScrollWidgetState } from './stickyScrollWidge import { StickyLineCandidateProvider, StickyRange } from './stickyScrollProvider'; import { IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import * as dom from 'vs/base/browser/dom'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { MenuId } from 'vs/platform/actions/common/actions'; export class StickyScrollController extends Disposable implements IEditorContribution { @@ -26,6 +29,7 @@ export class StickyScrollController extends Disposable implements IEditorContrib _editor: ICodeEditor, @ILanguageFeaturesService _languageFeaturesService: ILanguageFeaturesService, @IInstantiationService _instaService: IInstantiationService, + @IContextMenuService private readonly _contextMenuService: IContextMenuService, ) { super(); this._editor = _editor; @@ -41,6 +45,9 @@ export class StickyScrollController extends Disposable implements IEditorContrib } })); this.readConfiguration(); + this._register(dom.addDisposableListener(this._stickyScrollWidget.getDomNode(), dom.EventType.CONTEXT_MENU, async (event: MouseEvent) => { + this.onContextMenu(event); + })); } public get stickyScrollCandidateProvider() { @@ -51,6 +58,13 @@ export class StickyScrollController extends Disposable implements IEditorContrib return this._widgetState; } + private onContextMenu(event: MouseEvent) { + this._contextMenuService.showContextMenu({ + menuId: MenuId.StickyScrollContext, + getAnchor: () => event, + }); + } + private readConfiguration() { const options = this._editor.getOption(EditorOption.stickyScroll); if (options.enabled === false) { diff --git a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts index f35d88029b6..777154b9891 100644 --- a/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts +++ b/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts @@ -152,7 +152,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget { this._editor.revealPosition({ lineNumber: this._hoverOnLine, column: 1 }); } this._instaService.invokeFunction(goToDefinitionWithLocation, e, this._editor as IActiveCodeEditor, { uri: this._editor.getModel()!.uri, range: this._stickyRangeProjectedOnEditor } as Location); - } else { + } else if (!e.hasRightClick) { // Normal click this._editor.revealPosition({ lineNumber: this._hoverOnLine, column: 1 }); } @@ -275,7 +275,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget { const mouseOverEvent = new StandardMouseEvent(e); const text = mouseOverEvent.target.innerText; this._hoverOnLine = line; - // TODO: workaround to find the column index, perhaps need more solid solution + // TODO: workaround to find the column index, perhaps need a more solid solution this._hoverOnColumn = this._editor.getModel().getLineContent(line).indexOf(text) + 1 || -1; } })); @@ -296,8 +296,9 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget { const minimapSide = this._editor.getOption(EditorOption.minimap).side; if (minimapSide === 'left') { this._rootDomNode.style.marginLeft = this._editor.getLayoutInfo().minimap.minimapCanvasOuterWidth + 'px'; - } else if (minimapSide === 'right') { - this._rootDomNode.style.marginLeft = '0px'; + } + else if (minimapSide === 'right') { + this._rootDomNode.style.marginLeft = '1px'; } this._rootDomNode.style.zIndex = '11'; } diff --git a/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts b/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts index 4f7e077bfbf..9e4e01fb994 100644 --- a/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts +++ b/src/vs/editor/contrib/stickyScroll/test/browser/stickyScroll.test.ts @@ -13,12 +13,15 @@ import { DocumentSymbol, SymbolKind } from 'vs/editor/common/languages'; import { StickyLineCandidate, StickyLineCandidateProvider } from 'vs/editor/contrib/stickyScroll/browser/stickyScrollProvider'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; import { ILogService, NullLogService } from 'vs/platform/log/common/log'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { mock } from 'vs/base/test/common/mock'; suite('Sticky Scroll Tests', () => { const serviceCollection = new ServiceCollection( [ILanguageFeaturesService, new LanguageFeaturesService()], - [ILogService, new NullLogService()] + [ILogService, new NullLogService()], + [IContextMenuService, new class extends mock() { }] ); const text = [ diff --git a/src/vs/editor/contrib/suggest/browser/suggestMemory.ts b/src/vs/editor/contrib/suggest/browser/suggestMemory.ts index 8b2868cbde9..dce5326c6da 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestMemory.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestMemory.ts @@ -12,7 +12,7 @@ import { ITextModel } from 'vs/editor/common/model'; import { CompletionItemKind, CompletionItemKinds } from 'vs/editor/common/languages'; import { CompletionItem } from 'vs/editor/contrib/suggest/browser/suggest'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage'; @@ -306,4 +306,4 @@ export interface ISuggestMemoryService { select(model: ITextModel, pos: IPosition, items: CompletionItem[]): number; } -registerSingleton(ISuggestMemoryService, SuggestMemoryService, true); +registerSingleton(ISuggestMemoryService, SuggestMemoryService, InstantiationType.Delayed); diff --git a/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts b/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts index b9f16e4c68a..bd6d9cd9b84 100644 --- a/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts +++ b/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.ts @@ -483,7 +483,7 @@ export class UnicodeHighlighterHoverParticipant implements IEditorHoverParticipa .appendMarkdown(reason) .appendText(' ') .appendLink(uri, adjustSettings); - result.push(new MarkdownHover(this, d.range, [markdown], index++)); + result.push(new MarkdownHover(this, d.range, [markdown], false, index++)); } return result; } diff --git a/src/vs/editor/standalone/browser/standaloneLayoutService.ts b/src/vs/editor/standalone/browser/standaloneLayoutService.ts index aba9ec78509..42b7b0786a3 100644 --- a/src/vs/editor/standalone/browser/standaloneLayoutService.ts +++ b/src/vs/editor/standalone/browser/standaloneLayoutService.ts @@ -7,7 +7,7 @@ import * as dom from 'vs/base/browser/dom'; import { Event } from 'vs/base/common/event'; import { ILayoutService, ILayoutOffsetInfo } from 'vs/platform/layout/browser/layoutService'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; class StandaloneLayoutService implements ILayoutService { declare readonly _serviceBrand: undefined; @@ -63,4 +63,4 @@ export class EditorScopedLayoutService extends StandaloneLayoutService { } } -registerSingleton(ILayoutService, StandaloneLayoutService, true); +registerSingleton(ILayoutService, StandaloneLayoutService, InstantiationType.Delayed); diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts index c25434b6c38..5da75b817a5 100644 --- a/src/vs/editor/standalone/browser/standaloneServices.ts +++ b/src/vs/editor/standalone/browser/standaloneServices.ts @@ -817,7 +817,8 @@ class StandaloneBulkEditService implements IBulkEditService { } return { - ariaSummary: strings.format(StandaloneServicesNLS.bulkEditServiceSummary, totalEdits, totalFiles) + ariaSummary: strings.format(StandaloneServicesNLS.bulkEditServiceSummary, totalEdits, totalFiles), + isApplied: totalEdits > 0 }; } } @@ -948,9 +949,11 @@ class StandaloneContextMenuService extends ContextMenuService { @INotificationService notificationService: INotificationService, @IContextViewService contextViewService: IContextViewService, @IKeybindingService keybindingService: IKeybindingService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IMenuService menuService: IMenuService, + @IContextKeyService contextKeyService: IContextKeyService, ) { - super(telemetryService, notificationService, contextViewService, keybindingService, themeService); + super(telemetryService, notificationService, contextViewService, keybindingService, themeService, menuService, contextKeyService); this.configure({ blockMouse: false }); // we do not want that in the standalone editor } } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 5c9c1a1a25c..5f5e30d1c3f 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1488,6 +1488,11 @@ declare namespace monaco.editor { */ className?: string | null; blockClassName?: string | null; + /** + * Indicates if this block should be rendered after the last line. + * In this case, the range must be empty and set to the last line. + */ + blockIsAfterEnd?: boolean | null; /** * Message to be rendered when hovering over the glyph margin decoration. */ diff --git a/src/vs/platform/action/common/action.ts b/src/vs/platform/action/common/action.ts index 4b3f1b5f0ff..38d336ea603 100644 --- a/src/vs/platform/action/common/action.ts +++ b/src/vs/platform/action/common/action.ts @@ -6,6 +6,7 @@ import { URI, UriDto } from 'vs/base/common/uri'; import { ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; +import { Categories } from './actionCommonCategories'; export interface ILocalizedString { @@ -30,16 +31,50 @@ export interface ICommandActionTitle extends ILocalizedString { export type Icon = { dark?: URI; light?: URI } | ThemeIcon; +export interface ICommandActionToggleInfo { + + /** + * The condition that marks the action as toggled. + */ + condition: ContextKeyExpression; + + icon?: Icon; + + tooltip?: string; + + /** + * The title that goes well with a a check mark, e.g "(check) Line Numbers" vs "Toggle Line Numbers" + */ + title?: string; + + /** + * Like title but with a mnemonic designation. + */ + mnemonicTitle?: string; +} + +export function isICommandActionToggleInfo(thing: ContextKeyExpression | ICommandActionToggleInfo | undefined): thing is ICommandActionToggleInfo { + return thing ? (thing).condition !== undefined : false; +} + export interface ICommandAction { id: string; title: string | ICommandActionTitle; shortTitle?: string | ICommandActionTitle; - category?: string | ILocalizedString; + category?: keyof typeof Categories | ILocalizedString | string; tooltip?: string | ILocalizedString; icon?: Icon; source?: string; precondition?: ContextKeyExpression; - toggled?: ContextKeyExpression | { condition: ContextKeyExpression; icon?: Icon; tooltip?: string; title?: string | ILocalizedString }; + + /** + * The action is a toggle action. Define the context key expression that reflects its toggle-state + * or define toggle-info including an icon and a title that goes well with a checkmark. + */ + toggled?: ContextKeyExpression | ICommandActionToggleInfo; + + /** @deprecated see https://github.com/microsoft/vscode/issues/162004 */ + _isFakeAction?: true; } export type ISerializableCommandAction = UriDto; diff --git a/src/vs/platform/action/common/actionCommonCategories.ts b/src/vs/platform/action/common/actionCommonCategories.ts new file mode 100644 index 00000000000..5a62d7df897 --- /dev/null +++ b/src/vs/platform/action/common/actionCommonCategories.ts @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { localize } from 'vs/nls'; + +export const Categories = Object.freeze({ + View: { value: localize('view', "View"), original: 'View' }, + Help: { value: localize('help', "Help"), original: 'Help' }, + Test: { value: localize('test', "Test"), original: 'Test' }, + Preferences: { value: localize('preferences', "Preferences"), original: 'Preferences' }, + Developer: { value: localize({ key: 'developer', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"), original: 'Developer' } +}); diff --git a/src/vs/platform/actions/browser/menuEntryActionViewItem.css b/src/vs/platform/actions/browser/menuEntryActionViewItem.css index 31eb20ba8a8..5f0134dfeae 100644 --- a/src/vs/platform/actions/browser/menuEntryActionViewItem.css +++ b/src/vs/platform/actions/browser/menuEntryActionViewItem.css @@ -11,27 +11,29 @@ background-size: 16px; } - @keyframes shift { 0% { - transform: scale(1); + transform: translateX(0px); } - 15%{ - transform: scale(1.1); + 33%{ + transform: translateX(0.5px); } - 100% { - transform: scale(1); + 66% { + transform: translateX(-0.5px); } } .monaco-toolbar.config .monaco-action-bar .action-item { animation-duration: 1.2s; - animation-iteration-count: 1; + animation-iteration-count: infinite; animation-name: shift; } +.monaco-toolbar.config .monaco-action-bar .action-item:nth-child(odd) { + animation-delay: 0.6s; +} .monaco-dropdown-with-default { display: flex !important; diff --git a/src/vs/platform/actions/browser/menuEntryActionViewItem.ts b/src/vs/platform/actions/browser/menuEntryActionViewItem.ts index 76c445d5603..41faa91d8d7 100644 --- a/src/vs/platform/actions/browser/menuEntryActionViewItem.ts +++ b/src/vs/platform/actions/browser/menuEntryActionViewItem.ts @@ -16,7 +16,7 @@ import { isLinux, isWindows, OS } from 'vs/base/common/platform'; import 'vs/css!./menuEntryActionViewItem'; import { localize } from 'vs/nls'; import { IMenu, IMenuActionOptions, IMenuService, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions'; -import { ICommandAction, Icon } from 'vs/platform/action/common/action'; +import { ICommandAction, isICommandActionToggleInfo } from 'vs/platform/action/common/action'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -240,7 +240,7 @@ export class MenuEntryActionViewItem extends ActionViewItem { return; } - const icon = this._commandAction.checked && (item.toggled as { icon?: Icon })?.icon ? (item.toggled as { icon: Icon }).icon : item.icon; + const icon = this._commandAction.checked && isICommandActionToggleInfo(item.toggled) && item.toggled.icon ? item.toggled.icon : item.icon; if (!icon) { return; diff --git a/src/vs/platform/actions/browser/toolbar.ts b/src/vs/platform/actions/browser/toolbar.ts index be59a56d5a3..db91b1c67f7 100644 --- a/src/vs/platform/actions/browser/toolbar.ts +++ b/src/vs/platform/actions/browser/toolbar.ts @@ -10,7 +10,7 @@ import { coalesceInPlace } from 'vs/base/common/arrays'; import { BugIndicatingError } from 'vs/base/common/errors'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { localize } from 'vs/nls'; -import { createAndFillInActionBarActions, createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { IMenuActionOptions, IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -18,8 +18,12 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; export const enum HiddenItemStrategy { + /** This toolbar doesn't support hiding*/ + NoHide = -1, + /** Hidden items aren't shown anywhere */ Ignore = 0, - RenderInSecondaryGroup = 1 + /** Hidden items move into the secondary group */ + RenderInSecondaryGroup = 1, } export type IWorkbenchToolBarOptions = IToolBarOptions & { @@ -96,7 +100,7 @@ export class WorkbenchToolBar extends ToolBar { } } - override setActions(_primary: readonly IAction[], _secondary: readonly IAction[] = []): void { + override setActions(_primary: readonly IAction[], _secondary: readonly IAction[] = [], menuIds?: readonly MenuId[]): void { this._sessionDisposables.clear(); const primary = _primary.slice(); @@ -104,32 +108,33 @@ export class WorkbenchToolBar extends ToolBar { const toggleActions: IAction[] = []; let someAreHidden = false; + // unless disabled, move all hidden items to secondary group or ignore them + if (this._options?.hiddenItemStrategy !== HiddenItemStrategy.NoHide) { + let shouldPrependSeparator = secondary.length > 0; + for (let i = 0; i < primary.length; i++) { + const action = primary[i]; + if (!(action instanceof MenuItemAction) && !(action instanceof SubmenuItemAction)) { + // console.warn(`Action ${action.id}/${action.label} is not a MenuItemAction`); + continue; + } + if (!action.hideActions) { + continue; + } - // move all hidden items to secondary group or ignore them - let shouldPrependSeparator = secondary.length > 0; - for (let i = 0; i < primary.length; i++) { - const action = primary[i]; - if (!(action instanceof MenuItemAction) && !(action instanceof SubmenuItemAction)) { - // console.warn(`Action ${action.id}/${action.label} is not a MenuItemAction`); - continue; - } - if (!action.hideActions) { - continue; - } + // collect all toggle actions + toggleActions.push(action.hideActions.toggle); - // collect all toggle actions - toggleActions.push(action.hideActions.toggle); - - // hidden items move into overflow or ignore - if (action.hideActions.isHidden) { - someAreHidden = true; - primary[i] = undefined!; - if (this._options?.hiddenItemStrategy !== HiddenItemStrategy.Ignore) { - if (shouldPrependSeparator) { - shouldPrependSeparator = false; - secondary.unshift(new Separator()); + // hidden items move into overflow or ignore + if (action.hideActions.isHidden) { + someAreHidden = true; + primary[i] = undefined!; + if (this._options?.hiddenItemStrategy !== HiddenItemStrategy.Ignore) { + if (shouldPrependSeparator) { + shouldPrependSeparator = false; + secondary.unshift(new Separator()); + } + secondary.unshift(action); } - secondary.unshift(action); } } } @@ -151,8 +156,14 @@ export class WorkbenchToolBar extends ToolBar { // add "hide foo" actions let hideAction: IAction; - if ((action instanceof MenuItemAction || action instanceof SubmenuItemAction) && action.hideActions) { + if (action instanceof MenuItemAction || action instanceof SubmenuItemAction) { + if (!action.hideActions) { + // no context menu for MenuItemAction instances that support no hiding + // those are fake actions and need to be cleaned up + return; + } hideAction = action.hideActions.hide; + } else { hideAction = toAction({ id: 'label', @@ -164,32 +175,27 @@ export class WorkbenchToolBar extends ToolBar { actions = [hideAction, new Separator(), ...toggleActions]; // add "Reset Menu" action - if (someAreHidden && this._options?.resetMenu) { + if (this._options?.resetMenu && !menuIds) { + menuIds = [this._options.resetMenu]; + } + if (someAreHidden && menuIds) { actions.push(new Separator()); actions.push(toAction({ id: 'resetThisMenu', label: localize('resetThisMenu', "Reset Menu"), - run: () => this._menuService.resetHiddenStates(this._options!.resetMenu) + run: () => this._menuService.resetHiddenStates(menuIds) })); } - // add context menu actions (iff appicable) - if (this._options?.contextMenu) { - const menu = this._menuService.createMenu(this._options.contextMenu, this._contextKeyService); - const contextMenuActions: IAction[] = []; - createAndFillInContextMenuActions(menu, { ...this._options?.menuOptions, renderShortTitle: true, }, contextMenuActions); - menu.dispose(); - - if (contextMenuActions.length > 0) { - actions = [...actions, new Separator(), ...contextMenuActions]; - } - } - - this.getElement().classList.toggle('config', true); + // this.getElement().classList.toggle('config', true); this._contextMenuService.showContextMenu({ getAnchor: () => e, getActions: () => actions, + // add context menu actions (iff appicable) + menuId: this._options?.contextMenu, + menuActionOptions: { renderShortTitle: true, ...this._options?.menuOptions }, + contextKeyService: this._contextKeyService, onHide: () => this.getElement().classList.toggle('config', false), }); })); diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index e32071c164c..87c38c65e32 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -103,6 +103,7 @@ export class MenuId { static readonly SearchContext = new MenuId('SearchContext'); static readonly StatusBarWindowIndicatorMenu = new MenuId('StatusBarWindowIndicatorMenu'); static readonly StatusBarRemoteIndicatorMenu = new MenuId('StatusBarRemoteIndicatorMenu'); + static readonly StickyScrollContext = new MenuId('StickyScrollContext'); static readonly TestItem = new MenuId('TestItem'); static readonly TestItemGutter = new MenuId('TestItemGutter'); static readonly TestPeekElement = new MenuId('TestPeekElement'); @@ -238,7 +239,7 @@ export interface IMenuService { /** * Reset the menu's hidden states. */ - resetHiddenStates(menuId: MenuId | undefined): void; + resetHiddenStates(menuIds: readonly MenuId[] | undefined): void; } export type ICommandsMap = Map; @@ -397,6 +398,12 @@ export interface IMenuItemHide { // subscribes to events of Action or modified properties export class MenuItemAction implements IAction { + static label(action: ICommandAction, options?: IMenuActionOptions): string { + return options?.renderShortTitle && action.shortTitle + ? (typeof action.shortTitle === 'string' ? action.shortTitle : action.shortTitle.value) + : (typeof action.title === 'string' ? action.title : action.title.value); + } + readonly item: ICommandAction; readonly alt: MenuItemAction | undefined; @@ -418,9 +425,7 @@ export class MenuItemAction implements IAction { @ICommandService private _commandService: ICommandService ) { this.id = item.id; - this.label = options?.renderShortTitle && item.shortTitle - ? (typeof item.shortTitle === 'string' ? item.shortTitle : item.shortTitle.value) - : (typeof item.title === 'string' ? item.title : item.title.value); + this.label = MenuItemAction.label(item, options); this.tooltip = (typeof item.tooltip === 'string' ? item.tooltip : item.tooltip?.value) ?? ''; this.enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition); this.checked = undefined; @@ -554,6 +559,13 @@ export interface IAction2Options extends ICommandAction { * showing keybindings that have no other UX. */ description?: ICommandHandlerDescription; + + /** + * @deprecated workaround added for https://github.com/microsoft/vscode/issues/162004 + * This action doesn't do anything is just a workaround for rendering "something" + * inside a specific toolbar + */ + _isFakeAction?: true; } export abstract class Action2 { diff --git a/src/vs/platform/actions/common/menuResetAction.ts b/src/vs/platform/actions/common/menuResetAction.ts index 84ee76e2b91..6cebce22257 100644 --- a/src/vs/platform/actions/common/menuResetAction.ts +++ b/src/vs/platform/actions/common/menuResetAction.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Action2, IMenuService } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/platform/log/common/log'; @@ -14,10 +15,10 @@ export class MenuHiddenStatesReset extends Action2 { super({ id: 'menu.resetHiddenStates', title: { - value: localize('title', 'Reset Hidden Menus'), - original: 'Reset Hidden Menus' + value: localize('title', 'Reset All Menus'), + original: 'Reset All Menus' }, - category: localize('cat', 'View'), + category: Categories.View, f1: true }); } diff --git a/src/vs/platform/actions/common/menuService.ts b/src/vs/platform/actions/common/menuService.ts index 86ff1bd3b7e..d1c95179c67 100644 --- a/src/vs/platform/actions/common/menuService.ts +++ b/src/vs/platform/actions/common/menuService.ts @@ -10,7 +10,7 @@ import { IMenu, IMenuActionOptions, IMenuChangeEvent, IMenuCreateOptions, IMenuI import { ICommandAction, ILocalizedString } from 'vs/platform/action/common/action'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { ContextKeyExpression, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { IAction, Separator, toAction } from 'vs/base/common/actions'; +import { Separator, toAction } from 'vs/base/common/actions'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { removeFastWithoutKeepingOrder } from 'vs/base/common/arrays'; import { localize } from 'vs/nls'; @@ -32,8 +32,8 @@ export class MenuService implements IMenuService { return new MenuImpl(id, this._hiddenStates, { emitEventsForSubmenuChanges: false, eventDebounceDelay: 50, ...options }, this._commandService, contextKeyService); } - resetHiddenStates(id?: MenuId): void { - this._hiddenStates.reset(id); + resetHiddenStates(ids?: MenuId[]): void { + this._hiddenStates.reset(ids); } } @@ -108,17 +108,19 @@ class PersistedMenuHideState { this._persist(); } - reset(menu?: MenuId): void { - if (menu === undefined) { + reset(menus?: MenuId[]): void { + if (menus === undefined) { // reset all this._data = Object.create(null); this._persist(); } else { // reset only for a specific menu - if (this._data[menu.id]) { - delete this._data[menu.id]; - this._persist(); + for (const { id } of menus) { + if (this._data[id]) { + delete this._data[id]; + } } + this._persist(); } } @@ -215,13 +217,10 @@ class MenuInfo { createActionGroups(options: IMenuActionOptions | undefined): [string, Array][] { const result: [string, Array][] = []; - const allToggleActions: IAction[][] = []; for (const group of this._menuGroups) { const [id, items] = group; - const toggleActions: IAction[] = []; - const activeActions: Array = []; for (const item of items) { if (this._contextKeyService.contextMatchesRules(item.when)) { @@ -229,7 +228,8 @@ class MenuInfo { const menuHide = createMenuHide(this._id, isMenuItem ? item.command : item, this._hiddenStates); if (isMenuItem) { // MenuItemAction - activeActions.push(new MenuItemAction(item.command, item.alt, options, menuHide, this._contextKeyService, this._commandService)); + const actualMenuHide = item.command._isFakeAction ? undefined : menuHide; + activeActions.push(new MenuItemAction(item.command, item.alt, options, actualMenuHide, this._contextKeyService, this._commandService)); } else { // SubmenuItemAction @@ -244,9 +244,6 @@ class MenuInfo { if (activeActions.length > 0) { result.push([id, activeActions]); } - if (toggleActions.length > 0) { - allToggleActions.push(toggleActions); - } } return result; } diff --git a/src/vs/platform/contextkey/browser/contextKeyService.ts b/src/vs/platform/contextkey/browser/contextKeyService.ts index 07a136ef7b9..0ebe4e7c7ef 100644 --- a/src/vs/platform/contextkey/browser/contextKeyService.ts +++ b/src/vs/platform/contextkey/browser/contextKeyService.ts @@ -10,12 +10,14 @@ import { TernarySearchTree } from 'vs/base/common/map'; import { MarshalledObject } from 'vs/base/common/marshalling'; import { MarshalledId } from 'vs/base/common/marshallingIds'; import { cloneAndChange, distinct } from 'vs/base/common/objects'; +import { StopWatch } from 'vs/base/common/stopwatch'; import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ContextKeyExpression, ContextKeyInfo, ContextKeyValue, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyService, IContextKeyServiceTarget, IReadableSet, RawContextKey, SET_CONTEXT_COMMAND_ID } from 'vs/platform/contextkey/common/contextkey'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; const KEYBINDING_CONTEXT_ATTR = 'data-keybinding-context'; @@ -603,7 +605,27 @@ function findContextAttr(domNode: IContextKeyServiceTarget | null): number { } export function setContext(accessor: ServicesAccessor, contextKey: any, contextValue: any) { - accessor.get(IContextKeyService).createKey(String(contextKey), stringifyURIs(contextValue)); + const contextKeyService = accessor.get(IContextKeyService); + const telemetryService = accessor.get(ITelemetryService); + + const sw = new StopWatch(true); + contextKeyService.createKey(String(contextKey), stringifyURIs(contextValue)); + const duration = sw.elapsed(); + + type TelemetryData = { + duration: number; + contextKey: string; + }; + type TelemetryClassification = { + owner: 'jrieken'; + comment: 'Performance numbers of the setContext-API command'; + duration: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'The time it took to set the context key' }; + contextKey: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The context key that got set' }; + }; + telemetryService.publicLog2('command.setContext', { + contextKey: String(contextKey), + duration + }); } function stringifyURIs(contextValue: any): any { diff --git a/src/vs/platform/contextkey/test/browser/contextkey.test.ts b/src/vs/platform/contextkey/test/browser/contextkey.test.ts index 50309c6fe6b..8cbecda9b4b 100644 --- a/src/vs/platform/contextkey/test/browser/contextkey.test.ts +++ b/src/vs/platform/contextkey/test/browser/contextkey.test.ts @@ -6,12 +6,14 @@ import * as assert from 'assert'; import { DeferredPromise } from 'vs/base/common/async'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; +import { mock } from 'vs/base/test/common/mock'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { ContextKeyService, setContext } from 'vs/platform/contextkey/browser/contextKeyService'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; suite('ContextKeyService', () => { test('updateParent', () => { @@ -64,7 +66,12 @@ suite('ContextKeyService', () => { const contextKeyService: IContextKeyService = disposables.add(new ContextKeyService(configurationService)); const instantiationService = new TestInstantiationService(new ServiceCollection( [IConfigurationService, configurationService], - [IContextKeyService, contextKeyService] + [IContextKeyService, contextKeyService], + [ITelemetryService, new class extends mock() { + override async publicLog2() { + // + } + }] )); const uri = URI.parse('test://abc'); diff --git a/src/vs/platform/contextview/browser/contextMenuService.ts b/src/vs/platform/contextview/browser/contextMenuService.ts index c80851be9ac..fe80ed05a20 100644 --- a/src/vs/platform/contextview/browser/contextMenuService.ts +++ b/src/vs/platform/contextview/browser/contextMenuService.ts @@ -5,14 +5,18 @@ import { IContextMenuDelegate } from 'vs/base/browser/contextmenu'; import { ModifierKeyEmitter } from 'vs/base/browser/dom'; +import { IAction, Separator } from 'vs/base/common/actions'; import { Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; +import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ContextMenuHandler, IContextMenuHandlerOptions } from './contextMenuHandler'; -import { IContextMenuService, IContextViewService } from './contextView'; +import { IContextMenuMenuDelegate, IContextMenuService, IContextViewService } from './contextView'; export class ContextMenuService extends Disposable implements IContextMenuService { @@ -27,10 +31,10 @@ export class ContextMenuService extends Disposable implements IContextMenuServic return this._contextMenuHandler; } - private readonly _onDidShowContextMenu = new Emitter(); + private readonly _onDidShowContextMenu = this._store.add(new Emitter()); readonly onDidShowContextMenu = this._onDidShowContextMenu.event; - private readonly _onDidHideContextMenu = new Emitter(); + private readonly _onDidHideContextMenu = this._store.add(new Emitter()); readonly onDidHideContextMenu = this._onDidHideContextMenu.event; constructor( @@ -38,7 +42,9 @@ export class ContextMenuService extends Disposable implements IContextMenuServic @INotificationService private readonly notificationService: INotificationService, @IContextViewService private readonly contextViewService: IContextViewService, @IKeybindingService private readonly keybindingService: IKeybindingService, - @IThemeService private readonly themeService: IThemeService + @IThemeService private readonly themeService: IThemeService, + @IMenuService private readonly menuService: IMenuService, + @IContextKeyService private readonly contextKeyService: IContextKeyService, ) { super(); } @@ -49,7 +55,10 @@ export class ContextMenuService extends Disposable implements IContextMenuServic // ContextMenu - showContextMenu(delegate: IContextMenuDelegate): void { + showContextMenu(delegate: IContextMenuDelegate | IContextMenuMenuDelegate): void { + + delegate = ContextMenuMenuDelegate.transform(delegate, this.menuService, this.contextKeyService); + this.contextMenuHandler.showContextMenu({ ...delegate, onHide: (didCancel) => { @@ -62,3 +71,33 @@ export class ContextMenuService extends Disposable implements IContextMenuServic this._onDidShowContextMenu.fire(); } } + +export namespace ContextMenuMenuDelegate { + + function is(thing: IContextMenuDelegate | IContextMenuMenuDelegate): thing is IContextMenuMenuDelegate { + return thing && (thing).menuId instanceof MenuId; + } + + export function transform(delegate: IContextMenuDelegate | IContextMenuMenuDelegate, menuService: IMenuService, globalContextKeyService: IContextKeyService): IContextMenuDelegate { + if (!is(delegate)) { + return delegate; + } + const { menuId, menuActionOptions, contextKeyService } = delegate; + return { + ...delegate, + getActions: () => { + const target: IAction[] = []; + if (menuId) { + const menu = menuService.createMenu(menuId, contextKeyService ?? globalContextKeyService); + createAndFillInContextMenuActions(menu, menuActionOptions, target); + menu.dispose(); + } + if (!delegate.getActions) { + return target; + } else { + return Separator.join(delegate.getActions(), target); + } + } + }; + } +} diff --git a/src/vs/platform/contextview/browser/contextView.ts b/src/vs/platform/contextview/browser/contextView.ts index b99bfdc0aa5..505d76eabfb 100644 --- a/src/vs/platform/contextview/browser/contextView.ts +++ b/src/vs/platform/contextview/browser/contextView.ts @@ -5,8 +5,11 @@ import { IContextMenuDelegate } from 'vs/base/browser/contextmenu'; import { AnchorAlignment, AnchorAxisAlignment, IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; +import { IAction } from 'vs/base/common/actions'; import { Event } from 'vs/base/common/event'; import { IDisposable } from 'vs/base/common/lifecycle'; +import { IMenuActionOptions, MenuId } from 'vs/platform/actions/common/actions'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export const IContextViewService = createDecorator('contextViewService'); @@ -44,5 +47,25 @@ export interface IContextMenuService { readonly onDidShowContextMenu: Event; readonly onDidHideContextMenu: Event; - showContextMenu(delegate: IContextMenuDelegate): void; + showContextMenu(delegate: IContextMenuDelegate | IContextMenuMenuDelegate): void; } + +export type IContextMenuMenuDelegate = { + /** + * The MenuId that should be used to populate the context menu. + */ + menuId?: MenuId; + /** + * Optional options how menu actions are invoked + */ + menuActionOptions?: IMenuActionOptions; + /** + * Optional context key service which drives the given menu + */ + contextKeyService?: IContextKeyService; + + /** + * Optional getter for extra actions. They will be prepended to the menu actions. + */ + getActions?(): IAction[]; +} & Omit; diff --git a/src/vs/platform/extensionManagement/electron-sandbox/extensionsScannerService.ts b/src/vs/platform/extensionManagement/electron-sandbox/extensionsScannerService.ts index c13b4c23371..f99ba24598c 100644 --- a/src/vs/platform/extensionManagement/electron-sandbox/extensionsScannerService.ts +++ b/src/vs/platform/extensionManagement/electron-sandbox/extensionsScannerService.ts @@ -8,7 +8,7 @@ import { INativeEnvironmentService } from 'vs/platform/environment/common/enviro import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; import { IExtensionsScannerService, NativeExtensionsScannerService, } from 'vs/platform/extensionManagement/common/extensionsScannerService'; import { IFileService } from 'vs/platform/files/common/files'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/platform/log/common/log'; import { IProductService } from 'vs/platform/product/common/productService'; @@ -35,4 +35,4 @@ export class ExtensionsScannerService extends NativeExtensionsScannerService imp } -registerSingleton(IExtensionsScannerService, ExtensionsScannerService, true); +registerSingleton(IExtensionsScannerService, ExtensionsScannerService, InstantiationType.Delayed); diff --git a/src/vs/platform/instantiation/common/extensions.ts b/src/vs/platform/instantiation/common/extensions.ts index 474a9a59ea1..6b3cb6ac484 100644 --- a/src/vs/platform/instantiation/common/extensions.ts +++ b/src/vs/platform/instantiation/common/extensions.ts @@ -22,7 +22,7 @@ export const enum InstantiationType { Delayed = 1 } -export function registerSingleton(id: ServiceIdentifier, ctor: new (...services: Services) => T, supportsDelayedInstantiation: boolean | InstantiationType): void; +export function registerSingleton(id: ServiceIdentifier, ctor: new (...services: Services) => T, supportsDelayedInstantiation: false | InstantiationType): void; export function registerSingleton(id: ServiceIdentifier, descriptor: SyncDescriptor): void; export function registerSingleton(id: ServiceIdentifier, ctorOrDescriptor: { new(...services: Services): T } | SyncDescriptor, supportsDelayedInstantiation?: boolean | InstantiationType): void { if (!(ctorOrDescriptor instanceof SyncDescriptor)) { diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts index 21908bbcff0..3840b1bec11 100644 --- a/src/vs/platform/instantiation/common/instantiationService.ts +++ b/src/vs/platform/instantiation/common/instantiationService.ts @@ -111,7 +111,7 @@ export class InstantiationService implements IInstantiationService { } // now create the instance - return new ctor(...[...args, ...serviceArgs]); + return Reflect.construct(ctor, args.concat(serviceArgs)); } private _setServiceInstance(id: ServiceIdentifier, instance: T): void { diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 197fb970f66..5fb143fc948 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -1291,7 +1291,7 @@ class WorkbenchTreeInternals { updateStyleOverrides(overrideStyles?: IColorMapping): void { dispose(this.styler); - this.styler = overrideStyles ? attachListStyler(this.tree, this.themeService, overrideStyles) : Disposable.None; + this.styler = attachListStyler(this.tree, this.themeService, overrideStyles); } dispose(): void { diff --git a/src/vs/platform/profiling/electron-main/windowProfiling.ts b/src/vs/platform/profiling/electron-main/windowProfiling.ts index 2b6971c3dd9..18549159fe4 100644 --- a/src/vs/platform/profiling/electron-main/windowProfiling.ts +++ b/src/vs/platform/profiling/electron-main/windowProfiling.ts @@ -254,8 +254,6 @@ export class WindowProfiler { callstack: callstack.join('\n') }; this._telemetryService.publicLog2('prof.freeze.sample', data); - - console.log(data); } } } diff --git a/src/vs/platform/protocol/electron-main/protocolMainService.ts b/src/vs/platform/protocol/electron-main/protocolMainService.ts index b4b9544fccf..43ad2167684 100644 --- a/src/vs/platform/protocol/electron-main/protocolMainService.ts +++ b/src/vs/platform/protocol/electron-main/protocolMainService.ts @@ -8,7 +8,7 @@ import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain'; import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { TernarySearchTree } from 'vs/base/common/map'; import { COI, FileAccess, Schemas } from 'vs/base/common/network'; -import { extname, normalize } from 'vs/base/common/path'; +import { basename, extname, normalize } from 'vs/base/common/path'; import { isLinux } from 'vs/base/common/platform'; import { URI } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; @@ -96,7 +96,7 @@ export class ProtocolMainService extends Disposable implements IProtocolMainServ let headers: Record | undefined; if (this.environmentService.crossOriginIsolated) { - if (path.endsWith('/workbench.html') || path.endsWith('/workbench-dev.html')) { + if (basename(path) === 'workbench.html' || basename(path) === 'workbench-dev.html') { headers = COI.CoopAndCoep; } else { headers = COI.getHeadersFromQuery(request.url); diff --git a/src/vs/platform/remote/browser/browserSocketFactory.ts b/src/vs/platform/remote/browser/browserSocketFactory.ts index cac305317db..46a6dd3a7a7 100644 --- a/src/vs/platform/remote/browser/browserSocketFactory.ts +++ b/src/vs/platform/remote/browser/browserSocketFactory.ts @@ -274,7 +274,7 @@ export class BrowserSocketFactory implements ISocketFactory { connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void { const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws'); - const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel); + const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel); const errorListener = socket.onError((err) => callback(err, undefined)); socket.onOpen(() => { errorListener.dispose(); diff --git a/src/vs/platform/terminal/common/capabilities/capabilities.ts b/src/vs/platform/terminal/common/capabilities/capabilities.ts index 03f863348fc..d68a14d21b8 100644 --- a/src/vs/platform/terminal/common/capabilities/capabilities.ts +++ b/src/vs/platform/terminal/common/capabilities/capabilities.ts @@ -221,10 +221,35 @@ export interface ITerminalCommand { commandStartLineContent?: string; markProperties?: IMarkProperties; getOutput(): string | undefined; - getOutputMatch(outputMatcher: { lineMatcher: string | RegExp; anchor?: 'top' | 'bottom'; offset?: number; length?: number }): RegExpMatchArray | undefined; + getOutputMatch(outputMatcher: ITerminalOutputMatcher): RegExpMatchArray | undefined; hasOutput(): boolean; } + +/** + * A matcher that runs on a sub-section of a terminal command's output + */ +export interface ITerminalOutputMatcher { + /** + * A string or regex to match against the unwrapped line. If this is a regex with the multiline + * flag, it will scan an amount of lines equal to `\n` instances in the regex + 1. + */ + lineMatcher: string | RegExp; + /** + * Which side of the output to anchor the {@link offset} and {@link length} against. + */ + anchor: 'top' | 'bottom'; + /** + * How far from either the top or the bottom of the butter to start matching against. + */ + offset: number; + /** + * The number of rows to match against, this should be as small as possible for performance + * reasons. + */ + length: number; +} + /** * A clone of the IMarker from xterm which cannot be imported from common */ diff --git a/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts b/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts index 757881846c1..5ecd49bee30 100644 --- a/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts +++ b/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts @@ -7,7 +7,7 @@ import { timeout } from 'vs/base/common/async'; import { debounce } from 'vs/base/common/decorators'; import { Emitter } from 'vs/base/common/event'; import { ILogService } from 'vs/platform/log/common/log'; -import { ICommandDetectionCapability, TerminalCapability, ITerminalCommand, IHandleCommandOptions, ICommandInvalidationRequest, CommandInvalidationReason, ISerializedCommand, ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { ICommandDetectionCapability, TerminalCapability, ITerminalCommand, IHandleCommandOptions, ICommandInvalidationRequest, CommandInvalidationReason, ISerializedCommand, ISerializedCommandDetectionCapability, ITerminalOutputMatcher } from 'vs/platform/terminal/common/capabilities/capabilities'; // Importing types is safe in any layer // eslint-disable-next-line local/code-import-patterns @@ -490,7 +490,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability { commandStartLineContent: this._currentCommand.commandStartLineContent, hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker?.line < endMarker!.line), getOutput: () => getOutputForCommand(executedMarker, endMarker, buffer), - getOutputMatch: (outputMatcher?: { lineMatcher: string | RegExp; anchor?: 'top' | 'bottom'; offset?: number; length?: number }) => getOutputMatchForCommand(executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher), + getOutputMatch: (outputMatcher: ITerminalOutputMatcher) => getOutputMatchForCommand(executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher), markProperties: options?.markProperties }; this._commands.push(newCommand); @@ -615,7 +615,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability { exitCode: e.exitCode, hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker.line < endMarker.line), getOutput: () => getOutputForCommand(executedMarker, endMarker, buffer), - getOutputMatch: (outputMatcher: { lineMatcher: string | RegExp; anchor?: 'top' | 'bottom'; offset?: number; length?: number }) => getOutputMatchForCommand(executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher), + getOutputMatch: (outputMatcher: ITerminalOutputMatcher) => getOutputMatchForCommand(executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher), markProperties: e.markProperties }; this._commands.push(newCommand); @@ -647,36 +647,47 @@ function getOutputForCommand(executedMarker: IMarker | undefined, endMarker: IMa return output === '' ? undefined : output; } -export function getOutputMatchForCommand(executedMarker: IMarker | undefined, endMarker: IMarker | undefined, buffer: IBuffer, cols: number, outputMatcher: { lineMatcher: string | RegExp; anchor?: 'top' | 'bottom'; offset?: number; length?: number } | undefined): RegExpMatchArray | undefined { +export function getOutputMatchForCommand(executedMarker: IMarker | undefined, endMarker: IMarker | undefined, buffer: IBuffer, cols: number, outputMatcher: ITerminalOutputMatcher): RegExpMatchArray | undefined { if (!executedMarker || !endMarker) { return undefined; } const startLine = executedMarker.line; const endLine = endMarker.line; - if (startLine === endLine) { - return undefined; - } - if (outputMatcher?.length && (endLine - startLine) < outputMatcher.length) { - return undefined; - } - let output = ''; - let line: string | undefined; - if (outputMatcher?.anchor === 'bottom') { + const matcher = outputMatcher.lineMatcher; + const linesToCheck = typeof matcher === 'string' ? 1 : outputMatcher.length || countNewLines(matcher); + const lines: string[] = []; + if (outputMatcher.anchor === 'bottom') { for (let i = endLine - (outputMatcher.offset || 0); i >= startLine; i--) { - line = getXtermLineContent(buffer, i, i, cols); - output = line + output; - const match = output.match(outputMatcher.lineMatcher); + let wrappedLineStart = i; + const wrappedLineEnd = i; + while (wrappedLineStart >= startLine && buffer.getLine(wrappedLineStart)?.isWrapped) { + wrappedLineStart--; + } + i = wrappedLineStart; + lines.unshift(getXtermLineContent(buffer, wrappedLineStart, wrappedLineEnd, cols)); + if (lines.length > linesToCheck) { + lines.pop(); + } + const match = lines.join('\n').match(matcher); if (match) { return match; } } } else { - for (let i = startLine + (outputMatcher?.offset || 0); i < endLine; i++) { - line = getXtermLineContent(buffer, i, i, cols); - output += line; + for (let i = startLine + (outputMatcher.offset || 0); i < endLine; i++) { + const wrappedLineStart = i; + let wrappedLineEnd = i; + while (wrappedLineEnd + 1 < endLine && buffer.getLine(wrappedLineEnd + 1)?.isWrapped) { + wrappedLineEnd++; + } + i = wrappedLineEnd; + lines.push(getXtermLineContent(buffer, wrappedLineStart, wrappedLineEnd, cols)); + if (lines.length === linesToCheck) { + lines.shift(); + } if (outputMatcher) { - const match = output.match(outputMatcher.lineMatcher); + const match = lines.join('\n').match(matcher); if (match) { return match; } @@ -702,3 +713,17 @@ function getXtermLineContent(buffer: IBuffer, lineStart: number, lineEnd: number } return content; } + +function countNewLines(regex: RegExp): number { + if (!regex.multiline) { + return 1; + } + const source = regex.source; + let count = 1; + let i = source.indexOf('\\n'); + while (i !== -1) { + count++; + i = source.indexOf('\\n', i + 1); + } + return count; +} diff --git a/src/vs/platform/terminal/common/terminal.ts b/src/vs/platform/terminal/common/terminal.ts index d45df31b65a..692f8844b9c 100644 --- a/src/vs/platform/terminal/common/terminal.ts +++ b/src/vs/platform/terminal/common/terminal.ts @@ -486,7 +486,7 @@ export interface IShellLaunchConfig { * Whether the terminal process environment should be exactly as provided in * `TerminalOptions.env`. When this is false (default), the environment will be based on the * window's environment and also apply configured platform settings like - * `terminal.integrated.windows.env` on top. When this is true, the complete environment must be + * `terminal.integrated.env.windows` on top. When this is true, the complete environment must be * provided as nothing will be inherited from the process or any configuration. */ strictEnv?: boolean; diff --git a/src/vs/platform/terminal/node/ptyHostMain.ts b/src/vs/platform/terminal/node/ptyHostMain.ts index 3de63e7d9e6..a1fa938db10 100644 --- a/src/vs/platform/terminal/node/ptyHostMain.ts +++ b/src/vs/platform/terminal/node/ptyHostMain.ts @@ -44,7 +44,7 @@ delete process.env.VSCODE_RECONNECT_GRACE_TIME; delete process.env.VSCODE_RECONNECT_SHORT_GRACE_TIME; delete process.env.VSCODE_RECONNECT_SCROLLBACK; -const ptyService = new PtyService(lastPtyId, logService, reconnectConstants); +const ptyService = new PtyService(lastPtyId, logService, productService, reconnectConstants); server.registerChannel(TerminalIpcChannels.PtyHost, ProxyChannel.fromService(ptyService)); process.once('exit', () => { diff --git a/src/vs/platform/terminal/node/ptyService.ts b/src/vs/platform/terminal/node/ptyService.ts index 282bf02ff66..85ea2b0cc33 100644 --- a/src/vs/platform/terminal/node/ptyService.ts +++ b/src/vs/platform/terminal/node/ptyService.ts @@ -28,6 +28,7 @@ import { ErrorNoTelemetry } from 'vs/base/common/errors'; import { ShellIntegrationAddon } from 'vs/platform/terminal/common/xterm/shellIntegrationAddon'; import { formatMessageForTerminal } from 'vs/platform/terminal/common/terminalStrings'; import { IPtyHostProcessReplayEvent } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { IProductService } from 'vs/platform/product/common/productService'; type WorkspaceId = string; @@ -64,6 +65,7 @@ export class PtyService extends Disposable implements IPtyService { constructor( private _lastPtyId: number, private readonly _logService: ILogService, + private readonly _productService: IProductService, private readonly _reconnectConstants: IReconnectConstants ) { super(); @@ -122,7 +124,7 @@ export class PtyService extends Disposable implements IPtyService { await new Promise((resolve, reject) => { exec(`kill ${processId}`, {}, (err, stdout) => { if (err) { - return reject(`Problem occurred when killing the process w ID: ${processId}`); + return reject(`Problem occurred when killing the process with PID: ${processId}`); } resolve(stdout); }); @@ -141,13 +143,13 @@ export class PtyService extends Disposable implements IPtyService { }); const processesForPort = stdout.split('\n'); if (processesForPort.length >= 1) { - const capturePid = /LISTENING\s+(\d{3})/; + const capturePid = /LISTENING\s+(\d+)/; const processId = processesForPort[0].match(capturePid)?.[1]; if (processId) { await new Promise((resolve, reject) => { exec(`Taskkill /F /PID ${processId}`, {}, (err, stdout) => { if (err) { - return reject(`Problem occurred when killing the process w ID: ${processId}`); + return reject(`Problem occurred when killing the process with PID: ${processId}`); } resolve(stdout); }); @@ -244,7 +246,7 @@ export class PtyService extends Disposable implements IPtyService { throw new Error('Attempt to create a process when attach object was provided'); } const id = ++this._lastPtyId; - const process = new TerminalProcess(shellLaunchConfig, cwd, cols, rows, env, executableEnv, options, this._logService); + const process = new TerminalProcess(shellLaunchConfig, cwd, cols, rows, env, executableEnv, options, this._logService, this._productService); process.onProcessData(event => this._onProcessData.fire({ id, event })); const processLaunchOptions: IPersistentTerminalProcessLaunchConfig = { env, diff --git a/src/vs/platform/terminal/node/terminalEnvironment.ts b/src/vs/platform/terminal/node/terminalEnvironment.ts index d1884b8c3ab..9ff09c4322e 100644 --- a/src/vs/platform/terminal/node/terminalEnvironment.ts +++ b/src/vs/platform/terminal/node/terminalEnvironment.ts @@ -13,6 +13,7 @@ import { format } from 'vs/base/common/strings'; import { isString } from 'vs/base/common/types'; import * as pfs from 'vs/base/node/pfs'; import { ILogService } from 'vs/platform/log/common/log'; +import { IProductService } from 'vs/platform/product/common/productService'; import { IShellLaunchConfig, ITerminalEnvironment, ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal'; export function getWindowsBuildNumber(): number { @@ -103,15 +104,16 @@ export interface IShellIntegrationConfigInjection { */ export function getShellIntegrationInjection( shellLaunchConfig: IShellLaunchConfig, - options: ITerminalProcessOptions['shellIntegration'], + options: Pick, env: ITerminalEnvironment | undefined, - logService: ILogService + logService: ILogService, + productService: IProductService ): IShellIntegrationConfigInjection | undefined { // Shell integration arg injection is disabled when: // - The global setting is disabled // - There is no executable (not sure what script to run) // - The terminal is used by a feature like tasks or debugging - if (!options.enabled || !shellLaunchConfig.executable || shellLaunchConfig.isFeatureTerminal || shellLaunchConfig.hideFromUser || shellLaunchConfig.ignoreShellIntegration) { + if (!options.shellIntegration.enabled || !shellLaunchConfig.executable || shellLaunchConfig.isFeatureTerminal || shellLaunchConfig.hideFromUser || shellLaunchConfig.ignoreShellIntegration || (isWindows && !options.windowsEnableConpty)) { return undefined; } @@ -184,8 +186,9 @@ export function getShellIntegrationInjection( } newArgs = [...newArgs]; // Shallow clone the array to avoid setting the default array newArgs[newArgs.length - 1] = format(newArgs[newArgs.length - 1], appRoot); + // Move .zshrc into $ZDOTDIR as the way to activate the script - const zdotdir = path.join(os.tmpdir(), `${os.userInfo().username}-vscode-zsh`); + const zdotdir = path.join(os.tmpdir(), `${os.userInfo().username}-${productService.applicationName}-zsh`); envMixin['ZDOTDIR'] = zdotdir; const userZdotdir = env?.ZDOTDIR ?? os.homedir() ?? `~`; envMixin['USER_ZDOTDIR'] = userZdotdir; diff --git a/src/vs/platform/terminal/node/terminalProcess.ts b/src/vs/platform/terminal/node/terminalProcess.ts index 366d57b4d5f..9a670fda3e8 100644 --- a/src/vs/platform/terminal/node/terminalProcess.ts +++ b/src/vs/platform/terminal/node/terminalProcess.ts @@ -6,17 +6,16 @@ import { exec } from 'child_process'; import { promises as fs } from 'fs'; import type * as pty from 'node-pty'; -import { tmpdir } from 'os'; import { timeout } from 'vs/base/common/async'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { FileAccess } from 'vs/base/common/network'; import * as path from 'vs/base/common/path'; import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; import { URI } from 'vs/base/common/uri'; import { Promises } from 'vs/base/node/pfs'; import { localize } from 'vs/nls'; import { ILogService } from 'vs/platform/log/common/log'; +import { IProductService } from 'vs/platform/product/common/productService'; import { FlowControlConstants, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, IProcessProperty, IProcessPropertyMap as IProcessPropertyMap, ProcessPropertyType, TerminalShellType, IProcessReadyEvent, ITerminalProcessOptions, PosixShellType } from 'vs/platform/terminal/common/terminal'; import { ChildProcessMonitor } from 'vs/platform/terminal/node/childProcessMonitor'; import { findExecutable, getShellIntegrationInjection, getWindowsBuildNumber, IShellIntegrationConfigInjection } from 'vs/platform/terminal/node/terminalEnvironment'; @@ -145,7 +144,8 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess */ private readonly _executableEnv: IProcessEnvironment, private readonly _options: ITerminalProcessOptions, - @ILogService private readonly _logService: ILogService + @ILogService private readonly _logService: ILogService, + @IProductService private readonly _productService: IProductService ) { super(); let name: string; @@ -201,7 +201,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess let injection: IShellIntegrationConfigInjection | undefined; if (this._options.shellIntegration.enabled) { - injection = getShellIntegrationInjection(this.shellLaunchConfig, this._options.shellIntegration, this._ptyOptions.env, this._logService); + injection = getShellIntegrationInjection(this.shellLaunchConfig, { shellIntegration: this._options.shellIntegration, windowsEnableConpty: this._options.windowsEnableConpty }, this._ptyOptions.env, this._logService, this._productService); if (injection) { this._onDidChangeProperty.fire({ type: ProcessPropertyType.UsedShellIntegrationInjection, value: true }); if (injection.envMixin) { @@ -228,25 +228,6 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess } } - // Handle zsh shell integration - Set $ZDOTDIR to a temp dir and create $ZDOTDIR/.zshrc - if (this.shellLaunchConfig.env?.['_ZDOTDIR'] === '1') { - const zdotdir = path.join(tmpdir(), 'vscode-zsh'); - await fs.mkdir(zdotdir, { recursive: true }); - const source = path.join(path.dirname(FileAccess.asFileUri('', require).fsPath), 'out/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh'); - // TODO: Does filesToCopy make this unnecessary now? - try { - await fs.copyFile(source, path.join(zdotdir, '.zshrc')); - } catch { - // Swallow error, this should only happen when multiple users are on the same - // machine. Since the shell integration scripts rarely change, plus the other user - // should be using the same version of the server in this case, assume the script is - // fine if copy fails and swallow the error. - } - this._ptyOptions.env = this._ptyOptions.env || {}; - this._ptyOptions.env['ZDOTDIR'] = zdotdir; - delete this._ptyOptions.env['_ZDOTDIR']; - } - try { await this.setupPtyProcess(this.shellLaunchConfig, this._ptyOptions, injection); return undefined; diff --git a/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts b/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts index 2ce4d1864e9..3ddda6e00d7 100644 --- a/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts +++ b/src/vs/platform/terminal/test/node/terminalEnvironment.test.ts @@ -5,24 +5,33 @@ import { deepStrictEqual, ok, strictEqual } from 'assert'; import { homedir, userInfo } from 'os'; +import { isWindows } from 'vs/base/common/platform'; import { NullLogService } from 'vs/platform/log/common/log'; +import { IProductService } from 'vs/platform/product/common/productService'; import { ITerminalProcessOptions } from 'vs/platform/terminal/common/terminal'; import { getShellIntegrationInjection, IShellIntegrationConfigInjection } from 'vs/platform/terminal/node/terminalEnvironment'; -const enabledProcessOptions: ITerminalProcessOptions['shellIntegration'] = { enabled: true }; -const disabledProcessOptions: ITerminalProcessOptions['shellIntegration'] = { enabled: false }; +const enabledProcessOptions: Pick = { shellIntegration: { enabled: true }, windowsEnableConpty: true }; +const disabledProcessOptions: Pick = { shellIntegration: { enabled: false }, windowsEnableConpty: true }; +const winptyProcessOptions: Pick = { shellIntegration: { enabled: true }, windowsEnableConpty: false }; const pwshExe = process.platform === 'win32' ? 'pwsh.exe' : 'pwsh'; const repoRoot = process.platform === 'win32' ? process.cwd()[0].toLowerCase() + process.cwd().substring(1) : process.cwd(); const logService = new NullLogService(); +const productService = { applicationName: 'vscode' } as IProductService; const defaultEnvironment = {}; suite('platform - terminalEnvironment', () => { suite('getShellIntegrationInjection', () => { suite('should not enable', () => { test('when isFeatureTerminal or when no executable is provided', () => { - ok(!getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'], isFeatureTerminal: true }, enabledProcessOptions, defaultEnvironment, logService)); - ok(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'], isFeatureTerminal: false }, enabledProcessOptions, defaultEnvironment, logService)); + ok(!getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'], isFeatureTerminal: true }, enabledProcessOptions, defaultEnvironment, logService, productService)); + ok(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'], isFeatureTerminal: false }, enabledProcessOptions, defaultEnvironment, logService, productService)); }); + if (isWindows) { + test('when on windows with conpty false', () => { + ok(!getShellIntegrationInjection({ executable: pwshExe, args: ['-l'], isFeatureTerminal: false }, winptyProcessOptions, defaultEnvironment, logService, productService)); + }); + } }); suite('pwsh', () => { @@ -41,21 +50,21 @@ suite('platform - terminalEnvironment', () => { } }); test('when undefined, []', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: [] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: undefined }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: undefined }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); suite('when no logo', () => { test('array - case insensitive', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOLOGO'] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-nol'] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOL'] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOLOGO'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-nol'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-NOL'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); test('string - case insensitive', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NoLogo' }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NOLOGO' }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-nol' }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NOL' }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NoLogo' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NOLOGO' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-nol' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-NOL' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); }); }); @@ -72,23 +81,23 @@ suite('platform - terminalEnvironment', () => { } }); test('when array contains no logo and login', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); test('when string', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-l' }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-l' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); }); suite('should not modify args', () => { test('when shell integration is disabled', () => { - strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-l'] }, disabledProcessOptions, defaultEnvironment, logService), undefined); - strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-l' }, disabledProcessOptions, defaultEnvironment, logService), undefined); - strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: undefined }, disabledProcessOptions, defaultEnvironment, logService), undefined); + strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-l'] }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); + strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-l' }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); + strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: undefined }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); }); test('when using unrecognized arg', () => { - strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo', '-i'] }, disabledProcessOptions, defaultEnvironment, logService), undefined); + strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: ['-l', '-NoLogo', '-i'] }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); }); test('when using unrecognized arg (string)', () => { - strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-i' }, disabledProcessOptions, defaultEnvironment, logService), undefined); + strictEqual(getShellIntegrationInjection({ executable: pwshExe, args: '-i' }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); }); }); }); @@ -127,37 +136,37 @@ suite('platform - terminalEnvironment', () => { ok(result.filesToCopy[3].source.match(expectedSources[3])); } test('when undefined, []', () => { - const result1 = getShellIntegrationInjection({ executable: 'zsh', args: [] }, enabledProcessOptions, defaultEnvironment, logService); + const result1 = getShellIntegrationInjection({ executable: 'zsh', args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService); deepStrictEqual(result1?.newArgs, ['-i']); assertIsEnabled(result1); - const result2 = getShellIntegrationInjection({ executable: 'zsh', args: undefined }, enabledProcessOptions, defaultEnvironment, logService); + const result2 = getShellIntegrationInjection({ executable: 'zsh', args: undefined }, enabledProcessOptions, defaultEnvironment, logService, productService); deepStrictEqual(result2?.newArgs, ['-i']); assertIsEnabled(result2); }); suite('should incorporate login arg', () => { test('when array', () => { - const result = getShellIntegrationInjection({ executable: 'zsh', args: ['-l'] }, enabledProcessOptions, defaultEnvironment, logService); + const result = getShellIntegrationInjection({ executable: 'zsh', args: ['-l'] }, enabledProcessOptions, defaultEnvironment, logService, productService); deepStrictEqual(result?.newArgs, ['-il']); assertIsEnabled(result); }); }); suite('should not modify args', () => { test('when shell integration is disabled', () => { - strictEqual(getShellIntegrationInjection({ executable: 'zsh', args: ['-l'] }, disabledProcessOptions, defaultEnvironment, logService), undefined); - strictEqual(getShellIntegrationInjection({ executable: 'zsh', args: undefined }, disabledProcessOptions, defaultEnvironment, logService), undefined); + strictEqual(getShellIntegrationInjection({ executable: 'zsh', args: ['-l'] }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); + strictEqual(getShellIntegrationInjection({ executable: 'zsh', args: undefined }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); }); test('when using unrecognized arg', () => { - strictEqual(getShellIntegrationInjection({ executable: 'zsh', args: ['-l', '-fake'] }, disabledProcessOptions, defaultEnvironment, logService), undefined); + strictEqual(getShellIntegrationInjection({ executable: 'zsh', args: ['-l', '-fake'] }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); }); }); suite('should incorporate global ZDOTDIR env variable', () => { test('when custom ZDOTDIR', () => { - const result1 = getShellIntegrationInjection({ executable: 'zsh', args: [] }, enabledProcessOptions, { ...defaultEnvironment, ZDOTDIR: customZdotdir }, logService); + const result1 = getShellIntegrationInjection({ executable: 'zsh', args: [] }, enabledProcessOptions, { ...defaultEnvironment, ZDOTDIR: customZdotdir }, logService, productService); deepStrictEqual(result1?.newArgs, ['-i']); assertIsEnabled(result1, customZdotdir); }); test('when undefined', () => { - const result1 = getShellIntegrationInjection({ executable: 'zsh', args: [] }, enabledProcessOptions, undefined, logService); + const result1 = getShellIntegrationInjection({ executable: 'zsh', args: [] }, enabledProcessOptions, undefined, logService, productService); deepStrictEqual(result1?.newArgs, ['-i']); assertIsEnabled(result1); }); @@ -176,9 +185,9 @@ suite('platform - terminalEnvironment', () => { VSCODE_INJECTION: '1' } }); - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: [] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: '' }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: undefined }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: '' }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: undefined }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); suite('should set login env variable and not modify args', () => { const enabledExpectedResult = Object.freeze({ @@ -192,16 +201,16 @@ suite('platform - terminalEnvironment', () => { } }); test('when array', () => { - deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: ['-l'] }, enabledProcessOptions, defaultEnvironment, logService), enabledExpectedResult); + deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: ['-l'] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult); }); }); suite('should not modify args', () => { test('when shell integration is disabled', () => { - strictEqual(getShellIntegrationInjection({ executable: 'bash', args: ['-l'] }, disabledProcessOptions, defaultEnvironment, logService), undefined); - strictEqual(getShellIntegrationInjection({ executable: 'bash', args: undefined }, disabledProcessOptions, defaultEnvironment, logService), undefined); + strictEqual(getShellIntegrationInjection({ executable: 'bash', args: ['-l'] }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); + strictEqual(getShellIntegrationInjection({ executable: 'bash', args: undefined }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); }); test('when custom array entry', () => { - strictEqual(getShellIntegrationInjection({ executable: 'bash', args: ['-l', '-i'] }, disabledProcessOptions, defaultEnvironment, logService), undefined); + strictEqual(getShellIntegrationInjection({ executable: 'bash', args: ['-l', '-i'] }, disabledProcessOptions, defaultEnvironment, logService, productService), undefined); }); }); }); diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 01f9f4743ad..d4ba695131b 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -387,8 +387,8 @@ export const editorActiveLinkForeground = registerColor('editorLink.activeForegr /** * Inline hints */ -export const editorInlayHintForeground = registerColor('editorInlayHint.foreground', { dark: transparent(badgeForeground, .8), light: transparent(badgeForeground, .8), hcDark: badgeForeground, hcLight: badgeForeground }, nls.localize('editorInlayHintForeground', 'Foreground color of inline hints')); -export const editorInlayHintBackground = registerColor('editorInlayHint.background', { dark: transparent(badgeBackground, .6), light: transparent(badgeBackground, .3), hcDark: badgeBackground, hcLight: badgeBackground }, nls.localize('editorInlayHintBackground', 'Background color of inline hints')); +export const editorInlayHintForeground = registerColor('editorInlayHint.foreground', { dark: badgeForeground, light: badgeForeground, hcDark: Color.black, hcLight: badgeForeground }, nls.localize('editorInlayHintForeground', 'Foreground color of inline hints')); +export const editorInlayHintBackground = registerColor('editorInlayHint.background', { dark: transparent(badgeBackground, .8), light: transparent(badgeBackground, .6), hcDark: '#f38518', hcLight: badgeBackground }, nls.localize('editorInlayHintBackground', 'Background color of inline hints')); export const editorInlayHintTypeForeground = registerColor('editorInlayHint.typeForeground', { dark: editorInlayHintForeground, light: editorInlayHintForeground, hcDark: editorInlayHintForeground, hcLight: editorInlayHintForeground }, nls.localize('editorInlayHintForegroundTypes', 'Foreground color of inline hints for types')); export const editorInlayHintTypeBackground = registerColor('editorInlayHint.typeBackground', { dark: editorInlayHintBackground, light: editorInlayHintBackground, hcDark: editorInlayHintBackground, hcLight: editorInlayHintBackground }, nls.localize('editorInlayHintBackgroundTypes', 'Background color of inline hints for types')); export const editorInlayHintParameterForeground = registerColor('editorInlayHint.parameterForeground', { dark: editorInlayHintForeground, light: editorInlayHintForeground, hcDark: editorInlayHintForeground, hcLight: editorInlayHintForeground }, nls.localize('editorInlayHintForegroundParameter', 'Foreground color of inline hints for parameters')); @@ -406,8 +406,8 @@ export const editorLightBulbAutoFixForeground = registerColor('editorLightBulbAu export const defaultInsertColor = new Color(new RGBA(155, 185, 85, .2)); export const defaultRemoveColor = new Color(new RGBA(255, 0, 0, .2)); -export const diffInserted = registerColor('diffEditor.insertedTextBackground', { dark: '#9ccc2c33', light: '#9ccc2c66', hcDark: null, hcLight: null }, nls.localize('diffEditorInserted', 'Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true); -export const diffRemoved = registerColor('diffEditor.removedTextBackground', { dark: '#ff000066', light: '#ff00004d', hcDark: null, hcLight: null }, nls.localize('diffEditorRemoved', 'Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.'), true); +export const diffInserted = registerColor('diffEditor.insertedTextBackground', { dark: '#9ccc2c33', light: '#9ccc2c40', hcDark: null, hcLight: null }, nls.localize('diffEditorInserted', 'Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true); +export const diffRemoved = registerColor('diffEditor.removedTextBackground', { dark: '#ff000033', light: '#ff000033', hcDark: null, hcLight: null }, nls.localize('diffEditorRemoved', 'Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.'), true); export const diffInsertedLine = registerColor('diffEditor.insertedLineBackground', { dark: defaultInsertColor, light: defaultInsertColor, hcDark: null, hcLight: null }, nls.localize('diffEditorInsertedLines', 'Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true); export const diffRemovedLine = registerColor('diffEditor.removedLineBackground', { dark: defaultRemoveColor, light: defaultRemoveColor, hcDark: null, hcLight: null }, nls.localize('diffEditorRemovedLines', 'Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations.'), true); diff --git a/src/vs/platform/tunnel/common/tunnel.ts b/src/vs/platform/tunnel/common/tunnel.ts index 29b07680481..1c0d70f63ff 100644 --- a/src/vs/platform/tunnel/common/tunnel.ts +++ b/src/vs/platform/tunnel/common/tunnel.ts @@ -129,6 +129,7 @@ export interface ITunnelService { closeTunnel(remoteHost: string, remotePort: number): Promise; setTunnelProvider(provider: ITunnelProvider | undefined): IDisposable; setTunnelFeatures(features: TunnelProviderFeatures): void; + isPortPrivileged(port: number): boolean; } export function extractLocalHostUriMetaDataForPortMapping(uri: URI): { address: string; port: number } | undefined { @@ -402,6 +403,24 @@ export abstract class AbstractTunnelService implements ITunnelService { return !!extractLocalHostUriMetaDataForPortMapping(uri); } + public abstract isPortPrivileged(port: number): boolean; + + protected doIsPortPrivileged(port: number, isWindows: boolean, isMacintosh: boolean, osRelease: string): boolean { + if (isWindows) { + return false; + } else if (isMacintosh) { + const osVersion = (/(\d+)\.(\d+)\.(\d+)/g).exec(osRelease); + if (osVersion?.length === 4) { + const major = parseInt(osVersion[1]); + const minor = parseInt(osVersion[2]); + if (((major > 10) || (major === 10 && minor >= 14))) { + return false; + } + } + } + return port < 1024; + } + protected abstract retainOrCreateTunnel(addressProvider: IAddressProvider, remoteHost: string, remotePort: number, localPort: number | undefined, elevateIfNeeded: boolean, privacy?: string, protocol?: string): Promise | undefined; protected createWithProvider(tunnelProvider: ITunnelProvider, remoteHost: string, remotePort: number, localPort: number | undefined, elevateIfNeeded: boolean, privacy?: string, protocol?: string): Promise | undefined { @@ -409,7 +428,7 @@ export abstract class AbstractTunnelService implements ITunnelService { const key = remotePort; this._factoryInProgress.add(key); const preferredLocalPort = localPort === undefined ? remotePort : localPort; - const creationInfo = { elevationRequired: elevateIfNeeded ? isPortPrivileged(preferredLocalPort) : false }; + const creationInfo = { elevationRequired: elevateIfNeeded ? this.isPortPrivileged(preferredLocalPort) : false }; const tunnelOptions: TunnelOptions = { remoteAddress: { host: remoteHost, port: remotePort }, localAddressPort: localPort, privacy, public: privacy ? (privacy !== TunnelPrivacyId.Private) : undefined, protocol }; const tunnel = tunnelProvider.forwardPort(tunnelOptions, creationInfo); if (tunnel) { diff --git a/src/vs/platform/tunnel/node/tunnelService.ts b/src/vs/platform/tunnel/node/tunnelService.ts index 7cdd91afd53..50a7cb920af 100644 --- a/src/vs/platform/tunnel/node/tunnelService.ts +++ b/src/vs/platform/tunnel/node/tunnelService.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as net from 'net'; +import * as os from 'os'; import { BROWSER_RESTRICTED_PORTS, findFreePortFaster } from 'vs/base/node/ports'; import { NodeSocket } from 'vs/base/parts/ipc/node/ipc.net'; import { nodeSocketFactory } from 'vs/platform/remote/node/nodeSocketFactory'; @@ -16,6 +17,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { connectRemoteAgentTunnel, IAddressProvider, IConnectionOptions, ISocketFactory } from 'vs/platform/remote/common/remoteAgentConnection'; import { AbstractTunnelService, isAllInterfaces, ISharedTunnelsService as ISharedTunnelsService, isLocalhost, ITunnelService, RemoteTunnel, TunnelPrivacyId } from 'vs/platform/tunnel/common/tunnel'; import { ISignService } from 'vs/platform/sign/common/sign'; +import { isMacintosh, isWindows } from 'vs/base/common/platform'; async function createRemoteTunnel(options: IConnectionOptions, defaultTunnelHost: string, tunnelRemoteHost: string, tunnelRemotePort: number, tunnelLocalPort?: number): Promise { let readyTunnel: NodeRemoteTunnel | undefined; @@ -165,6 +167,10 @@ export class BaseTunnelService extends AbstractTunnelService { return (!settingValue || settingValue === 'localhost') ? '127.0.0.1' : '0.0.0.0'; } + public isPortPrivileged(port: number): boolean { + return this.doIsPortPrivileged(port, isWindows, isMacintosh, os.release()); + } + protected retainOrCreateTunnel(addressProvider: IAddressProvider, remoteHost: string, remotePort: number, localPort: number | undefined, elevateIfNeeded: boolean, privacy?: string, protocol?: string): Promise | undefined { const existing = this.getTunnelFromMap(remoteHost, remotePort); if (existing) { diff --git a/src/vs/platform/uriIdentity/common/uriIdentityService.ts b/src/vs/platform/uriIdentity/common/uriIdentityService.ts index a0bbc55fa66..a4a23090906 100644 --- a/src/vs/platform/uriIdentity/common/uriIdentityService.ts +++ b/src/vs/platform/uriIdentity/common/uriIdentityService.ts @@ -5,7 +5,7 @@ import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { URI } from 'vs/base/common/uri'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IFileService, FileSystemProviderCapabilities, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent } from 'vs/platform/files/common/files'; import { ExtUri, IExtUri, normalizePath } from 'vs/base/common/resources'; import { SkipList } from 'vs/base/common/skipList'; @@ -114,4 +114,4 @@ export class UriIdentityService implements IUriIdentityService { } } -registerSingleton(IUriIdentityService, UriIdentityService, true); +registerSingleton(IUriIdentityService, UriIdentityService, InstantiationType.Delayed); diff --git a/src/vs/platform/userDataProfile/common/userDataProfile.ts b/src/vs/platform/userDataProfile/common/userDataProfile.ts index 668a16b7c50..c68e5cf1c99 100644 --- a/src/vs/platform/userDataProfile/common/userDataProfile.ts +++ b/src/vs/platform/userDataProfile/common/userDataProfile.ts @@ -354,7 +354,12 @@ export class UserDataProfilesService extends Disposable implements IUserDataProf joiners.push(promise); } }); - await Promises.settled(joiners); + + try { + await Promise.allSettled(joiners); + } catch (error) { + this.logService.error(error); + } if (profile.id === this.profilesObject.emptyWindow?.id) { this.profilesObject.emptyWindow = undefined; diff --git a/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts index 2507e379501..3cf12e871af 100644 --- a/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts +++ b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts @@ -204,8 +204,8 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto await this.userDataSyncService.resetLocal(); } } catch (error) { + this.logService.error(error); if (softTurnOffOnError) { - this.logService.error(error); this.updateEnablement(false); } else { throw error; @@ -411,7 +411,6 @@ class AutoSync extends Disposable { this.syncTask?.stop(); this.logService.info('Auto Sync: Stopped'); })); - this.logService.info('Auto Sync: Started'); this.sync(AutoSync.INTERVAL_SYNCING, false); } diff --git a/src/vs/platform/userDataSync/common/userDataSyncService.ts b/src/vs/platform/userDataSync/common/userDataSyncService.ts index 02cd2ff1c7a..828b37cef34 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncService.ts @@ -92,7 +92,6 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ @IUserDataSyncEnablementService private readonly userDataSyncEnablementService: IUserDataSyncEnablementService, @IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService, @IProductService private readonly productService: IProductService, - @IConfigurationService private readonly configurationService: IConfigurationService, @IEnvironmentService private readonly environmentService: IEnvironmentService, ) { super(); @@ -104,6 +103,8 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ async createSyncTask(manifest: IUserDataManifest | null, disableCache?: boolean): Promise { this.checkEnablement(); + this.logService.info('Sync started.'); + const startTime = new Date().getTime(); const executionId = generateUuid(); try { const syncHeaders = createSyncHeaders(executionId); @@ -127,7 +128,9 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ throw new Error('Can run a task only once'); } cancellablePromise = createCancelablePromise(token => that.sync(manifest, false, executionId, token)); - return cancellablePromise.finally(() => cancellablePromise = undefined); + await cancellablePromise.finally(() => cancellablePromise = undefined); + that.logService.info(`Sync done. Took ${new Date().getTime() - startTime}ms`); + that.updateLastSyncTime(); }, stop(): Promise { cancellablePromise?.cancel(); @@ -143,9 +146,10 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ throw new UserDataSyncError('Cannot start manual sync when sync is enabled', UserDataSyncErrorCode.LocalError); } + this.logService.info('Sync started.'); + const startTime = new Date().getTime(); const executionId = generateUuid(); const syncHeaders = createSyncHeaders(executionId); - let manifest: IUserDataManifest | null; try { manifest = await this.userDataSyncStoreService.manifest(null, syncHeaders); @@ -166,12 +170,9 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ return that.sync(manifest, true, executionId, cancellableToken.token); }, async apply(): Promise { - for (const profileSynchronizer of that.getActiveProfileSynchronizers()) { - if (cancellableToken.token.isCancellationRequested) { - return; - } - await profileSynchronizer.apply(executionId, cancellableToken.token); - } + await that.applyManualSync(manifest, executionId, cancellableToken.token); + that.logService.info(`Sync done. Took ${new Date().getTime() - startTime}ms`); + that.updateLastSyncTime(); }, stop(): Promise { cancellableToken.cancel(); @@ -185,14 +186,8 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ } private async sync(manifest: IUserDataManifest | null, merge: boolean, executionId: string, token: CancellationToken): Promise { - // Return if cancellation is requested - if (token.isCancellationRequested) { - return; - } - const startTime = new Date().getTime(); this._syncErrors = []; try { - this.logService.info('Sync started.'); if (this.status !== SyncStatus.HasConflicts) { this.setStatus(SyncStatus.Syncing); } @@ -208,27 +203,56 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ if (token.isCancellationRequested) { return; } - for (const syncProfile of syncProfiles) { - if (token.isCancellationRequested) { - return; - } - const profile = this.userDataProfilesService.profiles.find(p => p.id === syncProfile.id); - if (!profile) { - this.logService.error(`Settings Profile with id:${syncProfile.id} and name: ${syncProfile.name} does not exist locally to sync.`); - continue; - } - this.logService.info('Syncing profile.', syncProfile.name); - const profileSynchronizer = this.getOrCreateActiveProfileSynchronizer(profile, syncProfile); - this._syncErrors.push(...await this.syncProfile(profileSynchronizer, manifest, merge, executionId, token)); - } + await this.syncRemoteProfiles(syncProfiles, manifest, merge, executionId, token); } - this.logService.info(`Sync done. Took ${new Date().getTime() - startTime}ms`); - this.updateLastSyncTime(); } finally { this._onSyncErrors.fire(this._syncErrors); } } + private async syncRemoteProfiles(remoteProfiles: ISyncUserDataProfile[], manifest: IUserDataManifest | null, merge: boolean, executionId: string, token: CancellationToken): Promise { + for (const syncProfile of remoteProfiles) { + if (token.isCancellationRequested) { + return; + } + const profile = this.userDataProfilesService.profiles.find(p => p.id === syncProfile.id); + if (!profile) { + this.logService.error(`Settings Profile with id:${syncProfile.id} and name: ${syncProfile.name} does not exist locally to sync.`); + continue; + } + this.logService.info('Syncing profile.', syncProfile.name); + const profileSynchronizer = this.getOrCreateActiveProfileSynchronizer(profile, syncProfile); + this._syncErrors.push(...await this.syncProfile(profileSynchronizer, manifest, merge, executionId, token)); + } + } + + private async applyManualSync(manifest: IUserDataManifest | null, executionId: string, token: CancellationToken): Promise { + const profileSynchronizers = this.getActiveProfileSynchronizers(); + for (const profileSynchronizer of profileSynchronizers) { + if (token.isCancellationRequested) { + return; + } + await profileSynchronizer.apply(executionId, token); + } + + const defaultProfileSynchronizer = profileSynchronizers.find(s => s.profile.isDefault); + if (!defaultProfileSynchronizer) { + return; + } + + const userDataProfileManifestSynchronizer = defaultProfileSynchronizer.enabled.find(s => s.resource === SyncResource.Profiles); + if (!userDataProfileManifestSynchronizer) { + return; + } + + // Sync remote profiles which are not synced locally + const remoteProfiles = (await (userDataProfileManifestSynchronizer as UserDataProfilesManifestSynchroniser).getRemoteSyncedProfiles(manifest?.latest ?? null)) || []; + const remoteProfilesToSync = remoteProfiles.filter(remoteProfile => profileSynchronizers.every(s => s.profile.id !== remoteProfile.id)); + if (remoteProfilesToSync.length) { + await this.syncRemoteProfiles(remoteProfilesToSync, manifest, false, executionId, token); + } + } + private async syncProfile(profileSynchronizer: ProfileSynchronizer, manifest: IUserDataManifest | null, merge: boolean, executionId: string, token: CancellationToken): Promise { const errors = await profileSynchronizer.sync(manifest, merge, executionId, token); return errors.map(([syncResource, error]) => ({ profile: profileSynchronizer.profile, syncResource, error })); @@ -367,16 +391,14 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ async resetLocal(): Promise { this.checkEnablement(); this.storageService.remove(LAST_SYNC_TIME_KEY, StorageScope.APPLICATION); - if (this.activeProfileSynchronizers) { - for (const [synchronizer] of this.activeProfileSynchronizers.values()) { - try { - await synchronizer.resetLocal(); - } catch (e) { - this.logService.error(e); - } + for (const [synchronizer] of this.activeProfileSynchronizers.values()) { + try { + await synchronizer.resetLocal(); + } catch (e) { + this.logService.error(e); } - this.clearActiveProfileSynchronizers(); } + this.clearActiveProfileSynchronizers(); this._onDidResetLocal.fire(); this.logService.info('Did reset the local sync state.'); } @@ -396,7 +418,7 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ return isUndefined(result) ? null : result; } - if (this.environmentService.isBuilt && !(this.productService.enableSyncingProfiles && this.configurationService.getValue('settingsSync.enableSyncingProfiles'))) { + if (this.environmentService.isBuilt && (!this.productService.enableSyncingProfiles || isEqual(this.userDataSyncStoreManagementService.userDataSyncStore?.url, this.userDataSyncStoreManagementService.userDataSyncStore?.stableUrl))) { return null; } @@ -568,7 +590,7 @@ class ProfileSynchronizer extends Disposable { if (!this._profile.isDefault) { return; } - if (this.environmentService.isBuilt && !(this.productService.enableSyncingProfiles && this.configurationService.getValue('settingsSync.enableSyncingProfiles'))) { + if (this.environmentService.isBuilt && (!this.productService.enableSyncingProfiles || isEqual(this.userDataSyncStoreManagementService.userDataSyncStore?.url, this.userDataSyncStoreManagementService.userDataSyncStore?.stableUrl))) { this.logService.debug('Skipping profiles sync'); return; } diff --git a/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts b/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts index 2697c75eb94..c6605c7ad7c 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts @@ -17,8 +17,8 @@ import { type ManualSyncTaskEvent = { manualSyncTaskId: string; data: T }; -function reviewSyncResource(syncResource: IUserDataSyncResource, userDataProfilesService: IUserDataProfilesService) { - return { ...syncResource, profie: reviveProfile(syncResource.profile, userDataProfilesService.profilesHome.scheme) }; +function reviewSyncResource(syncResource: IUserDataSyncResource, userDataProfilesService: IUserDataProfilesService): IUserDataSyncResource { + return { ...syncResource, profile: reviveProfile(syncResource.profile, userDataProfilesService.profilesHome.scheme) }; } export class UserDataSyncChannel implements IServerChannel { diff --git a/src/vs/server/node/webClientServer.ts b/src/vs/server/node/webClientServer.ts index 433e12a7b15..e57259fc731 100644 --- a/src/vs/server/node/webClientServer.ts +++ b/src/vs/server/node/webClientServer.ts @@ -302,7 +302,7 @@ export class WebClientServer { const workbenchWebConfiguration = { remoteAuthority, _wrapWebWorkerExtHostInIframe, - developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined }, + developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, enableWorkspaceTrust: !this._environmentService.args['disable-workspace-trust'], folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']), diff --git a/src/vs/workbench/api/browser/extensionHost.contribution.ts b/src/vs/workbench/api/browser/extensionHost.contribution.ts index 203f680485c..38a27b2cea4 100644 --- a/src/vs/workbench/api/browser/extensionHost.contribution.ts +++ b/src/vs/workbench/api/browser/extensionHost.contribution.ts @@ -90,4 +90,4 @@ export class ExtensionPoints implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExtensionPoints, 'ExtensionPoints', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExtensionPoints, LifecyclePhase.Starting); diff --git a/src/vs/workbench/api/browser/mainThreadBulkEdits.ts b/src/vs/workbench/api/browser/mainThreadBulkEdits.ts index dabd351f2d8..0c59eb78b5a 100644 --- a/src/vs/workbench/api/browser/mainThreadBulkEdits.ts +++ b/src/vs/workbench/api/browser/mainThreadBulkEdits.ts @@ -27,7 +27,7 @@ export class MainThreadBulkEdits implements MainThreadBulkEditsShape { $tryApplyWorkspaceEdit(dto: IWorkspaceEditDto, undoRedoGroupId?: number, isRefactoring?: boolean): Promise { const edits = reviveWorkspaceEditDto(dto, this._uriIdentService); - return this._bulkEditService.apply(edits, { undoRedoGroupId, respectAutoSaveConfig: isRefactoring }).then(() => true, err => { + return this._bulkEditService.apply(edits, { undoRedoGroupId, respectAutoSaveConfig: isRefactoring }).then((res) => res.isApplied, err => { this._logService.warn(`IGNORING workspace edit: ${err}`); return false; }); diff --git a/src/vs/workbench/api/browser/mainThreadEditorTabs.ts b/src/vs/workbench/api/browser/mainThreadEditorTabs.ts index bda93934177..09efeab8cde 100644 --- a/src/vs/workbench/api/browser/mainThreadEditorTabs.ts +++ b/src/vs/workbench/api/browser/mainThreadEditorTabs.ts @@ -194,7 +194,7 @@ export class MainThreadEditorTabs implements MainThreadEditorTabsShape { private _generateTabId(editor: EditorInput, groupId: number) { let resourceString: string | undefined; // Properly get the resource and account for side by side editors - const resource = EditorResourceAccessor.getOriginalUri(editor, { supportSideBySide: SideBySideEditor.BOTH }); + const resource = EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.BOTH }); if (resource instanceof URI) { resourceString = resource.toString(); } else { diff --git a/src/vs/workbench/api/browser/mainThreadTunnelService.ts b/src/vs/workbench/api/browser/mainThreadTunnelService.ts index c43a9e82756..ea4f8198698 100644 --- a/src/vs/workbench/api/browser/mainThreadTunnelService.ts +++ b/src/vs/workbench/api/browser/mainThreadTunnelService.ts @@ -8,7 +8,7 @@ import { MainThreadTunnelServiceShape, MainContext, ExtHostContext, ExtHostTunne import { TunnelDtoConverter } from 'vs/workbench/api/common/extHostTunnelService'; import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers'; import { CandidatePort, IRemoteExplorerService, makeAddress, PORT_AUTO_FORWARD_SETTING, PORT_AUTO_SOURCE_SETTING, PORT_AUTO_SOURCE_SETTING_OUTPUT, PORT_AUTO_SOURCE_SETTING_PROCESS, TunnelSource } from 'vs/workbench/services/remote/common/remoteExplorerService'; -import { ITunnelProvider, ITunnelService, TunnelCreationOptions, TunnelProviderFeatures, TunnelOptions, RemoteTunnel, isPortPrivileged, ProvidedPortAttributes, PortAttributesProvider, TunnelProtocol } from 'vs/platform/tunnel/common/tunnel'; +import { ITunnelProvider, ITunnelService, TunnelCreationOptions, TunnelProviderFeatures, TunnelOptions, RemoteTunnel, ProvidedPortAttributes, PortAttributesProvider, TunnelProtocol } from 'vs/platform/tunnel/common/tunnel'; import { Disposable } from 'vs/base/common/lifecycle'; import type { TunnelDescription } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; @@ -111,7 +111,7 @@ export class MainThreadTunnelService extends Disposable implements MainThreadTun if (!this.elevateionRetry && (tunnelOptions.localAddressPort !== undefined) && (tunnel.tunnelLocalPort !== undefined) - && isPortPrivileged(tunnelOptions.localAddressPort) + && this.tunnelService.isPortPrivileged(tunnelOptions.localAddressPort) && (tunnel.tunnelLocalPort !== tunnelOptions.localAddressPort) && this.tunnelService.canElevate) { diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts index 92b4f91954d..87e69afc783 100644 --- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts @@ -642,4 +642,4 @@ class ViewsExtensionHandler implements IWorkbenchContribution { } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(ViewsExtensionHandler, 'ViewsExtensionHandler', LifecyclePhase.Starting); +workbenchRegistry.registerWorkbenchContribution(ViewsExtensionHandler, LifecyclePhase.Starting); diff --git a/src/vs/workbench/api/common/extHost.common.services.ts b/src/vs/workbench/api/common/extHost.common.services.ts index 4658a622298..f00aebebc47 100644 --- a/src/vs/workbench/api/common/extHost.common.services.ts +++ b/src/vs/workbench/api/common/extHost.common.services.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IExtHostOutputService, ExtHostOutputService } from 'vs/workbench/api/common/extHostOutput'; import { IExtHostWorkspace, ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; import { IExtHostDecorations, ExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'; @@ -30,9 +30,9 @@ import { ExtHostVariableResolverProviderService, IExtHostVariableResolverProvide import { ExtHostTelemetryLogService, IExtHostTelemetryLogService } from 'vs/workbench/api/common/extHostTelemetryLogService'; import { ExtHostLocalizationService, IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLocalizationService'; -registerSingleton(IExtHostLocalizationService, ExtHostLocalizationService, true); -registerSingleton(ILoggerService, ExtHostLoggerService, true); -registerSingleton(ILogService, ExtHostLogService, true); +registerSingleton(IExtHostLocalizationService, ExtHostLocalizationService, InstantiationType.Delayed); +registerSingleton(ILoggerService, ExtHostLoggerService, InstantiationType.Delayed); +registerSingleton(ILogService, ExtHostLogService, InstantiationType.Delayed); registerSingleton(IExtHostApiDeprecationService, ExtHostApiDeprecationService, false); registerSingleton(IExtHostCommands, ExtHostCommands, false); registerSingleton(IExtHostConfiguration, ExtHostConfiguration, false); @@ -41,7 +41,7 @@ registerSingleton(IExtHostDebugService, WorkerExtHostDebugService, false); registerSingleton(IExtHostDecorations, ExtHostDecorations, false); registerSingleton(IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors, false); registerSingleton(IExtHostFileSystemInfo, ExtHostFileSystemInfo, false); -registerSingleton(IExtHostOutputService, ExtHostOutputService, true); +registerSingleton(IExtHostOutputService, ExtHostOutputService, InstantiationType.Delayed); registerSingleton(IExtHostSearch, ExtHostSearch, false); registerSingleton(IExtHostStorage, ExtHostStorage, false); registerSingleton(IExtHostTask, WorkerExtHostTask, false); diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 5e21c84cd15..50ad7f3c9e3 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -2199,7 +2199,7 @@ export interface ExtHostTestingShape { export interface ExtHostLocalizationShape { getMessage(extensionId: string, details: IStringDetails): string; - getBundle(extensionId: string): { [key: string]: string }; + getBundle(extensionId: string): { [key: string]: string } | undefined; getBundleUri(extensionId: string): URI | undefined; initializeLocalizedMessages(extension: IExtensionDescription): Promise; } diff --git a/src/vs/workbench/api/common/extHostBulkEdits.ts b/src/vs/workbench/api/common/extHostBulkEdits.ts index 59e0bbc2426..bdbfe2e5ba8 100644 --- a/src/vs/workbench/api/common/extHostBulkEdits.ts +++ b/src/vs/workbench/api/common/extHostBulkEdits.ts @@ -8,7 +8,6 @@ import { MainContext, MainThreadBulkEditsShape } from 'vs/workbench/api/common/e import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; import { WorkspaceEdit } from 'vs/workbench/api/common/extHostTypeConverters'; -import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; import type * as vscode from 'vscode'; export class ExtHostBulkEdits { @@ -29,11 +28,6 @@ export class ExtHostBulkEdits { } applyWorkspaceEdit(edit: vscode.WorkspaceEdit, extension: IExtensionDescription, metadata: vscode.WorkspaceEditMetadata | undefined): Promise { - const allowIsRefactoring = isProposedApiEnabled(extension, 'workspaceEditIsRefactoring'); - if (metadata && !allowIsRefactoring) { - console.warn(`Extension '${extension.identifier.value}' uses a proposed API 'workspaceEditIsRefactoring' which is NOT enabled for it`); - metadata = undefined; - } const dto = WorkspaceEdit.from(edit, this._versionInformationProvider); return this._proxy.$tryApplyWorkspaceEdit(dto, undefined, metadata?.isRefactoring ?? false); } diff --git a/src/vs/workbench/api/common/extHostLocalizationService.ts b/src/vs/workbench/api/common/extHostLocalizationService.ts index 38f3b41f632..335fdf88ac6 100644 --- a/src/vs/workbench/api/common/extHostLocalizationService.ts +++ b/src/vs/workbench/api/common/extHostLocalizationService.ts @@ -35,7 +35,7 @@ export class ExtHostLocalizationService implements ExtHostLocalizationShape { getMessage(extensionId: string, details: IStringDetails): string { const { message, args, comment } = details; if (this.isDefaultLanguage) { - return format(message, args); + return format(message, ...(args ?? [])); } let key = message; @@ -46,11 +46,11 @@ export class ExtHostLocalizationService implements ExtHostLocalizationShape { if (!str) { this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${key}`); } - return format(str ?? key, args); + return format(str ?? key, ...(args ?? [])); } - getBundle(extensionId: string): { [key: string]: string } { - return this.bundleCache.get(extensionId)?.contents ?? {}; + getBundle(extensionId: string): { [key: string]: string } | undefined { + return this.bundleCache.get(extensionId)?.contents; } getBundleUri(extensionId: string): URI | undefined { diff --git a/src/vs/workbench/api/common/extHostOutput.ts b/src/vs/workbench/api/common/extHostOutput.ts index abe63cff8da..09741ef4a3c 100644 --- a/src/vs/workbench/api/common/extHostOutput.ts +++ b/src/vs/workbench/api/common/extHostOutput.ts @@ -35,6 +35,7 @@ class ExtHostOutputChannel extends AbstractMessageLogger implements vscode.LogOu readonly extension: IExtensionDescription, ) { super(); + this._register(logger.onDidChangeLogLevel(level => this.setLevel(level))); } appendLine(value: string): void { @@ -235,7 +236,7 @@ export class ExtHostOutputService implements ExtHostOutputServiceShape { ...this.createExtHostOutputChannel(name, channelPromise), trace(value: string, ...args: any[]): void { validate(); - channelPromise.then(channel => channel.info(value, ...args)); + channelPromise.then(channel => channel.trace(value, ...args)); }, debug(value: string, ...args: any[]): void { validate(); diff --git a/src/vs/workbench/api/common/extHostTestItem.ts b/src/vs/workbench/api/common/extHostTestItem.ts index 25fa2780a45..496cc12a035 100644 --- a/src/vs/workbench/api/common/extHostTestItem.ts +++ b/src/vs/workbench/api/common/extHostTestItem.ts @@ -175,6 +175,8 @@ export class TestItemImpl implements vscode.TestItem { } export class TestItemRootImpl extends TestItemImpl { + public readonly _isRoot = true; + constructor(controllerId: string, label: string) { super(controllerId, controllerId, label, undefined); } diff --git a/src/vs/workbench/api/common/extHostTesting.ts b/src/vs/workbench/api/common/extHostTesting.ts index c436a936cf6..bf44c8939d4 100644 --- a/src/vs/workbench/api/common/extHostTesting.ts +++ b/src/vs/workbench/api/common/extHostTesting.ts @@ -751,7 +751,8 @@ class MirroredChangeCollector extends IncrementalChangeCollector => { return treeView.reveal(element, options); diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index 2be8385ad85..8721bb81444 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -1846,7 +1846,8 @@ export namespace TestResults { const byInternalId = new Map(); for (const item of serialized.items) { byInternalId.set(item.item.extId, item); - if (serialized.request.targets.some(t => t.controllerId === item.controllerId && t.testIds.includes(item.item.extId))) { + const controllerId = TestId.root(item.item.extId); + if (serialized.request.targets.some(t => t.controllerId === controllerId && t.testIds.includes(item.item.extId))) { roots.push(item); } } diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 57c2608bdfc..7f44f88a23e 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -28,12 +28,21 @@ import type * as vscode from 'vscode'; * but new ones must not be added * */ function es5ClassCompat(target: Function): any { - ///@ts-expect-error - function _() { return Reflect.construct(target, arguments, this.constructor); } - Object.defineProperty(_, 'name', Object.getOwnPropertyDescriptor(target, 'name')!); - Object.setPrototypeOf(_, target); - Object.setPrototypeOf(_.prototype, target.prototype); - return _; + const interceptFunctions = { + apply: function () { + const args = arguments.length === 1 ? [] : arguments[1]; + return Reflect.construct(target, args, arguments[0].constructor); + }, + call: function () { + if (arguments.length === 0) { + return Reflect.construct(target, []); + } else { + const [thisArg, ...restArgs] = arguments; + return Reflect.construct(target, restArgs, thisArg.constructor); + } + } + }; + return Object.assign(target, interceptFunctions); } @es5ClassCompat @@ -2460,6 +2469,22 @@ export enum ProgressLocation { Notification = 15 } +export namespace ViewBadge { + export function isViewBadge(thing: any): thing is vscode.ViewBadge { + const viewBadgeThing = thing as vscode.ViewBadge; + + if (!isNumber(viewBadgeThing.value)) { + console.log('INVALID view badge, invalid value', viewBadgeThing.value); + return false; + } + if (viewBadgeThing.tooltip && !isString(viewBadgeThing.tooltip)) { + console.log('INVALID view badge, invalid tooltip', viewBadgeThing.tooltip); + return false; + } + return true; + } +} + @es5ClassCompat export class TreeItem { diff --git a/src/vs/workbench/api/node/extHost.node.services.ts b/src/vs/workbench/api/node/extHost.node.services.ts index 27562ce32ca..98d300f7d8c 100644 --- a/src/vs/workbench/api/node/extHost.node.services.ts +++ b/src/vs/workbench/api/node/extHost.node.services.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ExtHostTerminalService } from 'vs/workbench/api/node/extHostTerminalService'; import { ExtHostTask } from 'vs/workbench/api/node/extHostTask'; import { ExtHostDebugService } from 'vs/workbench/api/node/extHostDebugService'; @@ -30,7 +30,7 @@ import { IExtHostVariableResolverProvider } from 'vs/workbench/api/common/extHos // ######################################################################### registerSingleton(IExtHostExtensionService, ExtHostExtensionService, false); -registerSingleton(ILoggerService, ExtHostLoggerService, true); +registerSingleton(ILoggerService, ExtHostLoggerService, InstantiationType.Delayed); registerSingleton(IExtensionStoragePaths, ExtensionStoragePaths, false); registerSingleton(IExtHostDebugService, ExtHostDebugService, false); diff --git a/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts b/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts index 021725f35f0..f7d92af7f58 100644 --- a/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts +++ b/src/vs/workbench/api/test/browser/extHostDiagnostics.test.ts @@ -16,6 +16,7 @@ import type * as vscode from 'vscode'; import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { ExtUri, extUri } from 'vs/base/common/resources'; import { IExtHostFileSystemInfo } from 'vs/workbench/api/common/extHostFileSystemInfo'; +import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler'; suite('ExtHostDiagnostics', () => { @@ -438,43 +439,46 @@ suite('ExtHostDiagnostics', () => { }); test('Diagnostics created by tasks aren\'t accessible to extensions #47292', async function () { - const diags = new ExtHostDiagnostics(new class implements IMainContext { - getProxy(id: any): any { - return {}; - } - set(): any { - return null; - } - dispose() { } - assertRegistered(): void { + return runWithFakedTimers({}, async function () { - } - drain() { - return undefined!; - } - }, new NullLogService(), fileSystemInfoService); + const diags = new ExtHostDiagnostics(new class implements IMainContext { + getProxy(id: any): any { + return {}; + } + set(): any { + return null; + } + dispose() { } + assertRegistered(): void { + + } + drain() { + return undefined!; + } + }, new NullLogService(), fileSystemInfoService); - // - const uri = URI.parse('foo:bar'); - const data: IMarkerData[] = [{ - message: 'message', - startLineNumber: 1, - startColumn: 1, - endLineNumber: 1, - endColumn: 1, - severity: 3 - }]; + // + const uri = URI.parse('foo:bar'); + const data: IMarkerData[] = [{ + message: 'message', + startLineNumber: 1, + startColumn: 1, + endLineNumber: 1, + endColumn: 1, + severity: 3 + }]; - const p1 = Event.toPromise(diags.onDidChangeDiagnostics); - diags.$acceptMarkersChange([[uri, data]]); - await p1; - assert.strictEqual(diags.getDiagnostics(uri).length, 1); + const p1 = Event.toPromise(diags.onDidChangeDiagnostics); + diags.$acceptMarkersChange([[uri, data]]); + await p1; + assert.strictEqual(diags.getDiagnostics(uri).length, 1); - const p2 = Event.toPromise(diags.onDidChangeDiagnostics); - diags.$acceptMarkersChange([[uri, []]]); - await p2; - assert.strictEqual(diags.getDiagnostics(uri).length, 0); + const p2 = Event.toPromise(diags.onDidChangeDiagnostics); + diags.$acceptMarkersChange([[uri, []]]); + await p2; + assert.strictEqual(diags.getDiagnostics(uri).length, 0); + }); }); test('languages.getDiagnostics doesn\'t handle case insensitivity correctly #128198', function () { diff --git a/src/vs/workbench/api/test/browser/extHostTesting.test.ts b/src/vs/workbench/api/test/browser/extHostTesting.test.ts index dad5ae26397..80645717880 100644 --- a/src/vs/workbench/api/test/browser/extHostTesting.test.ts +++ b/src/vs/workbench/api/test/browser/extHostTesting.test.ts @@ -102,19 +102,19 @@ suite('ExtHost Testing', () => { assert.deepStrictEqual(single.collectDiff(), [ { op: TestDiffOpType.Add, - item: { controllerId: 'ctrlId', parent: null, expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(single.root) } } + item: { controllerId: 'ctrlId', expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(single.root) } } }, { op: TestDiffOpType.Add, - item: { controllerId: 'ctrlId', parent: single.root.id, expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(a) } } + item: { controllerId: 'ctrlId', expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(a) } } }, { op: TestDiffOpType.Add, - item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-aa') as TestItemImpl) } + item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-aa') as TestItemImpl) } }, { op: TestDiffOpType.Add, - item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-ab') as TestItemImpl) } + item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-ab') as TestItemImpl) } }, { op: TestDiffOpType.Update, @@ -122,7 +122,7 @@ suite('ExtHost Testing', () => { }, { op: TestDiffOpType.Add, - item: { controllerId: 'ctrlId', parent: single.root.id, expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) } + item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) } }, { op: TestDiffOpType.Update, @@ -141,6 +141,19 @@ suite('ExtHost Testing', () => { assert.strictEqual(ab.parent, a); }); + test('can add an item with same ID as root', () => { + single.collectDiff(); + + const child = new TestItemImpl('ctrlId', 'ctrlId', 'c', undefined); + single.root.children.add(child); + assert.deepStrictEqual(single.collectDiff(), [ + { + op: TestDiffOpType.Add, + item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(child) }, + } + ]); + }); + test('no-ops if items not changed', () => { single.collectDiff(); assert.deepStrictEqual(single.collectDiff(), []); @@ -184,7 +197,6 @@ suite('ExtHost Testing', () => { { op: TestDiffOpType.Add, item: { controllerId: 'ctrlId', - parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(child), } @@ -213,7 +225,6 @@ suite('ExtHost Testing', () => { { op: TestDiffOpType.Add, item: { controllerId: 'ctrlId', - parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(child), } @@ -326,7 +337,7 @@ suite('ExtHost Testing', () => { }, { op: TestDiffOpType.Add, - item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) } + item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) } }, ]); diff --git a/src/vs/workbench/browser/actions/developerActions.ts b/src/vs/workbench/browser/actions/developerActions.ts index 5a0d08a8623..9de0788c23f 100644 --- a/src/vs/workbench/browser/actions/developerActions.ts +++ b/src/vs/workbench/browser/actions/developerActions.ts @@ -27,7 +27,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v import { ILogService } from 'vs/platform/log/common/log'; import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup'; class InspectContextKeysAction extends Action2 { @@ -36,7 +36,7 @@ class InspectContextKeysAction extends Action2 { super({ id: 'workbench.action.inspectContextKeys', title: { value: localize('inspect context keys', "Inspect Context Keys"), original: 'Inspect Context Keys' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -96,7 +96,7 @@ class ToggleScreencastModeAction extends Action2 { super({ id: 'workbench.action.toggleScreencastMode', title: { value: localize('toggle screencast mode', "Toggle Screencast Mode"), original: 'Toggle Screencast Mode' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -267,7 +267,7 @@ class LogStorageAction extends Action2 { super({ id: 'workbench.action.logStorage', title: { value: localize({ key: 'logStorage', comment: ['A developer only action to log the contents of the storage for the current window.'] }, "Log Storage Database Contents"), original: 'Log Storage Database Contents' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -283,7 +283,7 @@ class LogWorkingCopiesAction extends Action2 { super({ id: 'workbench.action.logWorkingCopies', title: { value: localize({ key: 'logWorkingCopies', comment: ['A developer only action to log the working copies that exist.'] }, "Log Working Copies"), original: 'Log Working Copies' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/browser/actions/helpActions.ts b/src/vs/workbench/browser/actions/helpActions.ts index 227492a8fce..d05f5a9e391 100644 --- a/src/vs/workbench/browser/actions/helpActions.ts +++ b/src/vs/workbench/browser/actions/helpActions.ts @@ -14,7 +14,7 @@ import { KeyChord, KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { IProductService } from 'vs/platform/product/common/productService'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; class KeybindingsReferenceAction extends Action2 { @@ -29,7 +29,7 @@ class KeybindingsReferenceAction extends Action2 { mnemonicTitle: localize({ key: 'miKeyboardShortcuts', comment: ['&& denotes a mnemonic'] }, "&&Keyboard Shortcuts Reference"), original: 'Keyboard Shortcuts Reference' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, @@ -68,7 +68,7 @@ class OpenIntroductoryVideosUrlAction extends Action2 { mnemonicTitle: localize({ key: 'miVideoTutorials', comment: ['&& denotes a mnemonic'] }, "&&Video Tutorials"), original: 'Video Tutorials' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, @@ -101,7 +101,7 @@ class OpenTipsAndTricksUrlAction extends Action2 { mnemonicTitle: localize({ key: 'miTipsAndTricks', comment: ['&& denotes a mnemonic'] }, "Tips and Tri&&cks"), original: 'Tips and Tricks' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, @@ -134,7 +134,7 @@ class OpenDocumentationUrlAction extends Action2 { mnemonicTitle: localize({ key: 'miDocumentation', comment: ['&& denotes a mnemonic'] }, "&&Documentation"), original: 'Documentation' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, @@ -163,7 +163,7 @@ class OpenNewsletterSignupUrlAction extends Action2 { super({ id: OpenNewsletterSignupUrlAction.ID, title: { value: localize('newsletterSignup', "Signup for the VS Code Newsletter"), original: 'Signup for the VS Code Newsletter' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true }); } @@ -192,7 +192,7 @@ class OpenTwitterUrlAction extends Action2 { mnemonicTitle: localize({ key: 'miTwitter', comment: ['&& denotes a mnemonic'] }, "&&Join Us on Twitter"), original: 'Join Us on Twitter' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, @@ -225,7 +225,7 @@ class OpenRequestFeatureUrlAction extends Action2 { mnemonicTitle: localize({ key: 'miUserVoice', comment: ['&& denotes a mnemonic'] }, "&&Search Feature Requests"), original: 'Search Feature Requests' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, @@ -258,7 +258,7 @@ class OpenLicenseUrlAction extends Action2 { mnemonicTitle: localize({ key: 'miLicense', comment: ['&& denotes a mnemonic'] }, "View &&License"), original: 'View License' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, @@ -296,7 +296,7 @@ class OpenPrivacyStatementUrlAction extends Action2 { mnemonicTitle: localize({ key: 'miPrivacyStatement', comment: ['&& denotes a mnemonic'] }, "Privac&&y Statement"), original: 'Privacy Statement' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 89651caa991..61f8d64c69f 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -6,7 +6,7 @@ import { localize } from 'vs/nls'; import Severity from 'vs/base/common/severity'; import { MenuId, MenuRegistry, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkbenchLayoutService, Parts, Position, positionToString } from 'vs/workbench/services/layout/browser/layoutService'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -58,7 +58,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.closeSidebar', title: { value: localize('closeSidebar', "Close Primary Side Bar"), original: 'Close Primary Side Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -84,7 +84,7 @@ export class ToggleActivityBarVisibilityAction extends Action2 { mnemonicTitle: localize({ key: 'miActivityBar', comment: ['&& denotes a mnemonic'] }, "&&Activity Bar"), original: 'Toggle Activity Bar Visibility' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: ContextKeyExpr.equals('config.workbench.activityBar.visible', true), menu: [{ @@ -120,7 +120,7 @@ registerAction2(class extends Action2 { mnemonicTitle: localize({ key: 'miToggleCenteredLayout', comment: ['&& denotes a mnemonic'] }, "&&Centered Layout"), original: 'Toggle Centered Layout' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: IsCenteredLayoutContext, menu: [{ @@ -201,7 +201,7 @@ export class ToggleSidebarPositionAction extends Action2 { super({ id: ToggleSidebarPositionAction.ID, title: { value: localize('toggleSidebarPosition', "Toggle Primary Side Bar Position"), original: 'Toggle Primary Side Bar Position' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -329,7 +329,7 @@ registerAction2(class extends Action2 { mnemonicTitle: localize({ key: 'miShowEditorArea', comment: ['&& denotes a mnemonic'] }, "Show &&Editor Area"), original: 'Toggle Editor Area Visibility' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: EditorAreaVisibleContext, // the workbench grid currently prevents us from supporting panel maximization with non-center panel alignment @@ -359,7 +359,7 @@ class ToggleSidebarVisibilityAction extends Action2 { super({ id: ToggleSidebarVisibilityAction.ID, title: { value: localize('toggleSidebar', "Toggle Primary Side Bar Visibility"), original: 'Toggle Primary Side Bar Visibility' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, @@ -467,7 +467,7 @@ export class ToggleStatusbarVisibilityAction extends Action2 { mnemonicTitle: localize({ key: 'miStatusbar', comment: ['&& denotes a mnemonic'] }, "S&&tatus Bar"), original: 'Toggle Status Bar Visibility' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: ContextKeyExpr.equals('config.workbench.statusBar.visible', true), menu: [{ @@ -502,7 +502,7 @@ registerAction2(class extends Action2 { value: localize('toggleTabs', "Toggle Tab Visibility"), original: 'Toggle Tab Visibility' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -529,7 +529,7 @@ registerAction2(class extends Action2 { mnemonicTitle: localize('miToggleZenMode', "Zen Mode"), original: 'Toggle Zen Mode' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, @@ -576,7 +576,7 @@ if (isWindows || isLinux || isWeb) { mnemonicTitle: localize({ key: 'miMenuBar', comment: ['&& denotes a mnemonic'] }, "Menu &&Bar"), original: 'Toggle Menu Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'compact')), menu: [{ @@ -614,7 +614,7 @@ registerAction2(class extends Action2 { value: localize('resetViewLocations', "Reset View Locations"), original: 'Reset View Locations' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -635,7 +635,7 @@ registerAction2(class extends Action2 { value: localize('moveView', "Move View"), original: 'Move View' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -780,7 +780,7 @@ class MoveFocusedViewAction extends Action2 { value: localize('moveFocusedView', "Move Focused View"), original: 'Move Focused View' }, - category: CATEGORIES.View, + category: Categories.View, precondition: FocusedViewContext.notEqualsTo(''), f1: true }); @@ -939,7 +939,7 @@ registerAction2(class extends Action2 { value: localize('resetFocusedViewLocation', "Reset Focused View Location"), original: 'Reset Focused View Location' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, precondition: FocusedViewContext.notEqualsTo('') }); diff --git a/src/vs/workbench/browser/actions/navigationActions.ts b/src/vs/workbench/browser/actions/navigationActions.ts index 86fca131e3f..9c3c8e0b1c1 100644 --- a/src/vs/workbench/browser/actions/navigationActions.ts +++ b/src/vs/workbench/browser/actions/navigationActions.ts @@ -9,7 +9,8 @@ import { Action } from 'vs/base/common/actions'; import { IEditorGroupsService, GroupDirection, GroupLocation, IFindGroupScope } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { IWorkbenchActionRegistry, Extensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Direction } from 'vs/base/browser/ui/grid/grid'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -312,9 +313,9 @@ export class FocusPreviousPart extends Action { const actionsRegistry = Registry.as(Extensions.WorkbenchActions); -actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateUpAction, undefined), 'View: Navigate to the View Above', CATEGORIES.View.value); -actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateDownAction, undefined), 'View: Navigate to the View Below', CATEGORIES.View.value); -actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateLeftAction, undefined), 'View: Navigate to the View on the Left', CATEGORIES.View.value); -actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateRightAction, undefined), 'View: Navigate to the View on the Right', CATEGORIES.View.value); -actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusNextPart, { primary: KeyCode.F6 }), 'View: Focus Next Part', CATEGORIES.View.value); -actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPreviousPart, { primary: KeyMod.Shift | KeyCode.F6 }), 'View: Focus Previous Part', CATEGORIES.View.value); +actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateUpAction, undefined), 'View: Navigate to the View Above', Categories.View.value); +actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateDownAction, undefined), 'View: Navigate to the View Below', Categories.View.value); +actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateLeftAction, undefined), 'View: Navigate to the View on the Left', Categories.View.value); +actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateRightAction, undefined), 'View: Navigate to the View on the Right', Categories.View.value); +actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusNextPart, { primary: KeyCode.F6 }), 'View: Focus Next Part', Categories.View.value); +actionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPreviousPart, { primary: KeyMod.Shift | KeyCode.F6 }), 'View: Focus Previous Part', Categories.View.value); diff --git a/src/vs/workbench/browser/actions/textInputActions.ts b/src/vs/workbench/browser/actions/textInputActions.ts index 993f595d69e..60dad795312 100644 --- a/src/vs/workbench/browser/actions/textInputActions.ts +++ b/src/vs/workbench/browser/actions/textInputActions.ts @@ -99,4 +99,4 @@ export class TextInputActionsProvider extends Disposable implements IWorkbenchCo } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TextInputActionsProvider, 'TextInputActionsProvider', LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TextInputActionsProvider, LifecyclePhase.Ready); diff --git a/src/vs/workbench/browser/actions/windowActions.ts b/src/vs/workbench/browser/actions/windowActions.ts index 8858f514ec5..eaa2db307dd 100644 --- a/src/vs/workbench/browser/actions/windowActions.ts +++ b/src/vs/workbench/browser/actions/windowActions.ts @@ -10,7 +10,7 @@ import { MenuRegistry, MenuId, Action2, registerAction2, IAction2Options } from import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { IsFullscreenContext } from 'vs/workbench/common/contextkeys'; import { IsMacNativeContext, IsDevelopmentContext, IsWebContext, IsIOSContext } from 'vs/platform/contextkey/common/contextkeys'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IQuickInputButton, IQuickInputService, IQuickPickSeparator, IKeyMods, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; import { IWorkspaceContextService, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; @@ -289,7 +289,7 @@ class ToggleFullScreenAction extends Action2 { mnemonicTitle: localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "&&Full Screen"), original: 'Toggle Full Screen' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, @@ -323,7 +323,7 @@ export class ReloadWindowAction extends Action2 { super({ id: ReloadWindowAction.ID, title: { value: localize('reloadWindow', "Reload Window"), original: 'Reload Window' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib + 50, @@ -350,7 +350,7 @@ class ShowAboutDialogAction extends Action2 { mnemonicTitle: localize({ key: 'miAbout', comment: ['&& denotes a mnemonic'] }, "&&About"), original: 'About' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, diff --git a/src/vs/workbench/browser/codeeditor.ts b/src/vs/workbench/browser/codeeditor.ts index 00be0866e3e..3a77af1f995 100644 --- a/src/vs/workbench/browser/codeeditor.ts +++ b/src/vs/workbench/browser/codeeditor.ts @@ -26,6 +26,7 @@ import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IAction } from 'vs/base/common/actions'; +import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget'; export interface IRangeHighlightDecoration { resource: URI; @@ -224,28 +225,31 @@ export class FloatingClickMenu extends Disposable implements IEditorContribution ) { super(); - const menu = menuService.createMenu(MenuId.EditorContent, contextKeyService); - const menuDisposables = new DisposableStore(); - const renderMenuAsFloatingClickBtn = () => { - menuDisposables.clear(); - if (!editor.hasModel() || editor.getOption(EditorOption.inDiffEditor)) { - return; - } - const actions: IAction[] = []; - createAndFillInActionBarActions(menu, { renderShortTitle: true, shouldForwardArgs: true }, actions); - if (actions.length === 0) { - return; - } - // todo@jrieken find a way to handle N actions, like showing a context menu - const [first] = actions; - const widget = instantiationService.createInstance(FloatingClickWidget, editor, first.label, first.id); - menuDisposables.add(widget); - menuDisposables.add(widget.onClick(() => first.run(editor.getModel().uri))); - widget.render(); - }; - this._store.add(menu); - this._store.add(menuDisposables); - this._store.add(menu.onDidChange(renderMenuAsFloatingClickBtn)); - renderMenuAsFloatingClickBtn(); + // DISABLED for embedded editors. In the future we can use a different MenuId for embedded editors + if (!(editor instanceof EmbeddedCodeEditorWidget)) { + const menu = menuService.createMenu(MenuId.EditorContent, contextKeyService); + const menuDisposables = new DisposableStore(); + const renderMenuAsFloatingClickBtn = () => { + menuDisposables.clear(); + if (!editor.hasModel() || editor.getOption(EditorOption.inDiffEditor)) { + return; + } + const actions: IAction[] = []; + createAndFillInActionBarActions(menu, { renderShortTitle: true, shouldForwardArgs: true }, actions); + if (actions.length === 0) { + return; + } + // todo@jrieken find a way to handle N actions, like showing a context menu + const [first] = actions; + const widget = instantiationService.createInstance(FloatingClickWidget, editor, first.label, first.id); + menuDisposables.add(widget); + menuDisposables.add(widget.onClick(() => first.run(editor.getModel().uri))); + widget.render(); + }; + this._store.add(menu); + this._store.add(menuDisposables); + this._store.add(menu.onDidChange(renderMenuAsFloatingClickBtn)); + renderMenuAsFloatingClickBtn(); + } } } diff --git a/src/vs/workbench/browser/composite.ts b/src/vs/workbench/browser/composite.ts index a619fe25a1f..ca2f9cdf638 100644 --- a/src/vs/workbench/browser/composite.ts +++ b/src/vs/workbench/browser/composite.ts @@ -15,6 +15,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { Disposable } from 'vs/base/common/lifecycle'; import { assertIsDefined } from 'vs/base/common/types'; import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; +import { MenuId } from 'vs/platform/actions/common/actions'; /** * Composites are layed out in the sidebar and panel part of the workbench. At a time only one composite @@ -161,6 +162,15 @@ export abstract class Composite extends Component implements IComposite { super.updateStyles(); } + + /** + * + * @returns the action runner for this composite + */ + getMenuIds(): readonly MenuId[] { + return []; + } + /** * Returns an array of actions to show in the action bar of the composite. */ diff --git a/src/vs/workbench/browser/contextkeys.ts b/src/vs/workbench/browser/contextkeys.ts index 2ac8feeba1f..08c286d1e84 100644 --- a/src/vs/workbench/browser/contextkeys.ts +++ b/src/vs/workbench/browser/contextkeys.ts @@ -6,7 +6,7 @@ import { Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext } from 'vs/platform/contextkey/common/contextkeys'; +import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys'; import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext } from 'vs/workbench/common/contextkeys'; import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor'; import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom'; @@ -96,6 +96,7 @@ export class WorkbenchContextKeysHandler extends Disposable { IsWebContext.bindTo(this.contextKeyService); IsMacNativeContext.bindTo(this.contextKeyService); IsIOSContext.bindTo(this.contextKeyService); + IsMobileContext.bindTo(this.contextKeyService); RemoteNameContext.bindTo(this.contextKeyService).set(getRemoteName(this.environmentService.remoteAuthority) || ''); diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index ea93a14b908..8d367d84589 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -1061,11 +1061,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi return true; } - // with the command center enabled, we should always show - if (this.configurationService.getValue('window.commandCenter')) { - return true; - } - // remaining behavior is based on menubar visibility switch (getMenuBarVisibility(this.configurationService)) { case 'classic': diff --git a/src/vs/workbench/browser/panecomposite.ts b/src/vs/workbench/browser/panecomposite.ts index 21230d84325..246e899675a 100644 --- a/src/vs/workbench/browser/panecomposite.ts +++ b/src/vs/workbench/browser/panecomposite.ts @@ -10,7 +10,7 @@ import { URI } from 'vs/base/common/uri'; import { Dimension } from 'vs/base/browser/dom'; import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IAction, Separator } from 'vs/base/common/actions'; -import { SubmenuItemAction } from 'vs/platform/actions/common/actions'; +import { MenuId, SubmenuItemAction } from 'vs/platform/actions/common/actions'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -73,6 +73,17 @@ export abstract class PaneComposite extends Composite implements IPaneComposite return this.viewPaneContainer?.menuActions?.getContextMenuActions() ?? []; } + override getMenuIds(): MenuId[] { + const result: MenuId[] = []; + if (this.viewPaneContainer?.menuActions) { + result.push(this.viewPaneContainer.menuActions.menuId); + if (this.viewPaneContainer.isViewMergedWithContainer()) { + result.push(this.viewPaneContainer.panes[0].menuActions.menuId); + } + } + return result; + } + override getActions(): readonly IAction[] { const result = []; if (this.viewPaneContainer?.menuActions) { diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts index bee1974abd0..d4db825ca72 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts @@ -17,9 +17,9 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { activeContrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry'; import { IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { ActivityAction, ActivityActionViewItem, IActivityActionViewItemOptions, IActivityHoverOptions, ICompositeBar, ICompositeBarColors, ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/compositeBarActions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IActivity } from 'vs/workbench/common/activity'; -import { ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER, ACTIVITY_BAR_ACTIVE_BACKGROUND, ACTIVITY_BAR_SETTINGS_PROFILE_HOVER_FOREGROUND } from 'vs/workbench/common/theme'; +import { ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER, ACTIVITY_BAR_ACTIVE_BACKGROUND, ACTIVITY_BAR_SETTINGS_PROFILE_BACKGROUND, ACTIVITY_BAR_SETTINGS_PROFILE_HOVER_FOREGROUND } from 'vs/workbench/common/theme'; import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; @@ -37,8 +37,7 @@ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/b import { ViewContainerLocation } from 'vs/workbench/common/views'; import { IPaneCompositePart } from 'vs/workbench/browser/parts/paneCompositePart'; import { ICredentialsService } from 'vs/platform/credentials/common/credentials'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IUserDataProfileService, MANAGE_PROFILES_ACTION_ID, PROFILES_CATEGORY } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { IUserDataProfileService, ManageProfilesSubMenu, PROFILES_CATEGORY } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; export class ViewContainerActivityAction extends ActivityAction { @@ -186,6 +185,7 @@ class MenuActivityActionViewItem extends AbstractGlobalActivityActionViewItem { private readonly menuId: MenuId, action: ActivityAction, contextMenuActionsProvider: () => IAction[], + icon: boolean, colors: (theme: IColorTheme) => ICompositeBarColors, hoverOptions: IActivityHoverOptions, @IThemeService themeService: IThemeService, @@ -197,7 +197,7 @@ class MenuActivityActionViewItem extends AbstractGlobalActivityActionViewItem { @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IKeybindingService keybindingService: IKeybindingService, ) { - super(action, contextMenuActionsProvider, { draggable: false, colors, icon: true, hasPopup: true, hoverOptions }, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); + super(action, contextMenuActionsProvider, { draggable: false, colors, icon, hasPopup: true, hoverOptions }, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); } protected async run(): Promise { @@ -245,7 +245,7 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { @IKeybindingService keybindingService: IKeybindingService, @ICredentialsService private readonly credentialsService: ICredentialsService, ) { - super(MenuId.AccountsContext, action, contextMenuActionsProvider, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); + super(MenuId.AccountsContext, action, contextMenuActionsProvider, true, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); } protected override async resolveMainMenuActions(accountsMenu: IMenu, disposables: DisposableStore): Promise { @@ -340,7 +340,7 @@ export interface IProfileActivity extends IActivity { readonly icon: boolean; } -export class ProfilesActivityActionViewItem extends AbstractGlobalActivityActionViewItem { +export class ProfilesActivityActionViewItem extends MenuActivityActionViewItem { static readonly PROFILES_VISIBILITY_PREFERENCE_KEY = 'workbench.activity.showProfiles'; @@ -350,7 +350,6 @@ export class ProfilesActivityActionViewItem extends AbstractGlobalActivityAction colors: (theme: IColorTheme) => ICompositeBarColors, hoverOptions: IActivityHoverOptions, @IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService, - @ICommandService private readonly commandService: ICommandService, @IStorageService private readonly storageService: IStorageService, @IThemeService themeService: IThemeService, @IHoverService hoverService: IHoverService, @@ -361,11 +360,12 @@ export class ProfilesActivityActionViewItem extends AbstractGlobalActivityAction @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IKeybindingService keybindingService: IKeybindingService, ) { - super(action, contextMenuActionsProvider, { draggable: false, colors, icon: (action.activity).icon, hasPopup: true, hoverOptions }, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); + super(ManageProfilesSubMenu, action, contextMenuActionsProvider, (action.activity).icon, colors, hoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); } - protected run(): Promise { - return this.commandService.executeCommand(MANAGE_PROFILES_ACTION_ID); + override render(container: HTMLElement): void { + super.render(container); + this.container.classList.add('profile-activity-item'); } protected override async resolveContextMenuActions(disposables: DisposableStore): Promise { @@ -401,7 +401,7 @@ export class GlobalActivityActionViewItem extends MenuActivityActionViewItem { @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IKeybindingService keybindingService: IKeybindingService, ) { - super(MenuId.GlobalActivity, action, contextMenuActionsProvider, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); + super(MenuId.GlobalActivity, action, contextMenuActionsProvider, true, colors, activityHoverOptions, themeService, hoverService, menuService, contextMenuService, contextKeyService, configurationService, environmentService, keybindingService); } } @@ -454,7 +454,7 @@ registerAction2( super({ id: 'workbench.action.previousSideBarView', title: { value: localize('previousSideBarView', "Previous Primary Side Bar View"), original: 'Previous Primary Side Bar View' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }, -1); } @@ -467,7 +467,7 @@ registerAction2( super({ id: 'workbench.action.nextSideBarView', title: { value: localize('nextSideBarView', "Next Primary Side Bar View"), original: 'Next Primary Side Bar View' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }, 1); } @@ -480,7 +480,7 @@ registerAction2( super({ id: 'workbench.action.focusActivityBar', title: { value: localize('focusActivityBar', "Focus Activity Bar"), original: 'Focus Activity Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -509,13 +509,24 @@ registerThemingParticipant((theme, collector) => { `); } - const activityBarSettingsProfileHoveFgColor = theme.getColor(ACTIVITY_BAR_SETTINGS_PROFILE_HOVER_FOREGROUND); - if (activityBarSettingsProfileHoveFgColor) { + const activityBarSettingsProfileBgColor = theme.getColor(ACTIVITY_BAR_SETTINGS_PROFILE_BACKGROUND); + if (activityBarSettingsProfileBgColor) { + collector.addRule(` + .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item .action-label.profile-activity-item, + .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item .action-label.profile-activity-item, + .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item .action-label.profile-activity-item { + background-color: ${activityBarSettingsProfileBgColor} !important; + } + `); + } + + const activityBarSettingsProfileHoverFgColor = theme.getColor(ACTIVITY_BAR_SETTINGS_PROFILE_HOVER_FOREGROUND); + if (activityBarSettingsProfileHoverFgColor) { collector.addRule(` .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active .action-label.profile-activity-item, .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:focus .action-label.profile-activity-item, .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:hover .action-label.profile-activity-item { - color: ${activityBarSettingsProfileHoveFgColor} !important; + color: ${activityBarSettingsProfileHoverFgColor} !important; } `); } @@ -567,6 +578,10 @@ registerThemingParticipant((theme, collector) => { z-index: 1; } + .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.profile-activity-item:before { + top: -6px; + } + .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active:before, .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active:hover:before, .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked:before, diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 1981ce23cc9..6e51d7a9257 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -1064,7 +1064,7 @@ export class ActivitybarPart extends Part implements IPaneCompositeSelectorPart } private get profilesVisibilityPreference(): boolean { - return this.userDataProfilesService.profiles.length > 1 && !this.userDataProfileService.currentProfile.isDefault && this.storageService.getBoolean(ProfilesActivityActionViewItem.PROFILES_VISIBILITY_PREFERENCE_KEY, StorageScope.PROFILE, true); + return this.storageService.getBoolean(ProfilesActivityActionViewItem.PROFILES_VISIBILITY_PREFERENCE_KEY, StorageScope.PROFILE, this.userDataProfilesService.profiles.length > 1); } private set profilesVisibilityPreference(value: boolean) { diff --git a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css index 292c36545bc..a7b7e543420 100644 --- a/src/vs/workbench/browser/parts/activitybar/media/activityaction.css +++ b/src/vs/workbench/browser/parts/activitybar/media/activityaction.css @@ -178,14 +178,14 @@ .monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-label.profile-activity-item { height: 20px; - width: 28px; - margin: 9px; + width: 32px; + margin: 14px 8px; padding: 0px; justify-content: center; align-items: center; - font-size: 12px; - line-height: 16px; - border: 1.5px solid; + font-size: 11px; + font-weight: 600; + border-radius: 10px; } /* Right aligned */ diff --git a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts index 4603210c471..0a8890728c3 100644 --- a/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts +++ b/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.ts @@ -10,7 +10,8 @@ import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Registry } from 'vs/platform/registry/common/platform'; import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { CATEGORIES, Extensions as WorkbenchExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; +import { Extensions as WorkbenchExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { AuxiliaryBarVisibleContext } from 'vs/workbench/common/contextkeys'; import { ViewContainerLocation, ViewContainerLocationToString } from 'vs/workbench/common/views'; import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; @@ -134,5 +135,5 @@ MenuRegistry.appendMenuItems([ ]); const actionRegistry = Registry.as(WorkbenchExtensions.WorkbenchActions); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleAuxiliaryBarAction), 'View: Toggle Secondary Side Bar Visibility', CATEGORIES.View.value); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAuxiliaryBarAction), 'View: Focus into Secondary Side Bar', CATEGORIES.View.value); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleAuxiliaryBarAction), 'View: Toggle Secondary Side Bar Visibility', Categories.View.value); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAuxiliaryBarAction), 'View: Focus into Secondary Side Bar', Categories.View.value); diff --git a/src/vs/workbench/browser/parts/banner/bannerPart.ts b/src/vs/workbench/browser/parts/banner/bannerPart.ts index 667296666ae..0bb128fd96e 100644 --- a/src/vs/workbench/browser/parts/banner/bannerPart.ts +++ b/src/vs/workbench/browser/parts/banner/bannerPart.ts @@ -22,7 +22,7 @@ import { IBannerItem, IBannerService } from 'vs/workbench/services/banner/browse import { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/markdownRenderer'; import { BANNER_BACKGROUND, BANNER_FOREGROUND, BANNER_ICON_FOREGROUND } from 'vs/workbench/common/theme'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { KeyCode } from 'vs/base/common/keyCodes'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -318,7 +318,7 @@ class FocusBannerAction extends Action2 { super({ id: FocusBannerAction.ID, title: { value: FocusBannerAction.LABEL, original: 'Focus Banner' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index af7db9400e1..18a4d42ea90 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -329,6 +329,7 @@ export abstract class CompositePart extends Part { private collectCompositeActions(composite?: Composite): () => void { // From Composite + const menuIds = composite?.getMenuIds(); const primaryActions: IAction[] = composite?.getActions().slice(0) || []; const secondaryActions: IAction[] = composite?.getSecondaryActions().slice(0) || []; @@ -337,7 +338,7 @@ export abstract class CompositePart extends Part { toolBar.context = this.actionsContextProvider(); // Return fn to set into toolbar - return () => toolBar.setActions(prepareActions(primaryActions), prepareActions(secondaryActions)); + return () => toolBar.setActions(prepareActions(primaryActions), prepareActions(secondaryActions), menuIds); } protected getActiveComposite(): IComposite | undefined { diff --git a/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts b/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts index 2781c45869f..4fa42a97578 100644 --- a/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts +++ b/src/vs/workbench/browser/parts/dialogs/dialog.web.contribution.ts @@ -75,4 +75,4 @@ export class DialogHandlerContribution extends Disposable implements IWorkbenchC } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(DialogHandlerContribution, 'DialogHandlerContribution', LifecyclePhase.Starting); +workbenchRegistry.registerWorkbenchContribution(DialogHandlerContribution, LifecyclePhase.Starting); diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbs.ts b/src/vs/workbench/browser/parts/editor/breadcrumbs.ts index f2a44d8b1db..af5bdc2b61f 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbs.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbs.ts @@ -10,7 +10,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { localize } from 'vs/nls'; import { IConfigurationOverrides, IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Extensions, IConfigurationRegistry, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Registry } from 'vs/platform/registry/common/platform'; import { GroupIdentifier, IEditorPartOptions } from 'vs/workbench/common/editor'; @@ -48,7 +48,7 @@ export class BreadcrumbsService implements IBreadcrumbsService { } } -registerSingleton(IBreadcrumbsService, BreadcrumbsService, true); +registerSingleton(IBreadcrumbsService, BreadcrumbsService, InstantiationType.Delayed); //#region config diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts index 120b7c0343a..657bea0cea4 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts @@ -36,7 +36,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'; import { PixelRatio } from 'vs/base/browser/browser'; import { ILabelService } from 'vs/platform/label/common/label'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ITreeNode } from 'vs/base/browser/ui/tree/tree'; import { IOutline } from 'vs/workbench/services/outline/browser/outline'; import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; @@ -504,15 +504,20 @@ registerAction2(class ToggleBreadcrumb extends Action2 { id: 'breadcrumbs.toggle', title: { value: localize('cmd.toggle', "Toggle Breadcrumbs"), - mnemonicTitle: localize('miBreadcrumbs', "&&Breadcrumbs"), + mnemonicTitle: localize('miBreadcrumbs', "Toggle &&Breadcrumbs"), original: 'Toggle Breadcrumbs', }, - category: CATEGORIES.View, - toggled: ContextKeyExpr.equals('config.breadcrumbs.enabled', true), + category: Categories.View, + toggled: { + condition: ContextKeyExpr.equals('config.breadcrumbs.enabled', true), + title: localize('cmd.toggle2', "Breadcrumbs"), + mnemonicTitle: localize('miBreadcrumbs2', "&&Breadcrumbs") + }, menu: [ { id: MenuId.CommandPalette }, { id: MenuId.MenubarViewMenu, group: '5_editor', order: 3 }, - { id: MenuId.NotebookToolbar, group: 'notebookLayout', order: 2 } + { id: MenuId.NotebookToolbar, group: 'notebookLayout', order: 2 }, + { id: MenuId.StickyScrollContext } ] }); } diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts index e6535720005..28894f417fe 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts @@ -381,6 +381,7 @@ export class BreadcrumbsFilePicker extends BreadcrumbsPicker { identityProvider: new FileIdentityProvider(), keyboardNavigationLabelProvider: new FileNavigationLabelProvider(), accessibilityProvider: this._instantiationService.createInstance(FileAccessibilityProvider), + showNotFoundMessage: false, overrideStyles: { listBackground: breadcrumbsPickerBackground }, @@ -474,6 +475,7 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker { collapseByDefault: true, expandOnlyOnTwistieClick: true, multipleSelectionSupport: false, + showNotFoundMessage: false } ); } diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 8651d5bfbe2..82ca36f22a6 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -22,7 +22,8 @@ import { TextResourceEditorInput } from 'vs/workbench/common/editor/textResource import { TextDiffEditor } from 'vs/workbench/browser/parts/editor/textDiffEditor'; import { BinaryResourceDiffEditor } from 'vs/workbench/browser/parts/editor/binaryDiffEditor'; import { ChangeEncodingAction, ChangeEOLAction, ChangeLanguageAction, EditorStatus } from 'vs/workbench/browser/parts/editor/editorStatus'; -import { IWorkbenchActionRegistry, Extensions as ActionExtensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { SyncActionDescriptor, MenuRegistry, MenuId, IMenuItem, registerAction2 } from 'vs/platform/actions/common/actions'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; @@ -122,10 +123,10 @@ Registry.as(EditorExtensions.EditorFactory).registerEdit //#region Workbench Contributions -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(EditorAutoSave, 'EditorAutoSave', LifecyclePhase.Ready); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(EditorStatus, 'EditorStatus', LifecyclePhase.Ready); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(UntitledTextEditorWorkingCopyEditorHandler, 'UntitledTextEditorWorkingCopyEditorHandler', LifecyclePhase.Ready); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DynamicEditorConfigurations, 'DynamicEditorConfigurations', LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(EditorAutoSave, LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(EditorStatus, LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(UntitledTextEditorWorkingCopyEditorHandler, LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DynamicEditorConfigurations, LifecyclePhase.Ready); registerEditorContribution(FloatingClickMenu.ID, FloatingClickMenu); @@ -172,78 +173,78 @@ registry.registerWorkbenchAction(SyncActionDescriptor.from(ChangeEOLAction), 'Ch registry.registerWorkbenchAction(SyncActionDescriptor.from(ChangeEncodingAction), 'Change File Encoding'); // Editor Management -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextEditor, { primary: KeyMod.CtrlCmd | KeyCode.PageDown, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.BracketRight] } }), 'View: Open Next Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousEditor, { primary: KeyMod.CtrlCmd | KeyCode.PageUp, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.BracketLeft] } }), 'View: Open Previous Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextEditorInGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.PageDown), mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow) } }), 'View: Open Next Editor in Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousEditorInGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.PageUp), mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow) } }), 'View: Open Previous Editor in Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextRecentlyUsedEditorAction), 'View: Open Next Recently Used Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousRecentlyUsedEditorAction), 'View: Open Previous Recently Used Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextRecentlyUsedEditorInGroupAction), 'View: Open Next Recently Used Editor In Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousRecentlyUsedEditorInGroupAction), 'View: Open Previous Recently Used Editor In Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenFirstEditorInGroup), 'View: Open First Editor in Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenLastEditorInGroup, { primary: KeyMod.Alt | KeyCode.Digit0, secondary: [KeyMod.CtrlCmd | KeyCode.Digit9], mac: { primary: KeyMod.WinCtrl | KeyCode.Digit0, secondary: [KeyMod.CtrlCmd | KeyCode.Digit9] } }), 'View: Open Last Editor in Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ReopenClosedEditorAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyT }), 'View: Reopen Closed Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ShowAllEditorsByAppearanceAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyP), mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Tab } }), 'View: Show All Editors By Appearance', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ShowAllEditorsByMostRecentlyUsedAction), 'View: Show All Editors By Most Recently Used', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ShowEditorsInActiveGroupByMostRecentlyUsedAction), 'View: Show Editors in Active Group By Most Recently Used', CATEGORIES.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextEditor, { primary: KeyMod.CtrlCmd | KeyCode.PageDown, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.BracketRight] } }), 'View: Open Next Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousEditor, { primary: KeyMod.CtrlCmd | KeyCode.PageUp, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.BracketLeft] } }), 'View: Open Previous Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextEditorInGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.PageDown), mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow) } }), 'View: Open Next Editor in Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousEditorInGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.PageUp), mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow) } }), 'View: Open Previous Editor in Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextRecentlyUsedEditorAction), 'View: Open Next Recently Used Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousRecentlyUsedEditorAction), 'View: Open Previous Recently Used Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenNextRecentlyUsedEditorInGroupAction), 'View: Open Next Recently Used Editor In Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenPreviousRecentlyUsedEditorInGroupAction), 'View: Open Previous Recently Used Editor In Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenFirstEditorInGroup), 'View: Open First Editor in Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenLastEditorInGroup, { primary: KeyMod.Alt | KeyCode.Digit0, secondary: [KeyMod.CtrlCmd | KeyCode.Digit9], mac: { primary: KeyMod.WinCtrl | KeyCode.Digit0, secondary: [KeyMod.CtrlCmd | KeyCode.Digit9] } }), 'View: Open Last Editor in Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ReopenClosedEditorAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyT }), 'View: Reopen Closed Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ShowAllEditorsByAppearanceAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyP), mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Tab } }), 'View: Show All Editors By Appearance', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ShowAllEditorsByMostRecentlyUsedAction), 'View: Show All Editors By Most Recently Used', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ShowEditorsInActiveGroupByMostRecentlyUsedAction), 'View: Show Editors in Active Group By Most Recently Used', Categories.View.value); registry.registerWorkbenchAction(SyncActionDescriptor.from(ClearRecentFilesAction), 'File: Clear Recently Opened', localize('file', "File")); -registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseAllEditorsAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyW) }), 'View: Close All Editors', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseAllEditorGroupsAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyW) }), 'View: Close All Editor Groups', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseLeftEditorsInGroupAction), 'View: Close Editors to the Left in Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseEditorsInOtherGroupsAction), 'View: Close Editors in Other Groups', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseEditorInAllGroupsAction), 'View: Close Editor in All Groups', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorAction, { primary: KeyMod.CtrlCmd | KeyCode.Backslash }), 'View: Split Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorOrthogonalAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Backslash) }), 'View: Split Editor Orthogonal', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorLeftAction), 'View: Split Editor Left', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorRightAction), 'View: Split Editor Right', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorUpAction), 'View: Split Editor Up', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorDownAction), 'View: Split Editor Down', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(JoinTwoGroupsAction), 'View: Join Editor Group with Next Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(JoinAllGroupsAction), 'View: Join All Editor Groups', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateBetweenGroupsAction), 'View: Navigate Between Editor Groups', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ResetGroupSizesAction), 'View: Reset Editor Group Sizes', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleGroupSizesAction), 'View: Toggle Editor Group Sizes', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MaximizeGroupAction), 'View: Maximize Editor Group and Hide Side Bars', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MinimizeOtherGroupsAction), 'View: Maximize Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorLeftInGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.PageUp, mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow) } }), 'View: Move Editor Left', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorRightInGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.PageDown, mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow) } }), 'View: Move Editor Right', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupLeftAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.LeftArrow) }), 'View: Move Editor Group Left', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupRightAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.RightArrow) }), 'View: Move Editor Group Right', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupUpAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.UpArrow) }), 'View: Move Editor Group Up', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupDownAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.DownArrow) }), 'View: Move Editor Group Down', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupLeftAction), 'View: Duplicate Editor Group Left', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupRightAction), 'View: Duplicate Editor Group Right', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupUpAction), 'View: Duplicate Editor Group Up', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupDownAction), 'View: Duplicate Editor Group Down', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToPreviousGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.LeftArrow } }), 'View: Move Editor into Previous Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToNextGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.RightArrow } }), 'View: Move Editor into Next Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToFirstGroupAction, { primary: KeyMod.Shift | KeyMod.Alt | KeyCode.Digit1, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.Digit1 } }), 'View: Move Editor into First Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToLastGroupAction, { primary: KeyMod.Shift | KeyMod.Alt | KeyCode.Digit9, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.Digit9 } }), 'View: Move Editor into Last Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToLeftGroupAction), 'View: Move Editor into Left Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToRightGroupAction), 'View: Move Editor into Right Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToAboveGroupAction), 'View: Move Editor into Group Above', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToBelowGroupAction), 'View: Move Editor into Group Below', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToPreviousGroupAction), 'View: Split Editor into Previous Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToNextGroupAction), 'View: Split Editor into Next Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToFirstGroupAction), 'View: Split Editor into First Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToLastGroupAction), 'View: Split Editor into Last Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToLeftGroupAction), 'View: Split Editor into Left Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToRightGroupAction), 'View: Split Editor into Right Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToAboveGroupAction), 'View: Split Editor into Group Above', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToBelowGroupAction), 'View: Split Editor into Group Below', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusActiveGroupAction), 'View: Focus Active Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusFirstGroupAction, { primary: KeyMod.CtrlCmd | KeyCode.Digit1 }), 'View: Focus First Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusLastGroupAction), 'View: Focus Last Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPreviousGroup), 'View: Focus Previous Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusNextGroup), 'View: Focus Next Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusLeftGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.LeftArrow) }), 'View: Focus Left Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusRightGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.RightArrow) }), 'View: Focus Right Editor Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAboveGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.UpArrow) }), 'View: Focus Editor Group Above', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusBelowGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.DownArrow) }), 'View: Focus Editor Group Below', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupLeftAction), 'View: New Editor Group to the Left', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupRightAction), 'View: New Editor Group to the Right', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupAboveAction), 'View: New Editor Group Above', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupBelowAction), 'View: New Editor Group Below', CATEGORIES.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseAllEditorsAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyW) }), 'View: Close All Editors', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseAllEditorGroupsAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyW) }), 'View: Close All Editor Groups', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseLeftEditorsInGroupAction), 'View: Close Editors to the Left in Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseEditorsInOtherGroupsAction), 'View: Close Editors in Other Groups', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseEditorInAllGroupsAction), 'View: Close Editor in All Groups', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorAction, { primary: KeyMod.CtrlCmd | KeyCode.Backslash }), 'View: Split Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorOrthogonalAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.Backslash) }), 'View: Split Editor Orthogonal', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorLeftAction), 'View: Split Editor Left', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorRightAction), 'View: Split Editor Right', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorUpAction), 'View: Split Editor Up', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorDownAction), 'View: Split Editor Down', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(JoinTwoGroupsAction), 'View: Join Editor Group with Next Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(JoinAllGroupsAction), 'View: Join All Editor Groups', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateBetweenGroupsAction), 'View: Navigate Between Editor Groups', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ResetGroupSizesAction), 'View: Reset Editor Group Sizes', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleGroupSizesAction), 'View: Toggle Editor Group Sizes', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MaximizeGroupAction), 'View: Maximize Editor Group and Hide Side Bars', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MinimizeOtherGroupsAction), 'View: Maximize Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorLeftInGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.PageUp, mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow) } }), 'View: Move Editor Left', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorRightInGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.PageDown, mac: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow) } }), 'View: Move Editor Right', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupLeftAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.LeftArrow) }), 'View: Move Editor Group Left', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupRightAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.RightArrow) }), 'View: Move Editor Group Right', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupUpAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.UpArrow) }), 'View: Move Editor Group Up', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveGroupDownAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.DownArrow) }), 'View: Move Editor Group Down', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupLeftAction), 'View: Duplicate Editor Group Left', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupRightAction), 'View: Duplicate Editor Group Right', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupUpAction), 'View: Duplicate Editor Group Up', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateGroupDownAction), 'View: Duplicate Editor Group Down', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToPreviousGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.LeftArrow } }), 'View: Move Editor into Previous Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToNextGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.RightArrow } }), 'View: Move Editor into Next Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToFirstGroupAction, { primary: KeyMod.Shift | KeyMod.Alt | KeyCode.Digit1, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.Digit1 } }), 'View: Move Editor into First Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToLastGroupAction, { primary: KeyMod.Shift | KeyMod.Alt | KeyCode.Digit9, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.Digit9 } }), 'View: Move Editor into Last Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToLeftGroupAction), 'View: Move Editor into Left Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToRightGroupAction), 'View: Move Editor into Right Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToAboveGroupAction), 'View: Move Editor into Group Above', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveEditorToBelowGroupAction), 'View: Move Editor into Group Below', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToPreviousGroupAction), 'View: Split Editor into Previous Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToNextGroupAction), 'View: Split Editor into Next Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToFirstGroupAction), 'View: Split Editor into First Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToLastGroupAction), 'View: Split Editor into Last Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToLeftGroupAction), 'View: Split Editor into Left Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToRightGroupAction), 'View: Split Editor into Right Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToAboveGroupAction), 'View: Split Editor into Group Above', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(SplitEditorToBelowGroupAction), 'View: Split Editor into Group Below', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusActiveGroupAction), 'View: Focus Active Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusFirstGroupAction, { primary: KeyMod.CtrlCmd | KeyCode.Digit1 }), 'View: Focus First Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusLastGroupAction), 'View: Focus Last Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPreviousGroup), 'View: Focus Previous Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusNextGroup), 'View: Focus Next Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusLeftGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.LeftArrow) }), 'View: Focus Left Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusRightGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.RightArrow) }), 'View: Focus Right Editor Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAboveGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.UpArrow) }), 'View: Focus Editor Group Above', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusBelowGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.DownArrow) }), 'View: Focus Editor Group Below', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupLeftAction), 'View: New Editor Group to the Left', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupRightAction), 'View: New Editor Group to the Right', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupAboveAction), 'View: New Editor Group Above', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(NewEditorGroupBelowAction), 'View: New Editor Group Below', Categories.View.value); registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigatePreviousAction), 'Go Previous'); registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateForwardInEditsAction), 'Go Forward in Edit Locations'); registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateBackwardsInEditsAction), 'Go Back in Edit Locations'); @@ -254,21 +255,21 @@ registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateBackwardsInNa registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigatePreviousInNavigationsAction), 'Go Previous in Navigation Locations'); registry.registerWorkbenchAction(SyncActionDescriptor.from(NavigateToLastNavigationLocationAction), 'Go to Last Navigation Location'); registry.registerWorkbenchAction(SyncActionDescriptor.from(ClearEditorHistoryAction), 'Clear Editor History'); -registry.registerWorkbenchAction(SyncActionDescriptor.from(RevertAndCloseEditorAction), 'View: Revert and Close Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutSingleAction), 'View: Single Column Editor Layout', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoColumnsAction), 'View: Two Columns Editor Layout', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutThreeColumnsAction), 'View: Three Columns Editor Layout', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoRowsAction), 'View: Two Rows Editor Layout', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutThreeRowsAction), 'View: Three Rows Editor Layout', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoByTwoGridAction), 'View: Grid Editor Layout (2x2)', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoRowsRightAction), 'View: Two Rows Right Editor Layout', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoColumnsBottomAction), 'View: Two Columns Bottom Editor Layout', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleEditorTypeAction), 'View: Toggle Editor Type', CATEGORIES.View.value, ActiveEditorAvailableEditorIdsContext); -registry.registerWorkbenchAction(SyncActionDescriptor.from(ReOpenInTextEditorAction), 'View: Reopen Editor With Text Editor', CATEGORIES.View.value, ActiveEditorAvailableEditorIdsContext); -registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessPreviousRecentlyUsedEditorAction), 'View: Quick Open Previous Recently Used Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessLeastRecentlyUsedEditorAction), 'View: Quick Open Least Recently Used Editor', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessPreviousRecentlyUsedEditorInGroupAction, { primary: KeyMod.CtrlCmd | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyCode.Tab } }, ActiveEditorGroupEmptyContext.toNegated()), 'View: Quick Open Previous Recently Used Editor in Group', CATEGORIES.View.value); -registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessLeastRecentlyUsedEditorInGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.Tab } }, ActiveEditorGroupEmptyContext.toNegated()), 'View: Quick Open Least Recently Used Editor in Group', CATEGORIES.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(RevertAndCloseEditorAction), 'View: Revert and Close Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutSingleAction), 'View: Single Column Editor Layout', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoColumnsAction), 'View: Two Columns Editor Layout', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutThreeColumnsAction), 'View: Three Columns Editor Layout', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoRowsAction), 'View: Two Rows Editor Layout', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutThreeRowsAction), 'View: Three Rows Editor Layout', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoByTwoGridAction), 'View: Grid Editor Layout (2x2)', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoRowsRightAction), 'View: Two Rows Right Editor Layout', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(EditorLayoutTwoColumnsBottomAction), 'View: Two Columns Bottom Editor Layout', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleEditorTypeAction), 'View: Toggle Editor Type', Categories.View.value, ActiveEditorAvailableEditorIdsContext); +registry.registerWorkbenchAction(SyncActionDescriptor.from(ReOpenInTextEditorAction), 'View: Reopen Editor With Text Editor', Categories.View.value, ActiveEditorAvailableEditorIdsContext); +registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessPreviousRecentlyUsedEditorAction), 'View: Quick Open Previous Recently Used Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessLeastRecentlyUsedEditorAction), 'View: Quick Open Least Recently Used Editor', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessPreviousRecentlyUsedEditorInGroupAction, { primary: KeyMod.CtrlCmd | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyCode.Tab } }, ActiveEditorGroupEmptyContext.toNegated()), 'View: Quick Open Previous Recently Used Editor in Group', Categories.View.value); +registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessLeastRecentlyUsedEditorInGroupAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.Tab } }, ActiveEditorGroupEmptyContext.toNegated()), 'View: Quick Open Least Recently Used Editor in Group', Categories.View.value); registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickAccessPreviousEditorFromHistoryAction), 'Quick Open Previous Editor from History'); registerAction2(NavigateForwardAction); @@ -547,17 +548,17 @@ appendEditorToolItem( ); // Editor Commands for Command Palette -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: KEEP_EDITOR_COMMAND_ID, title: { value: localize('keepEditor', "Keep Editor"), original: 'Keep Editor' }, category: CATEGORIES.View }, when: ContextKeyExpr.has('config.workbench.editor.enablePreview') }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: PIN_EDITOR_COMMAND_ID, title: { value: localize('pinEditor', "Pin Editor"), original: 'Pin Editor' }, category: CATEGORIES.View } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: UNPIN_EDITOR_COMMAND_ID, title: { value: localize('unpinEditor', "Unpin Editor"), original: 'Unpin Editor' }, category: CATEGORIES.View } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITOR_COMMAND_ID, title: { value: localize('closeEditor', "Close Editor"), original: 'Close Editor' }, category: CATEGORIES.View } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_PINNED_EDITOR_COMMAND_ID, title: { value: localize('closePinnedEditor', "Close Pinned Editor"), original: 'Close Pinned Editor' }, category: CATEGORIES.View } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITORS_IN_GROUP_COMMAND_ID, title: { value: localize('closeEditorsInGroup', "Close All Editors in Group"), original: 'Close All Editors in Group' }, category: CATEGORIES.View } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_SAVED_EDITORS_COMMAND_ID, title: { value: localize('closeSavedEditors', "Close Saved Editors in Group"), original: 'Close Saved Editors in Group' }, category: CATEGORIES.View } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: { value: localize('closeOtherEditors', "Close Other Editors in Group"), original: 'Close Other Editors in Group' }, category: CATEGORIES.View } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: { value: localize('closeRightEditors', "Close Editors to the Right in Group"), original: 'Close Editors to the Right in Group' }, category: CATEGORIES.View }, when: ActiveEditorLastInGroupContext.toNegated() }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITORS_AND_GROUP_COMMAND_ID, title: { value: localize('closeEditorGroup', "Close Editor Group"), original: 'Close Editor Group' }, category: CATEGORIES.View }, when: MultipleEditorGroupsContext }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: REOPEN_WITH_COMMAND_ID, title: { value: localize('reopenWith', "Reopen Editor With..."), original: 'Reopen Editor With...' }, category: CATEGORIES.View }, when: ActiveEditorAvailableEditorIdsContext }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: KEEP_EDITOR_COMMAND_ID, title: { value: localize('keepEditor', "Keep Editor"), original: 'Keep Editor' }, category: Categories.View }, when: ContextKeyExpr.has('config.workbench.editor.enablePreview') }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: PIN_EDITOR_COMMAND_ID, title: { value: localize('pinEditor', "Pin Editor"), original: 'Pin Editor' }, category: Categories.View } }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: UNPIN_EDITOR_COMMAND_ID, title: { value: localize('unpinEditor', "Unpin Editor"), original: 'Unpin Editor' }, category: Categories.View } }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITOR_COMMAND_ID, title: { value: localize('closeEditor', "Close Editor"), original: 'Close Editor' }, category: Categories.View } }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_PINNED_EDITOR_COMMAND_ID, title: { value: localize('closePinnedEditor', "Close Pinned Editor"), original: 'Close Pinned Editor' }, category: Categories.View } }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITORS_IN_GROUP_COMMAND_ID, title: { value: localize('closeEditorsInGroup', "Close All Editors in Group"), original: 'Close All Editors in Group' }, category: Categories.View } }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_SAVED_EDITORS_COMMAND_ID, title: { value: localize('closeSavedEditors', "Close Saved Editors in Group"), original: 'Close Saved Editors in Group' }, category: Categories.View } }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: { value: localize('closeOtherEditors', "Close Other Editors in Group"), original: 'Close Other Editors in Group' }, category: Categories.View } }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: { value: localize('closeRightEditors', "Close Editors to the Right in Group"), original: 'Close Editors to the Right in Group' }, category: Categories.View }, when: ActiveEditorLastInGroupContext.toNegated() }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: CLOSE_EDITORS_AND_GROUP_COMMAND_ID, title: { value: localize('closeEditorGroup', "Close Editor Group"), original: 'Close Editor Group' }, category: Categories.View }, when: MultipleEditorGroupsContext }); +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: REOPEN_WITH_COMMAND_ID, title: { value: localize('reopenWith', "Reopen Editor With..."), original: 'Reopen Editor With...' }, category: Categories.View }, when: ActiveEditorAvailableEditorIdsContext }); // File menu MenuRegistry.appendMenuItem(MenuId.MenubarRecentMenu, { diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index 69f5e571700..31d6bb4bf3f 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -25,7 +25,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { CommandsRegistry, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands'; import { MenuRegistry, MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ActiveGroupEditorsByMostRecentlyUsedQuickAccess } from 'vs/workbench/browser/parts/editor/editorQuickAccess'; import { IOpenerService, matchesScheme } from 'vs/platform/opener/common/opener'; import { EditorResolution, IEditorOptions, IResourceEditorInput, ITextEditorOptions } from 'vs/platform/editor/common/editor'; @@ -1058,7 +1058,7 @@ function registerSplitEditorInGroupCommands(): void { super({ id: SPLIT_EDITOR_IN_GROUP, title: { value: localize('splitEditorInGroup', "Split Editor in Group"), original: 'Split Editor in Group' }, - category: CATEGORIES.View, + category: Categories.View, precondition: ActiveEditorCanSplitInGroupContext, f1: true, keybinding: { @@ -1104,7 +1104,7 @@ function registerSplitEditorInGroupCommands(): void { super({ id: JOIN_EDITOR_IN_GROUP, title: { value: localize('joinEditorInGroup', "Join Editor in Group"), original: 'Join Editor in Group' }, - category: CATEGORIES.View, + category: Categories.View, precondition: SideBySideEditorActiveContext, f1: true, keybinding: { @@ -1124,7 +1124,7 @@ function registerSplitEditorInGroupCommands(): void { super({ id: TOGGLE_SPLIT_EDITOR_IN_GROUP, title: { value: localize('toggleJoinEditorInGroup', "Toggle Split Editor in Group"), original: 'Toggle Split Editor in Group' }, - category: CATEGORIES.View, + category: Categories.View, precondition: ContextKeyExpr.or(ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext), f1: true }); @@ -1146,7 +1146,7 @@ function registerSplitEditorInGroupCommands(): void { super({ id: TOGGLE_SPLIT_EDITOR_IN_GROUP_LAYOUT, title: { value: localize('toggleSplitEditorInGroupLayout', "Toggle Layout of Split Editor in Group"), original: 'Toggle Layout of Split Editor in Group' }, - category: CATEGORIES.View, + category: Categories.View, precondition: SideBySideEditorActiveContext, f1: true }); @@ -1174,7 +1174,7 @@ function registerFocusSideEditorsCommands(): void { super({ id: FOCUS_FIRST_SIDE_EDITOR, title: { value: localize('focusLeftSideEditor', "Focus First Side in Active Editor"), original: 'Focus First Side in Active Editor' }, - category: CATEGORIES.View, + category: Categories.View, precondition: ContextKeyExpr.or(SideBySideEditorActiveContext, TextCompareEditorActiveContext), f1: true }); @@ -1197,7 +1197,7 @@ function registerFocusSideEditorsCommands(): void { super({ id: FOCUS_SECOND_SIDE_EDITOR, title: { value: localize('focusRightSideEditor', "Focus Second Side in Active Editor"), original: 'Focus Second Side in Active Editor' }, - category: CATEGORIES.View, + category: Categories.View, precondition: ContextKeyExpr.or(SideBySideEditorActiveContext, TextCompareEditorActiveContext), f1: true }); @@ -1220,7 +1220,7 @@ function registerFocusSideEditorsCommands(): void { super({ id: FOCUS_OTHER_SIDE_EDITOR, title: { value: localize('focusOtherSideEditor', "Focus Other Side in Active Editor"), original: 'Focus Other Side in Active Editor' }, - category: CATEGORIES.View, + category: Categories.View, precondition: ContextKeyExpr.or(SideBySideEditorActiveContext, TextCompareEditorActiveContext), f1: true }); @@ -1283,7 +1283,7 @@ function registerOtherEditorCommands(): void { super({ id: TOGGLE_LOCK_GROUP_COMMAND_ID, title: { value: localize('toggleEditorGroupLock', "Toggle Editor Group Lock"), original: 'Toggle Editor Group Lock' }, - category: CATEGORIES.View, + category: Categories.View, precondition: MultipleEditorGroupsContext, f1: true }); @@ -1298,7 +1298,7 @@ function registerOtherEditorCommands(): void { super({ id: LOCK_GROUP_COMMAND_ID, title: { value: localize('lockEditorGroup', "Lock Editor Group"), original: 'Lock Editor Group' }, - category: CATEGORIES.View, + category: Categories.View, precondition: ContextKeyExpr.and(MultipleEditorGroupsContext, ActiveEditorGroupLockedContext.toNegated()), f1: true }); @@ -1314,7 +1314,7 @@ function registerOtherEditorCommands(): void { id: UNLOCK_GROUP_COMMAND_ID, title: { value: localize('unlockEditorGroup', "Unlock Editor Group"), original: 'Unlock Editor Group' }, precondition: ContextKeyExpr.and(MultipleEditorGroupsContext, ActiveEditorGroupLockedContext), - category: CATEGORIES.View, + category: Categories.View, f1: true }); } diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index 3049500d7f8..2495583b51f 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -36,9 +36,9 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IAction } from 'vs/base/common/actions'; import { NoTabsTitleControl } from 'vs/workbench/browser/parts/editor/noTabsTitleControl'; -import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions'; +import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { createAndFillInActionBarActions, createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { hash } from 'vs/base/common/hash'; @@ -364,13 +364,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView { } private createContainerContextMenu(): void { - const menu = this._register(this.menuService.createMenu(MenuId.EmptyEditorGroupContext, this.contextKeyService)); - - this._register(addDisposableListener(this.element, EventType.CONTEXT_MENU, e => this.onShowContainerContextMenu(menu, e))); - this._register(addDisposableListener(this.element, TouchEventType.Contextmenu, () => this.onShowContainerContextMenu(menu))); + this._register(addDisposableListener(this.element, EventType.CONTEXT_MENU, e => this.onShowContainerContextMenu(e))); + this._register(addDisposableListener(this.element, TouchEventType.Contextmenu, () => this.onShowContainerContextMenu())); } - private onShowContainerContextMenu(menu: IMenu, e?: MouseEvent): void { + private onShowContainerContextMenu(e?: MouseEvent): void { if (!this.isEmpty) { return; // only for empty editor groups } @@ -382,14 +380,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView { anchor = { x: event.posx, y: event.posy }; } - // Fill in contributed actions - const actions: IAction[] = []; - createAndFillInContextMenuActions(menu, undefined, actions); - // Show it this.contextMenuService.showContextMenu({ + menuId: MenuId.EmptyEditorGroupContext, + contextKeyService: this.contextKeyService, getAnchor: () => anchor, - getActions: () => actions, onHide: () => { this.focus(); } diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index 57fae3e0bc1..2ff9d39896b 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -12,8 +12,8 @@ import { ActionsOrientation, IActionViewItem, prepareActions } from 'vs/base/bro import { IAction, SubmenuAction, ActionRunner } from 'vs/base/common/actions'; import { ResolvedKeybinding } from 'vs/base/common/keybindings'; import { dispose, DisposableStore } from 'vs/base/common/lifecycle'; -import { createActionViewItem, createAndFillInActionBarActions, createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenu, IMenuService, MenuId } from 'vs/platform/actions/common/actions'; +import { createActionViewItem, createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -108,7 +108,6 @@ export abstract class TitleControl extends Themable { private readonly editorToolBarMenuDisposables = this._register(new DisposableStore()); - private contextMenu: IMenu; private renderDropdownAsChildElement: boolean; constructor( @@ -140,7 +139,6 @@ export abstract class TitleControl extends Themable { this.groupLockedContext = ActiveEditorGroupLockedContext.bindTo(contextKeyService); - this.contextMenu = this._register(this.menuService.createMenu(MenuId.EditorTitleContext, this.contextKeyService)); this.renderDropdownAsChildElement = false; this.create(parent); @@ -374,14 +372,12 @@ export abstract class TitleControl extends Themable { anchor = { x: event.posx, y: event.posy }; } - // Fill in contributed actions - const actions: IAction[] = []; - createAndFillInContextMenuActions(this.contextMenu, { shouldForwardArgs: true, arg: this.resourceContext.get() }, actions); - // Show it this.contextMenuService.showContextMenu({ getAnchor: () => anchor, - getActions: () => actions, + menuId: MenuId.EditorTitleContext, + menuActionOptions: { shouldForwardArgs: true, arg: this.resourceContext.get() }, + contextKeyService: this.contextKeyService, getActionsContext: () => ({ groupId: this.group.id, editorIndex: this.group.getIndexOfEditor(editor) }), getKeyBinding: action => this.getKeybinding(action), onHide: () => { diff --git a/src/vs/workbench/browser/parts/paneCompositePart.ts b/src/vs/workbench/browser/parts/paneCompositePart.ts index c0ee4b101f3..dd035d916fb 100644 --- a/src/vs/workbench/browser/parts/paneCompositePart.ts +++ b/src/vs/workbench/browser/parts/paneCompositePart.ts @@ -5,7 +5,7 @@ import { Event } from 'vs/base/common/event'; import { assertIsDefined } from 'vs/base/common/types'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IProgressIndicator } from 'vs/platform/progress/common/progress'; import { PaneCompositeDescriptor } from 'vs/workbench/browser/panecomposite'; @@ -159,4 +159,4 @@ export class PaneCompositeParts extends Disposable implements IPaneCompositePart } } -registerSingleton(IPaneCompositePartService, PaneCompositeParts, true); +registerSingleton(IPaneCompositePartService, PaneCompositeParts, InstantiationType.Delayed); diff --git a/src/vs/workbench/browser/parts/panel/panelActions.ts b/src/vs/workbench/browser/parts/panel/panelActions.ts index 074fafd9d61..f68ea5c90e3 100644 --- a/src/vs/workbench/browser/parts/panel/panelActions.ts +++ b/src/vs/workbench/browser/parts/panel/panelActions.ts @@ -9,7 +9,8 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { Action } from 'vs/base/common/actions'; import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor, MenuId, MenuRegistry, registerAction2, Action2, IAction2Options } from 'vs/platform/actions/common/actions'; -import { IWorkbenchActionRegistry, Extensions as WorkbenchExtensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IWorkbenchLayoutService, PanelAlignment, Parts, Position, positionToString } from 'vs/workbench/services/layout/browser/layoutService'; import { ActivityAction, ToggleCompositePinnedAction, ICompositeBar } from 'vs/workbench/browser/parts/compositeBarActions'; import { IActivity } from 'vs/workbench/common/activity'; @@ -159,7 +160,7 @@ PositionPanelActionConfigs.forEach(positionPanelAction => { super({ id, title, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -193,7 +194,7 @@ AlignPanelActionConfigs.forEach(alignPanelAction => { super({ id, title: title, - category: CATEGORIES.View, + category: Categories.View, toggled: when.negate(), f1: true }); @@ -322,10 +323,10 @@ export class NextPanelViewAction extends SwitchPanelViewAction { } const actionRegistry = Registry.as(WorkbenchExtensions.WorkbenchActions); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(TogglePanelAction, { primary: KeyMod.CtrlCmd | KeyCode.KeyJ }), 'View: Toggle Panel Visibility', CATEGORIES.View.value); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPanelAction), 'View: Focus into Panel', CATEGORIES.View.value); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(PreviousPanelViewAction), 'View: Previous Panel View', CATEGORIES.View.value); -actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NextPanelViewAction), 'View: Next Panel View', CATEGORIES.View.value); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(TogglePanelAction, { primary: KeyMod.CtrlCmd | KeyCode.KeyJ }), 'View: Toggle Panel Visibility', Categories.View.value); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPanelAction), 'View: Focus into Panel', Categories.View.value); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(PreviousPanelViewAction), 'View: Previous Panel View', Categories.View.value); +actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(NextPanelViewAction), 'View: Next Panel View', Categories.View.value); registerAction2(class extends Action2 { constructor() { @@ -333,7 +334,7 @@ registerAction2(class extends Action2 { id: 'workbench.action.toggleMaximizedPanel', title: { value: localize('toggleMaximizedPanel', "Toggle Maximized Panel"), original: 'Toggle Maximized Panel' }, tooltip: localize('maximizePanel', "Maximize Panel Size"), - category: CATEGORIES.View, + category: Categories.View, f1: true, icon: maximizeIcon, // the workbench grid currently prevents us from supporting panel maximization with non-center panel alignment @@ -374,7 +375,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.closePanel', title: { value: localize('closePanel', "Close Panel"), original: 'Close Panel' }, - category: CATEGORIES.View, + category: Categories.View, icon: closeIcon, menu: [{ id: MenuId.CommandPalette, @@ -396,7 +397,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.closeAuxiliaryBar', title: { value: localize('closeSecondarySideBar', "Close Secondary Side Bar"), original: 'Close Secondary Side Bar' }, - category: CATEGORIES.View, + category: Categories.View, icon: closeIcon, menu: [{ id: MenuId.CommandPalette, @@ -500,7 +501,7 @@ class MovePanelToSidePanelAction extends MoveViewsBetweenPanelsAction { value: localize('movePanelToSecondarySideBar', "Move Panel Views To Secondary Side Bar"), original: 'Move Panel Views To Secondary Side Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: false }); } @@ -515,7 +516,7 @@ export class MovePanelToSecondarySideBarAction extends MoveViewsBetweenPanelsAct value: localize('movePanelToSecondarySideBar', "Move Panel Views To Secondary Side Bar"), original: 'Move Panel Views To Secondary Side Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -536,7 +537,7 @@ class MoveSidePanelToPanelAction extends MoveViewsBetweenPanelsAction { value: localize('moveSidePanelToPanel', "Move Secondary Side Bar Views To Panel"), original: 'Move Secondary Side Bar Views To Panel' }, - category: CATEGORIES.View, + category: Categories.View, f1: false }); } @@ -552,7 +553,7 @@ export class MoveSecondarySideBarToPanelAction extends MoveViewsBetweenPanelsAct value: localize('moveSidePanelToPanel', "Move Secondary Side Bar Views To Panel"), original: 'Move Secondary Side Bar Views To Panel' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index d3dfaf39c5f..6b8e20f84f4 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -45,7 +45,7 @@ import { IPartOptions } from 'vs/workbench/browser/part'; import { StringSHA1 } from 'vs/base/common/hash'; import { URI } from 'vs/base/common/uri'; import { Extensions, IProfileStorageRegistry } from 'vs/workbench/services/userDataProfile/common/userDataProfileStorageRegistry'; -import { WorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; +import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; interface ICachedPanel { id: string; @@ -110,7 +110,7 @@ export abstract class BasePanelPart extends CompositePart impleme private compositeBar: CompositeBar; private readonly compositeActions = new Map(); - private globalToolBar: WorkbenchToolBar | undefined; + private globalToolBar: ToolBar | undefined; private globalActions: CompositeMenuActions; private readonly panelDisposables: Map = new Map(); @@ -549,13 +549,12 @@ export abstract class BasePanelPart extends CompositePart impleme const globalTitleActionsContainer = element.appendChild($('.global-actions')); // Global Actions Toolbar - this.globalToolBar = this._register(this.instantiationService.createInstance(WorkbenchToolBar, globalTitleActionsContainer, { + this.globalToolBar = this._register(new ToolBar(globalTitleActionsContainer, this.contextMenuService, { actionViewItemProvider: action => this.actionViewItemProvider(action), orientation: ActionsOrientation.HORIZONTAL, getKeyBinding: action => this.keybindingService.lookupKeybinding(action.id), anchorAlignmentProvider: () => this.getTitleAreaDropDownAnchorAlignment(), - toggleMenuTitle: localize('moreActions', "More Actions..."), - resetMenu: this.globalActions.menuId + toggleMenuTitle: localize('moreActions', "More Actions...") })); this.updateGlobalToolbarActions(); diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarActions.ts b/src/vs/workbench/browser/parts/sidebar/sidebarActions.ts index 9ebb1e99eb7..974349fe5b3 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarActions.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarActions.ts @@ -10,7 +10,7 @@ import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/bro import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; import { ViewContainerLocation } from 'vs/workbench/common/views'; @@ -20,7 +20,7 @@ export class FocusSideBarAction extends Action2 { super({ id: 'workbench.action.focusSideBar', title: { value: localize('focusSideBar', "Focus into Primary Side Bar"), original: 'Focus into Primary Side Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarActions.ts b/src/vs/workbench/browser/parts/statusbar/statusbarActions.ts index 1af3a67ebc2..d484e5a0ad2 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarActions.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarActions.ts @@ -11,7 +11,7 @@ import { KeyCode } from 'vs/base/common/keyCodes'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { StatusbarViewModel } from 'vs/workbench/browser/parts/statusbar/statusbarModel'; import { StatusBarFocused } from 'vs/workbench/common/contextkeys'; @@ -114,7 +114,7 @@ class FocusStatusBarAction extends Action2 { super({ id: 'workbench.action.focusStatusBar', title: { value: localize('focusStatusBar', "Focus Status Bar"), original: 'Focus Status Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 90cb274b662..29b322622bd 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -11,7 +11,6 @@ import { getZoomFactor } from 'vs/base/browser/browser'; import { MenuBarVisibility, getTitleBarStyle, getMenuBarVisibility } from 'vs/platform/window/common/window'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IAction } from 'vs/base/common/actions'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; @@ -25,8 +24,8 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati import { Emitter, Event } from 'vs/base/common/event'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { Parts, IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { createActionViewItem, createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { Action2, IMenuService, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; +import { createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { Codicon } from 'vs/base/common/codicons'; @@ -35,7 +34,7 @@ import { WindowTitle } from 'vs/workbench/browser/parts/titlebar/windowTitle'; import { CommandCenterControl } from 'vs/workbench/browser/parts/titlebar/commandCenterControl'; import { IHoverDelegate } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate'; import { IHoverService } from 'vs/workbench/services/hover/browser/hover'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { MenuWorkbenchToolBar } from 'vs/platform/actions/browser/toolbar'; export class TitlebarPart extends Part implements ITitleService { @@ -92,7 +91,6 @@ export class TitlebarPart extends Part implements ITitleService { @IThemeService themeService: IThemeService, @IStorageService storageService: IStorageService, @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, - @IMenuService private readonly menuService: IMenuService, @IContextKeyService private readonly contextKeyService: IContextKeyService, @IHostService private readonly hostService: IHostService, @IHoverService hoverService: IHoverService, @@ -322,7 +320,7 @@ export class TitlebarPart extends Part implements ITitleService { super({ id: `workbench.action.focusTitleBar`, title: { value: localize('focusTitleBar', "Focus Title Bar"), original: 'Focus Title Bar' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, }); } @@ -382,16 +380,11 @@ export class TitlebarPart extends Part implements ITitleService { const event = new StandardMouseEvent(e); const anchor = { x: event.posx, y: event.posy }; - // Fill in contributed actions - const menu = this.menuService.createMenu(menuId, this.contextKeyService); - const actions: IAction[] = []; - createAndFillInContextMenuActions(menu, undefined, actions); - menu.dispose(); - // Show it this.contextMenuService.showContextMenu({ getAnchor: () => anchor, - getActions: () => actions, + menuId, + contextKeyService: this.contextKeyService, domForShadowRoot: isMacintosh && isNative ? event.target : undefined }); } diff --git a/src/vs/workbench/browser/parts/views/viewsService.ts b/src/vs/workbench/browser/parts/views/viewsService.ts index 18670e883ad..4e2b8c64478 100644 --- a/src/vs/workbench/browser/parts/views/viewsService.ts +++ b/src/vs/workbench/browser/parts/views/viewsService.ts @@ -27,7 +27,7 @@ import { PaneCompositeDescriptor, PaneCompositeRegistry, Extensions as PaneCompo import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; import { URI } from 'vs/base/common/uri'; import { IProgressIndicator } from 'vs/platform/progress/common/progress'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { FilterViewPaneContainer } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; @@ -139,7 +139,7 @@ export class ViewsService extends Disposable implements IViewsService { for (const viewDescriptor of views) { const disposables = new DisposableStore(); disposables.add(this.registerOpenViewAction(viewDescriptor)); - disposables.add(this.registerFocusViewAction(viewDescriptor, composite?.name && composite.name !== composite.id ? composite.name : CATEGORIES.View)); + disposables.add(this.registerFocusViewAction(viewDescriptor, composite?.name && composite.name !== composite.id ? composite.name : Categories.View)); disposables.add(this.registerResetViewLocationAction(viewDescriptor)); this.viewDisposable.set(viewDescriptor, disposables); } @@ -354,7 +354,7 @@ export class ViewsService extends Disposable implements IViewsService { return { value: localize('toggle view', "Toggle {0}", localizedTitle), original: `Toggle ${originalTitle}` }; } }, - category: CATEGORIES.View, + category: Categories.View, precondition: ContextKeyExpr.has(getEnabledViewContainerContextKey(viewContainer.id)), keybinding: keybindings ? { ...keybindings, weight: KeybindingWeight.WorkbenchContrib } : undefined, f1: true @@ -422,7 +422,7 @@ export class ViewsService extends Disposable implements IViewsService { return { value: localize('toggle view', "Toggle {0}", localizedTitle), original: `Toggle ${originalTitle}` }; } }, - category: CATEGORIES.View, + category: Categories.View, precondition: ContextKeyExpr.has(`${viewDescriptor.id}.active`), keybinding: viewDescriptor.openCommandActionDescriptor!.keybindings ? { ...viewDescriptor.openCommandActionDescriptor!.keybindings, weight: KeybindingWeight.WorkbenchContrib } : undefined, f1: true diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts index e50d4867a52..11806254df3 100644 --- a/src/vs/workbench/browser/web.main.ts +++ b/src/vs/workbench/browser/web.main.ts @@ -52,7 +52,7 @@ import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecy import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { localize } from 'vs/nls'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; @@ -436,7 +436,7 @@ export class BrowserMain extends Disposable { super({ id: 'workbench.action.resetUserData', title: { original: 'Reset User Data', value: localize('reset', "Reset User Data") }, - category: CATEGORIES.Developer, + category: Categories.Developer, menu: { id: MenuId.CommandPalette } diff --git a/src/vs/workbench/browser/window.ts b/src/vs/workbench/browser/window.ts index 52dcef61e86..724e130fcd0 100644 --- a/src/vs/workbench/browser/window.ts +++ b/src/vs/workbench/browser/window.ts @@ -26,6 +26,7 @@ import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/envir import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { BrowserLifecycleService } from 'vs/workbench/services/lifecycle/browser/lifecycleService'; import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; +import { IHostService } from 'vs/workbench/services/host/browser/host'; export class BrowserWindow extends Disposable { @@ -36,7 +37,8 @@ export class BrowserWindow extends Disposable { @ILabelService private readonly labelService: ILabelService, @IProductService private readonly productService: IProductService, @IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService, - @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService + @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, + @IHostService private readonly hostService: IHostService ) { super(); @@ -204,29 +206,45 @@ export class BrowserWindow extends Disposable { invokeProtocolHandler(); const showProtocolUrlOpenedDialog = async () => { + const { downloadUrl } = this.productService; + let detail = localize( + 'openExternalDialogDetail.v2', + "We launched {0} on your computer.\n\nIf {1} did not launch, try again or install it below.", + this.productService.nameLong, + this.productService.nameLong + ); + const options = [ + localize('openExternalDialogButtonClose', "Close tab"), + localize('openExternalDialogButtonRetry', "Try again"), + localize('openExternalDialogButtonInstall.v3', "Install"), + localize('openExternalDialogButtonCancel', "Cancel") + ]; + if (downloadUrl === undefined) { + options.splice(2, 1); + detail = localize( + 'openExternalDialogDetailNoInstall', + "We launched {0} on your computer.\n\nIf {1} did not launch, try again below.", + this.productService.nameLong, + this.productService.nameLong + ); + } + const showResult = await this.dialogService.show( Severity.Info, localize('openExternalDialogTitle', "All done. You can close this tab now."), - [ - localize('openExternalDialogButtonRetry', "Try again"), - localize('openExternalDialogButtonInstall', "Install {0}", this.productService.nameLong), - localize('openExternalDialogButtonContinue', "Continue here") - ], + options, { - cancelId: 2, - detail: localize('openExternalDialogDetail', "We tried opening {0} on your computer.", this.productService.nameLong) + cancelId: downloadUrl === undefined ? 2 : 3, + detail }, ); if (showResult.choice === 0) { - invokeProtocolHandler(); + this.hostService.close(); } else if (showResult.choice === 1) { - // Route the user to the appropriate install link - await this.openerService.open(URI.parse( - this.productService.quality === 'stable' - ? `http://aka.ms/vscode-install` - : `http://aka.ms/vscode-install-insiders` - )); + invokeProtocolHandler(); + } else if (showResult.choice === 2 && downloadUrl !== undefined) { + await this.openerService.open(URI.parse(downloadUrl)); // Re-show the dialog so that the user can come back after installing and try again showProtocolUrlOpenedDialog(); diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index 4ebd6498e72..9ebe6ca8ed7 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -18,7 +18,7 @@ const registry = Registry.as(ConfigurationExtensions.Con (function registerConfiguration(): void { // Migration support - Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ConfigurationMigrationWorkbenchContribution, 'ConfigurationMigrationWorkbenchContribution', LifecyclePhase.Eventually); + Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ConfigurationMigrationWorkbenchContribution, LifecyclePhase.Eventually); // Workbench registry.registerConfiguration({ diff --git a/src/vs/workbench/common/actions.ts b/src/vs/workbench/common/actions.ts index 64742f9555f..3b2148055a5 100644 --- a/src/vs/workbench/common/actions.ts +++ b/src/vs/workbench/common/actions.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { ICommandHandler, CommandsRegistry } from 'vs/platform/commands/common/commands'; @@ -121,11 +120,3 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR } } }); - -export const CATEGORIES = { - View: { value: localize('view', "View"), original: 'View' }, - Help: { value: localize('help', "Help"), original: 'Help' }, - Test: { value: localize('test', "Test"), original: 'Test' }, - Preferences: { value: localize('preferences', "Preferences"), original: 'Preferences' }, - Developer: { value: localize({ key: 'developer', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"), original: 'Developer' } -}; diff --git a/src/vs/workbench/common/contributions.ts b/src/vs/workbench/common/contributions.ts index afa24265570..592f64c9f89 100644 --- a/src/vs/workbench/common/contributions.ts +++ b/src/vs/workbench/common/contributions.ts @@ -9,6 +9,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { runWhenIdle, IdleDeadline } from 'vs/base/common/async'; import { mark } from 'vs/base/common/performance'; import { ILogService } from 'vs/platform/log/common/log'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; /** * A workbench contribution that will be loaded when the workbench starts and disposed when the workbench shuts down. @@ -23,21 +24,15 @@ export namespace Extensions { type IWorkbenchContributionSignature = new (...services: Service) => IWorkbenchContribution; -interface IWorkbenchContributionRegistration { - readonly id: string; - readonly ctor: IConstructorSignature; -} - export interface IWorkbenchContributionsRegistry { /** * Registers a workbench contribution to the platform that will be loaded when the workbench starts and disposed when * the workbench shuts down. * - * @param id the identifier of the contribution. * @param phase the lifecycle phase when to instantiate the contribution. */ - registerWorkbenchContribution(contribution: IWorkbenchContributionSignature, id: string, phase: LifecyclePhase): void; + registerWorkbenchContribution(contribution: IWorkbenchContributionSignature, phase: LifecyclePhase): void; /** * Starts the registry by providing the required services. @@ -50,15 +45,15 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry private instantiationService: IInstantiationService | undefined; private lifecycleService: ILifecycleService | undefined; private logService: ILogService | undefined; + private environmentService: IEnvironmentService | undefined; - private readonly toBeInstantiated = new Map(); + private readonly toBeInstantiated = new Map[]>(); - registerWorkbenchContribution(ctor: IConstructorSignature, id: string, phase: LifecyclePhase = LifecyclePhase.Starting): void { - const contribution = { id, ctor }; + registerWorkbenchContribution(ctor: IConstructorSignature, phase: LifecyclePhase = LifecyclePhase.Starting): void { // Instantiate directly if we are already matching the provided phase - if (this.instantiationService && this.lifecycleService && this.logService && this.lifecycleService.phase >= phase) { - this.safeCreateInstance(this.instantiationService, this.logService, contribution, phase); + if (this.instantiationService && this.lifecycleService && this.logService && this.environmentService && this.lifecycleService.phase >= phase) { + this.safeCreateInstance(this.instantiationService, this.logService, this.environmentService, ctor, phase); } // Otherwise keep contributions by lifecycle phase @@ -69,7 +64,7 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry this.toBeInstantiated.set(phase, toBeInstantiated); } - toBeInstantiated.push(contribution); + toBeInstantiated.push(ctor as IConstructorSignature); } } @@ -77,26 +72,27 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry const instantiationService = this.instantiationService = accessor.get(IInstantiationService); const lifecycleService = this.lifecycleService = accessor.get(ILifecycleService); const logService = this.logService = accessor.get(ILogService); + const environmentService = this.environmentService = accessor.get(IEnvironmentService); for (const phase of [LifecyclePhase.Starting, LifecyclePhase.Ready, LifecyclePhase.Restored, LifecyclePhase.Eventually]) { - this.instantiateByPhase(instantiationService, lifecycleService, logService, phase); + this.instantiateByPhase(instantiationService, lifecycleService, logService, environmentService, phase); } } - private instantiateByPhase(instantiationService: IInstantiationService, lifecycleService: ILifecycleService, logService: ILogService, phase: LifecyclePhase): void { + private instantiateByPhase(instantiationService: IInstantiationService, lifecycleService: ILifecycleService, logService: ILogService, environmentService: IEnvironmentService, phase: LifecyclePhase): void { // Instantiate contributions directly when phase is already reached if (lifecycleService.phase >= phase) { - this.doInstantiateByPhase(instantiationService, logService, phase); + this.doInstantiateByPhase(instantiationService, logService, environmentService, phase); } // Otherwise wait for phase to be reached else { - lifecycleService.when(phase).then(() => this.doInstantiateByPhase(instantiationService, logService, phase)); + lifecycleService.when(phase).then(() => this.doInstantiateByPhase(instantiationService, logService, environmentService, phase)); } } - private doInstantiateByPhase(instantiationService: IInstantiationService, logService: ILogService, phase: LifecyclePhase): void { + private doInstantiateByPhase(instantiationService: IInstantiationService, logService: ILogService, environmentService: IEnvironmentService, phase: LifecyclePhase): void { const toBeInstantiated = this.toBeInstantiated.get(phase); if (toBeInstantiated) { this.toBeInstantiated.delete(phase); @@ -108,7 +104,7 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry mark(`code/willCreateWorkbenchContributions/${phase}`); for (const ctor of toBeInstantiated) { - this.safeCreateInstance(instantiationService, logService, ctor, phase); // catch error so that other contributions are still considered + this.safeCreateInstance(instantiationService, logService, environmentService, ctor, phase); // catch error so that other contributions are still considered } mark(`code/didCreateWorkbenchContributions/${phase}`); @@ -123,7 +119,7 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry const instantiateSome = (idle: IdleDeadline) => { while (i < toBeInstantiated.length) { const ctor = toBeInstantiated[i++]; - this.safeCreateInstance(instantiationService, logService, ctor, phase); // catch error so that other contributions are still considered + this.safeCreateInstance(instantiationService, logService, environmentService, ctor, phase); // catch error so that other contributions are still considered if (idle.timeRemaining() < 1) { // time is up -> reschedule runWhenIdle(instantiateSome, forcedTimeout); @@ -136,19 +132,19 @@ class WorkbenchContributionsRegistry implements IWorkbenchContributionsRegistry } } - private safeCreateInstance(instantiationService: IInstantiationService, logService: ILogService, contribution: IWorkbenchContributionRegistration, phase: LifecyclePhase): void { + private safeCreateInstance(instantiationService: IInstantiationService, logService: ILogService, environmentService: IEnvironmentService, ctor: IConstructorSignature, phase: LifecyclePhase): void { const now: number | undefined = phase < LifecyclePhase.Restored ? Date.now() : undefined; try { - instantiationService.createInstance(contribution.ctor); + instantiationService.createInstance(ctor); } catch (error) { - logService.error(`Unable to instantiate workbench contribution ${contribution.id}.`, error); + logService.error(`Unable to instantiate workbench contribution ${ctor.name}.`, error); } - if (typeof now === 'number') { + if (typeof now === 'number' && !environmentService.isBuilt /* only log out of sources where we have good ctor names */) { const time = Date.now() - now; - if (time > 5) { - logService.warn(`Workbench contribution ${contribution.id} blocked restore phase by ${time}ms.`); + if (time > 20) { + logService.warn(`Workbench contribution ${ctor.name} blocked restore phase by ${time}ms.`); } } } diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index b89e7d795d6..8c49d1bf96b 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -639,6 +639,13 @@ export const ACTIVITY_BAR_SETTINGS_PROFILE_HOVER_FOREGROUND = registerColor('act hcLight: ACTIVITY_BAR_FOREGROUND }, localize('activityBarItem.settingsProfilesHoverForeground', "Foreground color for the settings profile entry on the activity bar when hovering.")); +export const ACTIVITY_BAR_SETTINGS_PROFILE_BACKGROUND = registerColor('activityBarItem.settingsProfilesBackground', { + dark: lighten(ACTIVITY_BAR_BACKGROUND, 0.5), + light: darken(ACTIVITY_BAR_BACKGROUND, 0.12), + hcDark: null, + hcLight: null +}, localize('statusBarItemSettingsProfileBackground', "Background color for the settings profile entry on the activity bar.")); + // < --- Remote --- > export const STATUS_BAR_HOST_NAME_BACKGROUND = registerColor('statusBarItem.remoteBackground', { diff --git a/src/vs/workbench/contrib/audioCues/browser/audioCueService.ts b/src/vs/workbench/contrib/audioCues/browser/audioCueService.ts index 1c26424410f..ce7a4d8a1b0 100644 --- a/src/vs/workbench/contrib/audioCues/browser/audioCueService.ts +++ b/src/vs/workbench/contrib/audioCues/browser/audioCueService.ts @@ -152,7 +152,8 @@ export class Sound { public static readonly foldedArea = Sound.register({ fileName: 'foldedAreas.mp3' }); public static readonly break = Sound.register({ fileName: 'break.mp3' }); public static readonly quickFixes = Sound.register({ fileName: 'quickFixes.mp3' }); - public static readonly taskEnded = Sound.register({ fileName: 'taskEnded.mp3' }); + public static readonly taskCompleted = Sound.register({ fileName: 'taskCompleted.mp3' }); + public static readonly taskFailed = Sound.register({ fileName: 'taskFailed.mp3' }); public static readonly terminalBell = Sound.register({ fileName: 'terminalBell.mp3' }); private constructor(public readonly fileName: string) { } @@ -201,6 +202,12 @@ export class AudioCue { settingsKey: 'audioCues.lineHasInlineSuggestion', }); + public static readonly terminalQuickFix = AudioCue.register({ + name: localize('audioCues.terminalQuickFix.name', 'Terminal Quick Fix'), + sound: Sound.quickFixes, + settingsKey: 'audioCues.terminalQuickFix', + }); + public static readonly onDebugBreak = AudioCue.register({ name: localize('audioCues.onDebugBreak.name', 'Debugger Stopped on Breakpoint'), sound: Sound.break, @@ -213,10 +220,16 @@ export class AudioCue { settingsKey: 'audioCues.noInlayHints' }); - public static readonly taskEnded = AudioCue.register({ - name: localize('audioCues.taskEnded', 'Task Ended'), - sound: Sound.taskEnded, - settingsKey: 'audioCues.taskEnded' + public static readonly taskCompleted = AudioCue.register({ + name: localize('audioCues.taskCompleted', 'Task Completed'), + sound: Sound.taskCompleted, + settingsKey: 'audioCues.taskCompleted' + }); + + public static readonly taskFailed = AudioCue.register({ + name: localize('audioCues.taskFailed', 'Task Failed'), + sound: Sound.taskFailed, + settingsKey: 'audioCues.taskFailed' }); public static readonly terminalBell = AudioCue.register({ diff --git a/src/vs/workbench/contrib/audioCues/browser/audioCues.contribution.ts b/src/vs/workbench/contrib/audioCues/browser/audioCues.contribution.ts index facb74870e4..74b817d6c1a 100644 --- a/src/vs/workbench/contrib/audioCues/browser/audioCues.contribution.ts +++ b/src/vs/workbench/contrib/audioCues/browser/audioCues.contribution.ts @@ -17,8 +17,8 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle registerSingleton(IAudioCueService, AudioCueService, false); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(AudioCueLineFeatureContribution, 'AudioCueLineFeatureContribution', LifecyclePhase.Restored); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(AudioCueLineDebuggerContribution, 'AudioCueLineDebuggerContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(AudioCueLineFeatureContribution, LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(AudioCueLineDebuggerContribution, LifecyclePhase.Restored); const audioCueFeatureBase: IConfigurationPropertySchema = { 'type': 'string', @@ -72,8 +72,16 @@ Registry.as(ConfigurationExtensions.Configuration).regis 'description': localize('audioCues.noInlayHints', "Plays a sound when trying to read a line with inlay hints that has no inlay hints."), ...audioCueFeatureBase, }, - 'audioCues.taskEnded': { - 'description': localize('audioCues.taskEnded', "Plays a sound when a task ends."), + 'audioCues.taskCompleted': { + 'description': localize('audioCues.taskCompleted', "Plays a sound when a task completed."), + ...audioCueFeatureBase, + }, + 'audioCues.taskFailed': { + 'description': localize('audioCues.taskFailed', "Plays a sound when a task fails (non-zero exit code)."), + ...audioCueFeatureBase, + }, + 'audioCues.terminalQuickFix': { + 'description': localize('audioCues.terminalQuickFix', "Plays a sound when a terminal quick fixes are available"), ...audioCueFeatureBase, }, } diff --git a/src/vs/workbench/contrib/audioCues/browser/media/taskCompleted.mp3 b/src/vs/workbench/contrib/audioCues/browser/media/taskCompleted.mp3 new file mode 100644 index 00000000000..dd3fecbef57 Binary files /dev/null and b/src/vs/workbench/contrib/audioCues/browser/media/taskCompleted.mp3 differ diff --git a/src/vs/workbench/contrib/audioCues/browser/media/taskEnded.mp3 b/src/vs/workbench/contrib/audioCues/browser/media/taskEnded.mp3 deleted file mode 100644 index 37b832b02b5..00000000000 Binary files a/src/vs/workbench/contrib/audioCues/browser/media/taskEnded.mp3 and /dev/null differ diff --git a/src/vs/workbench/contrib/audioCues/browser/media/taskFailed.mp3 b/src/vs/workbench/contrib/audioCues/browser/media/taskFailed.mp3 new file mode 100644 index 00000000000..7a155fa67d3 Binary files /dev/null and b/src/vs/workbench/contrib/audioCues/browser/media/taskFailed.mp3 differ diff --git a/src/vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.ts b/src/vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.ts index af4f63a1d65..c1051e9d4cf 100644 --- a/src/vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.ts +++ b/src/vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.ts @@ -51,5 +51,5 @@ class BracketPairColorizer2TelemetryContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(BracketPairColorizer2TelemetryContribution, 'BracketPairColorizer2TelemetryContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(BracketPairColorizer2TelemetryContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts index ae0212db0c5..00a833511b0 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts @@ -16,7 +16,7 @@ import { localize } from 'vs/nls'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/platform/log/common/log'; import { IProgress, IProgressStep, Progress } from 'vs/platform/progress/common/progress'; @@ -184,7 +184,7 @@ export class BulkEditService implements IBulkEditService { let edits = liftEdits(Array.isArray(editsIn) ? editsIn : editsIn.edits); if (edits.length === 0) { - return { ariaSummary: localize('nothing', "Made no edits") }; + return { ariaSummary: localize('nothing', "Made no edits"), isApplied: false }; } if (this._previewHandler && (options?.showPreview || edits.some(value => value.metadata?.needsConfirmation))) { @@ -244,11 +244,11 @@ export class BulkEditService implements IBulkEditService { // when enabled (option AND setting) loop over all dirty working copies and trigger save // for those that were involved in this bulk edit operation. - if (options?.respectAutoSaveConfig && this._configService.getValue(autoSaveSetting) === true && resources.length > 1) { + if (options?.respectAutoSaveConfig && this._configService.getValue(autoSaveSetting) === true) { await this._saveAll(resources); } - return { ariaSummary: bulkEdit.ariaMessage() }; + return { ariaSummary: bulkEdit.ariaMessage(), isApplied: edits.length > 0 }; } catch (err) { // console.log('apply FAILED'); // console.log(err); @@ -289,7 +289,7 @@ export class BulkEditService implements IBulkEditService { } } -registerSingleton(IBulkEditService, BulkEditService, true); +registerSingleton(IBulkEditService, BulkEditService, InstantiationType.Delayed); const autoSaveSetting = 'files.refactoring.autoSave'; diff --git a/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts b/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts index 19164716538..4d51be59e2f 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.ts @@ -323,9 +323,7 @@ registerAction2(class ToggleGrouping extends Action2 { }); Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution( - BulkEditPreviewContribution, - 'BulkEditPreviewContribution', - LifecyclePhase.Ready + BulkEditPreviewContribution, LifecyclePhase.Ready ); const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, localize('refactorPreviewViewIcon', 'View icon of the refactor preview view.')); diff --git a/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.ts b/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.ts index cb829e3eb0b..33aae4de46f 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.ts @@ -26,9 +26,7 @@ import { ResourceLabels, IResourceLabelsContainer } from 'vs/workbench/browser/l import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import Severity from 'vs/base/common/severity'; import { basename, dirname } from 'vs/base/common/resources'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; -import { IAction } from 'vs/base/common/actions'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { MenuId } from 'vs/platform/actions/common/actions'; import { ITreeContextMenuEvent } from 'vs/base/browser/ui/tree/tree'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; @@ -78,10 +76,9 @@ export class BulkEditPane extends ViewPane { @ILabelService private readonly _labelService: ILabelService, @ITextModelService private readonly _textModelService: ITextModelService, @IDialogService private readonly _dialogService: IDialogService, - @IMenuService private readonly _menuService: IMenuService, @IContextMenuService private readonly _contextMenuService: IContextMenuService, - @IContextKeyService private readonly _contextKeyService: IContextKeyService, @IStorageService private readonly _storageService: IStorageService, + @IContextKeyService contextKeyService: IContextKeyService, @IViewDescriptorService viewDescriptorService: IViewDescriptorService, @IKeybindingService keybindingService: IKeybindingService, @IContextMenuService contextMenuService: IContextMenuService, @@ -92,13 +89,13 @@ export class BulkEditPane extends ViewPane { ) { super( { ...options, titleMenuId: MenuId.BulkEditTitle }, - keybindingService, contextMenuService, configurationService, _contextKeyService, viewDescriptorService, _instaService, openerService, themeService, telemetryService + keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, _instaService, openerService, themeService, telemetryService ); this.element.classList.add('bulk-edit-panel', 'show-file-icons'); - this._ctxHasCategories = BulkEditPane.ctxHasCategories.bindTo(_contextKeyService); - this._ctxGroupByFile = BulkEditPane.ctxGroupByFile.bindTo(_contextKeyService); - this._ctxHasCheckedChanges = BulkEditPane.ctxHasCheckedChanges.bindTo(_contextKeyService); + this._ctxHasCategories = BulkEditPane.ctxHasCategories.bindTo(contextKeyService); + this._ctxGroupByFile = BulkEditPane.ctxGroupByFile.bindTo(contextKeyService); + this._ctxHasCheckedChanges = BulkEditPane.ctxHasCheckedChanges.bindTo(contextKeyService); } override dispose(): void { @@ -380,16 +377,11 @@ export class BulkEditPane extends ViewPane { } private _onContextMenu(e: ITreeContextMenuEvent): void { - const menu = this._menuService.createMenu(MenuId.BulkEditContext, this._contextKeyService); - const actions: IAction[] = []; - createAndFillInContextMenuActions(menu, undefined, actions); this._contextMenuService.showContextMenu({ - getActions: () => actions, - getAnchor: () => e.anchor, - onHide: () => { - menu.dispose(); - } + menuId: MenuId.BulkEditContext, + contextKeyService: this.contextKeyService, + getAnchor: () => e.anchor }); } } diff --git a/src/vs/workbench/contrib/codeActions/browser/codeActions.contribution.ts b/src/vs/workbench/contrib/codeActions/browser/codeActions.contribution.ts index f3d4de633ba..afcf9915643 100644 --- a/src/vs/workbench/contrib/codeActions/browser/codeActions.contribution.ts +++ b/src/vs/workbench/contrib/codeActions/browser/codeActions.contribution.ts @@ -30,4 +30,4 @@ class WorkbenchConfigurationContribution { } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WorkbenchConfigurationContribution, 'WorkbenchConfigurationContribution', LifecyclePhase.Eventually); + .registerWorkbenchContribution(WorkbenchConfigurationContribution, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/codeEditor/browser/inspectKeybindings.ts b/src/vs/workbench/contrib/codeEditor/browser/inspectKeybindings.ts index 73808153cd7..dc493bf295c 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/inspectKeybindings.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/inspectKeybindings.ts @@ -8,7 +8,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; class InspectKeyMap extends Action2 { @@ -17,7 +17,7 @@ class InspectKeyMap extends Action2 { super({ id: 'workbench.action.inspectKeyMappings', title: { value: localize('workbench.action.inspectKeyMap', "Inspect Key Mappings"), original: 'Inspect Key Mappings' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -38,7 +38,7 @@ class InspectKeyMapJSON extends Action2 { super({ id: 'workbench.action.inspectKeyMappingsJSON', title: { value: localize('workbench.action.inspectKeyMapJSON', "Inspect Key Mappings (JSON)"), original: 'Inspect Key Mappings (JSON)' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts b/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts index 3cbf02252d0..5f44dc67e26 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts @@ -432,4 +432,4 @@ class DocumentSymbolsOutlineCreator implements IOutlineCreator(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DocumentSymbolsOutlineCreator, 'DocumentSymbolsOutlineCreator', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DocumentSymbolsOutlineCreator, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts b/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts index 2049f12a728..4b966ec9bd1 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts @@ -402,4 +402,4 @@ export class SaveParticipantsContribution extends Disposable implements IWorkben } const workbenchContributionsRegistry = Registry.as(WorkbenchContributionsExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(SaveParticipantsContribution, 'SaveParticipantsContribution', LifecyclePhase.Restored); +workbenchContributionsRegistry.registerWorkbenchContribution(SaveParticipantsContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts index f0ea2a89e33..33be24d8270 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; export class ToggleMinimapAction extends Action2 { @@ -22,7 +22,7 @@ export class ToggleMinimapAction extends Action2 { original: 'Toggle Minimap', mnemonicTitle: localize({ key: 'miMinimap', comment: ['&& denotes a mnemonic'] }, "&&Minimap") }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: ContextKeyExpr.equals('config.editor.minimap.enabled', true), menu: { diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.ts index 58424f5f37c..fea60d0515a 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.ts @@ -64,7 +64,7 @@ class MultiCursorModifierContextKeyController implements IWorkbenchContribution } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(MultiCursorModifierContextKeyController, 'MultiCursorModifierContextKeyController', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(MultiCursorModifierContextKeyController, LifecyclePhase.Restored); registerAction2(ToggleMultiCursorModifierAction); diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts index 0990dd2f454..9bc7a2b18ed 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { CATEGORIES, } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; export class ToggleRenderControlCharacterAction extends Action2 { @@ -22,7 +22,7 @@ export class ToggleRenderControlCharacterAction extends Action2 { mnemonicTitle: localize({ key: 'miToggleRenderControlCharacters', comment: ['&& denotes a mnemonic'] }, "Render &&Control Characters"), original: 'Toggle Control Characters' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: ContextKeyExpr.equals('config.editor.renderControlCharacters', true), menu: { diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts index c8bab9f321f..297c10d0cbb 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { CATEGORIES, } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; class ToggleRenderWhitespaceAction extends Action2 { @@ -22,7 +22,7 @@ class ToggleRenderWhitespaceAction extends Action2 { mnemonicTitle: localize({ key: 'miToggleRenderWhitespace', comment: ['&& denotes a mnemonic'] }, "&&Render Whitespace"), original: 'Toggle Render Whitespace' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, toggled: ContextKeyExpr.notEquals('config.editor.renderWhitespace', 'none'), menu: { diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.ts index 947a3d1cfb4..56e5219cb2b 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.ts @@ -269,7 +269,7 @@ class EditorWordWrapContextKeyTracker implements IWorkbenchContribution { } const workbenchRegistry = Registry.as(Extensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(EditorWordWrapContextKeyTracker, 'EditorWordWrapContextKeyTracker', LifecyclePhase.Ready); +workbenchRegistry.registerWorkbenchContribution(EditorWordWrapContextKeyTracker, LifecyclePhase.Ready); registerEditorContribution(ToggleWordWrapController.ID, ToggleWordWrapController); diff --git a/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts b/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts index 4a2368a13a1..4d53ac15383 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts @@ -23,4 +23,4 @@ class DisplayChangeRemeasureFonts extends Disposable implements IWorkbenchContri } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisplayChangeRemeasureFonts, 'DisplayChangeRemeasureFonts', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisplayChangeRemeasureFonts, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/codeEditor/electron-sandbox/selectionClipboard.ts b/src/vs/workbench/contrib/codeEditor/electron-sandbox/selectionClipboard.ts index 2801c0cb4c0..b0c66b9acb9 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-sandbox/selectionClipboard.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-sandbox/selectionClipboard.ts @@ -135,7 +135,7 @@ class PasteSelectionClipboardAction extends EditorAction { } registerEditorContribution(SelectionClipboardContributionID, SelectionClipboard); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SelectionClipboardPastePreventer, 'SelectionClipboardPastePreventer', LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SelectionClipboardPastePreventer, LifecyclePhase.Ready); if (platform.isLinux) { registerEditorAction(PasteSelectionClipboardAction); } diff --git a/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts b/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts index 78219ebf9ef..f0e5225baa5 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-sandbox/sleepResumeRepaintMinimap.ts @@ -24,4 +24,4 @@ class SleepResumeRepaintMinimap extends Disposable implements IWorkbenchContribu } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SleepResumeRepaintMinimap, 'SleepResumeRepaintMinimap', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SleepResumeRepaintMinimap, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.ts b/src/vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.ts index 5d6f3d31359..032f263903d 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-sandbox/startDebugTextMate.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { Range } from 'vs/editor/common/core/range'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ITextMateService } from 'vs/workbench/services/textMate/browser/textMate'; import { IModelService } from 'vs/editor/common/services/model'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -30,7 +30,7 @@ class StartDebugTextMate extends Action2 { super({ id: 'editor.action.startDebugTextMate', title: { value: nls.localize('startDebugTextMate', "Start Text Mate Syntax Grammar Logging"), original: 'Start Text Mate Syntax Grammar Logging' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/comments/browser/commentMenus.ts b/src/vs/workbench/contrib/comments/browser/commentMenus.ts index 79e647f9121..dae9f44956f 100644 --- a/src/vs/workbench/contrib/comments/browser/commentMenus.ts +++ b/src/vs/workbench/contrib/comments/browser/commentMenus.ts @@ -35,10 +35,6 @@ export class CommentMenus implements IDisposable { return this.getMenu(MenuId.CommentThreadTitleContext, contextKeyService); } - getCommentThreadCommentContextActions(contextKeyService: IContextKeyService): IMenu { - return this.getMenu(MenuId.CommentThreadCommentContext, contextKeyService); - } - private getMenu(menuId: MenuId, contextKeyService: IContextKeyService): IMenu { const menu = this.menuService.createMenu(menuId, contextKeyService); diff --git a/src/vs/workbench/contrib/comments/browser/commentNode.ts b/src/vs/workbench/contrib/comments/browser/commentNode.ts index df7f71d462a..8ca985d8f43 100644 --- a/src/vs/workbench/contrib/comments/browser/commentNode.ts +++ b/src/vs/workbench/contrib/comments/browser/commentNode.ts @@ -26,7 +26,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview'; import { ToggleReactionsAction, ReactionAction, ReactionActionViewItem } from './reactionsAction'; import { ICommentThreadWidget } from 'vs/workbench/contrib/comments/common/commentThreadWidget'; -import { MenuItemAction, SubmenuItemAction, IMenu } from 'vs/platform/actions/common/actions'; +import { MenuItemAction, SubmenuItemAction, IMenu, MenuId } from 'vs/platform/actions/common/actions'; import { MenuEntryActionViewItem, SubmenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { CommentFormActions } from 'vs/workbench/contrib/comments/browser/commentFormActions'; @@ -574,13 +574,11 @@ export class CommentNode extends Disposable { private onContextMenu(e: MouseEvent) { - const actions = this._commentMenus.getCommentThreadCommentContextActions(this._contextKeyService).getActions({ shouldForwardArgs: true }).map((value) => value[1]).flat(); - if (!actions.length) { - return; - } this.contextMenuService.showContextMenu({ getAnchor: () => e, - getActions: () => actions, + menuId: MenuId.CommentThreadCommentContext, + menuActionOptions: { shouldForwardArgs: true }, + contextKeyService: this._contextKeyService, actionRunner: new ActionRunner(), getActionsContext: () => { return this.commentNodeContext; diff --git a/src/vs/workbench/contrib/comments/browser/commentsViewActions.ts b/src/vs/workbench/contrib/comments/browser/commentsViewActions.ts index 4445e3a05b0..420029d895e 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsViewActions.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsViewActions.ts @@ -412,6 +412,7 @@ registerAction2(class extends ViewAction { registerAction2(class extends Action2 { constructor() { super({ + _isFakeAction: true, id: `workbench.actions.treeView.${COMMENTS_VIEW_ID}.filter`, title: localize('filter', "Filter"), menu: { diff --git a/src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.ts b/src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.ts index 9a0c2be015a..127283add02 100644 --- a/src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.ts +++ b/src/vs/workbench/contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.ts @@ -23,4 +23,4 @@ export class ExtensionPoints implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExtensionPoints, 'ExtensionPoints', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExtensionPoints, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.ts b/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.ts index 79cf442038e..ee27b0aefa9 100644 --- a/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.ts +++ b/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.ts @@ -25,4 +25,4 @@ class ContextMenuContribution implements IWorkbenchContribution { } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(ContextMenuContribution, 'ContextMenuContribution', LifecyclePhase.Eventually); + .registerWorkbenchContribution(ContextMenuContribution, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.ts b/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.ts index f7ce07c9213..f8673805e33 100644 --- a/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.ts +++ b/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/editor'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; @@ -16,7 +16,7 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle import { CustomEditorInput } from './customEditorInput'; import { CustomEditorService } from './customEditors'; -registerSingleton(ICustomEditorService, CustomEditorService, false); +registerSingleton(ICustomEditorService, CustomEditorService, InstantiationType.Delayed); Registry.as(EditorExtensions.EditorPane) .registerEditorPane( @@ -34,4 +34,4 @@ Registry.as(EditorExtensions.EditorFactory) CustomEditorInputSerializer); Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(ComplexCustomWorkingCopyEditorHandler, 'ComplexCustomWorkingCopyEditorHandler', LifecyclePhase.Starting); + .registerWorkbenchContribution(ComplexCustomWorkingCopyEditorHandler, LifecyclePhase.Starting); diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index 414b1b2494e..42b8cbf0f94 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -294,7 +294,7 @@ export class BreakpointsView extends ViewPane { return langId && dbg.interestedInLanguage(langId); }); - if (message && debuggerHasUnverifiedBps?.length) { + if (message && debuggerHasUnverifiedBps?.length && this.debugService.getModel().areBreakpointsActivated()) { if (delayed) { const mdown = new MarkdownString(undefined, { isTrusted: true }).appendMarkdown(message); this.hintContainer.setLabel('$(warning)', undefined, { title: { markdown: mdown, markdownNotSupportedFallback: message } }); diff --git a/src/vs/workbench/contrib/debug/browser/callStackView.ts b/src/vs/workbench/contrib/debug/browser/callStackView.ts index 7643f1a8057..74631ace0ca 100644 --- a/src/vs/workbench/contrib/debug/browser/callStackView.ts +++ b/src/vs/workbench/contrib/debug/browser/callStackView.ts @@ -229,7 +229,7 @@ export class CallStackView extends ViewPane { this.instantiationService.createInstance(ThreadsRenderer), this.instantiationService.createInstance(StackFramesRenderer), new ErrorsRenderer(), - new LoadAllRenderer(this.themeService), + new LoadMoreRenderer(this.themeService), new ShowMoreRenderer(this.themeService) ], this.dataSource, { accessibilityProvider: new CallStackAccessibilityProvider(), @@ -259,7 +259,7 @@ export class CallStackView extends ViewPane { return e; } if (e instanceof ThreadAndSessionIds) { - return LoadAllRenderer.LABEL; + return LoadMoreRenderer.LABEL; } return localize('showMoreStackFrames2', "Show More Stack Frames"); @@ -804,14 +804,14 @@ class ErrorsRenderer implements ICompressibleTreeRenderer { - static readonly ID = 'loadAll'; - static readonly LABEL = localize('loadAllStackFrames', "Load All Stack Frames"); +class LoadMoreRenderer implements ICompressibleTreeRenderer { + static readonly ID = 'loadMore'; + static readonly LABEL = localize('loadAllStackFrames', "Load More Stack Frames"); constructor(private readonly themeService: IThemeService) { } get templateId(): string { - return LoadAllRenderer.ID; + return LoadMoreRenderer.ID; } renderTemplate(container: HTMLElement): ILabelTemplateData { @@ -826,7 +826,7 @@ class LoadAllRenderer implements ICompressibleTreeRenderer, index: number, data: ILabelTemplateData): void { - data.label.textContent = LoadAllRenderer.LABEL; + data.label.textContent = LoadMoreRenderer.LABEL; } renderCompressedElements(node: ITreeNode, FuzzyScore>, index: number, templateData: ILabelTemplateData, height: number | undefined): void { @@ -904,7 +904,7 @@ class CallStackDelegate implements IListVirtualDelegate { return ErrorsRenderer.ID; } if (element instanceof ThreadAndSessionIds) { - return LoadAllRenderer.ID; + return LoadMoreRenderer.ID; } // element instanceof Array @@ -1067,7 +1067,7 @@ class CallStackAccessibilityProvider implements IListAccessibilityProvider(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, 'DebugStatusContribution', LifecyclePhase.Eventually); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugProgressContribution, 'DebugProgressContribution', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugProgressContribution, LifecyclePhase.Eventually); if (isWeb) { - Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugTitleContribution, 'DebugTitleContribution', LifecyclePhase.Eventually); + Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugTitleContribution, LifecyclePhase.Eventually); } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugToolBar, 'DebugToolBar', LifecyclePhase.Restored); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugContentProvider, 'DebugContentProvider', LifecyclePhase.Eventually); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(StatusBarColorProvider, 'StatusBarColorProvider', LifecyclePhase.Eventually); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisassemblyViewContribution, 'DisassemblyViewContribution', LifecyclePhase.Eventually); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugLifecycle, 'DebugLifecycle', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugToolBar, LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugContentProvider, LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(StatusBarColorProvider, LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisassemblyViewContribution, LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugLifecycle, LifecyclePhase.Eventually); // Register Quick Access Registry.as(QuickAccessExtensions.Quickaccess).registerQuickAccessProvider({ diff --git a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts index 3c2568989db..fe3d0e29842 100644 --- a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts +++ b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts @@ -3,41 +3,41 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { Event, Emitter } from 'vs/base/common/event'; -import * as objects from 'vs/base/common/objects'; -import * as json from 'vs/base/common/json'; -import { URI as uri } from 'vs/base/common/uri'; -import * as resources from 'vs/base/common/resources'; -import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { IEditorPane } from 'vs/workbench/common/editor'; -import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { IFileService } from 'vs/platform/files/common/files'; -import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState, IWorkspaceFoldersChangeEvent } from 'vs/platform/workspace/common/workspace'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IDebugConfigurationProvider, ICompound, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, CONTEXT_DEBUG_CONFIGURATION_TYPE, IConfigPresentation, DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug'; -import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration'; -import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { launchSchema } from 'vs/workbench/contrib/debug/common/debugSchemas'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; -import { withUndefinedAsNull } from 'vs/base/common/types'; +import { distinct, flatten } from 'vs/base/common/arrays'; import { sequence } from 'vs/base/common/async'; -import { IHistoryService } from 'vs/workbench/services/history/common/history'; -import { flatten, distinct } from 'vs/base/common/arrays'; -import { getVisibleAndSorted } from 'vs/workbench/contrib/debug/common/debugUtils'; +import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; +import { Emitter, Event } from 'vs/base/common/event'; +import * as json from 'vs/base/common/json'; +import { IJSONSchema } from 'vs/base/common/jsonSchema'; +import { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle'; +import * as objects from 'vs/base/common/objects'; +import * as resources from 'vs/base/common/resources'; +import { withUndefinedAsNull } from 'vs/base/common/types'; +import { URI as uri } from 'vs/base/common/uri'; +import * as nls from 'vs/nls'; +import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IFileService } from 'vs/platform/files/common/files'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; +import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; +import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; +import { IWorkspaceContextService, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, WorkbenchState } from 'vs/platform/workspace/common/workspace'; +import { IEditorPane } from 'vs/workbench/common/editor'; import { AdapterManager } from 'vs/workbench/contrib/debug/browser/debugAdapterManager'; import { debugConfigure } from 'vs/workbench/contrib/debug/browser/debugIcons'; -import { ThemeIcon } from 'vs/platform/theme/common/themeService'; +import { CONTEXT_DEBUG_CONFIGURATION_TYPE, DebugConfigurationProviderTriggerKind, ICompound, IConfig, IConfigPresentation, IConfigurationManager, IDebugConfigurationProvider, IGlobalConfig, ILaunch } from 'vs/workbench/contrib/debug/common/debug'; +import { launchSchema } from 'vs/workbench/contrib/debug/common/debugSchemas'; +import { getVisibleAndSorted } from 'vs/workbench/contrib/debug/common/debugUtils'; +import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration'; +import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { IHistoryService } from 'vs/workbench/services/history/common/history'; +import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; +import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; const jsonRegistry = Registry.as(JSONExtensions.JSONContribution); jsonRegistry.registerSchema(launchSchemaId, launchSchema); @@ -56,6 +56,7 @@ export class ConfigurationManager implements IConfigurationManager { private selectedLaunch: ILaunch | undefined; private getSelectedConfig: () => Promise = () => Promise.resolve(undefined); private selectedType: string | undefined; + private selectedDynamic = false; private toDispose: IDisposable[]; private readonly _onDidSelectConfigurationName = new Emitter(); private configProviders: IDebugConfigurationProvider[]; @@ -279,7 +280,7 @@ export class ConfigurationManager implements IConfigurationManager { removeRecentDynamicConfigurations(name: string, type: string) { const remaining = this.getRecentDynamicConfigurations().filter(c => c.name !== name || c.type !== type); this.storageService.store(DEBUG_RECENT_DYNAMIC_CONFIGURATIONS, JSON.stringify(remaining), StorageScope.WORKSPACE, StorageTarget.USER); - if (this.selectedConfiguration.name === name && this.selectedType === type) { + if (this.selectedConfiguration.name === name && this.selectedType === type && this.selectedDynamic) { this.selectConfiguration(undefined, undefined); } else { this._onDidSelectConfigurationName.fire(); @@ -377,6 +378,7 @@ export class ConfigurationManager implements IConfigurationManager { const previousLaunch = this.selectedLaunch; const previousName = this.selectedName; + const previousSelectedDynamic = this.selectedDynamic; this.selectedLaunch = launch; if (this.selectedLaunch) { @@ -436,6 +438,7 @@ export class ConfigurationManager implements IConfigurationManager { } this.selectedType = dynamicConfig?.type || config?.type; + this.selectedDynamic = !!dynamicConfig; // Only store the selected type if we are having a dynamic configuration. Otherwise restoring this configuration from storage might be misindentified as a dynamic configuration this.storageService.store(DEBUG_SELECTED_TYPE, dynamicConfig ? this.selectedType : undefined, StorageScope.WORKSPACE, StorageTarget.MACHINE); @@ -445,7 +448,7 @@ export class ConfigurationManager implements IConfigurationManager { this.debugConfigurationTypeContext.reset(); } - if (this.selectedLaunch !== previousLaunch || this.selectedName !== previousName) { + if (this.selectedLaunch !== previousLaunch || this.selectedName !== previousName || previousSelectedDynamic !== this.selectedDynamic) { this._onDidSelectConfigurationName.fire(); } } diff --git a/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts b/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts index a3fda1a7045..435d3fac617 100644 --- a/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts +++ b/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts @@ -9,7 +9,7 @@ import { IChannel } from 'vs/base/parts/ipc/common/ipc'; import { IExtensionHostDebugService, IOpenExtensionWindowResult } from 'vs/platform/debug/common/extensionHostDebug'; import { ExtensionHostDebugBroadcastChannel, ExtensionHostDebugChannelClient } from 'vs/platform/debug/common/extensionHostDebugIpc'; import { IFileService } from 'vs/platform/files/common/files'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window'; @@ -172,4 +172,4 @@ class BrowserExtensionHostDebugService extends ExtensionHostDebugChannelClient i } } -registerSingleton(IExtensionHostDebugService, BrowserExtensionHostDebugService, true); +registerSingleton(IExtensionHostDebugService, BrowserExtensionHostDebugService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index dfcdd381ef0..971f1e341f8 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -879,6 +879,7 @@ function getReplView(viewsService: IViewsService): Repl | undefined { registerAction2(class extends Action2 { constructor() { super({ + _isFakeAction: true, id: FILTER_ACTION_ID, title: localize('filter', "Filter"), f1: false, @@ -887,7 +888,7 @@ registerAction2(class extends Action2 { group: 'navigation', when: ContextKeyExpr.equals('view', REPL_VIEW_ID), order: 10 - } + }, }); } diff --git a/src/vs/workbench/contrib/debug/browser/replViewer.ts b/src/vs/workbench/contrib/debug/browser/replViewer.ts index 94b7ecd5b13..9c4adf953f3 100644 --- a/src/vs/workbench/contrib/debug/browser/replViewer.ts +++ b/src/vs/workbench/contrib/debug/browser/replViewer.ts @@ -312,18 +312,21 @@ export class ReplDelegate extends CachedListVirtualDelegate { return super.getHeight(element); } + /** + * With wordWrap enabled, this is an estimate. With wordWrap disabled, this is the real height that the list will use. + */ protected estimateHeight(element: IReplElement, ignoreValueLength = false): number { const lineHeight = this.replOptions.replConfiguration.lineHeight; - const countNumberOfLines = (str: string) => Math.max(1, (str && str.match(/\r\n|\n/g) || []).length); + const countNumberOfLines = (str: string) => str.match(/\n/g)?.length ?? 0; const hasValue = (e: any): e is { value: string } => typeof e.value === 'string'; - // Calculate a rough overestimation for the height - // For every 70 characters increase the number of lines needed beyond the first if (hasValue(element) && !isNestedVariable(element)) { const value = element.value; - const valueRows = countNumberOfLines(value) + (ignoreValueLength ? 0 : Math.floor(value.length / 70)); + const valueRows = countNumberOfLines(value) + + (ignoreValueLength ? 0 : Math.floor(value.length / 70)) // Make an estimate for wrapping + + (element instanceof SimpleReplElement ? 0 : 1); // A SimpleReplElement ends in \n if it's a complete line - return valueRows * lineHeight; + return Math.max(valueRows, 1) * lineHeight; } return lineHeight; diff --git a/src/vs/workbench/contrib/deprecatedExtensionMigrator/browser/deprecatedExtensionMigrator.contribution.ts b/src/vs/workbench/contrib/deprecatedExtensionMigrator/browser/deprecatedExtensionMigrator.contribution.ts index 2a91d82f0d8..3abb2f55315 100644 --- a/src/vs/workbench/contrib/deprecatedExtensionMigrator/browser/deprecatedExtensionMigrator.contribution.ts +++ b/src/vs/workbench/contrib/deprecatedExtensionMigrator/browser/deprecatedExtensionMigrator.contribution.ts @@ -100,4 +100,4 @@ interface State { }[]; } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DeprecatedExtensionMigratorContribution, 'DeprecatedExtensionMigratorContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DeprecatedExtensionMigratorContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts index 146864b176f..af450bcd68e 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts @@ -10,7 +10,7 @@ import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecyc import { Action2, IAction2Options, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; import { localize } from 'vs/nls'; -import { IEditSessionsStorageService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_CATEGORY, EDIT_SESSIONS_CONTAINER_ID, EditSessionSchemaVersion, IEditSessionsLogService, EDIT_SESSIONS_VIEW_ICON, EDIT_SESSIONS_TITLE, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_SIGNED_IN, EDIT_SESSIONS_DATA_VIEW_ID, decodeEditSessionFileContent } from 'vs/workbench/contrib/editSessions/common/editSessions'; +import { IEditSessionsStorageService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_CATEGORY, EDIT_SESSIONS_CONTAINER_ID, EditSessionSchemaVersion, IEditSessionsLogService, EDIT_SESSIONS_VIEW_ICON, EDIT_SESSIONS_TITLE, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_DATA_VIEW_ID, decodeEditSessionFileContent } from 'vs/workbench/contrib/editSessions/common/editSessions'; import { ISCMRepository, ISCMService } from 'vs/workbench/contrib/scm/common/scm'; import { IFileService } from 'vs/platform/files/common/files'; import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace'; @@ -131,6 +131,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo this._register(this.fileService.registerProvider(EditSessionsFileSystemProvider.SCHEMA, new EditSessionsFileSystemProvider(this.editSessionsStorageService))); this.lifecycleService.onWillShutdown((e) => e.join(this.autoStoreEditSession(), { id: 'autoStoreEditSession', label: localize('autoStoreEditSession', 'Storing current edit session...') })); this._register(this.editSessionsStorageService.onDidSignIn(() => this.updateAccountsMenuBadge())); + this._register(this.editSessionsStorageService.onDidSignOut(() => this.updateAccountsMenuBadge())); } private autoResumeEditSession() { @@ -143,22 +144,33 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo }; this.telemetryService.publicLog2('editSessions.continue.resume'); + const shouldAutoResumeOnReload = this.configurationService.getValue('workbench.editSessions.autoResume') === 'onReload'; + if (this.environmentService.editSessionId !== undefined) { this.logService.info(`Resuming edit session, reason: found editSessionId ${this.environmentService.editSessionId} in environment service...`); await this.resumeEditSession(this.environmentService.editSessionId).finally(() => this.environmentService.editSessionId = undefined); - } else if ( - this.configurationService.getValue('workbench.editSessions.autoResume') === 'onReload' && - this.editSessionsStorageService.isSignedIn - ) { + } else if (shouldAutoResumeOnReload && this.editSessionsStorageService.isSignedIn) { this.logService.info('Resuming edit session, reason: edit sessions enabled...'); // Attempt to resume edit session based on edit workspace identifier // Note: at this point if the user is not signed into edit sessions, // we don't want them to be prompted to sign in and should just return early await this.resumeEditSession(undefined, true); - } else { + } else if (shouldAutoResumeOnReload) { // The application has previously launched via a protocol URL Continue On flow const hasApplicationLaunchedFromContinueOnFlow = this.storageService.getBoolean(EditSessionsContribution.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION, false); + const handlePendingEditSessions = () => { + // display a badge in the accounts menu but do not prompt the user to sign in again + this.updateAccountsMenuBadge(); + // attempt a resume if we are in a pending state and the user just signed in + const disposable = this.editSessionsStorageService.onDidSignIn(async () => { + disposable.dispose(); + this.resumeEditSession(undefined, true); + this.storageService.remove(EditSessionsContribution.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION); + this.environmentService.continueOn = undefined; + }); + }; + if ((this.environmentService.continueOn !== undefined) && !this.editSessionsStorageService.isSignedIn && // and user has not yet been prompted to sign in on this machine @@ -169,17 +181,14 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo if (this.editSessionsStorageService.isSignedIn) { await this.resumeEditSession(undefined, true); } else { - this.updateAccountsMenuBadge(); + handlePendingEditSessions(); } // store the fact that we prompted the user } else if (!this.editSessionsStorageService.isSignedIn && // and user has been prompted to sign in on this machine hasApplicationLaunchedFromContinueOnFlow === true ) { - // display a badge in the accounts menu but do not prompt the user to sign in again - this.updateAccountsMenuBadge(); - // attempt a resume if we are in a pending state and the user just signed in - this._register(this.editSessionsStorageService.onDidSignIn(async () => this.resumeEditSession(undefined, true))); + handlePendingEditSessions(); } } @@ -255,8 +264,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo id: 'workbench.editSessions.actions.showEditSessions', title: { value: localize('show edit session', "Show Edit Sessions"), original: 'Show Edit Sessions' }, category: EDIT_SESSION_SYNC_CATEGORY, - f1: true, - precondition: EDIT_SESSIONS_SIGNED_IN + f1: true }); } @@ -378,6 +386,10 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo this.logService.info(ref !== undefined ? `Resuming edit session with ref ${ref}...` : 'Resuming edit session...'); + if (silent && !(await this.editSessionsStorageService.initialize(false, true))) { + return; + } + const data = await this.editSessionsStorageService.read(ref); if (!data) { if (ref === undefined && !silent) { @@ -398,6 +410,9 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo try { const { changes, conflictingChanges } = await this.generateChanges(editSession, ref); + if (changes.length === 0) { + return; + } // TODO@joyceerhl Provide the option to diff files which would be overwritten by edit session contents if (conflictingChanges.length > 0) { @@ -407,13 +422,12 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo const result = await this.dialogService.show( Severity.Warning, - changes.length > 1 ? - localize('resume edit session warning many', 'Resuming your edit session will overwrite the following {0} files. Do you want to proceed?', changes.length) : - localize('resume edit session warning 1', 'Resuming your edit session will overwrite {0}. Do you want to proceed?', basename(changes[0].uri)), + conflictingChanges.length > 1 ? + localize('resume edit session warning many', 'Resuming your edit session will overwrite the following {0} files. Do you want to proceed?', conflictingChanges.length) : + localize('resume edit session warning 1', 'Resuming your edit session will overwrite {0}. Do you want to proceed?', basename(conflictingChanges[0].uri)), [cancel, yes], { - custom: true, - detail: changes.length > 1 ? getFileNamesMessage(conflictingChanges.map((c) => c.uri)) : undefined, + detail: conflictingChanges.length > 1 ? getFileNamesMessage(conflictingChanges.map((c) => c.uri)) : undefined, cancelId: 0 }); @@ -794,7 +808,7 @@ const continueEditSessionExtPoint = ExtensionsRegistry.registerExtensionPoint(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, 'EditSessionsContribution', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(EditSessionsContribution, LifecyclePhase.Restored); Registry.as(ConfigurationExtensions.Configuration).registerConfiguration({ ...workbenchConfigurationNodeBase, diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts b/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts index 7637ef73355..fcdcc89dcce 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts @@ -56,6 +56,11 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes return this._didSignIn.event; } + private _didSignOut = new Emitter(); + get onDidSignOut() { + return this._didSignOut.event; + } + constructor( @IFileService private readonly fileService: IFileService, @IStorageService private readonly storageService: IStorageService, @@ -162,11 +167,11 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes return []; } - public async initialize(fromContinueOn: boolean) { + public async initialize(fromContinueOn: boolean, silent: boolean = false) { if (this.initialized) { return true; } - this.initialized = await this.doInitialize(fromContinueOn); + this.initialized = await this.doInitialize(fromContinueOn, silent); this.signedInContext.set(this.initialized); if (this.initialized) { this._didSignIn.fire(); @@ -181,7 +186,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes * meaning that authentication is configured and it * can be used to communicate with the remote storage service */ - private async doInitialize(fromContinueOn: boolean): Promise { + private async doInitialize(fromContinueOn: boolean, silent: boolean): Promise { // Wait for authentication extensions to be registered await this.extensionService.whenInstalledExtensionsRegistered(); @@ -206,7 +211,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes return true; } - const authenticationSession = await this.getAuthenticationSession(fromContinueOn); + const authenticationSession = await this.getAuthenticationSession(fromContinueOn, silent); if (authenticationSession !== undefined) { this.#authenticationInfo = authenticationSession; this.storeClient.setAuthToken(authenticationSession.token, authenticationSession.providerId); @@ -239,7 +244,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes return currentMachineId; } - private async getAuthenticationSession(fromContinueOn: boolean) { + private async getAuthenticationSession(fromContinueOn: boolean, silent: boolean) { // If the user signed in previously and the session is still available, reuse that without prompting the user again if (this.existingSessionId) { this.logService.info(`Searching for existing authentication session with ID ${this.existingSessionId}`); @@ -247,6 +252,8 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes if (existingSession) { this.logService.info(`Found existing authentication session with ID ${existingSession.session.id}`); return { sessionId: existingSession.session.id, token: existingSession.session.idToken ?? existingSession.session.accessToken, providerId: existingSession.session.providerId }; + } else { + this._didSignOut.fire(); } } @@ -261,6 +268,12 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes } } + // If we aren't supposed to prompt the user because + // we're in a silent flow, just return here + if (silent) { + return; + } + // Ask the user to pick a preferred account const authenticationSession = await this.getAccountPreference(fromContinueOn); if (authenticationSession !== undefined) { diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts b/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts index 7a70b872e41..92e368b719a 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts @@ -10,7 +10,7 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati import { Registry } from 'vs/platform/registry/common/platform'; import { TreeView, TreeViewPane } from 'vs/workbench/browser/parts/views/treeView'; import { Extensions, ITreeItem, ITreeViewDataProvider, ITreeViewDescriptor, IViewsRegistry, TreeItemCollapsibleState, TreeViewItemHandleArg, ViewContainer } from 'vs/workbench/common/views'; -import { EDIT_SESSIONS_DATA_VIEW_ID, EDIT_SESSIONS_SCHEME, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_SIGNED_IN, EDIT_SESSIONS_SIGNED_IN_KEY, EDIT_SESSIONS_TITLE, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions'; +import { EDIT_SESSIONS_DATA_VIEW_ID, EDIT_SESSIONS_SCHEME, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_TITLE, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions'; import { URI } from 'vs/base/common/uri'; import { fromNow } from 'vs/base/common/date'; import { Codicon } from 'vs/base/common/codicons'; @@ -54,7 +54,7 @@ export class EditSessionsDataViews extends Disposable { canMoveView: false, treeView, collapsed: false, - when: ContextKeyExpr.and(EDIT_SESSIONS_SIGNED_IN, EDIT_SESSIONS_SHOW_VIEW), + when: ContextKeyExpr.and(EDIT_SESSIONS_SHOW_VIEW), order: 100, hideByDefault: true, }], container); @@ -69,7 +69,7 @@ export class EditSessionsDataViews extends Disposable { localize('storeEditSessionTitle', 'Store Edit Session') ) ), - when: ContextKeyExpr.and(ContextKeyExpr.equals(EDIT_SESSIONS_SIGNED_IN_KEY, true), ContextKeyExpr.equals(EDIT_SESSIONS_COUNT_KEY, 0)), + when: ContextKeyExpr.equals(EDIT_SESSIONS_COUNT_KEY, 0), order: 1 }); @@ -208,7 +208,8 @@ class EditSessionDataViewDataProvider implements ITreeViewDataProvider { const sessionData = await this.editSessionsStorageService.read(session.ref); const label = sessionData?.editSession.folders.map((folder) => folder.name).join(', ') ?? session.ref; const machineId = sessionData?.editSession.machine; - const description = machineId === undefined ? fromNow(session.created, true) : `${fromNow(session.created, true)}\u00a0\u00a0\u2022\u00a0\u00a0${await this.editSessionsStorageService.getMachineById(machineId)}`; + const machineName = machineId ? await this.editSessionsStorageService.getMachineById(machineId) : undefined; + const description = machineName === undefined ? fromNow(session.created, true) : `${fromNow(session.created, true)}\u00a0\u00a0\u2022\u00a0\u00a0${machineName}`; editSessions.push({ handle: resource.toString(), diff --git a/src/vs/workbench/contrib/editSessions/common/editSessions.ts b/src/vs/workbench/contrib/editSessions/common/editSessions.ts index f9b84cf5bc0..99e5c8a16cc 100644 --- a/src/vs/workbench/contrib/editSessions/common/editSessions.ts +++ b/src/vs/workbench/contrib/editSessions/common/editSessions.ts @@ -25,8 +25,9 @@ export interface IEditSessionsStorageService { readonly isSignedIn: boolean; readonly onDidSignIn: Event; + readonly onDidSignOut: Event; - initialize(fromContinueOn: boolean): Promise; + initialize(fromContinueOn: boolean, silent?: boolean): Promise; read(ref: string | undefined): Promise<{ ref: string; editSession: EditSession } | undefined>; write(editSession: EditSession): Promise; delete(ref: string | null): Promise; diff --git a/src/vs/workbench/contrib/editSessions/test/browser/editSessions.test.ts b/src/vs/workbench/contrib/editSessions/test/browser/editSessions.test.ts index a766a535095..3bcd8b1d946 100644 --- a/src/vs/workbench/contrib/editSessions/test/browser/editSessions.test.ts +++ b/src/vs/workbench/contrib/editSessions/test/browser/editSessions.test.ts @@ -68,6 +68,7 @@ suite('Edit session sync', () => { instantiationService.stub(INotificationService, new TestNotificationService()); instantiationService.stub(IEditSessionsStorageService, new class extends mock() { override onDidSignIn = Event.None; + override onDidSignOut = Event.None; }); instantiationService.stub(IProgressService, ProgressService); instantiationService.stub(ISCMService, SCMService); diff --git a/src/vs/workbench/contrib/experiments/browser/experiments.contribution.ts b/src/vs/workbench/contrib/experiments/browser/experiments.contribution.ts index 2dc9b0f9303..c2d36360806 100644 --- a/src/vs/workbench/contrib/experiments/browser/experiments.contribution.ts +++ b/src/vs/workbench/contrib/experiments/browser/experiments.contribution.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IExperimentService, ExperimentService } from 'vs/workbench/contrib/experiments/common/experimentService'; import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; @@ -13,9 +13,9 @@ import { ExperimentalPrompts } from 'vs/workbench/contrib/experiments/browser/ex import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; -registerSingleton(IExperimentService, ExperimentService, true); +registerSingleton(IExperimentService, ExperimentService, InstantiationType.Delayed); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExperimentalPrompts, 'ExperimentalPrompts', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExperimentalPrompts, LifecyclePhase.Eventually); const registry = Registry.as(ConfigurationExtensions.Configuration); diff --git a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts index e9d58bface0..6eb6663c74c 100644 --- a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts @@ -35,7 +35,7 @@ import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { RuntimeExtensionsInput } from 'vs/workbench/contrib/extensions/common/runtimeExtensionsInput'; import { Action2, MenuId } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; interface IExtensionProfileInformation { @@ -491,7 +491,7 @@ export class ShowRuntimeExtensionsAction extends Action2 { super({ id: 'workbench.action.showRuntimeExtensions', title: { value: nls.localize('showRuntimeExtensions', "Show Running Extensions"), original: 'Show Running Extensions' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, menu: { id: MenuId.ViewContainerTitle, diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 96449b7b363..65d0cc03d7e 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -29,7 +29,7 @@ import { UpdateAction, ReloadAction, EnableDropDownAction, DisableDropDownAction, ExtensionStatusLabelAction, SetFileIconThemeAction, SetColorThemeAction, RemoteInstallAction, ExtensionStatusAction, LocalInstallAction, ToggleSyncExtensionAction, SetProductIconThemeAction, ActionWithDropDownAction, InstallDropdownAction, InstallingLabelAction, UninstallAction, ExtensionActionWithDropdownActionViewItem, ExtensionDropDownAction, - InstallAnotherVersionAction, ExtensionEditorManageExtensionAction, WebInstallAction, SwitchToPreReleaseVersionAction, SwitchToReleasedVersionAction, MigrateDeprecatedExtensionAction, SetLanguageAction, ClearLanguageAction + InstallAnotherVersionAction, ExtensionEditorManageExtensionAction, WebInstallAction, SwitchToPreReleaseVersionAction, SwitchToReleasedVersionAction, MigrateDeprecatedExtensionAction, SetLanguageAction, ClearLanguageAction, SkipUpdateAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; @@ -322,7 +322,8 @@ export class ExtensionEditor extends EditorPane { const actions = [ this.instantiationService.createInstance(ReloadAction), this.instantiationService.createInstance(ExtensionStatusLabelAction), - this.instantiationService.createInstance(UpdateAction), + this.instantiationService.createInstance(ActionWithDropDownAction, 'extensions.updateActions', '', + [[this.instantiationService.createInstance(UpdateAction)], [this.instantiationService.createInstance(SkipUpdateAction)]]), this.instantiationService.createInstance(SetColorThemeAction), this.instantiationService.createInstance(SetFileIconThemeAction), this.instantiationService.createInstance(SetProductIconThemeAction), @@ -674,7 +675,7 @@ export class ExtensionEditor extends EditorPane { private async openMarkdown(cacheResult: CacheResult, noContentCopy: string, container: HTMLElement, webviewIndex: WebviewIndex, token: CancellationToken): Promise { try { - const body = await this.renderMarkdown(cacheResult, container); + const body = await this.renderMarkdown(cacheResult, container, token); if (token.isCancellationRequested) { return Promise.resolve(null); } @@ -741,13 +742,21 @@ export class ExtensionEditor extends EditorPane { } } - private async renderMarkdown(cacheResult: CacheResult, container: HTMLElement) { + private async renderMarkdown(cacheResult: CacheResult, container: HTMLElement, token?: CancellationToken): Promise { const contents = await this.loadContents(() => cacheResult, container); - const content = await renderMarkdownDocument(contents, this.extensionService, this.languageService); + if (token?.isCancellationRequested) { + return ''; + } + + const content = await renderMarkdownDocument(contents, this.extensionService, this.languageService, true, false, token); + if (token?.isCancellationRequested) { + return ''; + } + return this.renderBody(content); } - private async renderBody(body: string): Promise { + private renderBody(body: string): string { const nonce = generateUuid(); const colorMap = TokenizationRegistry.getColorMap(); const css = colorMap ? generateTokensCSSForColorMap(colorMap) : ''; @@ -1171,7 +1180,14 @@ export class ExtensionEditor extends EditorPane { } else if (configuration) { properties = configuration.properties; } - const contrib = properties ? Object.keys(properties) : []; + + let contrib = properties ? Object.keys(properties) : []; + + // filter deprecated settings + contrib = contrib.filter(key => { + const config = properties[key]; + return !config.deprecationMessage && !config.markdownDeprecationMessage; + }); if (!contrib.length) { return false; @@ -1186,7 +1202,7 @@ export class ExtensionEditor extends EditorPane { $('th', undefined, localize('default', "Default")) ), ...contrib.map(key => { - let description: (Node | string) = properties[key].description; + let description: (Node | string) = properties[key].description || ''; if (properties[key].markdownDescription) { const { element, dispose } = renderMarkdown({ value: properties[key].markdownDescription }, { actionHandler: { callback: (content) => this.openerService.open(content).catch(onUnexpectedError), disposables: this.contentDisposables } }); description = element; diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts index 41169964b15..1519416d891 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts @@ -14,7 +14,7 @@ import { IExtensionIgnoredRecommendationsService, IExtensionRecommendationsServi import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/services/output/common/output'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { VIEWLET_ID, IExtensionsWorkbenchService, IExtensionsViewPaneContainer, TOGGLE_IGNORE_EXTENSION_ACTION_ID, INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID, WORKSPACE_RECOMMENDATIONS_VIEW_ID, IWorkspaceRecommendedExtensionsView, AutoUpdateConfigurationKey, HasOutdatedExtensionsContext, SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID, LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID, ExtensionEditorTab, THEME_ACTIONS_GROUP, INSTALL_ACTIONS_GROUP } from 'vs/workbench/contrib/extensions/common/extensions'; +import { VIEWLET_ID, IExtensionsWorkbenchService, IExtensionsViewPaneContainer, TOGGLE_IGNORE_EXTENSION_ACTION_ID, INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID, WORKSPACE_RECOMMENDATIONS_VIEW_ID, IWorkspaceRecommendedExtensionsView, AutoUpdateConfigurationKey, HasOutdatedExtensionsContext, SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID, LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID, ExtensionEditorTab, THEME_ACTIONS_GROUP, INSTALL_ACTIONS_GROUP, OUTDATED_EXTENSIONS_VIEW_ID } from 'vs/workbench/contrib/extensions/common/extensions'; import { ReinstallAction, InstallSpecificVersionOfExtensionAction, ConfigureWorkspaceRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction, PromptExtensionInstallFailureAction, SearchExtensionsAction, SwitchToPreReleaseVersionAction, SwitchToReleasedVersionAction, SetColorThemeAction, SetFileIconThemeAction, SetProductIconThemeAction, ClearLanguageAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; import { ExtensionEditor } from 'vs/workbench/contrib/extensions/browser/extensionEditor'; @@ -46,7 +46,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { MultiCommand } from 'vs/editor/browser/editorExtensions'; import { IWebview } from 'vs/workbench/contrib/webview/browser/webview'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations'; import { ExtensionRecommendationNotificationService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService'; import { IExtensionService, toExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; @@ -81,7 +81,7 @@ import { IStringDictionary } from 'vs/base/common/collections'; // Singletons registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService, InstantiationType.Eager /* Auto updates extensions */); -registerSingleton(IExtensionRecommendationNotificationService, ExtensionRecommendationNotificationService, true); +registerSingleton(IExtensionRecommendationNotificationService, ExtensionRecommendationNotificationService, InstantiationType.Delayed); registerSingleton(IExtensionRecommendationsService, ExtensionRecommendationsService, InstantiationType.Eager /* Prompts recommendations in the background */); Registry.as(OutputExtensions.OutputChannels) @@ -653,15 +653,23 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi title: { value: localize('updateAll', "Update All Extensions"), original: 'Update All Extensions' }, category: ExtensionsLocalizedLabel, precondition: HasOutdatedExtensionsContext, - menu: [{ - id: MenuId.CommandPalette, - when: ContextKeyExpr.and(CONTEXT_HAS_GALLERY, ContextKeyExpr.or(CONTEXT_HAS_LOCAL_SERVER, CONTEXT_HAS_REMOTE_SERVER, CONTEXT_HAS_WEB_SERVER)) - }, { - id: MenuId.ViewContainerTitle, - when: ContextKeyExpr.and(ContextKeyExpr.equals('viewContainer', VIEWLET_ID), ContextKeyExpr.or(ContextKeyExpr.has(`config.${AutoUpdateConfigurationKey}`).negate(), ContextKeyExpr.equals(`config.${AutoUpdateConfigurationKey}`, 'onlyEnabledExtensions'))), - group: '1_updates', - order: 2 - }], + menu: [ + { + id: MenuId.CommandPalette, + when: ContextKeyExpr.and(CONTEXT_HAS_GALLERY, ContextKeyExpr.or(CONTEXT_HAS_LOCAL_SERVER, CONTEXT_HAS_REMOTE_SERVER, CONTEXT_HAS_WEB_SERVER)) + }, { + id: MenuId.ViewContainerTitle, + when: ContextKeyExpr.and(ContextKeyExpr.equals('viewContainer', VIEWLET_ID), ContextKeyExpr.or(ContextKeyExpr.has(`config.${AutoUpdateConfigurationKey}`).negate(), ContextKeyExpr.equals(`config.${AutoUpdateConfigurationKey}`, 'onlyEnabledExtensions'))), + group: '1_updates', + order: 2 + }, { + id: MenuId.ViewTitle, + when: ContextKeyExpr.equals('view', OUTDATED_EXTENSIONS_VIEW_ID), + group: 'navigation', + order: 1 + } + ], + icon: installWorkspaceRecommendedIcon, run: () => { return Promise.all(this.extensionsWorkbenchService.outdated.map(async extension => { try { @@ -830,7 +838,7 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi this.registerExtensionAction({ id: 'workbench.extensions.action.installWebExtensionFromLocation', title: { value: localize('installWebExtensionFromLocation', "Install Web Extension..."), original: 'Install Web Extension...' }, - category: CATEGORIES.Developer, + category: Categories.Developer, menu: [{ id: MenuId.CommandPalette, when: ContextKeyExpr.or(CONTEXT_HAS_WEB_SERVER) @@ -1182,7 +1190,7 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi this.registerExtensionAction({ id: ReinstallAction.ID, title: { value: ReinstallAction.LABEL, original: 'Reinstall Extension...' }, - category: CATEGORIES.Developer, + category: Categories.Developer, menu: { id: MenuId.CommandPalette, when: ContextKeyExpr.and(CONTEXT_HAS_GALLERY, ContextKeyExpr.or(CONTEXT_HAS_LOCAL_SERVER, CONTEXT_HAS_REMOTE_SERVER)) @@ -1580,18 +1588,18 @@ class ExtensionStorageCleaner implements IWorkbenchContribution { } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(ExtensionsContributions, 'ExtensionsContributions', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(StatusUpdater, 'StatusUpdater', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(MaliciousExtensionChecker, 'MaliciousExtensionChecker', LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(KeymapExtensions, 'KeymapExtensions', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(ExtensionsViewletViewsContribution, 'ExtensionsViewletViewsContribution', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(ExtensionActivationProgress, 'ExtensionActivationProgress', LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(ExtensionDependencyChecker, 'ExtensionDependencyChecker', LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(ExtensionEnablementWorkspaceTrustTransitionParticipant, 'ExtensionEnablementWorkspaceTrustTransitionParticipant', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(ExtensionsCompletionItemsProvider, 'ExtensionsCompletionItemsProvider', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(UnsupportedExtensionsMigrationContrib, 'UnsupportedExtensionsMigrationContrib', LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(ExtensionsContributions, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(StatusUpdater, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(MaliciousExtensionChecker, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(KeymapExtensions, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(ExtensionsViewletViewsContribution, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(ExtensionActivationProgress, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(ExtensionDependencyChecker, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(ExtensionEnablementWorkspaceTrustTransitionParticipant, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(ExtensionsCompletionItemsProvider, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(UnsupportedExtensionsMigrationContrib, LifecyclePhase.Eventually); if (isWeb) { - workbenchRegistry.registerWorkbenchContribution(ExtensionStorageCleaner, 'ExtensionStorageCleaner', LifecyclePhase.Eventually); + workbenchRegistry.registerWorkbenchContribution(ExtensionStorageCleaner, LifecyclePhase.Eventually); } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts index 634dd88be4e..102fec7ea15 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts @@ -802,18 +802,18 @@ export class UninstallAction extends ExtensionAction { } } -export class UpdateAction extends ExtensionAction { +abstract class AbstractUpdateAction extends ExtensionAction { private static readonly EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} prominent update`; - private static readonly DisabledClass = `${UpdateAction.EnabledClass} disabled`; + private static readonly DisabledClass = `${AbstractUpdateAction.EnabledClass} disabled`; private readonly updateThrottler = new Throttler(); constructor( - @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, - @IInstantiationService private readonly instantiationService: IInstantiationService, + id: string, label: string | undefined, + protected readonly extensionsWorkbenchService: IExtensionsWorkbenchService, ) { - super(`extensions.update`, '', UpdateAction.DisabledClass, false); + super(id, label, AbstractUpdateAction.DisabledClass, false); this.update(); } @@ -824,7 +824,6 @@ export class UpdateAction extends ExtensionAction { private async computeAndUpdateEnablement(): Promise { this.enabled = false; this.class = UpdateAction.DisabledClass; - this.label = this.getLabel(); if (!this.extension) { return; @@ -838,8 +837,17 @@ export class UpdateAction extends ExtensionAction { const isInstalled = this.extension.state === ExtensionState.Installed; this.enabled = canInstall && isInstalled && this.extension.outdated; - this.class = this.enabled ? UpdateAction.EnabledClass : UpdateAction.DisabledClass; - this.label = this.getLabel(this.extension); + this.class = this.enabled ? AbstractUpdateAction.EnabledClass : AbstractUpdateAction.DisabledClass; + } +} + +export class UpdateAction extends AbstractUpdateAction { + + constructor( + @IExtensionsWorkbenchService override readonly extensionsWorkbenchService: IExtensionsWorkbenchService, + @IInstantiationService protected readonly instantiationService: IInstantiationService, + ) { + super(`extensions.update`, localize('update', "Update"), extensionsWorkbenchService); } override async run(): Promise { @@ -858,15 +866,35 @@ export class UpdateAction extends ExtensionAction { this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, InstallOperation.Update, undefined, err).run(); } } +} - private getLabel(extension?: IExtension): string { - if (!extension?.outdated) { - return localize('updateAction', "Update"); +export class SkipUpdateAction extends AbstractUpdateAction { + + constructor( + @IExtensionsWorkbenchService override readonly extensionsWorkbenchService: IExtensionsWorkbenchService + ) { + super(`extensions.ignoreUpdates`, localize('ignoreUpdates', "Ignore Updates"), extensionsWorkbenchService); + } + + override update() { + if (!this.extension) { + return; } - if (extension.outdatedTargetPlatform) { - return localize('updateToTargetPlatformVersion', "Update to {0} version", TargetPlatformToString(extension.gallery!.properties.targetPlatform)); + if (this.extension.isBuiltin) { + this.enabled = false; + return; } - return localize('updateToLatestVersion', "Update to {0}", extension.latestVersion); + super.update(); + this._checked = this.extensionsWorkbenchService.isExtensionIgnoresUpdates(this.extension); + } + + override async run(): Promise { + if (!this.extension) { + return; + } + alert(localize('ignoreExtensionUpdate', "Ignoring {0} updates", this.extension.displayName)); + const newIgnoresAutoUpdates = !this.extensionsWorkbenchService.isExtensionIgnoresUpdates(this.extension); + this.extensionsWorkbenchService.setExtensionIgnoresUpdate(this.extension, newIgnoresAutoUpdates); } } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsList.ts b/src/vs/workbench/contrib/extensions/browser/extensionsList.ts index 931710ee3d5..7c9a3c17f22 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsList.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsList.ts @@ -13,7 +13,7 @@ import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; import { IPagedRenderer } from 'vs/base/browser/ui/list/listPaging'; import { Event } from 'vs/base/common/event'; import { IExtension, ExtensionContainers, ExtensionState, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; -import { UpdateAction, ManageExtensionAction, ReloadAction, ExtensionStatusLabelAction, RemoteInstallAction, ExtensionStatusAction, LocalInstallAction, ActionWithDropDownAction, InstallDropdownAction, InstallingLabelAction, ExtensionActionWithDropdownActionViewItem, ExtensionDropDownAction, WebInstallAction, SwitchToPreReleaseVersionAction, SwitchToReleasedVersionAction, MigrateDeprecatedExtensionAction, SetLanguageAction, ClearLanguageAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; +import { ManageExtensionAction, ReloadAction, ExtensionStatusLabelAction, RemoteInstallAction, ExtensionStatusAction, LocalInstallAction, ActionWithDropDownAction, InstallDropdownAction, InstallingLabelAction, ExtensionActionWithDropdownActionViewItem, ExtensionDropDownAction, WebInstallAction, SwitchToPreReleaseVersionAction, SwitchToReleasedVersionAction, MigrateDeprecatedExtensionAction, SetLanguageAction, ClearLanguageAction, UpdateAction, SkipUpdateAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { RatingsWidget, InstallCountWidget, RecommendationWidget, RemoteBadgeWidget, ExtensionPackCountWidget as ExtensionPackBadgeWidget, SyncIgnoredWidget, ExtensionHoverWidget, ExtensionActivationStatusWidget, PreReleaseBookmarkWidget, extensionVerifiedPublisherIconColor } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets'; import { IExtensionService, toExtension } from 'vs/workbench/services/extensions/common/extensions'; @@ -120,7 +120,8 @@ export class Renderer implements IPagedRenderer { this.instantiationService.createInstance(ExtensionStatusLabelAction), this.instantiationService.createInstance(MigrateDeprecatedExtensionAction, true), reloadAction, - this.instantiationService.createInstance(UpdateAction), + this.instantiationService.createInstance(ActionWithDropDownAction, 'extensions.updateActions', '', + [[this.instantiationService.createInstance(UpdateAction)], [this.instantiationService.createInstance(SkipUpdateAction)]]), this.instantiationService.createInstance(InstallDropdownAction), this.instantiationService.createInstance(InstallingLabelAction), this.instantiationService.createInstance(SetLanguageAction), diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts index fb9c4ee55ab..b986e34b545 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts @@ -16,7 +16,7 @@ import { append, $, Dimension, hide, show, DragAndDropObserver } from 'vs/base/b import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { IExtensionsWorkbenchService, IExtensionsViewPaneContainer, VIEWLET_ID, CloseExtensionDetailsOnViewChangeKey, INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID, WORKSPACE_RECOMMENDATIONS_VIEW_ID, AutoCheckUpdatesConfigurationKey } from '../common/extensions'; +import { IExtensionsWorkbenchService, IExtensionsViewPaneContainer, VIEWLET_ID, CloseExtensionDetailsOnViewChangeKey, INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID, WORKSPACE_RECOMMENDATIONS_VIEW_ID, AutoCheckUpdatesConfigurationKey, OUTDATED_EXTENSIONS_VIEW_ID } from '../common/extensions'; import { InstallLocalExtensionsInRemoteAction, InstallRemoteExtensionsInLocalAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IWorkbenchExtensionEnablementService, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; @@ -328,7 +328,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio * View used for searching outdated extensions */ viewDescriptors.push({ - id: 'workbench.views.extensions.searchOutdated', + id: OUTDATED_EXTENSIONS_VIEW_ID, name: localize('availableUpdates', "Available Updates"), ctorDescriptor: new SyncDescriptor(OutdatedExtensionsView, [{}]), when: ContextKeyExpr.or(SearchExtensionUpdatesContext, ContextKeyExpr.has('searchOutdatedExtensions')), @@ -800,14 +800,14 @@ export class StatusUpdater extends Disposable implements IWorkbenchContribution @IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService ) { super(); - this._register(extensionsWorkbenchService.onChange(this.onServiceChange, this)); + this._register(Event.debounce(extensionsWorkbenchService.onChange, () => undefined, 100, undefined, undefined, this._store)(this.onServiceChange, this)); } private onServiceChange(): void { this.badgeHandle.clear(); const extensionsReloadRequired = this.extensionsWorkbenchService.installed.filter(e => e.reloadRequiredStatus !== undefined); - const outdated = this.extensionsWorkbenchService.outdated.reduce((r, e) => r + (this.extensionEnablementService.isEnabled(e.local!) && !extensionsReloadRequired.includes(e) ? 1 : 0), 0); + const outdated = this.extensionsWorkbenchService.outdated.reduce((r, e) => r + (this.extensionEnablementService.isEnabled(e.local!) && !this.extensionsWorkbenchService.isExtensionIgnoresUpdates(e) && !extensionsReloadRequired.includes(e) ? 1 : 0), 0); const newBadgeNumber = outdated + extensionsReloadRequired.length; if (newBadgeNumber > 0) { let msg = ''; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts index ec3821e1885..575a220bc18 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts @@ -512,16 +512,18 @@ export class ExtensionsListView extends ViewPane { value = value.replace(/@installed/g, '').replace(/@sort:(\w+)(-\w*)?/g, '').trim().toLowerCase(); - let result = local - .filter(e => !e.isBuiltin - && (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1) - && (!categories.length || categories.some(category => (e.local && e.local.manifest.categories || []).some(c => c.toLowerCase() === category)))); + const matchingText = (e: IExtension) => (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1) + && (!categories.length || categories.some(category => (e.local && e.local.manifest.categories || []).some(c => c.toLowerCase() === category))); + let result; if (options.sortBy !== undefined) { + result = local.filter(e => !e.isBuiltin && matchingText(e)); result = this.sortExtensions(result, options); } else { + result = local.filter(e => (!e.isBuiltin || e.outdated || e.reloadRequiredStatus !== undefined) && matchingText(e)); const runningExtensionsById = runningExtensions.reduce((result, e) => { result.set(ExtensionIdentifier.toKey(e.identifier.value), e); return result; }, new Map()); - result = result.sort((e1, e2) => { + + const defaultSort = (e1: IExtension, e2: IExtension) => { const running1 = runningExtensionsById.get(ExtensionIdentifier.toKey(e1.identifier.id)); const isE1Running = !!running1 && this.extensionManagementServerService.getExtensionManagementServer(toExtension(running1)) === e1.server; const running2 = runningExtensionsById.get(ExtensionIdentifier.toKey(e2.identifier.id)); @@ -544,7 +546,24 @@ export class ExtensionsListView extends ViewPane { return e1.displayName.localeCompare(e2.displayName); } return isE1Running ? -1 : 1; + }; + + const outdated: IExtension[] = []; + const reloadRequired: IExtension[] = []; + const noActionRequired: IExtension[] = []; + result.forEach(e => { + if (e.outdated && !this.extensionsWorkbenchService.isExtensionIgnoresUpdates(e)) { + outdated.push(e); + } + else if (e.reloadRequiredStatus) { + reloadRequired.push(e); + } + else { + noActionRequired.push(e); + } }); + + result = [...outdated.sort(defaultSort), ...reloadRequired.sort(defaultSort), ...noActionRequired.sort(defaultSort)]; } return result; } @@ -663,7 +682,7 @@ export class ExtensionsListView extends ViewPane { private filterRecentlyUpdatedExtensions(local: IExtension[], query: Query, options: IQueryOptions): IExtension[] { let { value, categories } = this.parseCategories(query.value); const currentTime = Date.now(); - local = local.filter(e => !e.isBuiltin && e.local?.installedTimestamp !== undefined && currentTime - e.local.installedTimestamp < ExtensionsListView.RECENT_UPDATE_DURATION); + local = local.filter(e => !e.isBuiltin && !e.outdated && e.local?.updated && e.local?.installedTimestamp !== undefined && currentTime - e.local.installedTimestamp < ExtensionsListView.RECENT_UPDATE_DURATION); value = value.replace(/@recentlyUpdated/g, '').replace(/@sort:(\w+)(-\w*)?/g, '').trim().toLowerCase(); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index 4dda6675f73..542534bada3 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -1587,14 +1587,15 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension for (const extension of toCheck) { checked.push(extension); } - const extensionsToDisable = installed.filter(i => { + const extensionsToEanbleOrDisable = installed.filter(i => { if (checked.indexOf(i) !== -1) { return false; } - if (i.enablementState === enablementState) { + const enable = enablementState === EnablementState.EnabledGlobally || enablementState === EnablementState.EnabledWorkspace; + const isExtensionEnabled = i.enablementState === EnablementState.EnabledGlobally || i.enablementState === EnablementState.EnabledWorkspace; + if (enable === isExtensionEnabled) { return false; } - const enable = enablementState === EnablementState.EnabledGlobally || enablementState === EnablementState.EnabledWorkspace; return (enable || !i.isBuiltin) // Include all Extensions for enablement and only non builtin extensions for disablement && (options.dependencies || options.pack) && extensions.some(extension => @@ -1602,10 +1603,10 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension || (options.pack && extension.extensionPack.some(id => areSameExtensions({ id }, i.identifier))) ); }); - if (extensionsToDisable.length) { - extensionsToDisable.push(...this.getExtensionsRecursively(extensionsToDisable, installed, enablementState, options, checked)); + if (extensionsToEanbleOrDisable.length) { + extensionsToEanbleOrDisable.push(...this.getExtensionsRecursively(extensionsToEanbleOrDisable, installed, enablementState, options, checked)); } - return extensionsToDisable; + return extensionsToEanbleOrDisable; } return []; } @@ -1770,6 +1771,24 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension } } + setExtensionIgnoresUpdate(extension: IExtension, ignoreAutoUpate: boolean): void { + const extensionKey = new ExtensionKey(extension.identifier, extension.version); + if (ignoreAutoUpate) { + this.ignoreAutoUpdate(extensionKey); + } + else if (this.isAutoUpdateIgnored(extensionKey)) { + this.ignoredAutoUpdateExtensions = this.ignoredAutoUpdateExtensions.filter(extensionId => extensionId !== extensionKey.toString()); + } + else { + return; + } + this._onChange.fire(extension); + } + + isExtensionIgnoresUpdates(extension: IExtension): boolean { + return this.isAutoUpdateIgnored(new ExtensionKey(extension.identifier, extension.version)); + } + private isAutoUpdateIgnored(extensionKey: ExtensionKey): boolean { return this.ignoredAutoUpdateExtensions.indexOf(extensionKey.toString()) !== -1; } diff --git a/src/vs/workbench/contrib/extensions/common/extensions.ts b/src/vs/workbench/contrib/extensions/common/extensions.ts index 9b6ca4e0345..e01cdeee918 100644 --- a/src/vs/workbench/contrib/extensions/common/extensions.ts +++ b/src/vs/workbench/contrib/extensions/common/extensions.ts @@ -111,6 +111,8 @@ export interface IExtensionsWorkbenchService { canSetLanguage(extension: IExtension): boolean; setLanguage(extension: IExtension): Promise; setEnablement(extensions: IExtension | IExtension[], enablementState: EnablementState): Promise; + setExtensionIgnoresUpdate(extension: IExtension, ignoreAutoUpate: boolean): void; + isExtensionIgnoresUpdates(extension: IExtension): boolean; open(extension: IExtension, options?: IExtensionEditorOptions): Promise; checkForUpdates(): Promise; getExtensionStatus(extension: IExtension): IExtensionsStatus | undefined; @@ -181,6 +183,7 @@ export class ExtensionContainers extends Disposable { } export const WORKSPACE_RECOMMENDATIONS_VIEW_ID = 'workbench.views.extensions.workspaceRecommendations'; +export const OUTDATED_EXTENSIONS_VIEW_ID = 'workbench.views.extensions.searchOutdated'; export const TOGGLE_IGNORE_EXTENSION_ACTION_ID = 'workbench.extensions.action.toggleIgnoreExtension'; export const SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID = 'workbench.extensions.action.installVSIX'; export const INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID = 'workbench.extensions.command.installFromVSIX'; 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 4af6ab2713f..eeb6f4d4c6b 100644 --- a/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts @@ -25,12 +25,12 @@ 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 { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; // Singletons -registerSingleton(IExtensionHostProfileService, ExtensionHostProfileService, true); +registerSingleton(IExtensionHostProfileService, ExtensionHostProfileService, InstantiationType.Delayed); // Running Extensions Editor Registry.as(EditorExtensions.EditorPane).registerEditorPane( @@ -67,9 +67,9 @@ class ExtensionsContributions implements IWorkbenchContribution { } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(ExtensionsContributions, 'ExtensionsContributions', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(ExtensionsAutoProfiler, 'ExtensionsAutoProfiler', LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(RemoteExtensionsInitializerContribution, 'RemoteExtensionsInitializerContribution', LifecyclePhase.Restored); +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/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 7b468431a75..4b6b310e139 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 @@ -68,7 +68,7 @@ let installEvent: Emitter, let disposables: DisposableStore; -async function setupTest() { +function setupTest() { disposables = new DisposableStore(); installEvent = new Emitter(); didInstallEvent = new Emitter(); @@ -415,11 +415,22 @@ suite('ExtensionsActions', () => { instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(gallery)); instantiationService.stubPromise(IExtensionGalleryService, 'getCompatibleExtension', gallery); instantiationService.stubPromise(IExtensionGalleryService, 'getExtensions', [gallery]); - await instantiationService.get(IExtensionsWorkbenchService).queryGallery(CancellationToken.None); - const promise = Event.toPromise(testObject.onDidChange); - installEvent.fire({ identifier: local.identifier, source: gallery }); - await promise; - assert.ok(!testObject.enabled); + await new Promise(c => { + testObject.onDidChange(() => { + if (testObject.enabled) { + c(); + } + }); + instantiationService.get(IExtensionsWorkbenchService).queryGallery(CancellationToken.None); + }); + await new Promise(c => { + testObject.onDidChange(() => { + if (!testObject.enabled) { + c(); + } + }); + installEvent.fire({ identifier: local.identifier, source: gallery }); + }); }); test('Test ManageExtensionAction when there is no extension', () => { diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 123c8cb5676..e85ca87d7cd 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -47,6 +47,7 @@ import { Schemas } from 'vs/base/common/network'; import { platform } from 'vs/base/common/platform'; import { arch } from 'vs/base/common/process'; import { IProductService } from 'vs/platform/product/common/productService'; +import { CancellationToken } from 'vs/base/common/cancellation'; suite('ExtensionsViews Tests', () => { @@ -58,13 +59,15 @@ suite('ExtensionsViews Tests', () => { didUninstallEvent: Emitter; const localEnabledTheme = aLocalExtension('first-enabled-extension', { categories: ['Themes', 'random'] }, { installedTimestamp: 123456 }); - const localEnabledLanguage = aLocalExtension('second-enabled-extension', { categories: ['Programming languages'] }, { installedTimestamp: Date.now() }); + const localEnabledLanguage = aLocalExtension('second-enabled-extension', { categories: ['Programming languages'], version: '1.0.0' }, { installedTimestamp: Date.now(), updated: false }); const localDisabledTheme = aLocalExtension('first-disabled-extension', { categories: ['themes'] }, { installedTimestamp: 234567 }); - const localDisabledLanguage = aLocalExtension('second-disabled-extension', { categories: ['programming languages'] }, { installedTimestamp: Date.now() - 50000 }); + const localDisabledLanguage = aLocalExtension('second-disabled-extension', { categories: ['programming languages'] }, { installedTimestamp: Date.now() - 50000, updated: true }); const localRandom = aLocalExtension('random-enabled-extension', { categories: ['random'] }, { installedTimestamp: 345678 }); const builtInTheme = aLocalExtension('my-theme', { contributes: { themes: ['my-theme'] } }, { type: ExtensionType.System, installedTimestamp: 222 }); const builtInBasic = aLocalExtension('my-lang', { contributes: { grammars: [{ language: 'my-language' }] } }, { type: ExtensionType.System, installedTimestamp: 666666 }); + const galleryEnabledLanguage = aGalleryExtension(localEnabledLanguage.manifest.name, { ...localEnabledLanguage.manifest, version: '1.0.1', identifier: localDisabledLanguage.identifier }); + const workspaceRecommendationA = aGalleryExtension('workspace-recommendation-A'); const workspaceRecommendationB = aGalleryExtension('workspace-recommendation-B'); const configBasedRecommendationA = aGalleryExtension('configbased-recommendation-A'); @@ -100,7 +103,8 @@ suite('ExtensionsViews Tests', () => { async getInstalled() { return []; }, async canInstall() { return true; }, async getExtensionsControlManifest() { return { malicious: [], deprecated: {} }; }, - async getTargetPlatform() { return getTargetPlatform(platform, arch); } + async getTargetPlatform() { return getTargetPlatform(platform, arch); }, + async updateMetadata(local) { return local; } }); instantiationService.stub(IRemoteAgentService, RemoteAgentService); instantiationService.stub(IContextKeyService, new MockContextKeyService()); @@ -165,8 +169,9 @@ suite('ExtensionsViews Tests', () => { setup(async () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localEnabledTheme, localEnabledLanguage, localRandom, localDisabledTheme, localDisabledLanguage, builtInTheme, builtInBasic]); instantiationService.stubPromise(IExtensionManagementService, 'getExtensgetExtensionsControlManifestionsReport', {}); - instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage()); - instantiationService.stubPromise(IExtensionGalleryService, 'getExtensions', []); + instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(galleryEnabledLanguage)); + instantiationService.stubPromise(IExtensionGalleryService, 'getCompatibleExtension', galleryEnabledLanguage); + instantiationService.stubPromise(IExtensionGalleryService, 'getExtensions', [galleryEnabledLanguage]); instantiationService.stubPromise(IExperimentService, 'getExperimentsByType', []); instantiationService.stub(IViewDescriptorService, { @@ -185,6 +190,7 @@ suite('ExtensionsViews Tests', () => { toExtensionDescription(builtInTheme), toExtensionDescription(builtInBasic) ], + canAddExtension: (extension) => true, whenInstalledExtensionsRegistered: () => Promise.resolve(true) }); await (instantiationService.get(IWorkbenchExtensionEnablementService)).setEnablement([localDisabledTheme], EnablementState.DisabledGlobally); @@ -242,6 +248,29 @@ suite('ExtensionsViews Tests', () => { }); }); + test('Test default view actions required sorting', async () => { + const workbenchService = instantiationService.get(IExtensionsWorkbenchService); + const extension = (await workbenchService.queryLocal()).find(ex => ex.identifier === localEnabledLanguage.identifier); + + await new Promise(c => { + const disposable = workbenchService.onChange(() => { + if (extension?.outdated) { + disposable.dispose(); + c(); + } + }); + instantiationService.get(IExtensionsWorkbenchService).queryGallery(CancellationToken.None); + }); + + const result = await testableView.show('@installed'); + assert.strictEqual(result.length, 5, 'Unexpected number of results for @installed query'); + const actual = [result.get(0).name, result.get(1).name, result.get(2).name, result.get(3).name, result.get(4).name]; + const expected = [localEnabledLanguage.manifest.name, localEnabledTheme.manifest.name, localRandom.manifest.name, localDisabledTheme.manifest.name, localDisabledLanguage.manifest.name]; + for (let i = 0; i < result.length; i++) { + assert.strictEqual(actual[i], expected[i], 'Unexpected extension for @installed query with outadted extension.'); + } + }); + test('Test installed query results', async () => { await testableView.show('@installed').then(result => { assert.strictEqual(result.length, 5, 'Unexpected number of results for @installed query'); @@ -352,12 +381,8 @@ suite('ExtensionsViews Tests', () => { test('Test local query with sorting order', async () => { await testableView.show('@recentlyUpdated').then(result => { - assert.strictEqual(result.length, 2, 'Unexpected number of results for @recentlyUpdated'); - const actual = [result.get(0).name, result.get(1).name]; - const expected = [localEnabledLanguage.manifest.name, localDisabledLanguage.manifest.name]; - for (let i = 0; i < actual.length; i++) { - assert.strictEqual(actual[i], expected[i], 'Unexpected default sort order of extensions for @recentlyUpdate query'); - } + assert.strictEqual(result.length, 1, 'Unexpected number of results for @recentlyUpdated'); + assert.strictEqual(result.get(0).name, localDisabledLanguage.manifest.name, 'Unexpected default sort order of extensions for @recentlyUpdate query'); }); await testableView.show('@installed @sort:updateDate').then(result => { diff --git a/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts b/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts index fdb07a0941f..b1cdf5d227a 100644 --- a/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts +++ b/src/vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution.ts @@ -136,4 +136,4 @@ export class ExternalTerminalContribution extends Disposable implements IWorkben } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExternalTerminalContribution, 'ExternalTerminalContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExternalTerminalContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/externalTerminal/electron-sandbox/externalTerminal.contribution.ts b/src/vs/workbench/contrib/externalTerminal/electron-sandbox/externalTerminal.contribution.ts index e0759e2b781..e910ea0b127 100644 --- a/src/vs/workbench/contrib/externalTerminal/electron-sandbox/externalTerminal.contribution.ts +++ b/src/vs/workbench/contrib/externalTerminal/electron-sandbox/externalTerminal.contribution.ts @@ -135,4 +135,4 @@ export class ExternalTerminalContribution implements IWorkbenchContribution { // Register workbench contributions const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(ExternalTerminalContribution, 'ExternalTerminalContribution', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(ExternalTerminalContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/feedback/browser/feedback.contribution.ts b/src/vs/workbench/contrib/feedback/browser/feedback.contribution.ts index 238e4095817..94485ad4969 100644 --- a/src/vs/workbench/contrib/feedback/browser/feedback.contribution.ts +++ b/src/vs/workbench/contrib/feedback/browser/feedback.contribution.ts @@ -8,4 +8,4 @@ import { FeedbackStatusbarConribution } from 'vs/workbench/contrib/feedback/brow import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FeedbackStatusbarConribution, 'FeedbackStatusbarConribution', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FeedbackStatusbarConribution, LifecyclePhase.Starting); diff --git a/src/vs/workbench/contrib/feedback/browser/feedbackStatusbarItem.ts b/src/vs/workbench/contrib/feedback/browser/feedbackStatusbarItem.ts index 1c3145bffc1..aaed0100585 100644 --- a/src/vs/workbench/contrib/feedback/browser/feedbackStatusbarItem.ts +++ b/src/vs/workbench/contrib/feedback/browser/feedbackStatusbarItem.ts @@ -14,7 +14,7 @@ import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/c import { IOpenerService } from 'vs/platform/opener/common/opener'; import { URI } from 'vs/base/common/uri'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { HIDE_NOTIFICATIONS_CENTER, HIDE_NOTIFICATION_TOAST } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; import { isIOS } from 'vs/base/common/platform'; @@ -80,7 +80,7 @@ export class FeedbackStatusbarConribution extends Disposable implements IWorkben MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: FeedbackStatusbarConribution.TOGGLE_FEEDBACK_COMMAND, - category: CATEGORIES.Help, + category: Categories.Help, title: localize('status.feedback', "Tweet Feedback") } }); diff --git a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts index 57bb796dfc4..a2b85639809 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts @@ -18,11 +18,11 @@ import { ContextKeyExpr, ContextKeyExpression } from 'vs/platform/contextkey/com import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerFolderContext, ExplorerResourceNotReadonlyContext, ExplorerResourceCut, ExplorerResourceMoveableToTrash, ExplorerViewletVisibleContext, ExplorerResourceAvailableEditorIdsContext } from 'vs/workbench/contrib/files/common/files'; import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL } from 'vs/workbench/browser/actions/workspaceCommands'; -import { CLOSE_SAVED_EDITORS_COMMAND_ID, CLOSE_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; +import { CLOSE_SAVED_EDITORS_COMMAND_ID, CLOSE_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, REOPEN_WITH_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService'; import { Schemas } from 'vs/base/common/network'; -import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey } from 'vs/workbench/common/contextkeys'; +import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext } from 'vs/workbench/common/contextkeys'; import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; @@ -226,6 +226,16 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { when: isFileOrUntitledResourceContextKey }); +MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { + group: '1_open', + order: 10, + command: { + id: REOPEN_WITH_COMMAND_ID, + title: nls.localize('reopenWith', "Reopen Editor With...") + }, + when: ActiveEditorAvailableEditorIdsContext +}); + MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { group: '1_cutcopypaste', order: 10, diff --git a/src/vs/workbench/contrib/files/browser/files.contribution.ts b/src/vs/workbench/contrib/files/browser/files.contribution.ts index 062fb218400..d51f8cae859 100644 --- a/src/vs/workbench/contrib/files/browser/files.contribution.ts +++ b/src/vs/workbench/contrib/files/browser/files.contribution.ts @@ -22,7 +22,7 @@ import { ExplorerViewletViewsContribution } from 'vs/workbench/contrib/files/bro import { IEditorPaneRegistry, EditorPaneDescriptor } from 'vs/workbench/browser/editor'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { ILabelService } from 'vs/platform/label/common/label'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ExplorerService, UNDO_REDO_SOURCE } from 'vs/workbench/contrib/files/browser/explorerService'; import { SUPPORTED_ENCODINGS } from 'vs/workbench/services/textfile/common/encoding'; import { Schemas } from 'vs/base/common/network'; @@ -53,7 +53,7 @@ class FileUriLabelContribution implements IWorkbenchContribution { } } -registerSingleton(IExplorerService, ExplorerService, true); +registerSingleton(IExplorerService, ExplorerService, InstantiationType.Delayed); // Register file editors Registry.as(EditorExtensions.EditorPane).registerEditorPane( @@ -83,25 +83,25 @@ Registry.as(EditorExtensions.EditorFactory).registerFile // Register Editor Input Serializer & Handler Registry.as(EditorExtensions.EditorFactory).registerEditorSerializer(FILE_EDITOR_INPUT_ID, FileEditorInputSerializer); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FileEditorWorkingCopyEditorHandler, 'FileEditorWorkingCopyEditorHandler', LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FileEditorWorkingCopyEditorHandler, LifecyclePhase.Ready); // Register Explorer views -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExplorerViewletViewsContribution, 'ExplorerViewletViewsContribution', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExplorerViewletViewsContribution, LifecyclePhase.Starting); // Register Text File Editor Tracker -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TextFileEditorTracker, 'TextFileEditorTracker', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TextFileEditorTracker, LifecyclePhase.Starting); // Register Text File Save Error Handler -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TextFileSaveErrorHandler, 'TextFileSaveErrorHandler', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TextFileSaveErrorHandler, LifecyclePhase.Starting); // Register uri display for file uris -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FileUriLabelContribution, 'FileUriLabelContribution', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(FileUriLabelContribution, LifecyclePhase.Starting); // Register Workspace Watcher -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceWatcher, 'WorkspaceWatcher', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceWatcher, LifecyclePhase.Restored); // Register Dirty Files Indicator -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DirtyFilesIndicator, 'DirtyFilesIndicator', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DirtyFilesIndicator, LifecyclePhase.Starting); // Configuration const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index 8dc7c9a2e1e..158ea94cbfb 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { URI } from 'vs/base/common/uri'; import * as perf from 'vs/base/common/performance'; -import { IAction, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions'; +import { WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions'; import { memoize } from 'vs/base/common/decorators'; import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocusedContext, ExplorerFocusedContext, ExplorerRootContext, ExplorerResourceReadonlyContext, ExplorerResourceCut, ExplorerResourceMoveableToTrash, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, ExplorerCompressedLastFocusContext, ExplorerResourceAvailableEditorIdsContext, VIEW_ID, VIEWLET_ID, ExplorerResourceNotReadonlyContext, ViewHasSomeCollapsibleRootItemContext } from 'vs/workbench/contrib/files/common/files'; import { FileCopiedContext, NEW_FILE_COMMAND_ID, NEW_FOLDER_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileActions'; @@ -31,8 +31,7 @@ import { ExplorerDelegate, ExplorerDataSource, FilesRenderer, ICompressedNavigat import { IThemeService, IFileIconTheme } from 'vs/platform/theme/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { ITreeContextMenuEvent, TreeVisibility } from 'vs/base/browser/ui/tree/tree'; -import { IMenuService, MenuId, IMenu, Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { MenuId, Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ExplorerItem, NewExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; import { ResourceLabels } from 'vs/workbench/browser/labels'; @@ -202,7 +201,6 @@ export class ExplorerView extends ViewPane implements IExplorerView { @IDecorationsService private readonly decorationService: IDecorationsService, @ILabelService private readonly labelService: ILabelService, @IThemeService themeService: IWorkbenchThemeService, - @IMenuService private readonly menuService: IMenuService, @ITelemetryService telemetryService: ITelemetryService, @IExplorerService private readonly explorerService: IExplorerService, @IStorageService private readonly storageService: IStorageService, @@ -242,13 +240,6 @@ export class ExplorerView extends ViewPane implements IExplorerView { // noop } - // Memoized locals - @memoize private get contributedContextMenu(): IMenu { - const contributedContextMenu = this.menuService.createMenu(MenuId.ExplorerContext, this.tree.contextKeyService); - this._register(contributedContextMenu); - return contributedContextMenu; - } - @memoize private get fileCopiedContextKey(): IContextKey { return FileCopiedContext.bindTo(this.contextKeyService); } @@ -582,7 +573,6 @@ export class ExplorerView extends ViewPane implements IExplorerView { const selection = this.tree.getSelection(); - const actions: IAction[] = []; const roots = this.explorerService.roots; // If the click is outside of the elements pass the root resource if there is only one root. If there are multiple roots pass empty object. let arg: URI | {}; if (stat instanceof ExplorerItem) { @@ -591,11 +581,12 @@ export class ExplorerView extends ViewPane implements IExplorerView { } else { arg = roots.length === 1 ? roots[0].resource : {}; } - createAndFillInContextMenuActions(this.contributedContextMenu, { arg, shouldForwardArgs: true }, actions); this.contextMenuService.showContextMenu({ + menuId: MenuId.ExplorerContext, + menuActionOptions: { arg, shouldForwardArgs: true }, + contextKeyService: this.tree.contextKeyService, getAnchor: () => anchor, - getActions: () => actions, onHide: (wasCancelled?: boolean) => { if (wasCancelled) { this.tree.domFocus(); diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 3d2a4c48a6e..90494a4ffd5 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -28,8 +28,7 @@ import { ResourceLabels, IResourceLabel } from 'vs/workbench/browser/labels'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuService, MenuId, IMenu, Action2, registerAction2, MenuRegistry } from 'vs/platform/actions/common/actions'; +import { MenuId, Action2, registerAction2, MenuRegistry } from 'vs/platform/actions/common/actions'; import { OpenEditorsDirtyEditorContext, OpenEditorsGroupContext, OpenEditorsReadonlyEditorContext, SAVE_ALL_LABEL, SAVE_ALL_COMMAND_ID, NEW_UNTITLED_FILE_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileConstants'; import { ResourceContextKey } from 'vs/workbench/common/contextkeys'; import { CodeDataTransfers, containsDragType } from 'vs/platform/dnd/browser/dnd'; @@ -69,7 +68,6 @@ export class OpenEditorsView extends ViewPane { private structuralRefreshDelay: number; private list!: WorkbenchList; private listLabels: ResourceLabels | undefined; - private contributedContextMenu!: IMenu; private needsRefresh = false; private elements: (OpenEditor | IEditorGroup)[] = []; private sortOrder: 'editorOrder' | 'alphabetical' | 'fullPath'; @@ -89,7 +87,6 @@ export class OpenEditorsView extends ViewPane { @IContextKeyService contextKeyService: IContextKeyService, @IThemeService themeService: IThemeService, @ITelemetryService telemetryService: ITelemetryService, - @IMenuService private readonly menuService: IMenuService, @IWorkingCopyService private readonly workingCopyService: IWorkingCopyService, @IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService, @IOpenerService openerService: IOpenerService, @@ -243,9 +240,6 @@ export class OpenEditorsView extends ViewPane { this._register(this.list); this._register(this.listLabels); - this.contributedContextMenu = this.menuService.createMenu(MenuId.OpenEditorsContext, this.list.contextKeyService); - this._register(this.contributedContextMenu); - this.updateSize(); // Bind context keys @@ -396,12 +390,12 @@ export class OpenEditorsView extends ViewPane { } const element = e.element; - const actions: IAction[] = []; - createAndFillInContextMenuActions(this.contributedContextMenu, { shouldForwardArgs: true, arg: element instanceof OpenEditor ? EditorResourceAccessor.getOriginalUri(element.editor) : {} }, actions); this.contextMenuService.showContextMenu({ + menuId: MenuId.OpenEditorsContext, + menuActionOptions: { shouldForwardArgs: true, arg: element instanceof OpenEditor ? EditorResourceAccessor.getOriginalUri(element.editor) : {} }, + contextKeyService: this.list.contextKeyService, getAnchor: () => e.anchor, - getActions: () => actions, getActionsContext: () => element instanceof OpenEditor ? { groupId: element.groupId, editorIndex: element.group.getIndexOfEditor(element.editor) } : { groupId: element.id } }); } diff --git a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts index e76a5bfc3b2..71c8d537e30 100644 --- a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts +++ b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts @@ -241,7 +241,6 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution { Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution( DefaultFormatter, - 'DefaultFormatter', LifecyclePhase.Restored ); diff --git a/src/vs/workbench/contrib/interactive/browser/interactive.contribution.ts b/src/vs/workbench/contrib/interactive/browser/interactive.contribution.ts index 0e31c344e68..89839abf905 100644 --- a/src/vs/workbench/contrib/interactive/browser/interactive.contribution.ts +++ b/src/vs/workbench/contrib/interactive/browser/interactive.contribution.ts @@ -268,8 +268,8 @@ class InteractiveInputContentProvider implements ITextModelContentProvider { const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(InteractiveDocumentContribution, 'InteractiveDocumentContribution', LifecyclePhase.Ready); -workbenchContributionsRegistry.registerWorkbenchContribution(InteractiveInputContentProvider, 'InteractiveInputContentProvider', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(InteractiveDocumentContribution, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(InteractiveInputContentProvider, LifecyclePhase.Ready); export class InteractiveEditorSerializer implements IEditorSerializer { public static readonly ID = InteractiveEditorInput.ID; diff --git a/src/vs/workbench/contrib/issue/browser/issue.web.contribution.ts b/src/vs/workbench/contrib/issue/browser/issue.web.contribution.ts index c3822e6c68c..d207b297844 100644 --- a/src/vs/workbench/contrib/issue/browser/issue.web.contribution.ts +++ b/src/vs/workbench/contrib/issue/browser/issue.web.contribution.ts @@ -7,11 +7,11 @@ import * as nls from 'vs/nls'; import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { ICommandAction } from 'vs/platform/action/common/action'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IProductService } from 'vs/platform/product/common/productService'; import { Registry } from 'vs/platform/registry/common/platform'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { WebIssueService } from 'vs/workbench/contrib/issue/browser/issueService'; import { OpenIssueReporterArgs, OpenIssueReporterActionId, OpenIssueReporterApiCommandId } from 'vs/workbench/contrib/issue/common/commands'; @@ -86,7 +86,7 @@ class RegisterIssueContribution implements IWorkbenchContribution { const command: ICommandAction = { id: OpenIssueReporterActionId, title: { value: OpenIssueReporterActionLabel, original: 'Report Issue' }, - category: CATEGORIES.Help + category: Categories.Help }; MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command }); @@ -100,10 +100,10 @@ class RegisterIssueContribution implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(RegisterIssueContribution, 'RegisterIssueContribution', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(RegisterIssueContribution, LifecyclePhase.Starting); CommandsRegistry.registerCommand('_issues.getSystemStatus', (accessor) => { return nls.localize('statusUnsupported', "The --status argument is not yet supported in browsers."); }); -registerSingleton(IWorkbenchIssueService, WebIssueService, true); +registerSingleton(IWorkbenchIssueService, WebIssueService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/issue/electron-sandbox/issue.contribution.ts b/src/vs/workbench/contrib/issue/electron-sandbox/issue.contribution.ts index de4f64639c2..09a805b8e5c 100644 --- a/src/vs/workbench/contrib/issue/electron-sandbox/issue.contribution.ts +++ b/src/vs/workbench/contrib/issue/electron-sandbox/issue.contribution.ts @@ -7,9 +7,9 @@ import { localize } from 'vs/nls'; import product from 'vs/platform/product/common/product'; import { MenuRegistry, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; import { ICommandAction } from 'vs/platform/action/common/action'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ReportPerformanceIssueUsingReporterAction, OpenProcessExplorer, StopTracing } from 'vs/workbench/contrib/issue/electron-sandbox/issueActions'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue'; import { WorkbenchIssueService } from 'vs/workbench/services/issue/electron-sandbox/issueService'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; @@ -78,7 +78,7 @@ if (!!product.reportIssueUrl) { value: localize({ key: 'reportIssueInEnglish', comment: ['Translate this to "Report Issue in English" in all languages please!'] }, "Report Issue..."), original: 'Report Issue...' }, - category: CATEGORIES.Help + category: Categories.Help }; MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: reportIssue }); @@ -105,7 +105,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, { registerAction2(OpenProcessExplorer); registerAction2(StopTracing); -registerSingleton(IWorkbenchIssueService, WorkbenchIssueService, true); +registerSingleton(IWorkbenchIssueService, WorkbenchIssueService, InstantiationType.Delayed); CommandsRegistry.registerCommand('_issues.getSystemStatus', (accessor) => { return accessor.get(IIssueService).getSystemStatus(); diff --git a/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts b/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts index 68ff563a009..fb21da86476 100644 --- a/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts +++ b/src/vs/workbench/contrib/issue/electron-sandbox/issueActions.ts @@ -13,7 +13,7 @@ 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 { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue'; export class OpenProcessExplorer extends Action2 { @@ -24,7 +24,7 @@ export class OpenProcessExplorer extends Action2 { super({ id: OpenProcessExplorer.ID, title: { value: localize('openProcessExplorer', "Open Process Explorer"), original: 'Open Process Explorer' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -44,7 +44,7 @@ export class ReportPerformanceIssueUsingReporterAction extends Action2 { super({ id: ReportPerformanceIssueUsingReporterAction.ID, title: { value: localize({ key: 'reportPerformanceIssue', comment: [`Here, 'issue' means problem or bug`] }, "Report Performance Issue..."), original: 'Report Performance Issue' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true }); } @@ -64,7 +64,7 @@ export class StopTracing extends Action2 { super({ id: StopTracing.ID, title: { value: localize('stopTracing', "Stop Tracing"), original: 'Stop Tracing' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.ts b/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.ts index 5f6cdfb3298..5e7443e410c 100644 --- a/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.ts +++ b/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { rendererLogChannelId } from 'vs/workbench/contrib/logs/common/logConstants'; import { IOutputService } from 'vs/workbench/services/output/common/output'; @@ -17,7 +17,7 @@ class ToggleKeybindingsLogAction extends Action2 { super({ id: 'workbench.action.toggleKeybindingsLog', title: { value: nls.localize('toggleKeybindingsLog', "Toggle Keyboard Shortcuts Troubleshooting"), original: 'Toggle Keyboard Shortcuts Troubleshooting' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts b/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts index d5605600b90..363f76cb570 100644 --- a/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts +++ b/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.ts @@ -115,7 +115,7 @@ class LanguageDetectionStatusContribution implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LanguageDetectionStatusContribution, 'LanguageDetectionStatusContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LanguageDetectionStatusContribution, LifecyclePhase.Restored); registerAction2(class extends Action2 { diff --git a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts index f1661dcd48e..22af57bcfa3 100644 --- a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts +++ b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts @@ -30,6 +30,7 @@ import { equals } from 'vs/base/common/arrays'; import { URI } from 'vs/base/common/uri'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; class LanguageStatusViewModel { @@ -391,7 +392,7 @@ class EditorStatusContribution implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(EditorStatusContribution, 'EditorStatusContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(EditorStatusContribution, LifecyclePhase.Restored); registerAction2(class extends Action2 { @@ -402,10 +403,7 @@ registerAction2(class extends Action2 { value: localize('reset', 'Reset Language Status Interaction Counter'), original: 'Reset Language Status Interaction Counter' }, - category: { - value: localize('cat', 'View'), - original: 'View' - }, + category: Categories.View, f1: true }); } diff --git a/src/vs/workbench/contrib/list/browser/list.contribution.ts b/src/vs/workbench/contrib/list/browser/list.contribution.ts index a8593efd37b..a2347a33886 100644 --- a/src/vs/workbench/contrib/list/browser/list.contribution.ts +++ b/src/vs/workbench/contrib/list/browser/list.contribution.ts @@ -20,4 +20,4 @@ export class ListContext implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ListContext, 'ListContext', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ListContext, LifecyclePhase.Starting); diff --git a/src/vs/workbench/contrib/localHistory/browser/localHistory.contribution.ts b/src/vs/workbench/contrib/localHistory/browser/localHistory.contribution.ts index 44e11d4afa6..dda52a6f3a5 100644 --- a/src/vs/workbench/contrib/localHistory/browser/localHistory.contribution.ts +++ b/src/vs/workbench/contrib/localHistory/browser/localHistory.contribution.ts @@ -10,4 +10,4 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle import { LocalHistoryTimeline } from 'vs/workbench/contrib/localHistory/browser/localHistoryTimeline'; // Register Local History Timeline -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LocalHistoryTimeline, 'LocalHistoryTimeline', LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LocalHistoryTimeline, LifecyclePhase.Ready); diff --git a/src/vs/workbench/contrib/localization/browser/localization.contribution.ts b/src/vs/workbench/contrib/localization/browser/localization.contribution.ts index 85716e8bcb9..e529fd5414d 100644 --- a/src/vs/workbench/contrib/localization/browser/localization.contribution.ts +++ b/src/vs/workbench/contrib/localization/browser/localization.contribution.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import { registerAction2 } from 'vs/platform/actions/common/actions'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { WebLocaleService } from 'vs/workbench/contrib/localization/browser/localeService'; import { ClearDisplayLanguageAction, ConfigureDisplayLanguageAction } from 'vs/workbench/contrib/localization/browser/localizationsActions'; import { ILocaleService } from 'vs/workbench/contrib/localization/common/locale'; -registerSingleton(ILocaleService, WebLocaleService, true); +registerSingleton(ILocaleService, WebLocaleService, InstantiationType.Delayed); // Register action to configure locale and related settings registerAction2(ConfigureDisplayLanguageAction); diff --git a/src/vs/workbench/contrib/localization/electron-sandbox/localization.contribution.ts b/src/vs/workbench/contrib/localization/electron-sandbox/localization.contribution.ts index cc72bb49812..72cf5f2f9f5 100644 --- a/src/vs/workbench/contrib/localization/electron-sandbox/localization.contribution.ts +++ b/src/vs/workbench/contrib/localization/electron-sandbox/localization.contribution.ts @@ -25,11 +25,11 @@ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/b import { ViewContainerLocation } from 'vs/workbench/common/views'; import { registerAction2 } from 'vs/platform/actions/common/actions'; import { ClearDisplayLanguageAction, ConfigureDisplayLanguageAction } from 'vs/workbench/contrib/localization/browser/localizationsActions'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILocaleService } from 'vs/workbench/contrib/localization/common/locale'; import { NativeLocaleService } from 'vs/workbench/contrib/localization/electron-sandbox/localeService'; -registerSingleton(ILocaleService, NativeLocaleService, true); +registerSingleton(ILocaleService, NativeLocaleService, InstantiationType.Delayed); // Register action to configure locale and related settings registerAction2(ConfigureDisplayLanguageAction); @@ -123,11 +123,11 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo const loc = manifest && manifest.contributes && manifest.contributes.localizations && manifest.contributes.localizations.filter(x => x.languageId.toLowerCase() === locale)[0]; const languageName = loc ? (loc.languageName || locale) : locale; const languageDisplayName = loc ? (loc.localizedLanguageName || loc.languageName || locale) : locale; - const translationsFromPack: any = translation && translation.contents ? translation.contents['vs/workbench/contrib/localization/electron-sandbox/minimalTranslations'] : {}; + const translationsFromPack: { [key: string]: string } = translation?.contents?.['vs/workbench/contrib/localization/electron-sandbox/minimalTranslations'] ?? {}; const promptMessageKey = extensionToInstall ? 'installAndRestartMessage' : 'showLanguagePackExtensions'; const useEnglish = !translationsFromPack[promptMessageKey]; - const translations: any = {}; + const translations: { [key: string]: string } = {}; Object.keys(minimumTranslatedStrings).forEach(key => { if (!translationsFromPack[key] || useEnglish) { translations[key] = minimumTranslatedStrings[key].replace('{0}', languageName); @@ -220,7 +220,7 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(LocalizationWorkbenchContribution, 'LocalizationWorkbenchContribution', LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(LocalizationWorkbenchContribution, LifecyclePhase.Eventually); ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'localizations', diff --git a/src/vs/workbench/contrib/logs/browser/logs.contribution.ts b/src/vs/workbench/contrib/logs/browser/logs.contribution.ts index 91600e0b61d..992093fe0b3 100644 --- a/src/vs/workbench/contrib/logs/browser/logs.contribution.ts +++ b/src/vs/workbench/contrib/logs/browser/logs.contribution.ts @@ -4,7 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { Registry } from 'vs/platform/registry/common/platform'; -import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { OpenWindowSessionLogFileAction } from 'vs/workbench/contrib/logs/common/logsActions'; import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; @@ -26,9 +27,9 @@ class WebLogOutputChannels extends Disposable implements IWorkbenchContribution this.instantiationService.createInstance(LogsDataCleaner); const workbenchActionsRegistry = Registry.as(WorkbenchActionExtensions.WorkbenchActions); - workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(OpenWindowSessionLogFileAction), 'Developer: Open Window Log File (Session)...', CATEGORIES.Developer.value); + workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(OpenWindowSessionLogFileAction), 'Developer: Open Window Log File (Session)...', Categories.Developer.value); } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WebLogOutputChannels, 'WebLogOutputChannels', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WebLogOutputChannels, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/logs/common/logs.contribution.ts b/src/vs/workbench/contrib/logs/common/logs.contribution.ts index d4e9518e352..f8f07b98ad4 100644 --- a/src/vs/workbench/contrib/logs/common/logs.contribution.ts +++ b/src/vs/workbench/contrib/logs/common/logs.contribution.ts @@ -5,7 +5,8 @@ import * as nls from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; -import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Action2, registerAction2, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { SetLogLevelAction } from 'vs/workbench/contrib/logs/common/logsActions'; import * as Constants from 'vs/workbench/contrib/logs/common/logConstants'; @@ -22,7 +23,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { URI } from 'vs/base/common/uri'; const workbenchActionsRegistry = Registry.as(WorkbenchActionExtensions.WorkbenchActions); -workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(SetLogLevelAction), 'Developer: Set Log Level...', CATEGORIES.Developer.value); +workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(SetLogLevelAction), 'Developer: Set Log Level...', Categories.Developer.value); class LogOutputChannels extends Disposable implements IWorkbenchContribution { @@ -62,7 +63,7 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution { super({ id: Constants.showWindowLogActionId, title: { value: nls.localize('show window log', "Show Window Log"), original: 'Show Window Log' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -80,4 +81,4 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution { } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LogOutputChannels, 'LogOutputChannels', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LogOutputChannels, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/logs/electron-sandbox/logs.contribution.ts b/src/vs/workbench/contrib/logs/electron-sandbox/logs.contribution.ts index 5032ac87a6b..26e63c77ca9 100644 --- a/src/vs/workbench/contrib/logs/electron-sandbox/logs.contribution.ts +++ b/src/vs/workbench/contrib/logs/electron-sandbox/logs.contribution.ts @@ -5,7 +5,8 @@ import * as nls from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; -import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { OpenLogsFolderAction, OpenExtensionLogsFolderAction } from 'vs/workbench/contrib/logs/electron-sandbox/logsActions'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; @@ -42,8 +43,8 @@ class NativeLogOutputChannels extends Disposable implements IWorkbenchContributi } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NativeLogOutputChannels, 'NativeLogOutputChannels', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NativeLogOutputChannels, LifecyclePhase.Restored); const workbenchActionsRegistry = Registry.as(WorkbenchActionExtensions.WorkbenchActions); -workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(OpenLogsFolderAction), 'Developer: Open Logs Folder', CATEGORIES.Developer.value); -workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(OpenExtensionLogsFolderAction), 'Developer: Open Extension Logs Folder', CATEGORIES.Developer.value); +workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(OpenLogsFolderAction), 'Developer: Open Logs Folder', Categories.Developer.value); +workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(OpenExtensionLogsFolderAction), 'Developer: Open Extension Logs Folder', Categories.Developer.value); diff --git a/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.ts b/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.ts index f45f3a3c145..be11c3073ba 100644 --- a/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.ts +++ b/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.ts @@ -6,6 +6,7 @@ import { hookDomPurifyHrefAndSrcSanitizer, basicMarkupHtmlTags } from 'vs/base/browser/dom'; import * as dompurify from 'vs/base/browser/dompurify/dompurify'; import { allowedMarkdownAttr } from 'vs/base/browser/markdownRenderer'; +import { CancellationToken } from 'vs/base/common/cancellation'; import { marked } from 'vs/base/common/marked/marked'; import { Schemas } from 'vs/base/common/network'; import { ILanguageService } from 'vs/editor/common/languages/language'; @@ -189,6 +190,7 @@ export async function renderMarkdownDocument( languageService: ILanguageService, shouldSanitize: boolean = true, allowUnknownProtocols: boolean = false, + token?: CancellationToken, ): Promise { const highlight = (code: string, lang: string | undefined, callback: ((error: any, code: string) => void) | undefined): any => { @@ -202,6 +204,11 @@ export async function renderMarkdownDocument( } extensionService.whenInstalledExtensionsRegistered().then(async () => { + if (token?.isCancellationRequested) { + callback(null, ''); + return; + } + const languageId = languageService.getLanguageIdByLanguageName(lang); const html = await tokenizeToString(languageService, code, languageId); callback(null, `${html}`); diff --git a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts index f19aa0a7492..d31a252577c 100644 --- a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts +++ b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts @@ -6,7 +6,7 @@ import 'vs/workbench/contrib/markers/browser/markersFileDecorations'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { localize } from 'vs/nls'; @@ -201,7 +201,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.problems.focus', title: { value: Messages.MARKERS_PANEL_SHOW_LABEL, original: 'Focus Problems (Errors, Warnings, Infos)' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, }); } @@ -409,6 +409,7 @@ registerAction2(class extends ViewAction { registerAction2(class extends Action2 { constructor() { super({ + _isFakeAction: true, id: `workbench.actions.treeView.${Markers.MARKERS_VIEW_ID}.filter`, title: localize('filter', "Filter"), menu: { @@ -513,7 +514,7 @@ class MarkersStatusBarContributions extends Disposable implements IWorkbenchCont } } -workbenchRegistry.registerWorkbenchContribution(MarkersStatusBarContributions, 'MarkersStatusBarContributions', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(MarkersStatusBarContributions, LifecyclePhase.Restored); class ActivityUpdater extends Disposable implements IWorkbenchContribution { @@ -536,4 +537,4 @@ class ActivityUpdater extends Disposable implements IWorkbenchContribution { } } -workbenchRegistry.registerWorkbenchContribution(ActivityUpdater, 'ActivityUpdater', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(ActivityUpdater, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/markers/browser/markersFileDecorations.ts b/src/vs/workbench/contrib/markers/browser/markersFileDecorations.ts index 88b5c1a57fd..8ca2e6bce00 100644 --- a/src/vs/workbench/contrib/markers/browser/markersFileDecorations.ts +++ b/src/vs/workbench/contrib/markers/browser/markersFileDecorations.ts @@ -107,4 +107,4 @@ Registry.as(ConfigurationExtensions.Configuration).regis // register file decorations Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(MarkersFileDecorations, 'MarkersFileDecorations', LifecyclePhase.Restored); + .registerWorkbenchContribution(MarkersFileDecorations, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/markers/browser/markersView.ts b/src/vs/workbench/contrib/markers/browser/markersView.ts index 826270e143a..bf9a407742a 100644 --- a/src/vs/workbench/contrib/markers/browser/markersView.ts +++ b/src/vs/workbench/contrib/markers/browser/markersView.ts @@ -32,7 +32,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { FilterData, Filter, VirtualDelegate, ResourceMarkersRenderer, MarkerRenderer, RelatedInformationRenderer, MarkersWidgetAccessibilityProvider, MarkersViewModel } from 'vs/workbench/contrib/markers/browser/markersTreeViewer'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { ActionBar, IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; +import { MenuId } from 'vs/platform/actions/common/actions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { ResourceLabels } from 'vs/workbench/browser/labels'; @@ -53,7 +53,6 @@ import { groupBy } from 'vs/base/common/arrays'; import { ResourceMap } from 'vs/base/common/map'; import { EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor'; import { IMarkersView } from 'vs/workbench/contrib/markers/browser/markers'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { ResourceListDnDHandler } from 'vs/workbench/browser/dnd'; import { ITableContextMenuEvent, ITableEvent } from 'vs/base/browser/ui/table/table'; import { MarkersTable } from 'vs/workbench/contrib/markers/browser/markersTable'; @@ -148,7 +147,6 @@ export class MarkersView extends ViewPane implements IMarkersView { @IContextKeyService contextKeyService: IContextKeyService, @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService, @IContextMenuService contextMenuService: IContextMenuService, - @IMenuService private readonly menuService: IMenuService, @IUriIdentityService private readonly uriIdentityService: IUriIdentityService, @IKeybindingService keybindingService: IKeybindingService, @IStorageService storageService: IStorageService, @@ -803,6 +801,7 @@ export class MarkersView extends ViewPane implements IMarkersView { this.contextMenuService.showContextMenu({ getAnchor: () => e.anchor!, + menuId: MenuId.ProblemsPanelContext, getActions: () => this.getMenuActions(element), getActionViewItem: (action) => { const keybinding = this.keybindingService.lookupKeybinding(action.id); @@ -833,9 +832,6 @@ export class MarkersView extends ViewPane implements IMarkersView { } } - const menu = this.menuService.createMenu(MenuId.ProblemsPanelContext, this.widget.contextKeyService); - createAndFillInContextMenuActions(menu, undefined, result); - menu.dispose(); return result; } diff --git a/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.ts b/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.ts index 98fc203bfe6..4ab7188c7eb 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Codicon } from 'vs/base/common/codicons'; +import { basename } from 'vs/base/common/resources'; import { URI, UriComponents } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { ILocalizedString } from 'vs/platform/action/common/action'; @@ -294,7 +295,7 @@ export class ShowHideAtTopBase extends Action2 { order: 10, }, ], - precondition: ContextKeyExpr.and(ctxIsMergeEditor, ctxMergeEditorShowBase), + precondition: ContextKeyExpr.and(ctxIsMergeEditor, ctxMergeEditorShowBase, ctxMergeEditorLayout.isEqualTo('mixed')), }); } @@ -603,31 +604,7 @@ export class ResetToBaseAndAutoMergeCommand extends MergeEditorAction { } override runWithViewModel(viewModel: MergeEditorViewModel, accessor: ServicesAccessor): void { - viewModel.model.resetResultToBaseAndAutoMerge(); - } -} - -export class ResetDirtyConflictsToBaseCommand extends MergeEditorAction { - constructor() { - super({ - id: 'mergeEditor.resetDirtyConflictsToBase', - category: mergeEditorCategory, - title: { - value: localize( - 'mergeEditor.resetDirtyConflictsToBase', - 'Reset Dirty Conflicts In Result To Base' - ), - original: 'Reset Dirty Conflicts In Result To Base', - }, - shortTitle: localize('mergeEditor.resetDirtyConflictsToBase.short', 'Reset Dirty Conflicts To Base'), - f1: true, - precondition: ctxIsMergeEditor, - menu: { id: MenuId.MergeInputResultToolbar } - }); - } - - override runWithViewModel(viewModel: MergeEditorViewModel, accessor: ServicesAccessor): void { - viewModel.model.resetDirtyConflictsToBase(); + viewModel.model.reset(); } } @@ -640,9 +617,9 @@ export class AcceptMerge extends MergeEditorAction2 { title: { value: localize( 'mergeEditor.acceptMerge', - 'Accept Merge' + 'Complete Merge' ), - original: 'Accept Merge', + original: 'Complete Merge', }, f1: false, precondition: ctxIsMergeEditor @@ -656,8 +633,9 @@ export class AcceptMerge extends MergeEditorAction2 { if (viewModel.model.unhandledConflictsCount.get() > 0) { const confirmResult = await dialogService.confirm({ type: 'info', - message: localize('mergeEditor.acceptMerge.unhandledConflicts', "There are still unhandled conflicts. Are you sure you want to accept the merge?"), - primaryButton: localize('mergeEditor.acceptMerge.unhandledConflicts.accept', "Accept merge with unhandled conflicts"), + message: localize('mergeEditor.acceptMerge.unhandledConflicts.message', "Do you want to complete the merge of {0}?", basename(inputModel.resultUri)), + detail: localize('mergeEditor.acceptMerge.unhandledConflicts.detail', "The file contains unhandled conflicts."), + primaryButton: localize('mergeEditor.acceptMerge.unhandledConflicts.accept', "Complete with Conflicts"), secondaryButton: localize('mergeEditor.acceptMerge.unhandledConflicts.cancel', "Cancel"), }); diff --git a/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.ts b/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.ts index b168f302520..4e3de4815a6 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.ts @@ -11,7 +11,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/editor'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { EditorExtensions, IEditorFactoryRegistry } from 'vs/workbench/common/editor'; -import { AcceptAllInput1, AcceptAllInput2, AcceptMerge, CompareInput1WithBaseCommand, CompareInput2WithBaseCommand, GoToNextUnhandledConflict, GoToPreviousUnhandledConflict, OpenBaseFile, OpenMergeEditor, OpenResultResource, ResetDirtyConflictsToBaseCommand, ResetToBaseAndAutoMergeCommand, SetColumnLayout, SetMixedLayout, ShowHideAtTopBase, ShowHideBase, ShowNonConflictingChanges, ToggleActiveConflictInput1, ToggleActiveConflictInput2 } from 'vs/workbench/contrib/mergeEditor/browser/commands/commands'; +import { AcceptAllInput1, AcceptAllInput2, AcceptMerge, CompareInput1WithBaseCommand, CompareInput2WithBaseCommand, GoToNextUnhandledConflict, GoToPreviousUnhandledConflict, OpenBaseFile, OpenMergeEditor, OpenResultResource, ResetToBaseAndAutoMergeCommand, SetColumnLayout, SetMixedLayout, ShowHideAtTopBase, ShowHideBase, ShowNonConflictingChanges, ToggleActiveConflictInput1, ToggleActiveConflictInput2 } from 'vs/workbench/contrib/mergeEditor/browser/commands/commands'; import { MergeEditorCopyContentsToJSON, MergeEditorLoadContentsFromFolder, MergeEditorSaveContentsToFolder } from 'vs/workbench/contrib/mergeEditor/browser/commands/devCommands'; import { MergeEditorInput } from 'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput'; import { MergeEditor, MergeEditorOpenHandlerContribution, MergeEditorResolverContribution } from 'vs/workbench/contrib/mergeEditor/browser/view/mergeEditor'; @@ -39,7 +39,7 @@ Registry.as(Extensions.Configuration).registerConfigurat 'mergeEditor.diffAlgorithm': { type: 'string', enum: ['smart', 'experimental'], - default: 'smart', + default: 'experimental', markdownEnumDescriptions: [ localize('diffAlgorithm.smart', "Uses the default diffing algorithm."), localize('diffAlgorithm.experimental', "Uses an experimental diffing algorithm."), @@ -70,7 +70,6 @@ registerAction2(AcceptAllInput1); registerAction2(AcceptAllInput2); registerAction2(ResetToBaseAndAutoMergeCommand); -registerAction2(ResetDirtyConflictsToBaseCommand); registerAction2(AcceptMerge); @@ -81,28 +80,8 @@ registerAction2(MergeEditorLoadContentsFromFolder); Registry .as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(MergeEditorOpenHandlerContribution, 'MergeEditorOpenHandlerContribution', LifecyclePhase.Restored); + .registerWorkbenchContribution(MergeEditorOpenHandlerContribution, LifecyclePhase.Restored); Registry .as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(MergeEditorResolverContribution, 'MergeEditorResolverContribution', LifecyclePhase.Starting); -/* -class MergeEditorWorkbenchContribution extends Disposable implements IWorkbenchContribution { - constructor(@IWorkingCopyEditorService private readonly _workingCopyEditorService: IWorkingCopyEditorService) { - super(); - - this._register( - _workingCopyEditorService.registerHandler({ - createEditor(workingCopy) { - throw new BugIndicatingError('not supported'); - }, - handles(workingCopy) { - return workingCopy.typeId === ''; - }, - isOpen(workingCopy, editor) { - return workingCopy.resource.toString() === that._model?.resultTextModel.uri.toString(); - }, - })); - } -} -*/ + .registerWorkbenchContribution(MergeEditorResolverContribution, LifecyclePhase.Starting); diff --git a/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.ts b/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.ts index 6f41a7f3632..d0e202909aa 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.ts @@ -66,7 +66,7 @@ export class MergeEditorInput extends AbstractTextResourceEditorInput implements super.dispose(); } - get typeId(): string { + override get typeId(): string { return MergeEditorInput.ID; } @@ -76,11 +76,9 @@ export class MergeEditorInput extends AbstractTextResourceEditorInput implements override get capabilities(): EditorInputCapabilities { let capabilities = super.capabilities | EditorInputCapabilities.MultipleEditors; - if (this.useWorkingCopy) { capabilities |= EditorInputCapabilities.Untitled; } - return capabilities; } @@ -171,6 +169,5 @@ export class MergeEditorInput extends AbstractTextResourceEditorInput implements this._inputModel?.model.setLanguageId(languageId, source); } - // implement get/set languageId // implement get/set encoding } diff --git a/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.ts b/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.ts index 4ef67a9d65a..2bd5c9b00c9 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.ts @@ -18,12 +18,12 @@ import { localize } from 'vs/nls'; import { ConfirmResult, IDialogOptions, IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IEditorModel } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IRevertOptions } from 'vs/workbench/common/editor'; +import { IRevertOptions, SaveSourceRegistry } from 'vs/workbench/common/editor'; import { EditorModel } from 'vs/workbench/common/editor/editorModel'; import { MergeEditorInputData } from 'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput'; +import { conflictMarkers } from 'vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController'; import { MergeDiffComputer } from 'vs/workbench/contrib/mergeEditor/browser/model/diffComputer'; import { InputData, MergeEditorModel } from 'vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel'; -import { ProjectedDiffComputer } from 'vs/workbench/contrib/mergeEditor/browser/model/projectedDocumentDiffProvider'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ITextFileEditorModel, ITextFileSaveOptions, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; @@ -109,7 +109,7 @@ export class TempFileMergeEditorModeFactory implements IMergeEditorInputModelFac input2Data, temporaryResultModel, this._instantiationService.createInstance(MergeDiffComputer, diffProvider), - this._instantiationService.createInstance(MergeDiffComputer, this._instantiationService.createInstance(ProjectedDiffComputer, diffProvider)), + this._instantiationService.createInstance(MergeDiffComputer, diffProvider), { resetResult: true, } @@ -269,6 +269,8 @@ export class WorkspaceMergeEditorModeFactory implements IMergeEditorInputModelFa ) { } + private static readonly FILE_SAVED_SOURCE = SaveSourceRegistry.registerSource('merge-editor.source', localize('merge-editor.source', "Before Resolving Conflicts In Merge Editor")); + public async createInputModel(args: MergeEditorArgs): Promise { const store = new DisposableStore(); @@ -302,7 +304,11 @@ export class WorkspaceMergeEditorModeFactory implements IMergeEditorInputModelFa throw new BugIndicatingError(); } // So that "Don't save" does revert the file - await resultTextFileModel.save(); + await resultTextFileModel.save({ source: WorkspaceMergeEditorModeFactory.FILE_SAVED_SOURCE }); + + const lines = resultTextFileModel.textEditorModel!.getLinesContent(); + const hasConflictMarkers = lines.some(l => l.startsWith(conflictMarkers.start)); + const resetResult = hasConflictMarkers; const diffProvider = this._instantiationService.createInstance(WorkerBasedDocumentDiffProvider); const model = this._instantiationService.createInstance( @@ -312,9 +318,9 @@ export class WorkspaceMergeEditorModeFactory implements IMergeEditorInputModelFa input2Data, result.object.textEditorModel, this._instantiationService.createInstance(MergeDiffComputer, diffProvider), - this._instantiationService.createInstance(MergeDiffComputer, this._instantiationService.createInstance(ProjectedDiffComputer, diffProvider)), + this._instantiationService.createInstance(MergeDiffComputer, diffProvider), { - resetResult: true + resetResult } ); store.add(model); @@ -365,7 +371,6 @@ class WorkspaceMergeEditorInputModel extends EditorModel implements IMergeEditor shouldConfirmClose(): boolean { // Always confirm return true; - //return this.resultTextFileModel.isDirty(); } async confirmClose(inputModels: IMergeEditorInputModel[]): Promise { @@ -394,7 +399,6 @@ class WorkspaceMergeEditorInputModel extends EditorModel implements IMergeEditor ConfirmResult.SAVE, ], [localize('workspace.doNotSave', "Don't Save"), ConfirmResult.DONT_SAVE], - // TODO [localize('workspace.discard', "Discard changes"), ConfirmResult.DONT_SAVE], [localize('workspace.cancel', 'Cancel'), ConfirmResult.CANCEL], ]; @@ -420,7 +424,6 @@ class WorkspaceMergeEditorInputModel extends EditorModel implements IMergeEditor : localize('workspace.close', 'Close'), ConfirmResult.SAVE, ], - // TODO [localize('workspace.discard', "Discard changes"), ConfirmResult.DONT_SAVE], [localize('workspace.cancel', 'Cancel'), ConfirmResult.CANCEL], ]; diff --git a/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts b/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts index 365d11269b8..0ba8f83e655 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.ts @@ -437,34 +437,6 @@ export class MergeEditorModel extends EditorModel { }); } - public acceptNonConflictingDiffs(): void { - transaction((tx) => { - /** @description Merge None Conflicting Diffs */ - this.resultTextModel.pushStackElement(); - for (const m of this.modifiedBaseRanges.get()) { - if (m.isConflicting) { - continue; - } - this.setState( - m, - m.input1Diffs.length > 0 - ? ModifiedBaseRangeState.default.withInput1(true) - : ModifiedBaseRangeState.default.withInput2(true), - true, - tx, - false - ); - } - this.resultTextModel.pushStackElement(); - }); - } - - public async resetResultToBaseAndAutoMerge() { - await waitForState(this.inputDiffComputingState, state => state === MergeEditorModelState.upToDate); - this.resultTextModel.setValue(this.base.getValue()); - this.acceptNonConflictingDiffs(); - } - public isHandled(baseRange: ModifiedBaseRange): IObservable { return this.modifiedBaseRangeResultStates.get().get(baseRange)!.handled; } diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.ts new file mode 100644 index 00000000000..dfb6979f5b1 --- /dev/null +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.ts @@ -0,0 +1,337 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { h, $, reset, createStyleSheet, isInShadowDOM } from 'vs/base/browser/dom'; +import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels'; +import { hash } from 'vs/base/common/hash'; +import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; +import { autorun, derived, IObservable, transaction } from 'vs/base/common/observable'; +import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; +import { EditorOption, EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; +import { localize } from 'vs/nls'; +import { ModifiedBaseRange, ModifiedBaseRangeState } from 'vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange'; +import { MergeEditorViewModel } from 'vs/workbench/contrib/mergeEditor/browser/view/viewModel'; + +export class ConflictActionsFactory extends Disposable { + private id = 0; + private readonly _styleClassName: string; + private readonly _styleElement: HTMLStyleElement; + + constructor(private readonly _editor: ICodeEditor) { + super(); + + this._register(this._editor.onDidChangeConfiguration((e) => { + if (e.hasChanged(EditorOption.fontInfo) || e.hasChanged(EditorOption.codeLensFontSize) || e.hasChanged(EditorOption.codeLensFontFamily)) { + this._updateLensStyle(); + } + })); + + this._styleClassName = '_conflictActionsFactory_' + hash(this._editor.getId()).toString(16); + this._styleElement = createStyleSheet( + isInShadowDOM(this._editor.getContainerDomNode()) + ? this._editor.getContainerDomNode() + : undefined + ); + + this._register(toDisposable(() => { + this._styleElement.remove(); + })); + + this._updateLensStyle(); + } + + private _updateLensStyle(): void { + + const { codeLensHeight, fontSize } = this._getLayoutInfo(); + const fontFamily = this._editor.getOption(EditorOption.codeLensFontFamily); + const editorFontInfo = this._editor.getOption(EditorOption.fontInfo); + + const fontFamilyVar = `--codelens-font-family${this._styleClassName}`; + const fontFeaturesVar = `--codelens-font-features${this._styleClassName}`; + + let newStyle = ` + .${this._styleClassName} { line-height: ${codeLensHeight}px; font-size: ${fontSize}px; padding-right: ${Math.round(fontSize * 0.5)}px; font-feature-settings: var(${fontFeaturesVar}) } + .monaco-workbench .${this._styleClassName} span.codicon { line-height: ${codeLensHeight}px; font-size: ${fontSize}px; } + `; + if (fontFamily) { + newStyle += `${this._styleClassName} { font-family: var(${fontFamilyVar}), ${EDITOR_FONT_DEFAULTS.fontFamily}}`; + } + this._styleElement.textContent = newStyle; + this._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily ?? 'inherit'); + this._editor.getContainerDomNode().style.setProperty(fontFeaturesVar, editorFontInfo.fontFeatureSettings); + } + + private _getLayoutInfo() { + const lineHeightFactor = Math.max(1.3, this._editor.getOption(EditorOption.lineHeight) / this._editor.getOption(EditorOption.fontSize)); + let fontSize = this._editor.getOption(EditorOption.codeLensFontSize); + if (!fontSize || fontSize < 5) { + fontSize = (this._editor.getOption(EditorOption.fontSize) * .9) | 0; + } + return { + fontSize, + codeLensHeight: (fontSize * lineHeightFactor) | 0, + }; + } + + createContentWidget(lineNumber: number, viewModel: MergeEditorViewModel, modifiedBaseRange: ModifiedBaseRange, inputNumber: 1 | 2): IContentWidget { + + function command(title: string, action: () => Promise, tooltip?: string): IContentWidgetAction { + return { + text: title, + action, + tooltip, + }; + } + + const items = derived('items', reader => { + if (!viewModel.model.hasBaseRange(modifiedBaseRange)) { + return []; + } + + const state = viewModel.model.getState(modifiedBaseRange).read(reader); + const handled = viewModel.model.isHandled(modifiedBaseRange).read(reader); + const model = viewModel.model; + + const result: IContentWidgetAction[] = []; + + const inputData = inputNumber === 1 ? viewModel.model.input1 : viewModel.model.input2; + const showNonConflictingChanges = viewModel.showNonConflictingChanges.read(reader); + + if (!modifiedBaseRange.isConflicting && handled && !showNonConflictingChanges) { + return []; + } + + const otherInputNumber = inputNumber === 1 ? 2 : 1; + + if (!state.conflicting && !state.isInputIncluded(inputNumber)) { + result.push( + !state.isInputIncluded(inputNumber) + ? command(localize('accept', "Accept {0}", inputData.title), async () => { + transaction((tx) => { + model.setState( + modifiedBaseRange, + state.withInputValue(inputNumber, true), + true, + tx + ); + }); + }, localize('acceptTooltip', "Accept {0} in the result document.", inputData.title)) + : command(localize('remove', "Remove {0}", inputData.title), async () => { + transaction((tx) => { + model.setState( + modifiedBaseRange, + state.withInputValue(inputNumber, false), + true, + tx + ); + }); + }, localize('removeTooltip', "Remove {0} from the result document.", inputData.title)), + ); + + if (modifiedBaseRange.canBeCombined && state.isEmpty) { + result.push( + state.input1 && state.input2 + ? command(localize('removeBoth', "Remove Both"), async () => { + transaction((tx) => { + model.setState( + modifiedBaseRange, + ModifiedBaseRangeState.default, + true, + tx + ); + }); + }, localize('removeBothTooltip', "Remove both changes from the result document.")) + : command(localize('acceptBoth', "Accept Both"), async () => { + transaction((tx) => { + model.setState( + modifiedBaseRange, + state + .withInputValue(inputNumber, true) + .withInputValue(otherInputNumber, true), + true, + tx + ); + }); + }, localize('acceptBothTooltip', "Accept an automatic combination of both sides in the result document.")), + ); + } + } + return result; + }); + return new ActionsContentWidget((this.id++).toString(), this._styleClassName, lineNumber, items); + } + + createResultWidget(lineNumber: number, viewModel: MergeEditorViewModel, modifiedBaseRange: ModifiedBaseRange): IContentWidget { + + function command(title: string, action: () => Promise, tooltip?: string): IContentWidgetAction { + return { + text: title, + action, + tooltip + }; + } + + const items = derived('items', reader => { + const state = viewModel.model.getState(modifiedBaseRange).read(reader); + const model = viewModel.model; + + const result: IContentWidgetAction[] = []; + + + if (state.conflicting) { + result.push({ + text: localize('manualResolution', "Manual Resolution"), + tooltip: localize('manualResolutionTooltip', "This conflict has been resolved manually."), + }); + } else if (state.isEmpty) { + result.push({ + text: localize('noChangesAccepted', 'No Changes Accepted'), + tooltip: localize( + 'noChangesAcceptedTooltip', + 'The current resolution of this conflict equals the common ancestor of both the right and left changes.' + ), + }); + + } else { + const labels = []; + if (state.input1) { + labels.push(model.input1.title); + } + if (state.input2) { + labels.push(model.input2.title); + } + if (state.input2First) { + labels.reverse(); + } + result.push({ + text: `${labels.join(' + ')}` + }); + } + + const stateToggles: IContentWidgetAction[] = []; + if (state.input1) { + result.push(command(localize('remove', "Remove {0}", model.input1.title), async () => { + transaction((tx) => { + model.setState( + modifiedBaseRange, + state.withInputValue(1, false), + true, + tx + ); + }); + }, localize('removeTooltip', "Remove {0} from the result document.", model.input1.title)), + ); + } + if (state.input2) { + result.push(command(localize('remove', "Remove {0}", model.input2.title), async () => { + transaction((tx) => { + model.setState( + modifiedBaseRange, + state.withInputValue(2, false), + true, + tx + ); + }); + }, localize('removeTooltip', "Remove {0} from the result document.", model.input2.title)), + ); + } + if (state.input2First) { + stateToggles.reverse(); + } + result.push(...stateToggles); + + + + if (state.conflicting) { + result.push( + command(localize('resetToBase', "Reset to base"), async () => { + transaction((tx) => { + model.setState( + modifiedBaseRange, + ModifiedBaseRangeState.default, + true, + tx + ); + }); + }, localize('resetToBaseTooltip', "Reset this conflict to the common ancestor of both the right and left changes.")), + ); + } + return result; + }); + return new ActionsContentWidget((this.id++).toString(), this._styleClassName, lineNumber, items); + } +} + + +interface IContentWidgetAction { + text: string; + tooltip?: string; + action?: () => Promise; +} + +class ActionsContentWidget extends Disposable implements IContentWidget { + private readonly _domNode = h('div.merge-editor-conflict-actions').root; + + constructor( + private readonly id: string, + className: string, + private readonly lineNumber: number, + items: IObservable, + ) { + super(); + + this._domNode.classList.add(className); + + this._register(autorun('update commands', (reader) => { + const i = items.read(reader); + this.setState(i); + })); + } + + private setState(items: IContentWidgetAction[]) { + const children: HTMLElement[] = []; + let isFirst = true; + for (const item of items) { + if (isFirst) { + isFirst = false; + } else { + children.push($('span', undefined, '\u00a0|\u00a0')); + } + const title = renderLabelWithIcons(item.text); + + if (item.action) { + children.push($('a', { title: item.tooltip, role: 'button', onclick: () => item.action!() }, ...title)); + } else { + children.push($('span', { title: item.tooltip }, ...title)); + } + } + + reset(this._domNode, ...children); + } + + getId(): string { + return this.id; + } + + getDomNode(): HTMLElement { + return this._domNode; + } + + getPosition(): IContentWidgetPosition | null { + // We cannot put the content widget after line 0, as line 0 gets normalized to line 1. + // Thus, we put the content widget before line 1 to make it slightly less buggy. + // TODO: Fix this properly. + if (this.lineNumber === 0) { + return { + position: { lineNumber: 1, column: 1, }, + preference: [ContentWidgetPositionPreference.ABOVE], + }; + } + return { + position: { lineNumber: this.lineNumber, column: 1, }, + preference: [ContentWidgetPositionPreference.BELOW], + }; + } +} diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.ts index b69a2d49b26..368dfff698e 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.ts @@ -67,6 +67,7 @@ export class BaseCodeEditorView extends CodeEditorView { return []; } const model = viewModel.model; + const textModel = model.base; const activeModifiedBaseRange = viewModel.activeModifiedBaseRange.read(reader); const showNonConflictingChanges = viewModel.showNonConflictingChanges.read(reader); @@ -98,6 +99,7 @@ export class BaseCodeEditorView extends CodeEditorView { options: { showIfCollapsed: true, blockClassName: blockClassNames.join(' '), + blockIsAfterEnd: range.startLineNumber > textModel.getLineCount(), description: 'Merge Editor', minimap: { position: MinimapPosition.Gutter, diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.ts index 27b27b276fc..7d53075c364 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.ts @@ -61,12 +61,7 @@ export abstract class CodeEditorView extends Disposable { protected readonly checkboxesVisible = observableFromEvent( this.configurationService.onDidChangeConfiguration, - () => /** @description checkboxesVisible */ this.configurationService.getValue('mergeEditor.showCheckboxes') ?? true - ); - - protected readonly codeLensesVisible = observableFromEvent( - this.configurationService.onDidChangeConfiguration, - () => /** @description codeLensesVisible */ this.configurationService.getValue('mergeEditor.showCodeLenses') ?? false + () => /** @description checkboxesVisible */ this.configurationService.getValue('mergeEditor.showCheckboxes') ?? false ); public readonly editor = this.instantiationService.createInstance( diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.ts index 9ad16bf2105..dbebe6d026e 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.ts @@ -8,21 +8,16 @@ import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels'; import { Toggle } from 'vs/base/browser/ui/toggle/toggle'; import { Action, IAction, Separator } from 'vs/base/common/actions'; import { Codicon } from 'vs/base/common/codicons'; -import { Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import { clamp } from 'vs/base/common/numbers'; import { autorun, autorunWithStore, derived, IObservable, ISettableObservable, ITransaction, observableValue, transaction } from 'vs/base/common/observable'; import { noBreakWhitespace } from 'vs/base/common/strings'; import { isDefined } from 'vs/base/common/types'; -import { URI } from 'vs/base/common/uri'; import { EditorExtensionsRegistry, IEditorContributionDescription } from 'vs/editor/browser/editorExtensions'; -import { CodeLens, CodeLensProvider, Command } from 'vs/editor/common/languages'; import { IModelDeltaDecoration, MinimapPosition, OverviewRulerLane } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; import { CodeLensContribution } from 'vs/editor/contrib/codelens/browser/codelensController'; import { localize } from 'vs/nls'; import { MenuId } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -65,14 +60,6 @@ export class InputCodeEditorView extends CodeEditorView { }, 'update checkboxes') ); - this._register( - autorunWithStore((reader, store) => { - if (this.codeLensesVisible.read(reader)) { - store.add(instantiationService.createInstance(CodeLensPart, this)); - } - }, 'update code lens part') - ); - this._register( createSelectionsAutorun(this, (baseRange, viewModel) => viewModel.model.translateBaseRangeToInput(this.inputNumber, baseRange) @@ -135,6 +122,7 @@ export class InputCodeEditorView extends CodeEditorView { return []; } const model = viewModel.model; + const textModel = (this.inputNumber === 1 ? model.input1 : model.input2).textModel; const activeModifiedBaseRange = viewModel.activeModifiedBaseRange.read(reader); @@ -171,6 +159,7 @@ export class InputCodeEditorView extends CodeEditorView { options: { showIfCollapsed: true, blockClassName: blockClassNames.join(' '), + blockIsAfterEnd: range.startLineNumber > textModel.getLineCount(), description: 'Merge Editor', minimap: { position: MinimapPosition.Gutter, @@ -216,143 +205,10 @@ export class InputCodeEditorView extends CodeEditorView { }); protected override getEditorContributions(): IEditorContributionDescription[] | undefined { - if (this.codeLensesVisible.get()) { - return undefined; - } return EditorExtensionsRegistry.getEditorContributions().filter(c => c.id !== CodeLensContribution.ID); } } -class CodeLensPart extends Disposable { - public static commandCounter = 0; - - constructor( - inputCodeEditorView: InputCodeEditorView, - @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, - ) { - super(); - - const codeLensCommandId = `mergeEditor.codeLensCommandInput${CodeLensPart.commandCounter++}`; - this._register(CommandsRegistry.registerCommand(codeLensCommandId, (accessor, arg) => { - arg(); - })); - - function command(title: string, callback: () => Promise): Command { - return { - title, - id: codeLensCommandId, - arguments: [callback], - }; - } - - const codeLenses = derived<{ codeLenses: CodeLens[]; uri: URI } | undefined>('codeLenses', reader => { - const viewModel = inputCodeEditorView.viewModel.read(reader); - if (!viewModel) { - return undefined; - } - const model = viewModel.model; - const inputData = inputCodeEditorView.inputNumber === 1 ? viewModel.model.input1 : viewModel.model.input2; - - const showNonConflictingChanges = viewModel.showNonConflictingChanges.read(reader); - - return { - codeLenses: viewModel.model.modifiedBaseRanges.read(reader).flatMap(r => { - const range = r.getInputRange(inputCodeEditorView.inputNumber).toRange(); - - const handled = model.isHandled(r).read(reader); - const state = model.getState(r).read(reader); - const result: CodeLens[] = []; - - if (!r.isConflicting && handled && !showNonConflictingChanges) { - return []; - } - - if (!state.conflicting && !state.isInputIncluded(inputCodeEditorView.inputNumber)) { - result.push( - { - range, - command: - !state.isInputIncluded(inputCodeEditorView.inputNumber) - ? command(`$(pass) Accept ${inputData.title}`, async () => { - transaction((tx) => { - model.setState( - r, - state.withInputValue(inputCodeEditorView.inputNumber, true), - true, - tx - ); - }); - }) - : command(`$(error) Remove ${inputData.title}`, async () => { - transaction((tx) => { - model.setState( - r, - state.withInputValue(inputCodeEditorView.inputNumber, false), - true, - tx - ); - }); - }), - } - ); - - if (r.canBeCombined && state.isEmpty) { - result.push({ - range, - command: - state.input1 && state.input2 - ? command(`$(error) Remove Both`, async () => { - transaction((tx) => { - model.setState( - r, - ModifiedBaseRangeState.default, - true, - tx - ); - }); - }) - : command(`$(pass) Accept Both`, async () => { - transaction((tx) => { - model.setState( - r, - state - .withInputValue(inputCodeEditorView.inputNumber, true) - .withInputValue(inputCodeEditorView.otherInputNumber, true), - true, - tx - ); - }); - }), - }); - } - } - if (result.length === 0) { - result.push({ - range: range, - command: command(` `, async () => { }) - }); - } - return result; - }), - uri: inputData.textModel.uri - }; - }); - - const codeLensProvider: CodeLensProvider = { - onDidChange: Event.map(Event.fromObservable(codeLenses), () => codeLensProvider), - async provideCodeLenses(model, token) { - const result = codeLenses.get(); - if (!result || result.uri.toString() !== model.uri.toString()) { - return { lenses: [], dispose: () => { } }; - } - return { lenses: result.codeLenses, dispose: () => { } }; - } - }; - - this._register(languageFeaturesService.codeLensProvider.register({ pattern: '**/*' }, codeLensProvider)); - } -} - export class ModifiedBaseRangeGutterItemModel implements IGutterItemInfo { private readonly model = this.viewModel.model; public readonly range = this.baseRange.getInputRange(this.inputNumber); diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.ts index 82c2ff6d315..a43d5ca319e 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.ts @@ -7,23 +7,16 @@ import { reset } from 'vs/base/browser/dom'; import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels'; import { CompareResult } from 'vs/base/common/arrays'; import { BugIndicatingError } from 'vs/base/common/errors'; -import { Event } from 'vs/base/common/event'; -import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { autorun, autorunWithStore, derived, IObservable, transaction } from 'vs/base/common/observable'; -import { URI } from 'vs/base/common/uri'; -import { CodeLens, CodeLensProvider, Command } from 'vs/editor/common/languages'; +import { toDisposable } from 'vs/base/common/lifecycle'; +import { autorun, autorunWithStore, derived, IObservable } from 'vs/base/common/observable'; import { IModelDeltaDecoration, MinimapPosition, OverviewRulerLane } from 'vs/editor/common/model'; -import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; import { localize } from 'vs/nls'; import { MenuId } from 'vs/platform/actions/common/actions'; -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILabelService } from 'vs/platform/label/common/label'; -import { MergeMarkersController } from 'vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController'; import { LineRange } from 'vs/workbench/contrib/mergeEditor/browser/model/lineRange'; -import { ModifiedBaseRangeState } from 'vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange'; import { applyObservableDecorations, join } from 'vs/workbench/contrib/mergeEditor/browser/utils'; import { handledConflictMinimapOverViewRulerColor, unhandledConflictMinimapOverViewRulerColor } from 'vs/workbench/contrib/mergeEditor/browser/view/colors'; import { EditorGutter } from 'vs/workbench/contrib/mergeEditor/browser/view/editorGutter'; @@ -47,16 +40,6 @@ export class ResultCodeEditorView extends CodeEditorView { this._register(toDisposable(() => isMergeResultEditor.reset())); }); - this._register(new MergeMarkersController(this.editor, this.viewModel)); - - this._register( - autorunWithStore((reader, store) => { - if (this.codeLensesVisible.read(reader)) { - store.add(instantiationService.createInstance(CodeLensPart, this)); - } - }, 'update code lens part') - ); - this.htmlElements.gutterDiv.style.width = '5px'; this._register( @@ -130,6 +113,7 @@ export class ResultCodeEditorView extends CodeEditorView { return []; } const model = viewModel.model; + const textModel = model.resultTextModel; const result = new Array(); const baseRangeWithStoreAndTouchingDiffs = join( @@ -168,11 +152,13 @@ export class ResultCodeEditorView extends CodeEditorView { continue; } + const range = model.getLineRangeInResult(modifiedBaseRange.baseRange, reader); result.push({ - range: model.getLineRangeInResult(modifiedBaseRange.baseRange, reader).toInclusiveRangeOrEmpty(), + range: range.toInclusiveRangeOrEmpty(), options: { showIfCollapsed: true, blockClassName: blockClassNames.join(' '), + blockIsAfterEnd: range.startLineNumber > textModel.getLineCount(), description: 'Result Diff', minimap: { position: MinimapPosition.Gutter, @@ -184,10 +170,8 @@ export class ResultCodeEditorView extends CodeEditorView { } : undefined } }); - } - if (!modifiedBaseRange || modifiedBaseRange.isConflicting) { for (const diff of m.rights) { const range = diff.outputRange.toInclusiveRange(); @@ -219,147 +203,3 @@ export class ResultCodeEditorView extends CodeEditorView { return result; }); } - -class CodeLensPart extends Disposable { - public static commandCounter = 0; - - constructor( - resultCodeEditorView: ResultCodeEditorView, - @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, - ) { - super(); - - const codeLensCommandId = `mergeEditor.codeLensCommandResult${CodeLensPart.commandCounter++}`; - this._register(CommandsRegistry.registerCommand(codeLensCommandId, (accessor, arg) => { - arg(); - })); - - function command(title: string, callback: () => Promise): Command { - return { - title, - id: codeLensCommandId, - arguments: [callback], - }; - } - - const codeLenses = derived<{ codeLenses: CodeLens[]; uri: URI } | undefined>('codeLenses', reader => { - const viewModel = resultCodeEditorView.viewModel.read(reader); - if (!viewModel) { - return undefined; - } - const model = viewModel.model; - const showNonConflictingChanges = viewModel.showNonConflictingChanges.read(reader); - - return { - codeLenses: viewModel.model.modifiedBaseRanges.read(reader).flatMap(r => { - const range = model.getLineRangeInResult(r.baseRange, reader).toRange(); - - const handled = model.isHandled(r).read(reader); - const state = model.getState(r).read(reader); - const result: CodeLens[] = []; - - if (!r.isConflicting && handled && !showNonConflictingChanges) { - return []; - } - - const stateLabel = ((state: ModifiedBaseRangeState): string => { - if (state.conflicting) { - return '= Manual Resolution'; - } else if (state.isEmpty) { - return '= Base'; - } else { - const labels = []; - if (state.input1) { - labels.push(model.input1.title); - } - if (state.input2) { - labels.push(model.input2.title); - } - return `= ${labels.join(' + ')}`; - } - })(state); - - result.push({ - range, - command: { - title: stateLabel, - id: 'notSupported', - } - }); - - - const stateToggles: CodeLens[] = []; - if (state.input1) { - result.push({ - range, - command: command(`$(error) Remove ${model.input1.title}`, async () => { - transaction((tx) => { - model.setState( - r, - state.withInputValue(1, false), - true, - tx - ); - }); - }), - }); - } - if (state.input2) { - result.push({ - range, - command: command(`$(error) Remove ${model.input2.title}`, async () => { - transaction((tx) => { - model.setState( - r, - state.withInputValue(2, false), - true, - tx - ); - }); - }), - }); - } - if (state.input2First) { - stateToggles.reverse(); - } - result.push(...stateToggles); - - - - if (state.conflicting) { - result.push( - { - range, - command: command(`$(error) Reset to base`, async () => { - transaction((tx) => { - model.setState( - r, - ModifiedBaseRangeState.default, - true, - tx - ); - }); - }) - } - ); - } - return result; - }), - uri: model.resultTextModel.uri, - }; - }); - - const codeLensProvider: CodeLensProvider = { - onDidChange: Event.map(Event.fromObservable(codeLenses), () => codeLensProvider), - async provideCodeLenses(model, token) { - const result = codeLenses.get(); - if (!result || result.uri.toString() !== model.uri.toString()) { - return { lenses: [], dispose: () => { } }; - } - return { lenses: result.codeLenses, dispose: () => { } }; - } - }; - - this._register(languageFeaturesService.codeLensProvider.register({ pattern: '**/*' }, codeLensProvider)); - } -} diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css b/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css index c105dd827fb..684f8bad077 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css @@ -229,3 +229,46 @@ .merge-conflict-input-selection { background-color: red; } + +.merge-editor-conflict-actions { + margin: -4px 3px; +} + +.merge-editor-conflict-actions { + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + color: var(--vscode-editorCodeLens-foreground) +} + +.merge-editor-conflict-actions>span, +.merge-editor-conflict-actions>a { + user-select: none; + -webkit-user-select: none; + white-space: nowrap; + vertical-align: sub; +} + +.merge-editor-conflict-actions>a { + text-decoration: none; +} + +.merge-editor-conflict-actions>a:hover { + cursor: pointer; + color: var(--vscode-editorLink-activeForeground) !important; +} + +.merge-editor-conflict-actions>a:hover .codicon { + color: var(--vscode-editorLink-activeForeground) !important; +} + +.merge-editor-conflict-actions .codicon { + vertical-align: middle; + color: currentColor !important; + color: var(--vscode-editorCodeLens-foreground); +} + +.merge-editor-conflict-actions>a:hover .codicon::before { + cursor: pointer; +} diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts index b956e502130..32216d538b5 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.ts @@ -11,8 +11,8 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { Color } from 'vs/base/common/color'; import { BugIndicatingError, onUnexpectedError } from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, DisposableStore, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { autorun, autorunWithStore, IObservable, IReader, observableValue, transaction } from 'vs/base/common/observable'; +import { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { autorun, autorunWithStore, IObservable, IReader, observableFromEvent, observableValue, transaction } from 'vs/base/common/observable'; import { basename, isEqual } from 'vs/base/common/resources'; import { isDefined } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; @@ -46,12 +46,13 @@ import { deepMerge, join, PersistentStore, thenIfNotDisposed } from 'vs/workbenc import { BaseCodeEditorView } from 'vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView'; import { ScrollSynchronizer } from 'vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer'; import { MergeEditorViewModel } from 'vs/workbench/contrib/mergeEditor/browser/view/viewModel'; -import { ctxIsMergeEditor, ctxMergeBaseUri, ctxMergeEditorLayout, ctxMergeEditorShowBase, ctxMergeEditorShowNonConflictingChanges, ctxMergeResultUri, MergeEditorLayoutKind } from 'vs/workbench/contrib/mergeEditor/common/mergeEditor'; +import { ctxIsMergeEditor, ctxMergeBaseUri, ctxMergeEditorLayout, ctxMergeEditorShowBase, ctxMergeEditorShowBaseAtTop, ctxMergeEditorShowNonConflictingChanges, ctxMergeResultUri, MergeEditorLayoutKind } from 'vs/workbench/contrib/mergeEditor/common/mergeEditor'; import { settingsSashBorder } from 'vs/workbench/contrib/preferences/common/settingsEditorColorRegistry'; import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IEditorResolverService, MergeEditorInputFactoryFunction, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import './colors'; +import { ConflictActionsFactory } from './conflictActions'; import { InputCodeEditorView } from './editors/inputCodeEditorView'; import { ResultCodeEditorView } from './editors/resultCodeEditorView'; import { getAlignments } from './lineAlignment'; @@ -77,12 +78,13 @@ export class MergeEditor extends AbstractTextEditor { private readonly inputResultView = this._register(this.instantiationService.createInstance(ResultCodeEditorView, this._viewModel)); private readonly _layoutMode = this.instantiationService.createInstance(MergeEditorLayoutStore); private readonly _layoutModeObs = observableValue('layoutMode', this._layoutMode.value); - private readonly _ctxIsMergeEditor: IContextKey; - private readonly _ctxUsesColumnLayout: IContextKey; - private readonly _ctxShowBase: IContextKey; - private readonly _ctxResultUri: IContextKey; - private readonly _ctxBaseUri: IContextKey; - private readonly _ctxShowNonConflictingChanges: IContextKey; + private readonly _ctxIsMergeEditor: IContextKey = ctxIsMergeEditor.bindTo(this.contextKeyService); + private readonly _ctxUsesColumnLayout: IContextKey = ctxMergeEditorLayout.bindTo(this.contextKeyService); + private readonly _ctxShowBase: IContextKey = ctxMergeEditorShowBase.bindTo(this.contextKeyService); + private readonly _ctxShowBaseAtTop = ctxMergeEditorShowBaseAtTop.bindTo(this.contextKeyService); + private readonly _ctxResultUri: IContextKey = ctxMergeResultUri.bindTo(this.contextKeyService); + private readonly _ctxBaseUri: IContextKey = ctxMergeBaseUri.bindTo(this.contextKeyService); + private readonly _ctxShowNonConflictingChanges: IContextKey = ctxMergeEditorShowNonConflictingChanges.bindTo(this.contextKeyService); private readonly _inputModel = observableValue('inputModel', undefined); public get inputModel(): IObservable { return this._inputModel; @@ -95,9 +97,20 @@ export class MergeEditor extends AbstractTextEditor { return !!this._configurationService.getValue('mergeEditor.writableInputs'); } + private readonly conflictActionsFactoryInput1 = new ConflictActionsFactory(this.input1View.editor); + private readonly conflictActionsFactoryInput2 = new ConflictActionsFactory(this.input2View.editor); + private readonly conflictActionsFactoryResult = new ConflictActionsFactory(this.inputResultView.editor); + + protected readonly codeLensesVisible = observableFromEvent( + this.configurationService.onDidChangeConfiguration, + () => /** @description codeLensesVisible */ this.configurationService.getValue('mergeEditor.showCodeLenses') ?? true + ); + + private readonly scrollSynchronizer = this._register(new ScrollSynchronizer(this._viewModel, this.input1View, this.input2View, this.baseView, this.inputResultView, this._layoutModeObs)); + constructor( @IInstantiationService instantiation: IInstantiationService, - @IContextKeyService contextKeyService: IContextKeyService, + @IContextKeyService private readonly contextKeyService: IContextKeyService, @ITelemetryService telemetryService: ITelemetryService, @IStorageService storageService: IStorageService, @IThemeService themeService: IThemeService, @@ -107,17 +120,9 @@ export class MergeEditor extends AbstractTextEditor { @IEditorGroupsService editorGroupService: IEditorGroupsService, @IFileService fileService: IFileService, @ICodeEditorService private readonly _codeEditorService: ICodeEditorService, + @IConfigurationService private readonly configurationService: IConfigurationService ) { super(MergeEditor.ID, telemetryService, instantiation, storageService, textResourceConfigurationService, themeService, editorService, editorGroupService, fileService); - - this._ctxIsMergeEditor = ctxIsMergeEditor.bindTo(contextKeyService); - this._ctxUsesColumnLayout = ctxMergeEditorLayout.bindTo(contextKeyService); - this._ctxBaseUri = ctxMergeBaseUri.bindTo(contextKeyService); - this._ctxResultUri = ctxMergeResultUri.bindTo(contextKeyService); - this._ctxShowBase = ctxMergeEditorShowBase.bindTo(contextKeyService); - this._ctxShowNonConflictingChanges = ctxMergeEditorShowNonConflictingChanges.bindTo(contextKeyService); - - this._register(new ScrollSynchronizer(this._viewModel, this.input1View, this.input2View, this.baseView, this.inputResultView)); } override dispose(): void { @@ -212,69 +217,55 @@ export class MergeEditor extends AbstractTextEditor { this._ctxResultUri.reset(); })); + // Set the view zones before restoring view state! // Otherwise scrolling will be off this._sessionDisposables.add(autorunWithStore((reader, store) => { - const input1ViewZoneIds: string[] = []; - const input2ViewZoneIds: string[] = []; - const baseViewZoneIds: string[] = []; - const resultViewZoneIds: string[] = []; const baseView = this.baseView.read(reader); this.inputResultView.editor.changeViewZones(resultViewZoneAccessor => { - const actualResultViewZoneAccessor = this._layoutModeObs.read(reader).kind === 'columns' ? resultViewZoneAccessor : undefined; + const layout = this._layoutModeObs.read(reader); + const shouldAlignResult = layout.kind === 'columns'; + const shouldAlignBase = layout.kind === 'mixed' && !layout.showBaseAtTop; this.input1View.editor.changeViewZones(input1ViewZoneAccessor => { this.input2View.editor.changeViewZones(input2ViewZoneAccessor => { if (baseView) { baseView.editor.changeViewZones(baseViewZoneAccessor => { - setViewZones(reader, - input1ViewZoneIds, input1ViewZoneAccessor, - input2ViewZoneIds, input2ViewZoneAccessor, - baseViewZoneIds, /*baseViewZoneAccessor,*/ undefined, - resultViewZoneIds, actualResultViewZoneAccessor, - ); + store.add(this.setViewZones(reader, + viewModel, + this.input1View.editor, + input1ViewZoneAccessor, + this.input2View.editor, + input2ViewZoneAccessor, + baseView.editor, + baseViewZoneAccessor, + shouldAlignBase, + this.inputResultView.editor, + resultViewZoneAccessor, + shouldAlignResult + )); }); } else { - setViewZones(reader, - input1ViewZoneIds, + store.add(this.setViewZones(reader, + viewModel, + this.input1View.editor, input1ViewZoneAccessor, - input2ViewZoneIds, + this.input2View.editor, input2ViewZoneAccessor, - baseViewZoneIds, undefined, - resultViewZoneIds, actualResultViewZoneAccessor, - ); + undefined, + false, + this.inputResultView.editor, + resultViewZoneAccessor, + shouldAlignResult + )); } }); }); }); - store.add({ - dispose: () => { - this.input1View.editor.changeViewZones(a => { - for (const zone of input1ViewZoneIds) { - a.removeZone(zone); - } - }); - this.input2View.editor.changeViewZones(a => { - for (const zone of input2ViewZoneIds) { - a.removeZone(zone); - } - }); - this.baseView.get()?.editor.changeViewZones(a => { - for (const zone of baseViewZoneIds) { - a.removeZone(zone); - } - }); - this.inputResultView.editor.changeViewZones(a => { - for (const zone of resultViewZoneIds) { - a.removeZone(zone); - } - }); - } - }); - + this.scrollSynchronizer.updateScrolling(); }, 'update alignment view zones')); const viewState = this.loadEditorViewState(input, context); @@ -287,6 +278,10 @@ export class MergeEditor extends AbstractTextEditor { return; } this.input1View.editor.revealLineInCenter(firstConflict.input1Range.startLineNumber); + transaction(tx => { + /** @description setActiveModifiedBaseRange */ + viewModel.setActiveModifiedBaseRange(firstConflict, tx); + }); })); } @@ -340,146 +335,233 @@ export class MergeEditor extends AbstractTextEditor { ); } }); + } - function setViewZones( - reader: IReader, - input1ViewZoneIds: string[], - input1ViewZoneAccessor: IViewZoneChangeAccessor, - input2ViewZoneIds: string[], - input2ViewZoneAccessor: IViewZoneChangeAccessor, - baseViewZoneIds: string[], - baseViewZoneAccessor: IViewZoneChangeAccessor | undefined, - resultViewZoneIds: string[], - resultViewZoneAccessor: IViewZoneChangeAccessor | undefined, - ) { - let input1LinesAdded = 0; - let input2LinesAdded = 0; - let baseLinesAdded = 0; - let resultLinesAdded = 0; + private setViewZones( + reader: IReader, + viewModel: MergeEditorViewModel, + input1Editor: ICodeEditor, + input1ViewZoneAccessor: IViewZoneChangeAccessor, + input2Editor: ICodeEditor, + input2ViewZoneAccessor: IViewZoneChangeAccessor, + baseEditor: ICodeEditor | undefined, + baseViewZoneAccessor: IViewZoneChangeAccessor | undefined, + shouldAlignBase: boolean, + resultEditor: ICodeEditor, + resultViewZoneAccessor: IViewZoneChangeAccessor, + shouldAlignResult: boolean, + ): IDisposable { + let input1LinesAdded = 0; + let input2LinesAdded = 0; + let baseLinesAdded = 0; + let resultLinesAdded = 0; - const resultDiffs = model.baseResultDiffs.read(reader); - const baseRangeWithStoreAndTouchingDiffs = join( - model.modifiedBaseRanges.read(reader), - resultDiffs, - (baseRange, diff) => - baseRange.baseRange.touches(diff.inputRange) - ? CompareResult.neitherLessOrGreaterThan - : LineRange.compareByStart( - baseRange.baseRange, - diff.inputRange - ) - ); + const model = viewModel.model; - let lastModifiedBaseRange: ModifiedBaseRange | undefined = undefined; - let lastBaseResultDiff: DetailedLineRangeMapping | undefined = undefined; - for (const m of baseRangeWithStoreAndTouchingDiffs) { - interface LineAlignment { - baseLine: number; - input1Line?: number; - input2Line?: number; - resultLine?: number; - } + const input1ViewZoneIds: string[] = []; + const input2ViewZoneIds: string[] = []; + const baseViewZoneIds: string[] = []; + const resultViewZoneIds: string[] = []; - const lastResultDiff = lastOrDefault(m.rights)!; - if (lastResultDiff) { - lastBaseResultDiff = lastResultDiff; - } - let alignedLines: LineAlignment[]; - if (m.left) { - alignedLines = getAlignments(m.left).map(a => ({ - input1Line: a[0], - baseLine: a[1], - input2Line: a[2], - resultLine: undefined, + const resultDiffs = model.baseResultDiffs.read(reader); + const baseRangeWithStoreAndTouchingDiffs = join( + model.modifiedBaseRanges.read(reader), + resultDiffs, + (baseRange, diff) => + baseRange.baseRange.touches(diff.inputRange) + ? CompareResult.neitherLessOrGreaterThan + : LineRange.compareByStart( + baseRange.baseRange, + diff.inputRange + ) + ); + + const disposableStore = new DisposableStore(); + disposableStore.add({ + dispose: () => { + input1Editor.changeViewZones(a => { + for (const zone of input1ViewZoneIds) { + a.removeZone(zone); + } + }); + input2Editor.changeViewZones(a => { + for (const zone of input2ViewZoneIds) { + a.removeZone(zone); + } + }); + baseEditor?.changeViewZones(a => { + for (const zone of baseViewZoneIds) { + a.removeZone(zone); + } + }); + resultEditor.changeViewZones(a => { + for (const zone of resultViewZoneIds) { + a.removeZone(zone); + } + }); + } + }); + + const shouldShowCodeLenses = this.codeLensesVisible.read(reader); + const showNonConflictingChanges = this.showNonConflictingChanges.read(reader); + + let lastModifiedBaseRange: ModifiedBaseRange | undefined = undefined; + let lastBaseResultDiff: DetailedLineRangeMapping | undefined = undefined; + for (const m of baseRangeWithStoreAndTouchingDiffs) { + + if (shouldShowCodeLenses && m.left && (m.left.isConflicting || showNonConflictingChanges || !model.isHandled(m.left).read(reader))) { + + input1ViewZoneIds.push(input1ViewZoneAccessor.addZone({ + afterLineNumber: m.left.input1Range.startLineNumber - 1, + heightInPx: 16, + domNode: $('div.conflict-actions-placeholder'), + })); + const w1 = this.conflictActionsFactoryInput1.createContentWidget(m.left.input1Range.startLineNumber - 1, viewModel, m.left, this.input1View.inputNumber); + input1Editor.addContentWidget(w1); + disposableStore.add(toDisposable(() => { + input1Editor.removeContentWidget(w1); + })); + + + input2ViewZoneIds.push(input2ViewZoneAccessor.addZone({ + afterLineNumber: m.left.input2Range.startLineNumber - 1, + heightInPx: 16, + domNode: $('div.conflict-actions-placeholder'), + })); + const w2 = this.conflictActionsFactoryInput2.createContentWidget(m.left.input2Range.startLineNumber - 1, viewModel, m.left, this.input2View.inputNumber); + input2Editor.addContentWidget(w2); + disposableStore.add(toDisposable(() => { + input2Editor.removeContentWidget(w2); + })); + + const afterLineNumber = m.left.baseRange.startLineNumber + (lastBaseResultDiff?.resultingDeltaFromOriginalToModified ?? 0) - 1; + resultViewZoneIds.push(resultViewZoneAccessor.addZone({ + afterLineNumber, + heightInPx: 16, + domNode: $('div.conflict-actions-placeholder'), + })); + const w3 = this.conflictActionsFactoryResult.createResultWidget(afterLineNumber, viewModel, m.left); + resultEditor.addContentWidget(w3); + disposableStore.add(toDisposable(() => { + resultEditor.removeContentWidget(w3); + })); + + if (shouldAlignBase && baseViewZoneAccessor) { + baseViewZoneIds.push(baseViewZoneAccessor.addZone({ + afterLineNumber: m.left.baseRange.startLineNumber - 1, + heightInPx: 16, + domNode: $('div.conflict-actions-placeholder'), })); + } + } - lastModifiedBaseRange = m.left; - // This is a total hack. - alignedLines[alignedLines.length - 1].resultLine = - m.left.baseRange.endLineNumberExclusive - + (lastBaseResultDiff ? lastBaseResultDiff.resultingDeltaFromOriginalToModified : 0); + interface LineAlignment { + baseLine: number; + input1Line?: number; + input2Line?: number; + resultLine?: number; + } - } else { - alignedLines = [{ - baseLine: lastResultDiff.inputRange.endLineNumberExclusive, - input1Line: lastResultDiff.inputRange.endLineNumberExclusive + (lastModifiedBaseRange ? (lastModifiedBaseRange.input1Range.endLineNumberExclusive - lastModifiedBaseRange.baseRange.endLineNumberExclusive) : 0), - input2Line: lastResultDiff.inputRange.endLineNumberExclusive + (lastModifiedBaseRange ? (lastModifiedBaseRange.input2Range.endLineNumberExclusive - lastModifiedBaseRange.baseRange.endLineNumberExclusive) : 0), - resultLine: lastResultDiff.outputRange.endLineNumberExclusive, - }]; + const lastResultDiff = lastOrDefault(m.rights)!; + if (lastResultDiff) { + lastBaseResultDiff = lastResultDiff; + } + let alignedLines: LineAlignment[]; + if (m.left) { + alignedLines = getAlignments(m.left).map(a => ({ + input1Line: a[0], + baseLine: a[1], + input2Line: a[2], + resultLine: undefined, + })); + + lastModifiedBaseRange = m.left; + // This is a total hack. + alignedLines[alignedLines.length - 1].resultLine = + m.left.baseRange.endLineNumberExclusive + + (lastBaseResultDiff ? lastBaseResultDiff.resultingDeltaFromOriginalToModified : 0); + + } else { + alignedLines = [{ + baseLine: lastResultDiff.inputRange.endLineNumberExclusive, + input1Line: lastResultDiff.inputRange.endLineNumberExclusive + (lastModifiedBaseRange ? (lastModifiedBaseRange.input1Range.endLineNumberExclusive - lastModifiedBaseRange.baseRange.endLineNumberExclusive) : 0), + input2Line: lastResultDiff.inputRange.endLineNumberExclusive + (lastModifiedBaseRange ? (lastModifiedBaseRange.input2Range.endLineNumberExclusive - lastModifiedBaseRange.baseRange.endLineNumberExclusive) : 0), + resultLine: lastResultDiff.outputRange.endLineNumberExclusive, + }]; + } + + for (const { input1Line, baseLine, input2Line, resultLine } of alignedLines) { + if (!shouldAlignBase && (input1Line === undefined || input2Line === undefined)) { + continue; } - for (const { input1Line, baseLine, input2Line, resultLine } of alignedLines) { - if (!baseViewZoneAccessor && (input1Line === undefined || input2Line === undefined)) { - continue; + const input1Line_ = + input1Line !== undefined ? input1Line + input1LinesAdded : -1; + const input2Line_ = + input2Line !== undefined ? input2Line + input2LinesAdded : -1; + const baseLine_ = baseLine + baseLinesAdded; + const resultLine_ = resultLine !== undefined ? resultLine + resultLinesAdded : -1; + + const max = Math.max(shouldAlignBase ? baseLine_ : 0, input1Line_, input2Line_, shouldAlignResult ? resultLine_ : 0); + + if (input1Line !== undefined) { + const diffInput1 = max - input1Line_; + if (diffInput1 > 0) { + input1ViewZoneIds.push( + input1ViewZoneAccessor.addZone({ + afterLineNumber: input1Line - 1, + heightInLines: diffInput1, + domNode: $('div.diagonal-fill'), + }) + ); + input1LinesAdded += diffInput1; } + } - const input1Line_ = - input1Line !== undefined ? input1Line + input1LinesAdded : -1; - const input2Line_ = - input2Line !== undefined ? input2Line + input2LinesAdded : -1; - const baseLine_ = baseLine + baseLinesAdded; - const resultLine_ = resultLine !== undefined ? resultLine + resultLinesAdded : -1; - - const max = Math.max(baseViewZoneAccessor ? baseLine_ : 0, input1Line_, input2Line_, resultLine_); - - if (input1Line !== undefined) { - const diffInput1 = max - input1Line_; - if (diffInput1 > 0) { - input1ViewZoneIds.push( - input1ViewZoneAccessor.addZone({ - afterLineNumber: input1Line - 1, - heightInLines: diffInput1, - domNode: $('div.diagonal-fill'), - }) - ); - input1LinesAdded += diffInput1; - } + if (input2Line !== undefined) { + const diffInput2 = max - input2Line_; + if (diffInput2 > 0) { + input2ViewZoneIds.push( + input2ViewZoneAccessor.addZone({ + afterLineNumber: input2Line - 1, + heightInLines: diffInput2, + domNode: $('div.diagonal-fill'), + }) + ); + input2LinesAdded += diffInput2; } + } - if (input2Line !== undefined) { - const diffInput2 = max - input2Line_; - if (diffInput2 > 0) { - input2ViewZoneIds.push( - input2ViewZoneAccessor.addZone({ - afterLineNumber: input2Line - 1, - heightInLines: diffInput2, - domNode: $('div.diagonal-fill'), - }) - ); - input2LinesAdded += diffInput2; - } + if (shouldAlignBase && baseViewZoneAccessor) { + const diffBase = max - baseLine_; + if (diffBase > 0) { + baseViewZoneIds.push( + baseViewZoneAccessor.addZone({ + afterLineNumber: baseLine - 1, + heightInLines: diffBase, + domNode: $('div.diagonal-fill'), + }) + ); + baseLinesAdded += diffBase; } + } - if (baseViewZoneAccessor) { - const diffBase = max - baseLine_; - if (diffBase > 0) { - baseViewZoneIds.push( - baseViewZoneAccessor.addZone({ - afterLineNumber: baseLine - 1, - heightInLines: diffBase, - domNode: $('div.diagonal-fill'), - }) - ); - baseLinesAdded += diffBase; - } - } - - if (resultViewZoneAccessor && resultLine !== undefined) { - const diffResult = max - resultLine_; - if (diffResult > 0) { - resultViewZoneIds.push( - resultViewZoneAccessor.addZone({ - afterLineNumber: resultLine - 1, - heightInLines: diffResult, - domNode: $('div.diagonal-fill'), - }) - ); - resultLinesAdded += diffResult; - } + if (shouldAlignResult && resultViewZoneAccessor && resultLine !== undefined) { + const diffResult = max - resultLine_; + if (diffResult > 0) { + resultViewZoneIds.push( + resultViewZoneAccessor.addZone({ + afterLineNumber: resultLine - 1, + heightInLines: diffResult, + domNode: $('div.diagonal-fill'), + }) + ); + resultLinesAdded += diffResult; } } } } + return disposableStore; } override setOptions(options: ITextEditorOptions | undefined): void { @@ -630,6 +712,7 @@ export class MergeEditor extends AbstractTextEditor { this._layoutMode.value = layout; this._ctxUsesColumnLayout.set(layout.kind); this._ctxShowBase.set(layout.showBase); + this._ctxShowBaseAtTop.set(layout.showBaseAtTop); this._onDidChangeSizeConstraints.fire(); this._layoutModeObs.set(layout, tx); }); @@ -704,7 +787,7 @@ export class MergeEditor extends AbstractTextEditor { } } -interface IMergeEditorLayout { +export interface IMergeEditorLayout { readonly kind: MergeEditorLayoutKind; readonly showBase: boolean; readonly showBaseAtTop: boolean; diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.ts index 854418a297b..1fd54b6b7e6 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.ts @@ -10,6 +10,7 @@ import { ScrollType } from 'vs/editor/common/editorCommon'; import { DocumentLineRangeMap } from 'vs/workbench/contrib/mergeEditor/browser/model/mapping'; import { ReentrancyBarrier } from 'vs/workbench/contrib/mergeEditor/browser/utils'; import { BaseCodeEditorView } from 'vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView'; +import { IMergeEditorLayout } from 'vs/workbench/contrib/mergeEditor/browser/view/mergeEditor'; import { MergeEditorViewModel } from 'vs/workbench/contrib/mergeEditor/browser/view/viewModel'; import { InputCodeEditorView } from './editors/inputCodeEditorView'; import { ResultCodeEditorView } from './editors/resultCodeEditorView'; @@ -19,21 +20,44 @@ export class ScrollSynchronizer extends Disposable { private readonly reentrancyBarrier = new ReentrancyBarrier(); + public readonly updateScrolling: () => void; + + private get shouldAlignResult() { return this.layout.get().kind === 'columns'; } + private get shouldAlignBase() { return this.layout.get().kind === 'mixed' && !this.layout.get().showBaseAtTop; } + constructor( private readonly viewModel: IObservable, private readonly input1View: InputCodeEditorView, private readonly input2View: InputCodeEditorView, private readonly baseView: IObservable, - private readonly inputResultView: ResultCodeEditorView + private readonly inputResultView: ResultCodeEditorView, + private readonly layout: IObservable, ) { super(); - const handleInput1OnScroll = () => { - const mapping = this.model?.input1ResultMapping.get(); - this.synchronizeScrolling(this.input1View.editor, this.inputResultView.editor, mapping); + const handleInput1OnScroll = this.updateScrolling = () => { + if (!this.model) { + return; + } + this.input2View.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate); - this.baseView.get()?.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate); + if (this.shouldAlignResult) { + this.inputResultView.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate); + } else { + const mappingInput1Result = this.model!.input1ResultMapping.get(); + this.synchronizeScrolling(this.input1View.editor, this.inputResultView.editor, mappingInput1Result); + } + + const baseView = this.baseView.get(); + if (baseView) { + if (this.shouldAlignBase) { + this.baseView.get()?.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate); + } else { + const mapping = new DocumentLineRangeMap(this.model!.baseInput1Diffs.get(), -1).reverse(); + this.synchronizeScrolling(this.input1View.editor, baseView.editor, mapping); + } + } }; this._store.add( @@ -54,12 +78,29 @@ export class ScrollSynchronizer extends Disposable { this._store.add( this.input2View.editor.onDidScrollChange( this.reentrancyBarrier.makeExclusive((c) => { + if (!this.model) { + return; + } + if (c.scrollTopChanged) { - const mapping = this.model?.input2ResultMapping.get(); - this.synchronizeScrolling(this.input2View.editor, this.inputResultView.editor, mapping); this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); - this.baseView.get()?.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); + if (this.shouldAlignResult) { + this.inputResultView.editor.setScrollTop(this.input2View.editor.getScrollTop(), ScrollType.Immediate); + } else { + const mappingInput2Result = this.model!.input2ResultMapping.get(); + this.synchronizeScrolling(this.input2View.editor, this.inputResultView.editor, mappingInput2Result); + } + + const baseView = this.baseView.get(); + if (baseView && this.model) { + if (this.shouldAlignBase) { + this.baseView.get()?.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); + } else { + const mapping = new DocumentLineRangeMap(this.model!.baseInput2Diffs.get(), -1).reverse(); + this.synchronizeScrolling(this.input2View.editor, baseView.editor, mapping); + } + } } if (c.scrollLeftChanged) { this.baseView.get()?.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate); @@ -73,14 +114,20 @@ export class ScrollSynchronizer extends Disposable { this.inputResultView.editor.onDidScrollChange( this.reentrancyBarrier.makeExclusive((c) => { if (c.scrollTopChanged) { - const mapping1 = this.model?.resultInput1Mapping.get(); - this.synchronizeScrolling(this.inputResultView.editor, this.input1View.editor, mapping1); - const mapping2 = this.model?.resultInput2Mapping.get(); - this.synchronizeScrolling(this.inputResultView.editor, this.input2View.editor, mapping2); + if (this.shouldAlignResult) { + this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); + this.input2View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); + } else { + const mapping1 = this.model?.resultInput1Mapping.get(); + this.synchronizeScrolling(this.inputResultView.editor, this.input1View.editor, mapping1); + + const mapping2 = this.model?.resultInput2Mapping.get(); + this.synchronizeScrolling(this.inputResultView.editor, this.input2View.editor, mapping2); + } const baseMapping = this.model?.resultBaseMapping.get(); const baseView = this.baseView.get(); - if (baseView) { + if (baseView && this.model) { this.synchronizeScrolling(this.inputResultView.editor, baseView.editor, baseMapping); } } @@ -100,8 +147,19 @@ export class ScrollSynchronizer extends Disposable { store.add(baseView.editor.onDidScrollChange( this.reentrancyBarrier.makeExclusive((c) => { if (c.scrollTopChanged) { - this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); - this.input2View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); + if (!this.model) { + return; + } + if (this.shouldAlignBase) { + this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); + this.input2View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate); + } else { + const baseInput1Mapping = new DocumentLineRangeMap(this.model!.baseInput1Diffs.get(), -1); + this.synchronizeScrolling(baseView.editor, this.input1View.editor, baseInput1Mapping); + + const baseInput2Mapping = new DocumentLineRangeMap(this.model!.baseInput2Diffs.get(), -1); + this.synchronizeScrolling(baseView.editor, this.input2View.editor, baseInput2Mapping); + } const baseMapping = this.model?.baseResultMapping.get(); this.synchronizeScrolling(baseView.editor, this.inputResultView.editor, baseMapping); @@ -116,20 +174,6 @@ export class ScrollSynchronizer extends Disposable { } }, 'set baseViewEditor.onDidScrollChange') ); - - this._store.add( - autorunWithStore((reader, store) => { - const vm = this.viewModel.read(reader); - if (!vm) { - return; - } - this.baseView.read(reader); - - this.reentrancyBarrier.runExclusively(() => { - handleInput1OnScroll(); - }); - }, 'update scroll when base view changes') - ); } private synchronizeScrolling(scrollingEditor: CodeEditorWidget, targetEditor: CodeEditorWidget, mapping: DocumentLineRangeMap | undefined) { diff --git a/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.ts b/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.ts index d16dc21b25d..b4910bbd219 100644 --- a/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.ts +++ b/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.ts @@ -124,6 +124,10 @@ export class MergeEditorViewModel extends Disposable { } ); + public setActiveModifiedBaseRange(range: ModifiedBaseRange | undefined, tx: ITransaction): void { + this.manuallySetActiveModifiedBaseRange.set({ range, counter: this.counter++ }, tx); + } + public setState( baseRange: ModifiedBaseRange, state: ModifiedBaseRangeState, diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/breakpoints/notebookBreakpoints.ts b/src/vs/workbench/contrib/notebook/browser/contrib/breakpoints/notebookBreakpoints.ts index dab66bf78fe..908b48c6295 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/breakpoints/notebookBreakpoints.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/breakpoints/notebookBreakpoints.ts @@ -129,7 +129,7 @@ class NotebookBreakpoints extends Disposable implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookBreakpoints, 'NotebookBreakpoints', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookBreakpoints, LifecyclePhase.Restored); class NotebookCellPausing extends Disposable implements IWorkbenchContribution { private readonly _pausedCells = new Set(); @@ -196,4 +196,4 @@ class NotebookCellPausing extends Disposable implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookCellPausing, 'NotebookCellPausing', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookCellPausing, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.ts b/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.ts index a7f9f6bb958..ee2b1fdfa22 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.ts @@ -155,4 +155,4 @@ class BuiltinCellStatusBarProviders extends Disposable { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(BuiltinCellStatusBarProviders, 'BuiltinCellStatusBarProviders', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(BuiltinCellStatusBarProviders, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.ts b/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.ts index 71403cf4fde..b555b4709ba 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.ts @@ -26,7 +26,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { RedoCommand, UndoCommand } from 'vs/editor/browser/editorExtensions'; import { IWebview } from 'vs/workbench/contrib/webview/browser/webview'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IOutputService } from 'vs/workbench/services/output/common/output'; import { rendererLogChannelId } from 'vs/workbench/contrib/logs/common/logConstants'; import { ILogService } from 'vs/platform/log/common/log'; @@ -400,7 +400,7 @@ export class NotebookClipboardContribution extends Disposable { } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(NotebookClipboardContribution, 'NotebookClipboardContribution', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(NotebookClipboardContribution, LifecyclePhase.Ready); const COPY_CELL_COMMAND_ID = 'notebook.cell.copy'; const CUT_CELL_COMMAND_ID = 'notebook.cell.cut'; @@ -550,7 +550,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.toggleNotebookClipboardLog', title: { value: localize('toggleNotebookClipboardLog', "Toggle Notebook Clipboard Troubleshooting"), original: 'Toggle Notebook Clipboard Troubleshooting' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.ts b/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.ts index ad13e9be7a0..d3d04163713 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.ts @@ -517,7 +517,7 @@ export class KernelStatus extends Disposable implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(KernelStatus, 'KernelStatus', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(KernelStatus, LifecyclePhase.Restored); export class ActiveCellStatus extends Disposable implements IWorkbenchContribution { @@ -593,4 +593,4 @@ export class ActiveCellStatus extends Disposable implements IWorkbenchContributi } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ActiveCellStatus, 'ActiveCellStatus', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ActiveCellStatus, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.ts b/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.ts index 9bcf8daff2e..7c37a41ac75 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.ts @@ -12,7 +12,7 @@ import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/commo import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { Registry } from 'vs/platform/registry/common/platform'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { Memento } from 'vs/workbench/common/memento'; import { HAS_OPENED_NOTEBOOK } from 'vs/workbench/contrib/notebook/common/notebookContextKeys'; @@ -75,7 +75,7 @@ export class NotebookGettingStarted extends Disposable implements IWorkbenchCont } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookGettingStarted, 'NotebookGettingStarted', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookGettingStarted, LifecyclePhase.Restored); registerAction2(class NotebookClearNotebookLayoutAction extends Action2 { constructor() { @@ -87,7 +87,7 @@ registerAction2(class NotebookClearNotebookLayoutAction extends Action2 { }, f1: true, precondition: ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true), - category: CATEGORIES.Developer, + category: Categories.Developer, }); } run(accessor: ServicesAccessor): void { diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.ts b/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.ts index f7c3f252abd..13315c8ab5d 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.ts @@ -46,4 +46,4 @@ class MarkerListProvider implements IMarkerListProvider { Registry .as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(MarkerListProvider, 'MarkerListProvider', LifecyclePhase.Ready); + .registerWorkbenchContribution(MarkerListProvider, LifecyclePhase.Ready); diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts b/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts index 7c189a4b3dc..1103b138b84 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts @@ -648,7 +648,7 @@ class NotebookOutlineCreator implements IOutlineCreator(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookOutlineCreator, 'NotebookOutlineCreator', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NotebookOutlineCreator, LifecyclePhase.Eventually); Registry.as(ConfigurationExtensions.Configuration).registerConfiguration({ diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.ts b/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.ts index 5848a745b90..42089a40651 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.ts @@ -125,5 +125,5 @@ export class NotebookProfileContribution extends Disposable { } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(NotebookProfileContribution, 'NotebookProfileContribution', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(NotebookProfileContribution, LifecyclePhase.Ready); diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.ts b/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.ts index 3644400d74b..ce2b9849c2a 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.ts @@ -7,7 +7,7 @@ import { Disposable, DisposableStore, dispose, IDisposable } from 'vs/base/commo import { localize } from 'vs/nls'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { getNotebookEditorFromEditorPane, ICellViewModel, ICommonCellViewModelLayoutChangeInfo, INotebookDeltaCellStatusBarItems, INotebookEditor, INotebookEditorContribution } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { registerNotebookContribution } from 'vs/workbench/contrib/notebook/browser/notebookEditorExtensions'; import { NotebookEditorWidget } from 'vs/workbench/contrib/notebook/browser/notebookEditorWidget'; @@ -126,7 +126,7 @@ registerAction2(class extends Action2 { value: localize('workbench.notebook.toggleLayoutTroubleshoot', "Toggle Layout Troubleshoot"), original: 'Toggle Notebook Layout Troubleshoot' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -152,7 +152,7 @@ registerAction2(class extends Action2 { value: localize('workbench.notebook.inspectLayout', "Inspect Notebook Layout"), original: 'Inspect Notebook Layout' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -180,7 +180,7 @@ registerAction2(class extends Action2 { value: localize('workbench.notebook.clearNotebookEdtitorTypeCache', "Clear Notebook Editor Type Cache"), original: 'Clear Notebook Editor Cache' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.ts b/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.ts index ee32a2865c5..22678c6af01 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.ts @@ -65,4 +65,4 @@ class NotebookUndoRedoContribution extends Disposable { } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(NotebookUndoRedoContribution, 'NotebookUndoRedoContribution', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(NotebookUndoRedoContribution, LifecyclePhase.Ready); diff --git a/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.ts b/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.ts index 7f6ac0a645b..48ecba090de 100644 --- a/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.ts +++ b/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.ts @@ -133,7 +133,7 @@ registerAction2(class ToggleLineNumberFromEditorTitle extends Action2 { f1: true, toggled: { condition: ContextKeyExpr.notEquals('config.notebook.lineNumbers', 'off'), - title: { value: localize('notebook.showLineNumbers', "Show Notebook Line Numbers"), original: 'Show Notebook Line Numbers' }, + title: localize('notebook.showLineNumbers', "Notebook Line Numbers"), } }); } diff --git a/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.ts b/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.ts index c446f07e32b..7ccc71587d3 100644 --- a/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.ts +++ b/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.ts @@ -66,7 +66,7 @@ export class NotebookDiffOverviewRuler extends Themable { this._renderOverviewViewport(); })); - this._register(DOM.addStandardDisposableListener(this._overviewViewportDomElement.domNode, DOM.EventType.POINTER_DOWN, (e) => { + this._register(DOM.addStandardDisposableListener(container, DOM.EventType.POINTER_DOWN, (e) => { this.notebookEditor.delegateVerticalScrollbarPointerDown(e); })); } @@ -124,6 +124,7 @@ export class NotebookDiffOverviewRuler extends Themable { private _layoutNow() { const layoutInfo = this.notebookEditor.getLayoutInfo(); const height = layoutInfo.height; + const scrollHeight = layoutInfo.scrollHeight; const ratio = browser.PixelRatio.value; this._domNode.setWidth(this.width); this._domNode.setHeight(height); @@ -131,7 +132,7 @@ export class NotebookDiffOverviewRuler extends Themable { this._domNode.domNode.height = height * ratio; const ctx = this._domNode.domNode.getContext('2d')!; ctx.clearRect(0, 0, this.width * ratio, height * ratio); - this._renderCanvas(ctx, this.width * ratio, ratio); + this._renderCanvas(ctx, this.width * ratio, height * ratio, scrollHeight * ratio, ratio); this._renderOverviewViewport(); } @@ -168,7 +169,7 @@ export class NotebookDiffOverviewRuler extends Themable { }; } - private _renderCanvas(ctx: CanvasRenderingContext2D, width: number, ratio: number) { + private _renderCanvas(ctx: CanvasRenderingContext2D, width: number, height: number, scrollHeight: number, ratio: number) { if (!this._insertColorHex || !this._removeColorHex) { // no op when colors are not yet known return; @@ -179,7 +180,8 @@ export class NotebookDiffOverviewRuler extends Themable { for (let i = 0; i < this._diffElementViewModels.length; i++) { const element = this._diffElementViewModels[i]; - const cellHeight = element.layoutInfo.totalHeight * ratio; + const cellHeight = (element.layoutInfo.totalHeight / scrollHeight) * ratio * height; + switch (element.type) { case 'insert': ctx.fillStyle = this._insertColorHex; diff --git a/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts b/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts index 977573bf87d..bcab942c8cc 100644 --- a/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts +++ b/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts @@ -157,6 +157,10 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD this._revealFirst = true; } + private isOverviewRulerEnabled(): boolean { + return this.configurationService.getValue('notebook.experimental.diffOverviewRuler.enabled') ?? false; + } + getSelection(): IEditorPaneSelection | undefined { const selections = this._list.getFocus(); return new NotebookDiffEditorSelection(selections); @@ -559,7 +563,9 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD private _setViewModel(viewModels: DiffElementViewModelBase[]) { this._diffElementViewModels = viewModels; this._list.splice(0, this._list.length, this._diffElementViewModels); - this._overviewRuler.updateViewModels(this._diffElementViewModels, this._eventDispatcher); + if (this.isOverviewRulerEnabled()) { + this._overviewRuler.updateViewModels(this._diffElementViewModels, this._eventDispatcher); + } } /** @@ -976,7 +982,8 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD layout(dimension: DOM.Dimension): void { this._rootElement.classList.toggle('mid-width', dimension.width < 1000 && dimension.width >= 600); this._rootElement.classList.toggle('narrow-width', dimension.width < 600); - this._dimension = dimension.with(dimension.width - NotebookTextDiffEditor.ENTIRE_DIFF_OVERVIEW_WIDTH); + const overviewRulerEnabled = this.isOverviewRulerEnabled(); + this._dimension = dimension.with(dimension.width - (overviewRulerEnabled ? NotebookTextDiffEditor.ENTIRE_DIFF_OVERVIEW_WIDTH : 0)); this._listViewContainer.style.height = `${dimension.height}px`; this._listViewContainer.style.width = `${this._dimension.width}px`; @@ -998,7 +1005,9 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD this._webviewTransparentCover.style.width = `${this._dimension.width}px`; } - this._overviewRuler.layout(); + if (overviewRulerEnabled) { + this._overviewRuler.layout(); + } this._eventDispatcher?.emit([new NotebookDiffLayoutChangedEvent({ width: true, fontInfo: true }, this.getLayoutInfo())]); } diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index 489c3a3670d..3ce47b6f33f 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -17,7 +17,7 @@ import { ITextModelContentProvider, ITextModelService } from 'vs/editor/common/s import * as nls from 'vs/nls'; import { Extensions, IConfigurationPropertySchema, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -688,25 +688,25 @@ class NotebookLanguageSelectorScoreRefine { } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(NotebookContribution, 'NotebookContribution', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(CellContentProvider, 'CellContentProvider', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(CellInfoContentProvider, 'CellInfoContentProvider', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(RegisterSchemasContribution, 'RegisterSchemasContribution', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(NotebookEditorManager, 'NotebookEditorManager', LifecyclePhase.Ready); -workbenchContributionsRegistry.registerWorkbenchContribution(NotebookLanguageSelectorScoreRefine, 'NotebookLanguageSelectorScoreRefine', LifecyclePhase.Ready); -workbenchContributionsRegistry.registerWorkbenchContribution(SimpleNotebookWorkingCopyEditorHandler, 'SimpleNotebookWorkingCopyEditorHandler', LifecyclePhase.Ready); -workbenchContributionsRegistry.registerWorkbenchContribution(ComplexNotebookWorkingCopyEditorHandler, 'ComplexNotebookWorkingCopyEditorHandler', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(NotebookContribution, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(CellContentProvider, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(CellInfoContentProvider, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(RegisterSchemasContribution, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(NotebookEditorManager, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(NotebookLanguageSelectorScoreRefine, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(SimpleNotebookWorkingCopyEditorHandler, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(ComplexNotebookWorkingCopyEditorHandler, LifecyclePhase.Ready); registerSingleton(INotebookService, NotebookService, false); registerSingleton(INotebookEditorWorkerService, NotebookEditorWorkerServiceImpl, false); -registerSingleton(INotebookEditorModelResolverService, NotebookModelResolverServiceImpl, true); -registerSingleton(INotebookCellStatusBarService, NotebookCellStatusBarService, true); -registerSingleton(INotebookEditorService, NotebookEditorWidgetService, true); -registerSingleton(INotebookKernelService, NotebookKernelService, true); -registerSingleton(INotebookExecutionService, NotebookExecutionService, true); -registerSingleton(INotebookExecutionStateService, NotebookExecutionStateService, true); -registerSingleton(INotebookRendererMessagingService, NotebookRendererMessagingService, true); -registerSingleton(INotebookKeymapService, NotebookKeymapService, true); +registerSingleton(INotebookEditorModelResolverService, NotebookModelResolverServiceImpl, InstantiationType.Delayed); +registerSingleton(INotebookCellStatusBarService, NotebookCellStatusBarService, InstantiationType.Delayed); +registerSingleton(INotebookEditorService, NotebookEditorWidgetService, InstantiationType.Delayed); +registerSingleton(INotebookKernelService, NotebookKernelService, InstantiationType.Delayed); +registerSingleton(INotebookExecutionService, NotebookExecutionService, InstantiationType.Delayed); +registerSingleton(INotebookExecutionStateService, NotebookExecutionStateService, InstantiationType.Delayed); +registerSingleton(INotebookRendererMessagingService, NotebookRendererMessagingService, InstantiationType.Delayed); +registerSingleton(INotebookKeymapService, NotebookKeymapService, InstantiationType.Delayed); const schemas: IJSONSchemaMap = {}; function isConfigurationPropertySchema(x: IConfigurationPropertySchema | { [path: string]: IConfigurationPropertySchema }): x is IConfigurationPropertySchema { diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts index 09d6ffab345..e7b2dc19892 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts @@ -14,7 +14,6 @@ import * as DOM from 'vs/base/browser/dom'; import { IMouseWheelEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import * as aria from 'vs/base/browser/ui/aria/aria'; import { IListContextMenuEvent } from 'vs/base/browser/ui/list/list'; -import { IAction } from 'vs/base/common/actions'; import { DeferredPromise, runWhenIdle, SequencerByKey } from 'vs/base/common/async'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Color, RGBA } from 'vs/base/common/color'; @@ -33,8 +32,7 @@ import { Range } from 'vs/editor/common/core/range'; import { IEditor } from 'vs/editor/common/editorCommon'; import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; import * as nls from 'vs/nls'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; +import { MenuId } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -86,12 +84,13 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor import { NotebookPerfMarks } from 'vs/workbench/contrib/notebook/common/notebookPerformance'; import { BaseCellEditorOptions } from 'vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions'; import { ILogService } from 'vs/platform/log/common/log'; +import { FloatingClickMenu } from 'vs/workbench/browser/codeeditor'; const $ = DOM.$; export function getDefaultNotebookCreationOptions(): INotebookEditorCreationOptions { // We inlined the id to avoid loading comment contrib in tests - const skipContributions = ['editor.contrib.review']; + const skipContributions = ['editor.contrib.review', FloatingClickMenu.ID]; const contributions = EditorExtensionsRegistry.getEditorContributions().filter(c => skipContributions.indexOf(c.id) === -1); return { @@ -251,7 +250,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD @IContextKeyService contextKeyService: IContextKeyService, @ILayoutService private readonly layoutService: ILayoutService, @IContextMenuService private readonly contextMenuService: IContextMenuService, - @IMenuService private readonly menuService: IMenuService, @ITelemetryService private readonly telemetryService: ITelemetryService, @INotebookExecutionService private readonly notebookExecutionService: INotebookExecutionService, @INotebookExecutionStateService notebookExecutionStateService: INotebookExecutionStateService, @@ -952,13 +950,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD private showListContextMenu(e: IListContextMenuEvent) { this.contextMenuService.showContextMenu({ - getActions: () => { - const result: IAction[] = []; - const menu = this.menuService.createMenu(MenuId.NotebookCellTitle, this.scopedContextKeyService); - createAndFillInContextMenuActions(menu, undefined, result); - menu.dispose(); - return result; - }, + menuId: MenuId.NotebookCellTitle, + contextKeyService: this.scopedContextKeyService, getAnchor: () => e.anchor }); } diff --git a/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.ts b/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.ts index dd2ab69fa3c..2ce63b5332e 100644 --- a/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.ts +++ b/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.ts @@ -246,7 +246,7 @@ export class NotebookKernelService extends Disposable implements INotebookKernel // bound kernel const selectedId = this._notebookBindings.get(NotebookTextModelLikeId.str(notebook)); const selected = selectedId ? this._kernels.get(selectedId)?.kernel : undefined; - const suggestions = kernels.filter(item => item.instanceAffinity > 1 && item.kernel !== selected).map(item => item.kernel); + const suggestions = kernels.filter(item => item.instanceAffinity > 1).map(item => item.kernel); const hidden = kernels.filter(item => item.instanceAffinity < 0).map(item => item.kernel); return { all, selected, suggestions, hidden }; } diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts index 3059080c7d5..f3751c8dbdf 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts @@ -134,7 +134,7 @@ registerAction2(class ToggleLineNumberAction extends Action2 { f1: true, toggled: { condition: ContextKeyExpr.notEquals('config.notebook.lineNumbers', 'off'), - title: { value: localize('notebook.showLineNumbers', "Show Notebook Line Numbers"), original: 'Show Notebook Line Numbers' }, + title: localize('notebook.showLineNumbers', "Notebook Line Numbers"), } }); } diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts index 30da51aa51c..15ba313df2c 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { IAction } from 'vs/base/common/actions'; import { coalesce } from 'vs/base/common/arrays'; import { decodeBase64 } from 'vs/base/common/buffer'; import { Emitter, Event } from 'vs/base/common/event'; @@ -21,8 +20,7 @@ import { ILanguageService } from 'vs/editor/common/languages/language'; import { generateTokensCSSForColorMap } from 'vs/editor/common/languages/supports/tokenization'; import { tokenizeToString } from 'vs/editor/common/languages/textToHtmlTokenizer'; import * as nls from 'vs/nls'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; +import { MenuId } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -47,6 +45,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { FromWebviewMessage, IAckOutputHeight, IClickedDataUrlMessage, ICodeBlockHighlightRequest, IContentWidgetTopRequest, IControllerPreload, ICreationContent, ICreationRequestMessage, IFindMatch, IMarkupCellInitialization, RendererMetadata, ToWebviewMessage } from './webviewMessages'; import { compressOutputItemStreams } from 'vs/workbench/contrib/notebook/browser/view/renderers/stdOutErrorPreProcessor'; +import { DeferredPromise } from 'vs/base/common/async'; export interface ICachedInset { outputId: string; @@ -110,10 +109,14 @@ export class BackLayerWebView extends Disposable { private readonly _onMessage = this._register(new Emitter()); private readonly _preloadsCache = new Set(); public readonly onMessage: Event = this._onMessage.event; - private _initialized?: Promise; private _disposed = false; private _currentKernel?: INotebookKernel; + private _initialized?: DeferredPromise; + private _webviewPreloadInitialized?: DeferredPromise; + private firstInit = true; + private initializeMarkupPromise?: { readonly requestId: string; readonly p: DeferredPromise; readonly isFirstInit: boolean }; + private readonly nonce = UUID.generateUuid(); constructor( @@ -130,7 +133,6 @@ export class BackLayerWebView extends Disposable { @IFileDialogService private readonly fileDialogService: IFileDialogService, @IFileService private readonly fileService: IFileService, @IContextMenuService private readonly contextMenuService: IContextMenuService, - @IMenuService private readonly menuService: IMenuService, @IContextKeyService private readonly contextKeyService: IContextKeyService, @IWorkspaceTrustManagementService private readonly workspaceTrustManagementService: IWorkspaceTrustManagementService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -452,11 +454,9 @@ export class BackLayerWebView extends Disposable { } let coreDependencies = ''; - let resolveFunc: () => void; - this._initialized = new Promise((resolve) => { - resolveFunc = resolve; - }); + this._initialized = new DeferredPromise(); + this._webviewPreloadInitialized = new DeferredPromise(); if (!isWeb) { const loaderUri = FileAccess.asFileUri('vs/loader.js', require); @@ -469,7 +469,7 @@ export class BackLayerWebView extends Disposable { `; const htmlContent = this.generateContent(coreDependencies, baseUrl.toString()); this._initialize(htmlContent); - resolveFunc!(); + this._initialized.complete(); } else { const loaderUri = FileAccess.asBrowserUri('vs/loader.js', require); @@ -493,16 +493,16 @@ var requirejs = (function() { const htmlContent = this.generateContent(coreDependencies, baseUrl.toString()); this._initialize(htmlContent); - resolveFunc!(); + this._initialized!.complete(); }, error => { // the fetch request is rejected const htmlContent = this.generateContent(coreDependencies, baseUrl.toString()); this._initialize(htmlContent); - resolveFunc!(); + this._initialized!.complete(); }); } - await this._initialized; + await this._initialized.p; } private getNotebookBaseUri() { @@ -590,9 +590,17 @@ var requirejs = (function() { switch (data.type) { case 'initialized': { + this._webviewPreloadInitialized?.complete(); this.initializeWebViewState(); break; } + case 'initializedMarkup': { + if (this.initializeMarkupPromise?.requestId === data.requestId) { + this.initializeMarkupPromise?.p.complete(); + this.initializeMarkupPromise = undefined; + } + break; + } case 'dimension': { for (const update of data.updates) { const height = update.height; @@ -766,13 +774,8 @@ var requirejs = (function() { // Then show the context menu const webviewRect = this.element.getBoundingClientRect(); this.contextMenuService.showContextMenu({ - getActions: () => { - const result: IAction[] = []; - const menu = this.menuService.createMenu(MenuId.NotebookCellTitle, this.contextKeyService); - createAndFillInContextMenuActions(menu, undefined, result); - menu.dispose(); - return result; - }, + menuId: MenuId.NotebookCellTitle, + contextKeyService: this.contextKeyService, getAnchor: () => ({ x: webviewRect.x + data.clientX, y: webviewRect.y + data.clientY @@ -932,8 +935,6 @@ var requirejs = (function() { ]; } - private firstInit = true; - private initializeWebViewState() { this._preloadsCache.clear(); if (this._currentKernel) { @@ -944,9 +945,9 @@ var requirejs = (function() { this._sendMessageToWebview({ ...inset.cachedCreation, initiallyHidden: this.hiddenInsetMapping.has(output) }); } - if (this.firstInit) { + if (this.initializeMarkupPromise?.isFirstInit) { // On first run the contents have already been initialized so we don't need to init them again - this.firstInit = false; + // no op } else { const mdCells = [...this.markupPreviewMapping.values()]; this.markupPreviewMapping.clear(); @@ -1160,15 +1161,16 @@ var requirejs = (function() { return; } - // TODO: use proper handler - const p = new Promise(resolve => { - const sub = this.webview?.onMessage(e => { - if (e.message.type === 'initializedMarkup') { - resolve(); - sub?.dispose(); - } - }); - }); + this.initializeMarkupPromise?.p.complete(); + const requestId = UUID.generateUuid(); + this.initializeMarkupPromise = { p: new DeferredPromise(), requestId, isFirstInit: this.firstInit }; + + if (this._webviewPreloadInitialized) { + // wait for webview preload script module to be loaded + await this._webviewPreloadInitialized.p; + } + + this.firstInit = false; for (const cell of cells) { this.markupPreviewMapping.set(cell.cellId, cell); @@ -1177,9 +1179,10 @@ var requirejs = (function() { this._sendMessageToWebview({ type: 'initializeMarkup', cells, + requestId, }); - await p; + return this.initializeMarkupPromise.p.p; } /** @@ -1529,4 +1532,3 @@ function getTokenizationCss() { const tokenizationCss = colorMap ? generateTokensCSSForColorMap(colorMap) : ''; return tokenizationCss; } - diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts index 79b1b1d3959..79adc52e51e 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.ts @@ -138,6 +138,7 @@ export interface ICellDragEndMessage extends BaseToWebviewMessage { export interface IInitializedMarkupMessage extends BaseToWebviewMessage { readonly type: 'initializedMarkup'; + readonly requestId: string; } export interface ICodeBlockHighlightRequest { @@ -351,6 +352,7 @@ export interface IMarkupCellInitialization { export interface IInitializeMarkupCells { readonly type: 'initializeMarkup'; readonly cells: readonly IMarkupCellInitialization[]; + readonly requestId: string; } export interface INotebookStylesMessage { 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 c0f2e223fea..6062c79818c 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts @@ -1048,7 +1048,7 @@ async function webviewPreloads(ctx: PreloadContext) { await Promise.all(event.data.cells.map(info => viewModel.ensureMarkupCell(info))); } finally { dimensionUpdater.updateImmediately(); - postNotebookMessage('initializedMarkup', {}); + postNotebookMessage('initializedMarkup', { requestId: event.data.requestId }); } break; } @@ -1489,11 +1489,28 @@ async function webviewPreloads(ctx: PreloadContext) { this._renderers.get(rendererId)?.disposeOutputItem(outputId); } - public async render(info: rendererApi.OutputItem, element: HTMLElement, signal: AbortSignal): Promise { - const renderers = Array.from(this._renderers.values()) - .filter((renderer) => renderer.data.mimeTypes.includes(info.mime) && !renderer.data.extends); + public async render(info: rendererApi.OutputItem, preferredRendererId: string | undefined, element: HTMLElement, signal: AbortSignal): Promise { + let renderer: Renderer | undefined; - if (!renderers.length) { + if (typeof preferredRendererId === 'string') { + renderer = Array.from(this._renderers.values()) + .find((renderer) => renderer.data.id === preferredRendererId); + } else { + const renderers = Array.from(this._renderers.values()) + .filter((renderer) => renderer.data.mimeTypes.includes(info.mime) && !renderer.data.extends); + + if (renderers.length) { + // De-prioritize built-in renderers + renderers.sort((a, b) => +a.data.isBuiltin - +b.data.isBuiltin); + + // Use first renderer we find in sorted list + renderer = renderers[0]; + } + } + + if (renderer) { + await renderer.renderOutputItem(info, element, signal); + } else { const errorContainer = document.createElement('div'); const error = document.createElement('div'); @@ -1509,15 +1526,7 @@ async function webviewPreloads(ctx: PreloadContext) { element.innerText = ''; element.appendChild(errorContainer); - - return; } - - // De-prioritize built-in renderers - renderers.sort((a, b) => +a.data.isBuiltin - +b.data.isBuiltin); - - // Use first renderer we find in sorted list - await renderers[0].renderOutputItem(info, element, signal); } }(); @@ -1874,7 +1883,7 @@ async function webviewPreloads(ctx: PreloadContext) { const controller = new AbortController(); this.renderTaskAbort = controller; try { - await renderers.render(this.outputItem, this.element, this.renderTaskAbort.signal); + await renderers.render(this.outputItem, undefined, this.element, this.renderTaskAbort.signal); } finally { if (this.renderTaskAbort === controller) { this.renderTaskAbort = undefined; @@ -2001,7 +2010,7 @@ async function webviewPreloads(ctx: PreloadContext) { public async renderOutputElement(data: webviewMessages.ICreationRequestMessage, preloadErrors: ReadonlyArray, signal: AbortSignal) { const outputElement = this.createOutputElement(data); - await outputElement.render(data.content, preloadErrors, signal); + await outputElement.render(data.content, data.rendererId, preloadErrors, signal); // don't hide until after this step so that the height is right outputElement.element.style.visibility = data.initiallyHidden ? 'hidden' : ''; @@ -2132,6 +2141,7 @@ async function webviewPreloads(ctx: PreloadContext) { public readonly element: HTMLElement; private _content?: { readonly content: webviewMessages.ICreationContent; + readonly preferredRendererId: string | undefined; readonly preloadErrors: ReadonlyArray; }; private hasResizeObserver = false; @@ -2164,11 +2174,11 @@ async function webviewPreloads(ctx: PreloadContext) { this.renderTaskAbort = undefined; } - public async render(content: webviewMessages.ICreationContent, preloadErrors: ReadonlyArray, signal?: AbortSignal) { + public async render(content: webviewMessages.ICreationContent, preferredRendererId: string | undefined, preloadErrors: ReadonlyArray, signal?: AbortSignal) { this.renderTaskAbort?.abort(); this.renderTaskAbort = undefined; - this._content = { content, preloadErrors }; + this._content = { content, preferredRendererId, preloadErrors }; if (content.type === 0 /* RenderOutputType.Html */) { const trustedHtml = ttPolicy?.createHTML(content.htmlContent) ?? content.htmlContent; this.element.innerHTML = trustedHtml as string; @@ -2186,7 +2196,7 @@ async function webviewPreloads(ctx: PreloadContext) { signal?.addEventListener('abort', () => controller.abort()); try { - await renderers.render(item, this.element, controller.signal); + await renderers.render(item, preferredRendererId, this.element, controller.signal); } finally { if (this.renderTaskAbort === controller) { this.renderTaskAbort = undefined; @@ -2229,13 +2239,13 @@ async function webviewPreloads(ctx: PreloadContext) { public rerender() { if (this._content) { - this.render(this._content.content, this._content.preloadErrors); + this.render(this._content.content, this._content.preferredRendererId, this._content.preloadErrors); } } public updateAndRerender(content: webviewMessages.ICreationContent) { if (this._content) { - this._content = { content, preloadErrors: this._content.preloadErrors }; + this._content = { content, preferredRendererId: this._content.preferredRendererId, preloadErrors: this._content.preloadErrors }; this.rerender(); } } diff --git a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts index 362123693b2..34479ba1115 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts @@ -473,7 +473,7 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE } override isResolved(): this is IResolvedNotebookEditorModel { - return Boolean(this._workingCopy); + return Boolean(this._workingCopy?.model?.notebookModel); } isDirty(): boolean { diff --git a/src/vs/workbench/contrib/offline/browser/offline.contribution.ts b/src/vs/workbench/contrib/offline/browser/offline.contribution.ts index 470eaf250e3..75b1671e327 100644 --- a/src/vs/workbench/contrib/offline/browser/offline.contribution.ts +++ b/src/vs/workbench/contrib/offline/browser/offline.contribution.ts @@ -94,4 +94,4 @@ export class OfflineStatusBarController implements IWorkbenchContribution { } Registry.as(Extensions.Workbench) - .registerWorkbenchContribution(OfflineStatusBarController, 'OfflineStatusBarController', LifecyclePhase.Restored); + .registerWorkbenchContribution(OfflineStatusBarController, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/output/browser/output.contribution.ts b/src/vs/workbench/contrib/output/browser/output.contribution.ts index d7c89247cde..08aebc57bca 100644 --- a/src/vs/workbench/contrib/output/browser/output.contribution.ts +++ b/src/vs/workbench/contrib/output/browser/output.contribution.ts @@ -10,7 +10,7 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { ModesRegistry } from 'vs/editor/common/languages/modesRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; import { MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { OutputService, LogContentProvider } from 'vs/workbench/contrib/output/browser/outputServices'; import { OUTPUT_MODE_ID, OUTPUT_MIME, OUTPUT_VIEW_ID, IOutputService, CONTEXT_IN_OUTPUT, LOG_SCHEME, LOG_MODE_ID, LOG_MIME, CONTEXT_ACTIVE_LOG_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK, IOutputChannelDescriptor, IFileOutputChannelDescriptor } from 'vs/workbench/services/output/common/output'; import { OutputViewPane } from 'vs/workbench/contrib/output/browser/outputView'; @@ -30,11 +30,11 @@ import { assertIsDefined } from 'vs/base/common/types'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Codicon } from 'vs/base/common/codicons'; import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { EditorExtensions } from 'vs/workbench/common/editor'; // Register Service -registerSingleton(IOutputService, OutputService, true); +registerSingleton(IOutputService, OutputService, InstantiationType.Delayed); // Register Output Mode ModesRegistry.registerLanguage({ @@ -102,11 +102,12 @@ class OutputContribution implements IWorkbenchContribution { } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(OutputContribution, 'OutputContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(OutputContribution, LifecyclePhase.Restored); registerAction2(class extends Action2 { constructor() { super({ + _isFakeAction: true, id: `workbench.output.action.switchBetweenOutputs`, title: nls.localize('switchToOutput.label', "Switch to Output"), menu: { @@ -129,7 +130,7 @@ registerAction2(class extends Action2 { super({ id: `workbench.output.action.clearOutput`, title: { value: nls.localize('clearOutput.label', "Clear Output"), original: 'Clear Output' }, - category: CATEGORIES.View, + category: Categories.View, menu: [{ id: MenuId.ViewTitle, when: ContextKeyExpr.equals('view', OUTPUT_VIEW_ID), @@ -165,10 +166,10 @@ registerAction2(class extends Action2 { group: 'navigation', order: 3, }, - icon: Codicon.unlock, + icon: Codicon.lock, toggled: { condition: CONTEXT_OUTPUT_SCROLL_LOCK, - icon: Codicon.lock, + icon: Codicon.unlock, tooltip: nls.localize('outputScrollOn', "Turn Auto Scrolling On") } }); @@ -222,7 +223,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.showLogs', title: { value: nls.localize('showLogs', "Show Logs..."), original: 'Show Logs...' }, - category: CATEGORIES.Developer, + category: Categories.Developer, menu: { id: MenuId.CommandPalette, }, @@ -267,7 +268,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.openLogFile', title: { value: nls.localize('openLogFile', "Open Log File..."), original: 'Open Log File...' }, - category: CATEGORIES.Developer, + category: Categories.Developer, menu: { id: MenuId.CommandPalette, }, diff --git a/src/vs/workbench/contrib/output/common/outputChannelModelService.ts b/src/vs/workbench/contrib/output/common/outputChannelModelService.ts index b2cf6ad39d3..3c562328b0c 100644 --- a/src/vs/workbench/contrib/output/common/outputChannelModelService.ts +++ b/src/vs/workbench/contrib/output/common/outputChannelModelService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IFileService } from 'vs/platform/files/common/files'; @@ -57,4 +57,4 @@ export class OutputChannelModelService extends AbstractOutputChannelModelService } } -registerSingleton(IOutputChannelModelService, OutputChannelModelService, true); +registerSingleton(IOutputChannelModelService, OutputChannelModelService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/output/electron-sandbox/outputChannelModelService.ts b/src/vs/workbench/contrib/output/electron-sandbox/outputChannelModelService.ts index 211a3e73d83..db0b6be79de 100644 --- a/src/vs/workbench/contrib/output/electron-sandbox/outputChannelModelService.ts +++ b/src/vs/workbench/contrib/output/electron-sandbox/outputChannelModelService.ts @@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri'; import { IFileService } from 'vs/platform/files/common/files'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { toLocalISOString } from 'vs/base/common/date'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; import { AbstractOutputChannelModelService, IOutputChannelModelService } from 'vs/workbench/contrib/output/common/outputChannelModelService'; @@ -26,4 +26,4 @@ export class OutputChannelModelService extends AbstractOutputChannelModelService } -registerSingleton(IOutputChannelModelService, OutputChannelModelService, true); +registerSingleton(IOutputChannelModelService, OutputChannelModelService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/performance/browser/performance.contribution.ts b/src/vs/workbench/contrib/performance/browser/performance.contribution.ts index ac2fe448888..b7fbee24b67 100644 --- a/src/vs/workbench/contrib/performance/browser/performance.contribution.ts +++ b/src/vs/workbench/contrib/performance/browser/performance.contribution.ts @@ -8,7 +8,7 @@ import { registerAction2, Action2 } from 'vs/platform/actions/common/actions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { Registry } from 'vs/platform/registry/common/platform'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { EditorExtensions, IEditorSerializer, IEditorFactoryRegistry } from 'vs/workbench/common/editor'; import { PerfviewContrib, PerfviewInput } from 'vs/workbench/contrib/performance/browser/perfviewEditor'; @@ -20,7 +20,6 @@ import { EventProfiling } from 'vs/base/common/event'; Registry.as(Extensions.Workbench).registerWorkbenchContribution( PerfviewContrib, - 'PerfviewContrib', LifecyclePhase.Ready ); @@ -46,7 +45,7 @@ registerAction2(class extends Action2 { super({ id: 'perfview.show', title: { value: localize('show.label', "Startup Performance"), original: 'Startup Performance' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -65,7 +64,7 @@ registerAction2(class PrintServiceCycles extends Action2 { super({ id: 'perf.insta.printAsyncCycles', title: { value: localize('cycles', "Print Service Cycles"), original: 'Print Service Cycles' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -89,7 +88,7 @@ registerAction2(class PrintServiceTraces extends Action2 { super({ id: 'perf.insta.printTraces', title: { value: localize('insta.trace', "Print Service Traces"), original: 'Print Service Traces' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -113,7 +112,7 @@ registerAction2(class PrintEventProfiling extends Action2 { super({ id: 'perf.event.profiling', title: { value: localize('emitter', "Print Emitter Profiles"), original: 'Print Emitter Profiles' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/performance/browser/performance.web.contribution.ts b/src/vs/workbench/contrib/performance/browser/performance.web.contribution.ts index 25e76c1f35a..566cf8af723 100644 --- a/src/vs/workbench/contrib/performance/browser/performance.web.contribution.ts +++ b/src/vs/workbench/contrib/performance/browser/performance.web.contribution.ts @@ -30,6 +30,5 @@ class ResourcePerformanceMarks { Registry.as(Extensions.Workbench).registerWorkbenchContribution( ResourcePerformanceMarks, - 'ResourcePerformanceMarks', LifecyclePhase.Eventually ); diff --git a/src/vs/workbench/contrib/performance/electron-sandbox/performance.contribution.ts b/src/vs/workbench/contrib/performance/electron-sandbox/performance.contribution.ts index 35adfeaff21..978c8c32b04 100644 --- a/src/vs/workbench/contrib/performance/electron-sandbox/performance.contribution.ts +++ b/src/vs/workbench/contrib/performance/electron-sandbox/performance.contribution.ts @@ -13,7 +13,6 @@ import { RendererProfiling } from 'vs/workbench/contrib/performance/electron-san Registry.as(Extensions.Workbench).registerWorkbenchContribution( RendererProfiling, - 'RendererProfiling', LifecyclePhase.Eventually ); @@ -21,7 +20,6 @@ Registry.as(Extensions.Workbench).registerWorkb Registry.as(Extensions.Workbench).registerWorkbenchContribution( StartupProfiler, - 'StartupProfiler', LifecyclePhase.Restored ); @@ -29,6 +27,5 @@ Registry.as(Extensions.Workbench).registerWorkb Registry.as(Extensions.Workbench).registerWorkbenchContribution( StartupTimings, - 'StartupTimings', LifecyclePhase.Eventually ); diff --git a/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts b/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts index 12134bca348..b80db72dddb 100644 --- a/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts +++ b/src/vs/workbench/contrib/performance/electron-sandbox/rendererAutoProfiler.ts @@ -37,7 +37,6 @@ export class RendererProfiling { const eventHistory = new RingBuffer<{ command: string; timestamp: number }>(5); this._disposables.add(commandService.onWillExecuteCommand(e => eventHistory.push({ command: e.commandId, timestamp: Date.now() }))); - const sessionDisposables = this._disposables.add(new DisposableStore()); const obs = new PerformanceObserver(list => { @@ -51,11 +50,7 @@ export class RendererProfiling { return; } - // pause observation, we'll take a detailed look - obs.disconnect(); - const sessionId = generateUuid(); - logService.warn(`[perf] Renderer reported VERY LONG TASK (${maxDuration}ms), starting auto profiling session '${sessionId}'`); // all visible views const views = viewsDescriptorService.viewContainers.map(container => { @@ -74,31 +69,34 @@ export class RendererProfiling { editors: JSON.stringify(editors), }); - // start heartbeat monitoring - nativeHostService.startHeartbeat(sessionId).then(success => { - if (!success) { - logService.warn('[perf] FAILED to start heartbeat sending'); - return; - } + // // start heartbeat monitoring + // const sessionDisposables = this._disposables.add(new DisposableStore()); + // logService.warn(`[perf] Renderer reported VERY LONG TASK (${maxDuration}ms), starting auto profiling session '${sessionId}'`); + // // pause observation, we'll take a detailed look + // obs.disconnect(); + // nativeHostService.startHeartbeat(sessionId).then(success => { + // if (!success) { + // logService.warn('[perf] FAILED to start heartbeat sending'); + // return; + // } - // start sending a repeated heartbeat which is expected to be received by the main side - const handle1 = setInterval(() => nativeHostService.sendHeartbeat(sessionId), 500); + // // start sending a repeated heartbeat which is expected to be received by the main side + // const handle1 = setInterval(() => nativeHostService.sendHeartbeat(sessionId), 500); - // stop heartbeat after 20s - const handle2 = setTimeout(() => sessionDisposables.clear(), 20 * 1000); + // // stop heartbeat after 20s + // const handle2 = setTimeout(() => sessionDisposables.clear(), 20 * 1000); - // cleanup - // - stop heartbeat - // - reconnect perf observer - sessionDisposables.add(toDisposable(() => { - clearInterval(handle1); - clearTimeout(handle2); - nativeHostService.stopHeartbeat(sessionId); - logService.warn(`[perf] STOPPING to send heartbeat`); - - obs.observe({ entryTypes: ['longtask'] }); - })); - }); + // // cleanup + // // - stop heartbeat + // // - reconnect perf observer + // sessionDisposables.add(toDisposable(() => { + // clearInterval(handle1); + // clearTimeout(handle2); + // nativeHostService.stopHeartbeat(sessionId); + // logService.warn(`[perf] STOPPING to send heartbeat`); + // obs.observe({ entryTypes: ['longtask'] }); + // })); + // }); }); this._disposables.add(toDisposable(() => obs.disconnect())); @@ -123,7 +121,7 @@ type TelemetryEventClassification = { owner: 'jrieken'; comment: 'Insight about what happened before/while a long task was reported'; sessionId: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Session identifier that allows to correlate CPU samples and events' }; - timestamp: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Unix time at which the long task approximately happened' }; + timestamp: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Unix time at which the long task approximately happened' }; recentCommands: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Events prior to the long task' }; views: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Visible views' }; editors: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Visible editor' }; diff --git a/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.ts b/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.ts index efc514e74a4..f5dff19e6d8 100644 --- a/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.ts +++ b/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.ts @@ -81,7 +81,7 @@ export class KeyboardLayoutPickerContribution extends Disposable implements IWor } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(KeyboardLayoutPickerContribution, 'KeyboardLayoutPickerContribution', LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(KeyboardLayoutPickerContribution, LifecyclePhase.Starting); interface LayoutQuickPickItem extends IQuickPickItem { layout: IKeyboardLayoutInfo; diff --git a/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts b/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts index bda672f49dd..e1aab482fb5 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts @@ -1243,8 +1243,8 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(PreferencesActionsContribution, 'PreferencesActionsContribution', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(PreferencesContribution, 'PreferencesContribution', LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(PreferencesActionsContribution, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(PreferencesContribution, LifecyclePhase.Starting); registerEditorContribution(SettingsEditorContribution.ID, SettingsEditorContribution); diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts b/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts index 2c59b8bfc44..809fefe402c 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts @@ -25,7 +25,7 @@ import { nullRange } from 'vs/workbench/services/preferences/common/preferencesM import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IStringDictionary } from 'vs/base/common/collections'; import { IProductService } from 'vs/platform/product/common/productService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; export interface IEndpointDetails { urlBase?: string; @@ -607,4 +607,4 @@ export class SettingMatches { } } -registerSingleton(IPreferencesSearchService, PreferencesSearchService, true); +registerSingleton(IPreferencesSearchService, PreferencesSearchService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts b/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts index 1ee86f9e52c..c08156d9246 100644 --- a/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts +++ b/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts @@ -19,7 +19,7 @@ import { Action2 } from 'vs/platform/actions/common/actions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; import { IDebugService, REPL_VIEW_ID } from 'vs/workbench/contrib/debug/common/debug'; @@ -235,7 +235,7 @@ export class OpenViewPickerAction extends Action2 { super({ id: OpenViewPickerAction.ID, title: { value: localize('openView', "Open View"), original: 'Open View' }, - category: CATEGORIES.View, + category: Categories.View, f1: true }); } @@ -258,7 +258,7 @@ export class QuickAccessViewPickerAction extends Action2 { super({ id: QuickAccessViewPickerAction.ID, title: { value: localize('quickOpenView', "Quick Open View"), original: 'Quick Open View' }, - category: CATEGORIES.View, + category: Categories.View, f1: false, // hide quick pickers from command palette to not confuse with the other entry that shows a input field keybinding: { weight: KeybindingWeight.WorkbenchContrib, diff --git a/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts b/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts index cdde19ded70..fa262bfda14 100644 --- a/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts +++ b/src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts @@ -27,7 +27,7 @@ interface IConfiguration extends IWindowsConfiguration { editor?: { accessibilitySupport?: 'on' | 'off' | 'auto' }; security?: { workspace?: { trust?: { enabled?: boolean } } }; window: IWindowSettings & { experimental?: { windowControlsOverlay?: { enabled?: boolean }; useSandbox?: boolean } }; - workbench?: { experimental?: { settingsProfiles?: { enabled?: boolean } } }; + workbench?: { experimental?: { settingsProfiles?: { enabled?: boolean } }; enableExperiments?: boolean }; } export class SettingsChangeRelauncher extends Disposable implements IWorkbenchContribution { @@ -42,6 +42,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo private accessibilitySupport: 'on' | 'off' | 'auto' | undefined; private workspaceTrustEnabled: boolean | undefined; private settingsProfilesEnabled: boolean | undefined; + private experimentsEnabled: boolean | undefined; constructor( @IHostService private readonly hostService: IHostService, @@ -123,6 +124,12 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo changed = true; } + // Experiments + if (typeof config.workbench?.enableExperiments === 'boolean' && config.workbench.enableExperiments !== this.experimentsEnabled) { + this.experimentsEnabled = config.workbench.enableExperiments; + changed = true; + } + // Notify only when changed and we are the focused window (avoids notification spam across windows) if (notify && changed) { this.doConfirm( @@ -225,5 +232,5 @@ export class WorkspaceChangeExtHostRelauncher extends Disposable implements IWor } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(SettingsChangeRelauncher, 'SettingsChangeRelauncher', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(WorkspaceChangeExtHostRelauncher, 'WorkspaceChangeExtHostRelauncher', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(SettingsChangeRelauncher, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(WorkspaceChangeExtHostRelauncher, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/remote/browser/remote.contribution.ts b/src/vs/workbench/contrib/remote/browser/remote.contribution.ts index 4bb56230f2a..63e7f2df0b4 100644 --- a/src/vs/workbench/contrib/remote/browser/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/browser/remote.contribution.ts @@ -13,11 +13,11 @@ import { RemoteStatusIndicator } from 'vs/workbench/contrib/remote/browser/remot import { AutomaticPortForwarding, ForwardedPortsView, PortRestore } from 'vs/workbench/contrib/remote/browser/remoteExplorer'; const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(ShowCandidateContribution, 'ShowCandidateContribution', LifecyclePhase.Ready); -workbenchContributionsRegistry.registerWorkbenchContribution(TunnelFactoryContribution, 'TunnelFactoryContribution', LifecyclePhase.Ready); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentConnectionStatusListener, 'RemoteAgentConnectionStatusListener', LifecyclePhase.Eventually); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteStatusIndicator, 'RemoteStatusIndicator', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(ForwardedPortsView, 'ForwardedPortsView', LifecyclePhase.Restored); -workbenchContributionsRegistry.registerWorkbenchContribution(PortRestore, 'PortRestore', LifecyclePhase.Eventually); -workbenchContributionsRegistry.registerWorkbenchContribution(AutomaticPortForwarding, 'AutomaticPortForwarding', LifecyclePhase.Eventually); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteMarkers, 'RemoteMarkers', LifecyclePhase.Eventually); +workbenchContributionsRegistry.registerWorkbenchContribution(ShowCandidateContribution, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(TunnelFactoryContribution, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentConnectionStatusListener, LifecyclePhase.Eventually); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteStatusIndicator, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(ForwardedPortsView, LifecyclePhase.Restored); +workbenchContributionsRegistry.registerWorkbenchContribution(PortRestore, LifecyclePhase.Eventually); +workbenchContributionsRegistry.registerWorkbenchContribution(AutomaticPortForwarding, LifecyclePhase.Eventually); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteMarkers, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts b/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts index e9f2f1ae804..15e4776d4a9 100644 --- a/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts +++ b/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts @@ -339,7 +339,7 @@ class OnAutoForwardedAction extends Disposable { choices.push(this.openPreviewChoice(tunnel)); } - if ((tunnel.tunnelLocalPort !== tunnel.tunnelRemotePort) && this.tunnelService.canElevate && isPortPrivileged(tunnel.tunnelRemotePort)) { + if ((tunnel.tunnelLocalPort !== tunnel.tunnelRemotePort) && this.tunnelService.canElevate && this.tunnelService.isPortPrivileged(tunnel.tunnelRemotePort)) { // Privileged ports are not on Windows, so it's safe to use "superuser" message += nls.localize('remote.tunnelsView.elevationMessage', "You'll need to run as superuser to use port {0} locally. ", tunnel.tunnelRemotePort); choices.unshift(this.elevateChoice(tunnel)); diff --git a/src/vs/workbench/contrib/remote/browser/tunnelView.ts b/src/vs/workbench/contrib/remote/browser/tunnelView.ts index b087ee0bd88..d598e2d2ece 100644 --- a/src/vs/workbench/contrib/remote/browser/tunnelView.ts +++ b/src/vs/workbench/contrib/remote/browser/tunnelView.ts @@ -23,7 +23,7 @@ import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel'; import { ActionRunner, IAction } from 'vs/base/common/actions'; import { IMenuService, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { ILocalizedString } from 'vs/platform/action/common/action'; -import { createAndFillInContextMenuActions, createAndFillInActionBarActions, createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; +import { createAndFillInActionBarActions, createActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { IRemoteExplorerService, TunnelModel, makeAddress, TunnelType, ITunnelItem, Tunnel, TUNNEL_VIEW_ID, parseAddress, CandidatePort, TunnelEditId, mapHasAddressLocalhostOrAllInterfaces, Attributes, TunnelSource } from 'vs/workbench/services/remote/common/remoteExplorerService'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; @@ -35,7 +35,7 @@ import { IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platfor import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPane'; import { URI } from 'vs/base/common/uri'; -import { isAllInterfaces, isLocalhost, isPortPrivileged, ITunnelService, RemoteTunnel, TunnelPrivacyId, TunnelProtocol } from 'vs/platform/tunnel/common/tunnel'; +import { isAllInterfaces, isLocalhost, ITunnelService, RemoteTunnel, TunnelPrivacyId, TunnelProtocol } from 'vs/platform/tunnel/common/tunnel'; import { TunnelPrivacy } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -1023,14 +1023,11 @@ export class TunnelPanel extends ViewPane { this.portChangableContextKey.set(false); } - const menu = this.menuService.createMenu(MenuId.TunnelContext, this.table.contextKeyService); - const actions: IAction[] = []; - createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, actions); - menu.dispose(); - this.contextMenuService.showContextMenu({ + menuId: MenuId.TunnelContext, + menuActionOptions: { shouldForwardArgs: true }, + contextKeyService: this.table.contextKeyService, getAnchor: () => event.anchor, - getActions: () => actions, getActionViewItem: (action) => { const keybinding = this.keybindingService.lookupKeybinding(action.id); if (keybinding) { @@ -1141,13 +1138,13 @@ export namespace ForwardPortAction { export const TREEITEM_LABEL = nls.localize('remote.tunnel.forwardItem', "Forward Port"); const forwardPrompt = nls.localize('remote.tunnel.forwardPrompt', "Port number or address (eg. 3000 or 10.10.10.10:2000)."); - function validateInput(remoteExplorerService: IRemoteExplorerService, value: string, canElevate: boolean): { content: string; severity: Severity } | null { + function validateInput(remoteExplorerService: IRemoteExplorerService, tunnelService: ITunnelService, value: string, canElevate: boolean): { content: string; severity: Severity } | null { const parsed = parseAddress(value); if (!parsed) { return { content: invalidPortString, severity: Severity.Error }; } else if (parsed.port >= maxPortNumber) { return { content: invalidPortNumberString, severity: Severity.Error }; - } else if (canElevate && isPortPrivileged(parsed.port)) { + } else if (canElevate && tunnelService.isPortPrivileged(parsed.port)) { return { content: requiresSudoString, severity: Severity.Info }; } else if (mapHasAddressLocalhostOrAllInterfaces(remoteExplorerService.tunnelModel.forwarded, parsed.host, parsed.port)) { return { content: alreadyForwarded, severity: Severity.Error }; @@ -1177,7 +1174,7 @@ export namespace ForwardPortAction { }).then(tunnel => error(notificationService, tunnel, parsed!.host, parsed!.port)); } }, - validationMessage: (value) => validateInput(remoteExplorerService, value, tunnelService.canElevate), + validationMessage: (value) => validateInput(remoteExplorerService, tunnelService, value, tunnelService.canElevate), placeholder: forwardPrompt }); }; @@ -1193,7 +1190,7 @@ export namespace ForwardPortAction { await viewsService.openView(TunnelPanel.ID, true); const value = await quickInputService.input({ prompt: forwardPrompt, - validateInput: (value) => Promise.resolve(validateInput(remoteExplorerService, value, tunnelService.canElevate)) + validateInput: (value) => Promise.resolve(validateInput(remoteExplorerService, tunnelService, value, tunnelService.canElevate)) }); let parsed: { host: string; port: number } | undefined; if (value && (parsed = parseAddress(value))) { @@ -1439,12 +1436,12 @@ namespace ChangeLocalPortAction { export const ID = 'remote.tunnel.changeLocalPort'; export const LABEL = nls.localize('remote.tunnel.changeLocalPort', "Change Local Address Port"); - function validateInput(value: string, canElevate: boolean): { content: string; severity: Severity } | null { + function validateInput(tunnelService: ITunnelService, value: string, canElevate: boolean): { content: string; severity: Severity } | null { if (!value.match(/^[0-9]+$/)) { return { content: invalidPortString, severity: Severity.Error }; } else if (Number(value) >= maxPortNumber) { return { content: invalidPortNumberString, severity: Severity.Error }; - } else if (canElevate && isPortPrivileged(Number(value))) { + } else if (canElevate && tunnelService.isPortPrivileged(Number(value))) { return { content: requiresSudoString, severity: Severity.Info }; } return null; @@ -1487,7 +1484,7 @@ namespace ChangeLocalPortAction { } } }, - validationMessage: (value) => validateInput(value, tunnelService.canElevate), + validationMessage: (value) => validateInput(tunnelService, value, tunnelService.canElevate), placeholder: nls.localize('remote.tunnelsView.changePort', "New local port") }); } diff --git a/src/vs/workbench/contrib/remote/common/remote.contribution.ts b/src/vs/workbench/contrib/remote/common/remote.contribution.ts index c1de0fcfdae..a65fefa0da1 100644 --- a/src/vs/workbench/contrib/remote/common/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/common/remote.contribution.ts @@ -25,7 +25,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { firstOrDefault } from 'vs/base/common/arrays'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { PersistentConnection } from 'vs/platform/remote/common/remoteAgentConnection'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { getRemoteName } from 'vs/platform/remote/common/remoteHosts'; @@ -267,11 +267,11 @@ class InitialRemoteConnectionHealthContribution implements IWorkbenchContributio } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(LabelContribution, 'LabelContribution', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteChannelsContribution, 'RemoteChannelsContribution', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteInvalidWorkspaceDetector, 'RemoteInvalidWorkspaceDetector', LifecyclePhase.Starting); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteLogOutputChannels, 'RemoteLogOutputChannels', LifecyclePhase.Restored); -workbenchContributionsRegistry.registerWorkbenchContribution(InitialRemoteConnectionHealthContribution, 'InitialRemoteConnectionHealthContribution', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(LabelContribution, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteChannelsContribution, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteInvalidWorkspaceDetector, LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteLogOutputChannels, LifecyclePhase.Restored); +workbenchContributionsRegistry.registerWorkbenchContribution(InitialRemoteConnectionHealthContribution, LifecyclePhase.Ready); const enableDiagnostics = true; @@ -281,7 +281,7 @@ if (enableDiagnostics) { super({ id: 'workbench.action.triggerReconnect', title: { value: localize('triggerReconnect', "Connection: Trigger Reconnect"), original: 'Connection: Trigger Reconnect' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, }); } @@ -296,7 +296,7 @@ if (enableDiagnostics) { super({ id: 'workbench.action.pauseSocketWriting', title: { value: localize('pauseSocketWriting', "Connection: Pause socket writing"), original: 'Connection: Pause socket writing' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, }); } 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 74be20ebf6c..f884e73d9da 100644 --- a/src/vs/workbench/contrib/remote/electron-sandbox/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-sandbox/remote.contribution.ts @@ -170,12 +170,12 @@ class WSLContextKeyInitializer extends Disposable implements IWorkbenchContribut } const workbenchContributionsRegistry = Registry.as(WorkbenchContributionsExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentDiagnosticListener, 'RemoteAgentDiagnosticListener', LifecyclePhase.Eventually); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteExtensionHostEnvironmentUpdater, 'RemoteExtensionHostEnvironmentUpdater', LifecyclePhase.Eventually); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteTelemetryEnablementUpdater, 'RemoteTelemetryEnablementUpdater', LifecyclePhase.Ready); -workbenchContributionsRegistry.registerWorkbenchContribution(RemoteEmptyWorkbenchPresentation, 'RemoteEmptyWorkbenchPresentation', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentDiagnosticListener, LifecyclePhase.Eventually); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteExtensionHostEnvironmentUpdater, LifecyclePhase.Eventually); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteTelemetryEnablementUpdater, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteEmptyWorkbenchPresentation, LifecyclePhase.Ready); if (isWindows) { - workbenchContributionsRegistry.registerWorkbenchContribution(WSLContextKeyInitializer, 'WSLContextKeyInitializer', LifecyclePhase.Ready); + workbenchContributionsRegistry.registerWorkbenchContribution(WSLContextKeyInitializer, LifecyclePhase.Ready); } Registry.as(ConfigurationExtensions.Configuration) diff --git a/src/vs/workbench/contrib/sash/browser/sash.contribution.ts b/src/vs/workbench/contrib/sash/browser/sash.contribution.ts index ffcbfcce3fa..ca2bbe1d72b 100644 --- a/src/vs/workbench/contrib/sash/browser/sash.contribution.ts +++ b/src/vs/workbench/contrib/sash/browser/sash.contribution.ts @@ -16,7 +16,7 @@ import { isIOS } from 'vs/base/common/platform'; // Sash size contribution Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(SashSettingsController, 'SashSettingsController', LifecyclePhase.Restored); + .registerWorkbenchContribution(SashSettingsController, LifecyclePhase.Restored); // Sash size configuration contribution Registry.as(ConfigurationExtensions.Configuration) diff --git a/src/vs/workbench/contrib/scm/browser/scm.contribution.ts b/src/vs/workbench/contrib/scm/browser/scm.contribution.ts index 0ff79b1dc49..b2353ef9da5 100644 --- a/src/vs/workbench/contrib/scm/browser/scm.contribution.ts +++ b/src/vs/workbench/contrib/scm/browser/scm.contribution.ts @@ -16,7 +16,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions, Configur import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { SCMService } from 'vs/workbench/contrib/scm/common/scmService'; import { IViewContainersRegistry, ViewContainerLocation, Extensions as ViewContainerExtensions, IViewsRegistry } from 'vs/workbench/common/views'; import { SCMViewPaneContainer } from 'vs/workbench/contrib/scm/browser/scmViewPaneContainer'; @@ -39,7 +39,7 @@ ModesRegistry.registerLanguage({ }); Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(DirtyDiffWorkbenchController, 'DirtyDiffWorkbenchController', LifecyclePhase.Restored); + .registerWorkbenchContribution(DirtyDiffWorkbenchController, LifecyclePhase.Restored); const sourceControlViewIcon = registerIcon('source-control-view-icon', Codicon.sourceControl, localize('sourceControlViewIcon', 'View icon of the Source Control view.')); @@ -108,10 +108,10 @@ viewsRegistry.registerViews([{ }], viewContainer); Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(SCMActiveResourceContextKeyController, 'SCMActiveResourceContextKeyController', LifecyclePhase.Restored); + .registerWorkbenchContribution(SCMActiveResourceContextKeyController, LifecyclePhase.Restored); Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(SCMStatusController, 'SCMStatusController', LifecyclePhase.Restored); + .registerWorkbenchContribution(SCMStatusController, LifecyclePhase.Restored); Registry.as(ConfigurationExtensions.Configuration).registerConfiguration({ id: 'scm', @@ -383,5 +383,5 @@ MenuRegistry.appendMenuItem(MenuId.SCMSourceControl, { when: ContextKeyExpr.equals('scmProviderHasRootUri', true) }); -registerSingleton(ISCMService, SCMService, true); -registerSingleton(ISCMViewService, SCMViewService, true); +registerSingleton(ISCMService, SCMService, InstantiationType.Delayed); +registerSingleton(ISCMViewService, SCMViewService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/search/browser/replaceContributions.ts b/src/vs/workbench/contrib/search/browser/replaceContributions.ts index 5312753d6d2..42176f2aeec 100644 --- a/src/vs/workbench/contrib/search/browser/replaceContributions.ts +++ b/src/vs/workbench/contrib/search/browser/replaceContributions.ts @@ -2,7 +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 { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; import { ReplaceService, ReplacePreviewContentProvider } from 'vs/workbench/contrib/search/browser/replaceService'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -10,6 +10,6 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } fr import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; export function registerContributions(): void { - registerSingleton(IReplaceService, ReplaceService, true); - Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ReplacePreviewContentProvider, 'ReplacePreviewContentProvider', LifecyclePhase.Starting); + registerSingleton(IReplaceService, ReplaceService, InstantiationType.Delayed); + Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ReplacePreviewContentProvider, LifecyclePhase.Starting); } diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index 3f8f2efa982..6762eea280e 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -20,10 +20,10 @@ import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurati import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IFileService } from 'vs/platform/files/common/files'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { IListService, WorkbenchListFocusContextKey, WorkbenchObjectTree } from 'vs/platform/list/browser/listService'; +import { IListService, WorkbenchListFocusContextKey, WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listService'; import { Extensions as QuickAccessExtensions, IQuickAccessRegistry } from 'vs/platform/quickinput/common/quickAccess'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -57,8 +57,8 @@ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/b import { ISearchConfiguration, SearchSortOrder, SEARCH_EXCLUDE_CONFIG, VIEWLET_ID, ViewMode, VIEW_ID } from 'vs/workbench/services/search/common/search'; import { Extensions, IConfigurationMigrationRegistry } from 'vs/workbench/common/configuration'; -registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, true); -registerSingleton(ISearchHistoryService, SearchHistoryService, true); +registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, InstantiationType.Delayed); +registerSingleton(ISearchHistoryService, SearchHistoryService, InstantiationType.Delayed); replaceContributions(); searchWidgetContributions(); @@ -104,7 +104,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ handler: (accessor) => { const searchView = getSearchView(accessor.get(IViewsService)); if (searchView) { - const tree: WorkbenchObjectTree = searchView.getControl(); + const tree: WorkbenchCompressibleObjectTree = searchView.getControl(); const viewer = searchView.getControl(); const focus = tree.getFocus()[0]; @@ -128,7 +128,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ handler: (accessor, args: any) => { const searchView = getSearchView(accessor.get(IViewsService)); if (searchView) { - const tree: WorkbenchObjectTree = searchView.getControl(); + const tree: WorkbenchCompressibleObjectTree = searchView.getControl(); searchView.open(tree.getFocus()[0], false, true, true); } } @@ -145,7 +145,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ handler: (accessor, args: any) => { const searchView = getSearchView(accessor.get(IViewsService)); if (searchView) { - const tree: WorkbenchObjectTree = searchView.getControl(); + const tree: WorkbenchCompressibleObjectTree = searchView.getControl(); accessor.get(IInstantiationService).createInstance(RemoveAction, tree, tree.getFocus()[0]!).run(); } } @@ -159,7 +159,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ handler: (accessor, args: any) => { const searchView = getSearchView(accessor.get(IViewsService)); if (searchView) { - const tree: WorkbenchObjectTree = searchView.getControl(); + const tree: WorkbenchCompressibleObjectTree = searchView.getControl(); accessor.get(IInstantiationService).createInstance(ReplaceAction, tree, tree.getFocus()[0] as Match, searchView).run(); } } @@ -174,7 +174,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ handler: (accessor, args: any) => { const searchView = getSearchView(accessor.get(IViewsService)); if (searchView) { - const tree: WorkbenchObjectTree = searchView.getControl(); + const tree: WorkbenchCompressibleObjectTree = searchView.getControl(); accessor.get(IInstantiationService).createInstance(ReplaceAllAction, searchView, tree.getFocus()[0] as FileMatch).run(); } } @@ -189,7 +189,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ handler: (accessor, args: any) => { const searchView = getSearchView(accessor.get(IViewsService)); if (searchView) { - const tree: WorkbenchObjectTree = searchView.getControl(); + const tree: WorkbenchCompressibleObjectTree = searchView.getControl(); accessor.get(IInstantiationService).createInstance(ReplaceAllInFolderAction, tree, tree.getFocus()[0] as FolderMatch).run(); } } @@ -746,7 +746,7 @@ class RegisterSearchViewContribution implements IWorkbenchContribution { .registerConfigurationMigrations([{ key: 'search.location', migrateFn: (value: any) => ({ value: undefined }) }]); } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(RegisterSearchViewContribution, 'RegisterSearchViewContribution', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(RegisterSearchViewContribution, LifecyclePhase.Starting); // Actions const registry = Registry.as(ActionExtensions.WorkbenchActions); @@ -852,7 +852,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ handler: (accessor, args: any) => { const searchView = getSearchView(accessor.get(IViewsService)); if (searchView) { - const tree: WorkbenchObjectTree = searchView.getControl(); + const tree: WorkbenchCompressibleObjectTree = searchView.getControl(); searchView.openEditorWithMultiCursor(tree.getFocus()[0]); } } diff --git a/src/vs/workbench/contrib/search/browser/searchActions.ts b/src/vs/workbench/contrib/search/browser/searchActions.ts index cd458000ec8..6f121ec4d6f 100644 --- a/src/vs/workbench/contrib/search/browser/searchActions.ts +++ b/src/vs/workbench/contrib/search/browser/searchActions.ts @@ -15,7 +15,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ILabelService } from 'vs/platform/label/common/label'; -import { getSelectionKeyboardEvent, WorkbenchObjectTree } from 'vs/platform/list/browser/listService'; +import { getSelectionKeyboardEvent, WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listService'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { IViewsService } from 'vs/workbench/common/views'; import { searchRemoveIcon, searchReplaceAllIcon, searchReplaceIcon } from 'vs/workbench/contrib/search/browser/searchIcons'; @@ -292,15 +292,22 @@ export function collapseDeepestExpandedLevel(accessor: ServicesAccessor) { let canCollapseFileMatchLevel = false; let canCollapseFirstLevel = false; - if (node instanceof FolderMatch) { + if (node instanceof FolderMatchWorkspaceRoot) { while (node = navigator.next()) { if (node instanceof Match) { canCollapseFileMatchLevel = true; break; } if (searchView.isTreeLayoutViewVisible && !canCollapseFirstLevel) { - const immediateParent = node.parent(); - if (immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot) { + let nodeToTest = node; + + if (node instanceof FolderMatch) { + nodeToTest = node.compressionStartParent ?? node; + } + + const immediateParent = nodeToTest.parent(); + + if (!(immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot || immediateParent instanceof SearchResult)) { canCollapseFirstLevel = true; } } @@ -318,10 +325,17 @@ export function collapseDeepestExpandedLevel(accessor: ServicesAccessor) { node = navigator.first(); if (node) { do { - const immediateParent = node.parent(); + + let nodeToTest = node; + + if (node instanceof FolderMatch) { + nodeToTest = node.compressionStartParent ?? node; + } + const immediateParent = nodeToTest.parent(); + if (immediateParent instanceof FolderMatchWorkspaceRoot || immediateParent instanceof FolderMatchNoRoot) { - if (viewer.hasElement(immediateParent) && viewer.isCollapsed(immediateParent)) { - viewer.collapse(immediateParent, true); + if (viewer.hasElement(node)) { + viewer.collapse(node, true); } else { viewer.collapseAll(); } @@ -396,12 +410,12 @@ export abstract class AbstractSearchAndReplaceAction extends Action { /** * Returns element to focus after removing the given element */ - getElementToFocusAfterRemoved(viewer: WorkbenchObjectTree, elementToRemove: RenderableMatch, isTreeViewVisible: boolean): RenderableMatch { + getElementToFocusAfterRemoved(viewer: WorkbenchCompressibleObjectTree, elementToRemove: RenderableMatch, isTreeViewVisible: boolean): RenderableMatch { const elementToFocus = this.getNextElementAfterRemoved(viewer, elementToRemove); return elementToFocus || this.getPreviousElementAfterRemoved(viewer, elementToRemove, isTreeViewVisible); } - getNextElementAfterRemoved(viewer: WorkbenchObjectTree, element: RenderableMatch): RenderableMatch { + getNextElementAfterRemoved(viewer: WorkbenchCompressibleObjectTree, element: RenderableMatch): RenderableMatch { const navigator: ITreeNavigator = viewer.navigate(element); if (element instanceof FolderMatch) { while (!!navigator.next() && !(navigator.current() instanceof FolderMatch)) { } @@ -415,7 +429,7 @@ export abstract class AbstractSearchAndReplaceAction extends Action { return navigator.current(); } - getPreviousElementAfterRemoved(viewer: WorkbenchObjectTree, element: RenderableMatch, isTreeViewVisible: boolean): RenderableMatch { + getPreviousElementAfterRemoved(viewer: WorkbenchCompressibleObjectTree, element: RenderableMatch, isTreeViewVisible: boolean): RenderableMatch { const navigator: ITreeNavigator = viewer.navigate(element); let previousElement = navigator.previous(); // Hence take the previous element. @@ -448,10 +462,10 @@ export abstract class AbstractSearchAndReplaceAction extends Action { class ReplaceActionRunner { constructor( - private viewer: WorkbenchObjectTree, + private viewer: WorkbenchCompressibleObjectTree, private viewlet: SearchView | undefined, - private getElementToFocusAfterRemoved: (viewer: WorkbenchObjectTree, lastElementToBeRemoved: RenderableMatch, isTreeViewVisible: boolean) => RenderableMatch, - private getPreviousElementAfterRemoved: (viewer: WorkbenchObjectTree, element: RenderableMatch, isTreeViewVisible: boolean) => RenderableMatch, + private getElementToFocusAfterRemoved: (viewer: WorkbenchCompressibleObjectTree, lastElementToBeRemoved: RenderableMatch, isTreeViewVisible: boolean) => RenderableMatch, + private getPreviousElementAfterRemoved: (viewer: WorkbenchCompressibleObjectTree, element: RenderableMatch, isTreeViewVisible: boolean) => RenderableMatch, // Services @IReplaceService private readonly replaceService: IReplaceService, @IEditorService private readonly editorService: IEditorService, @@ -573,7 +587,7 @@ export class RemoveAction extends AbstractSearchAndReplaceAction { static readonly LABEL = nls.localize('RemoveAction.label', "Dismiss"); constructor( - private viewer: WorkbenchObjectTree, + private viewer: WorkbenchCompressibleObjectTree, private element: RenderableMatch, @IKeybindingService keyBindingService: IKeybindingService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -640,7 +654,7 @@ export class ReplaceAllInFolderAction extends AbstractSearchAndReplaceAction { static readonly LABEL = nls.localize('file.replaceAll.label', "Replace All"); private replaceRunner: ReplaceActionRunner; - constructor(viewer: WorkbenchObjectTree, private folderMatch: FolderMatch, + constructor(viewer: WorkbenchCompressibleObjectTree, private folderMatch: FolderMatch, @IInstantiationService private readonly instantiationService: IInstantiationService, @IKeybindingService keyBindingService: IKeybindingService ) { @@ -660,7 +674,7 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction { static runQ = Promise.resolve(); private replaceRunner: ReplaceActionRunner; - constructor(viewer: WorkbenchObjectTree, private element: Match, viewlet: SearchView, + constructor(viewer: WorkbenchCompressibleObjectTree, private element: Match, viewlet: SearchView, @IInstantiationService private readonly instantiationService: IInstantiationService, @IKeybindingService keyBindingService: IKeybindingService, ) { @@ -825,7 +839,7 @@ export const focusSearchListCommand: ICommandHandler = accessor => { }); }; -function getElementsToOperateOnInfo(viewer: WorkbenchObjectTree, currElement: RenderableMatch, sortConfig: ISearchConfigurationProperties): { elements: RenderableMatch[]; mustReselect: boolean } { +function getElementsToOperateOnInfo(viewer: WorkbenchCompressibleObjectTree, currElement: RenderableMatch, sortConfig: ISearchConfigurationProperties): { elements: RenderableMatch[]; mustReselect: boolean } { let elements: RenderableMatch[] = viewer.getSelection().filter((x): x is RenderableMatch => x !== null).sort((a, b) => searchComparer(a, b, sortConfig.sortOrder)); const mustReselect = elements.includes(currElement); // this indicates whether we need to re-focus/re-select on a remove. diff --git a/src/vs/workbench/contrib/search/browser/searchResultsView.ts b/src/vs/workbench/contrib/search/browser/searchResultsView.ts index d2bbfc89c65..5ddcc2e1134 100644 --- a/src/vs/workbench/contrib/search/browser/searchResultsView.ts +++ b/src/vs/workbench/contrib/search/browser/searchResultsView.ts @@ -8,7 +8,7 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; -import { ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree'; +import { ITreeNode } from 'vs/base/browser/ui/tree/tree'; import { IAction } from 'vs/base/common/actions'; import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; import * as paths from 'vs/base/common/path'; @@ -24,8 +24,10 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels'; import { RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction } from 'vs/workbench/contrib/search/browser/searchActions'; import { SearchView } from 'vs/workbench/contrib/search/browser/searchView'; -import { FileMatch, Match, RenderableMatch, SearchModel, FolderMatch, FolderMatchNoRoot } from 'vs/workbench/contrib/search/common/searchModel'; +import { FileMatch, Match, RenderableMatch, SearchModel, FolderMatch, FolderMatchNoRoot, FolderMatchWorkspaceRoot } from 'vs/workbench/contrib/search/common/searchModel'; import { isEqual } from 'vs/base/common/resources'; +import { ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTree'; +import { ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel'; interface IFolderMatchTemplate { label: IResourceLabel; @@ -73,8 +75,7 @@ export class SearchDelegate implements IListVirtualDelegate { throw new Error('Invalid search tree element'); } } - -export class FolderMatchRenderer extends Disposable implements ITreeRenderer { +export class FolderMatchRenderer extends Disposable implements ICompressibleTreeRenderer { static readonly TEMPLATE_ID = 'folderMatch'; readonly templateId = FolderMatchRenderer.TEMPLATE_ID; @@ -85,16 +86,38 @@ export class FolderMatchRenderer extends Disposable implements ITreeRenderer, any>, index: number, templateData: IFolderMatchTemplate, height: number | undefined): void { + const compressed = node.element; + const folder = compressed.elements[compressed.elements.length - 1]; + folder.compressionStartParent = compressed.elements[0]; + const label = compressed.elements.map(e => e.name()); + + if (folder.resource) { + const fileKind = (folder instanceof FolderMatchWorkspaceRoot) ? FileKind.ROOT_FOLDER : FileKind.FOLDER; + templateData.label.setResource({ resource: folder.resource, name: label }, { + fileKind, + separator: this.labelService.getSeparator(folder.resource.scheme), + }); + } else { + templateData.label.setLabel(nls.localize('searchFolderMatch.other.label', "Other files")); + } + + templateData.actions.clear(); + templateData.actions.context = folder; + this.renderFolderDetails(folder, templateData); + } + renderTemplate(container: HTMLElement): IFolderMatchTemplate { const disposables: IDisposable[] = []; const folderMatchElement = DOM.append(container, DOM.$('.foldermatch')); - const label = this.labels.create(folderMatchElement); + const label = this.labels.create(folderMatchElement, { supportDescriptionHighlights: true, supportHighlights: true }); disposables.push(label); const badge = new CountBadge(DOM.append(folderMatchElement, DOM.$('.badge'))); disposables.push(attachBadgeStyler(badge, this.themeService)); @@ -112,6 +135,7 @@ export class FolderMatchRenderer extends Disposable implements ITreeRenderer, index: number, templateData: IFolderMatchTemplate): void { const folderMatch = node.element; + folderMatch.compressionStartParent = undefined; if (folderMatch.resource) { const workspaceFolder = this.contextService.getWorkspaceFolder(folderMatch.resource); if (workspaceFolder && isEqual(workspaceFolder.uri, folderMatch.resource)) { @@ -122,19 +146,8 @@ export class FolderMatchRenderer extends Disposable implements ITreeRenderer 1 ? nls.localize('searchFileMatches', "{0} files found", count) : nls.localize('searchFileMatch', "{0} file found", count)); - templateData.actions.clear(); - - const actions: IAction[] = []; - if (this.searchModel.isReplaceActive() && count > 0) { - actions.push(this.instantiationService.createInstance(ReplaceAllInFolderAction, this.searchView.getControl(), folderMatch)); - } - - actions.push(this.instantiationService.createInstance(RemoveAction, this.searchView.getControl(), folderMatch)); - templateData.actions.push(actions, { icon: true, label: false }); + this.renderFolderDetails(folderMatch, templateData); } disposeElement(element: ITreeNode, index: number, templateData: IFolderMatchTemplate): void { @@ -143,9 +156,23 @@ export class FolderMatchRenderer extends Disposable implements ITreeRenderer 1 ? nls.localize('searchFileMatches', "{0} files found", count) : nls.localize('searchFileMatch', "{0} file found", count)); + + const actions: IAction[] = []; + if (this.searchModel.isReplaceActive() && count > 0) { + actions.push(this.instantiationService.createInstance(ReplaceAllInFolderAction, this.searchView.getControl(), folder)); + } + + actions.push(this.instantiationService.createInstance(RemoveAction, this.searchView.getControl(), folder)); + templateData.actions.push(actions, { icon: true, label: false }); + } } -export class FileMatchRenderer extends Disposable implements ITreeRenderer { +export class FileMatchRenderer extends Disposable implements ICompressibleTreeRenderer { static readonly TEMPLATE_ID = 'fileMatch'; readonly templateId = FileMatchRenderer.TEMPLATE_ID; @@ -162,6 +189,10 @@ export class FileMatchRenderer extends Disposable implements ITreeRenderer, any>, index: number, templateData: IFileMatchTemplate, height: number | undefined): void { + throw new Error('Should never happen since node is incompressible.'); + } + renderTemplate(container: HTMLElement): IFileMatchTemplate { const disposables: IDisposable[] = []; const fileMatchElement = DOM.append(container, DOM.$('.filematch')); @@ -210,7 +241,7 @@ export class FileMatchRenderer extends Disposable implements ITreeRenderer { +export class MatchRenderer extends Disposable implements ICompressibleTreeRenderer { static readonly TEMPLATE_ID = 'match'; readonly templateId = MatchRenderer.TEMPLATE_ID; @@ -224,6 +255,9 @@ export class MatchRenderer extends Disposable implements ITreeRenderer, void>, index: number, templateData: IMatchTemplate, height: number | undefined): void { + throw new Error('Should never happen since node is incompressible.'); + } renderTemplate(container: HTMLElement): IMatchTemplate { container.classList.add('linematch'); diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index e209f70f451..08ce9025877 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -8,8 +8,8 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import * as aria from 'vs/base/browser/ui/aria/aria'; import { MessageType } from 'vs/base/browser/ui/inputbox/inputBox'; import { IIdentityProvider } from 'vs/base/browser/ui/list/list'; -import { ITreeContextMenuEvent, ITreeElement } from 'vs/base/browser/ui/tree/tree'; -import { IAction } from 'vs/base/common/actions'; +import { ICompressedTreeElement } from 'vs/base/browser/ui/tree/compressedObjectTreeModel'; +import { ITreeContextMenuEvent } from 'vs/base/browser/ui/tree/tree'; import { Delayer } from 'vs/base/common/async'; import { Color, RGBA } from 'vs/base/common/color'; import * as errors from 'vs/base/common/errors'; @@ -32,8 +32,7 @@ import { CommonFindController } from 'vs/editor/contrib/find/browser/findControl import { MultiCursorSelectionController } from 'vs/editor/contrib/multicursor/browser/multicursor'; import * as nls from 'vs/nls'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { IMenu, IMenuService, MenuId } from 'vs/platform/actions/common/actions'; +import { MenuId } from 'vs/platform/actions/common/actions'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -43,7 +42,7 @@ import { FileChangesEvent, FileChangeType, IFileService } from 'vs/platform/file import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { getSelectionKeyboardEvent, WorkbenchObjectTree } from 'vs/platform/list/browser/listService'; +import { getSelectionKeyboardEvent, WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listService'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IOpenerService, withSelection } from 'vs/platform/opener/common/opener'; import { IProgress, IProgressService, IProgressStep } from 'vs/platform/progress/common/progress'; @@ -121,9 +120,7 @@ export class SearchView extends ViewPane { private hasFilePatternKey: IContextKey; private hasSomeCollapsibleResultKey: IContextKey; - private contextMenu: IMenu | null = null; - - private tree!: WorkbenchObjectTree; + private tree!: WorkbenchCompressibleObjectTree; private treeLabels!: ResourceLabels; private viewletState: MementoObject; private messagesElement!: HTMLElement; @@ -178,7 +175,6 @@ export class SearchView extends ViewPane { @IThemeService themeService: IThemeService, @ISearchHistoryService private readonly searchHistoryService: ISearchHistoryService, @IContextMenuService contextMenuService: IContextMenuService, - @IMenuService private readonly menuService: IMenuService, @IAccessibilityService private readonly accessibilityService: IAccessibilityService, @IKeybindingService keybindingService: IKeybindingService, @IStorageService storageService: IStorageService, @@ -531,7 +527,7 @@ export class SearchView extends ViewPane { private refreshAndUpdateCount(event?: IChangeEvent): void { this.searchWidget.setReplaceAllActionState(!this.viewModel.searchResult.isEmpty()); - this.updateSearchResultCount(this.viewModel.searchResult.query!.userDisabledExcludesAndIgnoreFiles, this.viewModel.searchResult.query?.onlyOpenEditors); + this.updateSearchResultCount(this.viewModel.searchResult.query!.userDisabledExcludesAndIgnoreFiles, this.viewModel.searchResult.query?.onlyOpenEditors, event?.clearingAll); return this.refreshTree(event); } @@ -561,22 +557,22 @@ export class SearchView extends ViewPane { } } - private createResultIterator(collapseResults: ISearchConfigurationProperties['collapseResults']): Iterable> { + private createResultIterator(collapseResults: ISearchConfigurationProperties['collapseResults']): Iterable> { const folderMatches = this.searchResult.folderMatches() .filter(fm => !fm.isEmpty()) .sort(searchMatchComparer); if (folderMatches.length === 1) { - return this.createFolderIterator(folderMatches[0], collapseResults); + return this.createFolderIterator(folderMatches[0], collapseResults, true); } return Iterable.map(folderMatches, folderMatch => { - const children = this.createFolderIterator(folderMatch, collapseResults); - return >{ element: folderMatch, children }; + const children = this.createFolderIterator(folderMatch, collapseResults, true); + return >{ element: folderMatch, children, incompressible: true }; // roots should always be incompressible }); } - private createFolderIterator(folderMatch: FolderMatch, collapseResults: ISearchConfigurationProperties['collapseResults']): Iterable> { + private createFolderIterator(folderMatch: FolderMatch, collapseResults: ISearchConfigurationProperties['collapseResults'], childFolderIncompressible: boolean): Iterable> { const sortOrder = this.searchConfig.sortOrder; const matchArray = this.isTreeLayoutViewVisible ? folderMatch.matches() : folderMatch.downstreamFileMatches(); @@ -587,7 +583,7 @@ export class SearchView extends ViewPane { if (match instanceof FileMatch) { children = this.createFileIterator(match); } else { - children = this.createFolderIterator(match, collapseResults); + children = this.createFolderIterator(match, collapseResults, false); } let nodeExists = true; try { this.tree.getNode(match); } catch (e) { nodeExists = false; } @@ -595,18 +591,18 @@ export class SearchView extends ViewPane { const collapsed = nodeExists ? undefined : (collapseResults === 'alwaysCollapse' || (match.count() > 10 && collapseResults !== 'alwaysExpand')); - return >{ element: match, children, collapsed }; + return >{ element: match, children, collapsed, incompressible: (match instanceof FileMatch) ? true : childFolderIncompressible }; }); } - private createFileIterator(fileMatch: FileMatch): Iterable> { + private createFileIterator(fileMatch: FileMatch): Iterable> { const matches = fileMatch.matches().sort(searchMatchComparer); - return Iterable.map(matches, r => (>{ element: r })); + return Iterable.map(matches, r => (>{ element: r, incompressible: true })); } - private createIterator(match: FolderMatch | FileMatch | SearchResult, collapseResults: ISearchConfigurationProperties['collapseResults']): Iterable> { + private createIterator(match: FolderMatch | FileMatch | SearchResult, collapseResults: ISearchConfigurationProperties['collapseResults']): Iterable> { return match instanceof SearchResult ? this.createResultIterator(collapseResults) : - match instanceof FolderMatch ? this.createFolderIterator(match, collapseResults) : + match instanceof FolderMatch ? this.createFolderIterator(match, collapseResults, false) : this.createFileIterator(match); } @@ -744,7 +740,7 @@ export class SearchView extends ViewPane { }; this.treeLabels = this._register(this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility })); - this.tree = this._register(>this.instantiationService.createInstance(WorkbenchObjectTree, + this.tree = this._register(>this.instantiationService.createInstance(WorkbenchCompressibleObjectTree, 'SearchView', this.resultsElement, delegate, @@ -823,19 +819,15 @@ export class SearchView extends ViewPane { } private onContextMenu(e: ITreeContextMenuEvent): void { - if (!this.contextMenu) { - this.contextMenu = this._register(this.menuService.createMenu(MenuId.SearchContext, this.contextKeyService)); - } e.browserEvent.preventDefault(); e.browserEvent.stopPropagation(); - const actions: IAction[] = []; - createAndFillInContextMenuActions(this.contextMenu, { shouldForwardArgs: true }, actions); - this.contextMenuService.showContextMenu({ + menuId: MenuId.SearchContext, + menuActionOptions: { shouldForwardArgs: true }, + contextKeyService: this.contextKeyService, getAnchor: () => e.anchor, - getActions: () => actions, getActionsContext: () => e.element, }); } @@ -1654,14 +1646,14 @@ export class SearchView extends ViewPane { this.inputPatternIncludes.setOnlySearchInOpenEditors(false); } - private updateSearchResultCount(disregardExcludesAndIgnores?: boolean, onlyOpenEditors?: boolean): void { + private updateSearchResultCount(disregardExcludesAndIgnores?: boolean, onlyOpenEditors?: boolean, clear: boolean = false): void { const fileCount = this.viewModel.searchResult.fileCount(); this.hasSearchResultsKey.set(fileCount > 0); const msgWasHidden = this.messagesElement.style.display === 'none'; const messageEl = this.clearMessage(); - const resultMsg = this.buildResultCountMessage(this.viewModel.searchResult.count(), fileCount); + const resultMsg = clear ? '' : this.buildResultCountMessage(this.viewModel.searchResult.count(), fileCount); this.tree.ariaLabel = resultMsg + nls.localize('forTerm', " - Search: {0}", this.searchResult.query?.contentPattern.pattern ?? ''); dom.append(messageEl, resultMsg); diff --git a/src/vs/workbench/contrib/search/common/searchModel.ts b/src/vs/workbench/contrib/search/common/searchModel.ts index 0aafd7dbff6..045bf940b95 100644 --- a/src/vs/workbench/contrib/search/common/searchModel.ts +++ b/src/vs/workbench/contrib/search/common/searchModel.ts @@ -476,6 +476,7 @@ export interface IChangeEvent { elements: FileMatch[]; added?: boolean; removed?: boolean; + clearingAll?: boolean; } export class FolderMatch extends Disposable { @@ -492,6 +493,10 @@ export class FolderMatch extends Disposable { protected _unDisposedFileMatches: ResourceMap; protected _unDisposedFolderMatches: ResourceMap; private _replacingAll: boolean = false; + + // if this is compressed in a node with other FolderMatches, then this is set to the parent where compression starts + public compressionStartParent: FolderMatch | undefined; + constructor( protected _resource: URI | null, private _id: string, @@ -555,9 +560,10 @@ export class FolderMatch extends Disposable { if (fileMatch) { fileMatch.bindModel(model); } else { - this.folderMatches().forEach(e => { - e.bindModel(model); - }); + const folderMatches = this.folderMatchesIterator(); + for (const elem of folderMatches) { + elem.bindModel(model); + } } } @@ -573,10 +579,10 @@ export class FolderMatch extends Disposable { folderMatch.onDispose(() => disposable.dispose()); } - clear(): void { + clear(clearingAll = false): void { const changed: FileMatch[] = this.downstreamFileMatches(); this.disposeMatches(); - this._onChange.fire({ elements: changed, removed: true, added: false }); + this._onChange.fire({ elements: changed, removed: true, added: false, clearingAll }); } remove(matches: FileMatch | FolderMatchWithResource | (FileMatch | FolderMatchWithResource)[]): void { @@ -599,15 +605,15 @@ export class FolderMatch extends Disposable { } matches(): (FileMatch | FolderMatchWithResource)[] { - return [...this.fileMatches(), ...this.folderMatches()]; + return [...this.fileMatchesIterator(), ...this.folderMatchesIterator()]; } - fileMatches(): FileMatch[] { - return [...this._fileMatches.values()]; + fileMatchesIterator(): IterableIterator { + return this._fileMatches.values(); } - folderMatches(): FolderMatchWithResource[] { - return [...this._folderMatches.values()]; + folderMatchesIterator(): IterableIterator { + return this._folderMatches.values(); } isEmpty(): boolean { @@ -619,8 +625,10 @@ export class FolderMatch extends Disposable { if (directChildFileMatch) { return directChildFileMatch; } - for (let i = 0; i < this.folderMatches().length; i++) { - const match = this.folderMatches()[i].hasFileUriDownstream(uri); + + const folderMatches = this.folderMatchesIterator(); + for (const elem of folderMatches) { + const match = elem.hasFileUriDownstream(uri); if (match) { return match; } @@ -629,8 +637,13 @@ export class FolderMatch extends Disposable { } downstreamFileMatches(): FileMatch[] { - const recursiveChildren = this.folderMatches().map(e => e.downstreamFileMatches()).flat(); - return [...this.fileMatches(), ...recursiveChildren]; + let recursiveChildren: FileMatch[] = []; + const iterator = this.folderMatchesIterator(); + for (const elem of iterator) { + recursiveChildren = recursiveChildren.concat(elem.downstreamFileMatches()); + } + + return [...this.fileMatchesIterator(), ...recursiveChildren]; } private fileCount(): number { @@ -708,7 +721,7 @@ export class FolderMatch extends Disposable { return false; } - private getFolderMatch(resource: URI): FolderMatchWithResource | undefined { + public getFolderMatch(resource: URI): FolderMatchWithResource | undefined { const folderMatch = this._folderMatchesMap.findSubstr(resource); return folderMatch; } @@ -766,7 +779,7 @@ export class FolderMatch extends Disposable { const removed = []; for (const match of fileMatches as FileMatch[]) { - if (this.fileMatches().includes(match)) { + if (this._fileMatches.get(match.resource)) { this._fileMatches.delete(match.resource); if (dispose) { match.dispose(); @@ -873,7 +886,7 @@ export class FolderMatchWorkspaceRoot extends FolderMatchWithResource { const root = this.closestRoot ?? this; let parent: FolderMatch = this; for (let i = 0; i < fileMatchParentParts.length; i++) { - let folderMatch: FolderMatchWithResource | undefined = parent.folderMatches().find(e => e.resource && (this.uriEquals(e.resource, fileMatchParentParts[i]))); + let folderMatch: FolderMatchWithResource | undefined = parent.getFolderMatch(fileMatchParentParts[i]); if (!folderMatch) { folderMatch = parent.createIntermediateFolderMatch(fileMatchParentParts[i], fileMatchParentParts[i].toString(), null, this._query, root); } @@ -916,12 +929,38 @@ export class FolderMatchNoRoot extends FolderMatch { * and their sort order is undefined. */ export function searchMatchComparer(elementA: RenderableMatch, elementB: RenderableMatch, sortOrder: SearchSortOrder = SearchSortOrder.Default): number { + + if (elementA instanceof FileMatch && elementB instanceof FolderMatch) { + return 1; + } + + if (elementB instanceof FileMatch && elementA instanceof FolderMatch) { + return -1; + } + if (elementA instanceof FolderMatch && elementB instanceof FolderMatch) { const elemAIndex = elementA.index(); const elemBIndex = elementB.index(); if (elemAIndex !== null && elemBIndex !== null) { return elemAIndex - elemBIndex; } + + switch (sortOrder) { + case SearchSortOrder.CountDescending: + return elementB.count() - elementA.count(); + case SearchSortOrder.CountAscending: + return elementA.count() - elementB.count(); + case SearchSortOrder.Type: + return compareFileExtensions(elementA.name(), elementB.name()); + case SearchSortOrder.FileNames: + return compareFileNames(elementA.name(), elementB.name()); + // Fall through otherwise + default: + if (!elementA.resource || !elementB.resource) { + return 0; + } + return comparePaths(elementA.resource.fsPath, elementB.resource.fsPath) || compareFileNames(elementA.name(), elementB.name()); + } } if (elementA instanceof FileMatch && elementB instanceof FileMatch) { @@ -935,12 +974,11 @@ export function searchMatchComparer(elementA: RenderableMatch, elementB: Rendera case SearchSortOrder.FileNames: return compareFileNames(elementA.name(), elementB.name()); case SearchSortOrder.Modified: { - if (!(elementA instanceof FolderMatch) || !(elementB instanceof FolderMatch)) { - const fileStatA = elementA.fileStat; - const fileStatB = elementB.fileStat; - if (fileStatA && fileStatB) { - return fileStatB.mtime - fileStatA.mtime; - } + const fileStatA = elementA.fileStat; + const fileStatB = elementB.fileStat; + if (fileStatA && fileStatB) { + return fileStatB.mtime - fileStatA.mtime; + } } // Fall through otherwise @@ -1154,7 +1192,7 @@ export class SearchResult extends Disposable { } clear(): void { - this.folderMatches().forEach((folderMatch) => folderMatch.clear()); + this.folderMatches().forEach((folderMatch) => folderMatch.clear(true)); this.disposeMatches(); this._folderMatches = []; this._otherFilesMatch = null; diff --git a/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts b/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts index 623a2b6f972..c76c3469563 100644 --- a/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts @@ -124,7 +124,7 @@ suite('Search Actions', () => { resource: URI.file('somepath' + ++counter), results: [] }; - return instantiationService.createInstance(FileMatch, null, null, null, null, rawMatch); + return instantiationService.createInstance(FileMatch, null, null, null, null, rawMatch, null); } function aMatch(fileMatch: FileMatch): Match { diff --git a/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts b/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts index 41a1754d7c0..d003bb48d85 100644 --- a/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts @@ -168,7 +168,7 @@ suite('Search - Viewlet', () => { resource: createFileUriFromPathFromRoot(path), results: lineMatches }; - return instantiation.createInstance(FileMatch, null, null, null, parentFolder, rawMatch); + return instantiation.createInstance(FileMatch, null, null, null, parentFolder, rawMatch, parentFolder); } function aFolderMatch(path: string, index: number, parent?: SearchResult): FolderMatch { diff --git a/src/vs/workbench/contrib/search/test/common/searchResult.test.ts b/src/vs/workbench/contrib/search/test/common/searchResult.test.ts index 15ed87adcce..19a836683ee 100644 --- a/src/vs/workbench/contrib/search/test/common/searchResult.test.ts +++ b/src/vs/workbench/contrib/search/test/common/searchResult.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { Match, FileMatch, SearchResult, SearchModel } from 'vs/workbench/contrib/search/common/searchModel'; +import { Match, FileMatch, SearchResult, SearchModel, FolderMatch } from 'vs/workbench/contrib/search/common/searchModel'; import { URI } from 'vs/base/common/uri'; import { IFileMatch, TextSearchMatch, OneLineRange, ITextSearchMatch, QueryType } from 'vs/workbench/services/search/common/search'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -402,36 +402,36 @@ suite('SearchResult', () => { const root3 = testObject.folderMatches()[3]; const root0DownstreamFiles = root0.downstreamFileMatches(); - assert.deepStrictEqual(root0DownstreamFiles, root0.fileMatches().concat(root0.folderMatches()[0].fileMatches())); - assert.deepStrictEqual(root0.folderMatches()[0].downstreamFileMatches(), root0.folderMatches()[0].fileMatches()); - assert.deepStrictEqual(root0.folderMatches()[0].fileMatches()[0].parent(), root0.folderMatches()[0]); - assert.deepStrictEqual(root0.folderMatches()[0].parent(), root0); - assert.deepStrictEqual(root0.folderMatches()[0].closestRoot, root0); + assert.deepStrictEqual(root0DownstreamFiles, [...root0.fileMatchesIterator(), ...getFolderMatchAtIndex(root0, 0).fileMatchesIterator()]); + assert.deepStrictEqual(getFolderMatchAtIndex(root0, 0).downstreamFileMatches(), Array.from(getFolderMatchAtIndex(root0, 0).fileMatchesIterator())); + assert.deepStrictEqual(getFileMatchAtIndex(getFolderMatchAtIndex(root0, 0), 0).parent(), getFolderMatchAtIndex(root0, 0)); + assert.deepStrictEqual(getFolderMatchAtIndex(root0, 0).parent(), root0); + assert.deepStrictEqual(getFolderMatchAtIndex(root0, 0).closestRoot, root0); root0DownstreamFiles.forEach((e) => { assert.deepStrictEqual(e.closestRoot, root0); }); const root1DownstreamFiles = root1.downstreamFileMatches(); - assert.deepStrictEqual(root1.downstreamFileMatches(), root1.fileMatches().concat(root1.folderMatches()[0].fileMatches())); // excludes the matches from nested root - assert.deepStrictEqual(root1.folderMatches()[0].fileMatches()[0].parent(), root1.folderMatches()[0]); + assert.deepStrictEqual(root1.downstreamFileMatches(), [...root1.fileMatchesIterator(), ...getFolderMatchAtIndex(root1, 0).fileMatchesIterator()]); // excludes the matches from nested root + assert.deepStrictEqual(getFileMatchAtIndex(getFolderMatchAtIndex(root1, 0), 0).parent(), getFolderMatchAtIndex(root1, 0)); root1DownstreamFiles.forEach((e) => { assert.deepStrictEqual(e.closestRoot, root1); }); const root2DownstreamFiles = root2.downstreamFileMatches(); - assert.deepStrictEqual(root2DownstreamFiles, root2.fileMatches()); - assert.deepStrictEqual(root2.fileMatches()[0].parent(), root2); - assert.deepStrictEqual(root2.fileMatches()[0].closestRoot, root2); + assert.deepStrictEqual(root2DownstreamFiles, Array.from(root2.fileMatchesIterator())); + assert.deepStrictEqual(getFileMatchAtIndex(root2, 0).parent(), root2); + assert.deepStrictEqual(getFileMatchAtIndex(root2, 0).closestRoot, root2); const root3DownstreamFiles = root3.downstreamFileMatches(); - const root3Level3Folder = root3.folderMatches()[0].folderMatches()[0]; - assert.deepStrictEqual(root3DownstreamFiles, [root3.fileMatches(), ...root3Level3Folder.folderMatches()[0].fileMatches(), ...root3Level3Folder.folderMatches()[1].fileMatches()].flat()); - assert.deepStrictEqual(root3Level3Folder.downstreamFileMatches(), root3.folderMatches()[0].downstreamFileMatches()); + const root3Level3Folder = getFolderMatchAtIndex(getFolderMatchAtIndex(root3, 0), 0); + assert.deepStrictEqual(root3DownstreamFiles, [...root3.fileMatchesIterator(), ...getFolderMatchAtIndex(root3Level3Folder, 0).fileMatchesIterator(), ...getFolderMatchAtIndex(root3Level3Folder, 1).fileMatchesIterator()].flat()); + assert.deepStrictEqual(root3Level3Folder.downstreamFileMatches(), getFolderMatchAtIndex(root3, 0).downstreamFileMatches()); - assert.deepStrictEqual(root3Level3Folder.folderMatches()[1].fileMatches()[0].parent(), root3Level3Folder.folderMatches()[1]); - assert.deepStrictEqual(root3Level3Folder.folderMatches()[1].parent(), root3Level3Folder); - assert.deepStrictEqual(root3Level3Folder.parent(), root3.folderMatches()[0]); + assert.deepStrictEqual(getFileMatchAtIndex(getFolderMatchAtIndex(root3Level3Folder, 1), 0).parent(), getFolderMatchAtIndex(root3Level3Folder, 1)); + assert.deepStrictEqual(getFolderMatchAtIndex(root3Level3Folder, 1).parent(), root3Level3Folder); + assert.deepStrictEqual(root3Level3Folder.parent(), getFolderMatchAtIndex(root3, 0)); root3DownstreamFiles.forEach((e) => { assert.deepStrictEqual(e.closestRoot, root3); @@ -442,21 +442,21 @@ suite('SearchResult', () => { const target = sinon.spy(); const testObject = getPopulatedSearchResultForTreeTesting(); - const folderMatch = testObject.folderMatches()[3].folderMatches()[0].folderMatches()[0].folderMatches()[0]; + const folderMatch = getFolderMatchAtIndex(getFolderMatchAtIndex(getFolderMatchAtIndex(testObject.folderMatches()[3], 0), 0), 0); const expectedArrayResult = folderMatch.downstreamFileMatches(); testObject.onChange(target); testObject.remove(folderMatch); assert.ok(target.calledOnce); - assert.deepStrictEqual([{ elements: expectedArrayResult, removed: true, added: false }], target.args[0]); + assert.deepStrictEqual([{ elements: expectedArrayResult, removed: true, added: false, clearingAll: false }], target.args[0]); }); test('Replacing an intermediate folder should remove all downstream folders and file matches', async function () { const target = sinon.spy(); const testObject = getPopulatedSearchResultForTreeTesting(); - const folderMatch = testObject.folderMatches()[3].folderMatches()[0]; + const folderMatch = getFolderMatchAtIndex(testObject.folderMatches()[3], 0); const expectedArrayResult = folderMatch.downstreamFileMatches(); @@ -471,7 +471,7 @@ suite('SearchResult', () => { resource: URI.file('/' + path), results: lineMatches }; - return instantiationService.createInstance(FileMatch, null, null, null, searchResult, rawMatch); + return instantiationService.createInstance(FileMatch, null, null, null, searchResult, rawMatch, searchResult); } function aSearchResult(): SearchResult { @@ -600,4 +600,12 @@ suite('SearchResult', () => { ]); return testObject; } + + function getFolderMatchAtIndex(parent: FolderMatch, index: number) { + return Array.from(parent.folderMatchesIterator())[index]; + } + + function getFileMatchAtIndex(parent: FolderMatch, index: number) { + return Array.from(parent.fileMatchesIterator())[index]; + } }); diff --git a/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts b/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts index 6e72f838ba0..a8a22c38b18 100644 --- a/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts +++ b/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.ts @@ -100,7 +100,7 @@ class SearchEditorContribution implements IWorkbenchContribution { } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(SearchEditorContribution, 'SearchEditorContribution', LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(SearchEditorContribution, LifecyclePhase.Starting); //#endregion //#region Input Serializer @@ -592,5 +592,5 @@ class SearchEditorWorkingCopyEditorHandler extends Disposable implements IWorkbe } } -workbenchContributionsRegistry.registerWorkbenchContribution(SearchEditorWorkingCopyEditorHandler, 'SearchEditorWorkingCopyEditorHandler', LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(SearchEditorWorkingCopyEditorHandler, LifecyclePhase.Ready); //#endregion diff --git a/src/vs/workbench/contrib/snippets/browser/commands/insertSnippet.ts b/src/vs/workbench/contrib/snippets/browser/commands/insertSnippet.ts index 5b10727b169..d8b905d5f79 100644 --- a/src/vs/workbench/contrib/snippets/browser/commands/insertSnippet.ts +++ b/src/vs/workbench/contrib/snippets/browser/commands/insertSnippet.ts @@ -147,6 +147,7 @@ export class InsertSnippetAction extends SnippetEditorAction { if (snippet.needsClipboard) { clipboardText = await clipboardService.readText(); } + editor.focus(); SnippetController2.get(editor)?.insert(snippet.codeSnippet, { clipboardText }); snippetService.updateUsageTimestamp(snippet); } diff --git a/src/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.ts b/src/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.ts index bdd36872158..e42370ce4fa 100644 --- a/src/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.ts +++ b/src/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.ts @@ -72,6 +72,7 @@ export class SurroundWithSnippetEditorAction extends SnippetEditorAction { clipboardText = await clipboardService.readText(); } + editor.focus(); SnippetController2.get(editor)?.insert(snippet.codeSnippet, { clipboardText }); snippetsService.updateUsageTimestamp(snippet); } diff --git a/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts b/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts index 24d7e406307..cb5aa0de617 100644 --- a/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts +++ b/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts @@ -7,7 +7,7 @@ import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; import * as nls from 'vs/nls'; import { registerAction2 } from 'vs/platform/actions/common/actions'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import * as JSONContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; @@ -25,7 +25,7 @@ import 'vs/workbench/contrib/snippets/browser/tabCompletion'; import { editorConfigurationBaseNode } from 'vs/editor/common/config/editorConfigurationSchema'; // service -registerSingleton(ISnippetsService, SnippetsService, true); +registerSingleton(ISnippetsService, SnippetsService, InstantiationType.Delayed); // actions registerAction2(InsertSnippetAction); @@ -36,7 +36,7 @@ registerAction2(ApplyFileSnippetAction); // workbench contribs Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(SnippetCodeActions, 'SnippetCodeActions', LifecyclePhase.Restored); + .registerWorkbenchContribution(SnippetCodeActions, LifecyclePhase.Restored); // config Registry diff --git a/src/vs/workbench/contrib/snippets/test/browser/snippetsService.test.ts b/src/vs/workbench/contrib/snippets/test/browser/snippetsService.test.ts index a414f31246d..b4581ae1494 100644 --- a/src/vs/workbench/contrib/snippets/test/browser/snippetsService.test.ts +++ b/src/vs/workbench/contrib/snippets/test/browser/snippetsService.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { SnippetCompletion, SnippetCompletionProvider } from 'vs/workbench/contrib/snippets/browser/snippetCompletionProvider'; import { Position } from 'vs/editor/common/core/position'; import { createModelServices, instantiateTextModel } from 'vs/editor/test/common/testTextModel'; -import { ISnippetsService } from "vs/workbench/contrib/snippets/browser/snippets"; +import { ISnippetsService } from 'vs/workbench/contrib/snippets/browser/snippets'; import { Snippet, SnippetSource } from 'vs/workbench/contrib/snippets/browser/snippetsFile'; import { CompletionContext, CompletionItemLabel, CompletionItemRanges, CompletionTriggerKind } from 'vs/editor/common/languages'; import { DisposableStore } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/contrib/splash/browser/splash.contribution.ts b/src/vs/workbench/contrib/splash/browser/splash.contribution.ts index e427bc2e0e2..a6b4093aed9 100644 --- a/src/vs/workbench/contrib/splash/browser/splash.contribution.ts +++ b/src/vs/workbench/contrib/splash/browser/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 { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; @@ -18,10 +18,9 @@ registerSingleton(ISplashStorageService, class SplashStorageService implements I const raw = JSON.stringify(splash); localStorage.setItem('monaco-parts-splash', raw); } -}, true); +}, InstantiationType.Delayed); Registry.as(Extensions.Workbench).registerWorkbenchContribution( PartsSplash, - 'PartsSplash', LifecyclePhase.Starting ); 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 904e65ce6cb..a2a88ad20e5 100644 --- a/src/vs/workbench/contrib/splash/electron-sandbox/splash.contribution.ts +++ b/src/vs/workbench/contrib/splash/electron-sandbox/splash.contribution.ts @@ -8,7 +8,7 @@ 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 { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; @@ -21,10 +21,9 @@ class SplashStorageService implements ISplashStorageService { } } -registerSingleton(ISplashStorageService, SplashStorageService, true); +registerSingleton(ISplashStorageService, SplashStorageService, InstantiationType.Delayed); Registry.as(Extensions.Workbench).registerWorkbenchContribution( PartsSplash, - 'PartsSplash', LifecyclePhase.Starting ); diff --git a/src/vs/workbench/contrib/surveys/browser/ces.contribution.ts b/src/vs/workbench/contrib/surveys/browser/ces.contribution.ts index aa6e5e53f50..3320a020843 100644 --- a/src/vs/workbench/contrib/surveys/browser/ces.contribution.ts +++ b/src/vs/workbench/contrib/surveys/browser/ces.contribution.ts @@ -160,5 +160,5 @@ class CESContribution extends Disposable implements IWorkbenchContribution { if (language === 'en') { const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); - workbenchRegistry.registerWorkbenchContribution(CESContribution, 'CESContribution', LifecyclePhase.Restored); + workbenchRegistry.registerWorkbenchContribution(CESContribution, LifecyclePhase.Restored); } diff --git a/src/vs/workbench/contrib/surveys/browser/languageSurveys.contribution.ts b/src/vs/workbench/contrib/surveys/browser/languageSurveys.contribution.ts index c05d75f92e7..ae6e3b498bc 100644 --- a/src/vs/workbench/contrib/surveys/browser/languageSurveys.contribution.ts +++ b/src/vs/workbench/contrib/surveys/browser/languageSurveys.contribution.ts @@ -160,5 +160,5 @@ class LanguageSurveysContribution implements IWorkbenchContribution { if (language === 'en') { const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); - workbenchRegistry.registerWorkbenchContribution(LanguageSurveysContribution, 'LanguageSurveysContribution', LifecyclePhase.Restored); + workbenchRegistry.registerWorkbenchContribution(LanguageSurveysContribution, LifecyclePhase.Restored); } diff --git a/src/vs/workbench/contrib/surveys/browser/nps.contribution.ts b/src/vs/workbench/contrib/surveys/browser/nps.contribution.ts index df89651c60d..bb1e79f25e4 100644 --- a/src/vs/workbench/contrib/surveys/browser/nps.contribution.ts +++ b/src/vs/workbench/contrib/surveys/browser/nps.contribution.ts @@ -94,5 +94,5 @@ class NPSContribution implements IWorkbenchContribution { if (language === 'en') { const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); - workbenchRegistry.registerWorkbenchContribution(NPSContribution, 'NPSContribution', LifecyclePhase.Restored); + workbenchRegistry.registerWorkbenchContribution(NPSContribution, LifecyclePhase.Restored); } diff --git a/src/vs/workbench/contrib/tags/browser/workspaceTagsService.ts b/src/vs/workbench/contrib/tags/browser/workspaceTagsService.ts index 0fbc6faa520..a955a05b091 100644 --- a/src/vs/workbench/contrib/tags/browser/workspaceTagsService.ts +++ b/src/vs/workbench/contrib/tags/browser/workspaceTagsService.ts @@ -5,7 +5,7 @@ import { WorkbenchState, IWorkspace } from 'vs/platform/workspace/common/workspace'; import { URI } from 'vs/base/common/uri'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkspaceTagsService, Tags } from 'vs/workbench/contrib/tags/common/workspaceTags'; export class NoOpWorkspaceTagsService implements IWorkspaceTagsService { @@ -25,4 +25,4 @@ export class NoOpWorkspaceTagsService implements IWorkspaceTagsService { } } -registerSingleton(IWorkspaceTagsService, NoOpWorkspaceTagsService, true); +registerSingleton(IWorkspaceTagsService, NoOpWorkspaceTagsService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/tags/electron-sandbox/tags.contribution.ts b/src/vs/workbench/contrib/tags/electron-sandbox/tags.contribution.ts index 61ce8213cd8..887b429b74c 100644 --- a/src/vs/workbench/contrib/tags/electron-sandbox/tags.contribution.ts +++ b/src/vs/workbench/contrib/tags/electron-sandbox/tags.contribution.ts @@ -9,4 +9,4 @@ import { WorkspaceTags } from 'vs/workbench/contrib/tags/electron-sandbox/worksp import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; // Register Workspace Tags Contribution -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTags, 'WorkspaceTags', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTags, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts b/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts index 603020d57eb..6859b738e2a 100644 --- a/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts +++ b/src/vs/workbench/contrib/tags/electron-sandbox/workspaceTagsService.ts @@ -10,7 +10,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/ import { ITextFileService, ITextFileContent } from 'vs/workbench/services/textfile/common/textfiles'; import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkspaceTagsService, Tags } from 'vs/workbench/contrib/tags/common/workspaceTags'; import { getHashedRemotesFromConfig } from 'vs/workbench/contrib/tags/electron-sandbox/workspaceTags'; import { splitLines } from 'vs/base/common/strings'; @@ -812,4 +812,4 @@ export class WorkspaceTagsService implements IWorkspaceTagsService { } } -registerSingleton(IWorkspaceTagsService, WorkspaceTagsService, true); +registerSingleton(IWorkspaceTagsService, WorkspaceTagsService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 4c78b403fa1..2b90f232779 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -2953,7 +2953,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer // eat the error, it has already been surfaced to the user and we don't care about it here }); } - const chooseAndRunTask = (tasks: Task[]) => { this._showIgnoredFoldersMessage().then(() => { this._showQuickPick(tasks, @@ -2968,7 +2967,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer return; } if (task === null) { - configure(); + configure.apply(this); return; } runSingleTask(task, { attachProblemMatcher: true }, this); diff --git a/src/vs/workbench/contrib/tasks/browser/task.contribution.ts b/src/vs/workbench/contrib/tasks/browser/task.contribution.ts index 25f1e3c891d..a8b5100b47b 100644 --- a/src/vs/workbench/contrib/tasks/browser/task.contribution.ts +++ b/src/vs/workbench/contrib/tasks/browser/task.contribution.ts @@ -41,7 +41,7 @@ import { TerminalMenuBarGroup } from 'vs/workbench/contrib/terminal/browser/term import { isString } from 'vs/base/common/types'; const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(RunAutomaticTasks, 'RunAutomaticTasks', LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(RunAutomaticTasks, LifecyclePhase.Eventually); registerAction2(ManageAutomaticTaskRunning); MenuRegistry.appendMenuItem(MenuId.CommandPalette, { @@ -161,7 +161,7 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench } } -workbenchRegistry.registerWorkbenchContribution(TaskStatusBarContributions, 'TaskStatusBarContributions', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(TaskStatusBarContributions, LifecyclePhase.Restored); MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, { group: TerminalMenuBarGroup.Run, diff --git a/src/vs/workbench/contrib/tasks/browser/taskService.ts b/src/vs/workbench/contrib/tasks/browser/taskService.ts index 75fac4be22a..2107166b2ce 100644 --- a/src/vs/workbench/contrib/tasks/browser/taskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/taskService.ts @@ -9,7 +9,7 @@ import { ITaskSystem } from 'vs/workbench/contrib/tasks/common/taskSystem'; import { ExecutionEngine } from 'vs/workbench/contrib/tasks/common/tasks'; import { AbstractTaskService, IWorkspaceFolderConfigurationResult } from 'vs/workbench/contrib/tasks/browser/abstractTaskService'; import { ITaskFilter, ITaskService } from 'vs/workbench/contrib/tasks/common/taskService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; export class TaskService extends AbstractTaskService { private static readonly ProcessTaskSystemSupportMessage = nls.localize('taskService.processTaskSystem', 'Process task system is not support in the web.'); @@ -44,4 +44,4 @@ export class TaskService extends AbstractTaskService { } } -registerSingleton(ITaskService, TaskService, true); +registerSingleton(ITaskService, TaskService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.ts b/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.ts index 793e69845e9..c38cc7bcc09 100644 --- a/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.ts +++ b/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.ts @@ -48,17 +48,10 @@ export class TaskTerminalStatus extends Disposable { case TaskEventKind.Active: this.eventActive(event); break; case TaskEventKind.Inactive: this.eventInactive(event); break; case TaskEventKind.ProcessEnded: this.eventEnd(event); break; - case TaskEventKind.End: this._playEndSound(event.exitCode); break; } })); } - private _playEndSound(exitCode?: number): void { - //TODO: determine sound based on exit code - this._audioCueService.playAudioCue(AudioCue.taskEnded); - } - - addTerminal(task: Task, terminal: ITerminalInstance, problemMatcher: AbstractProblemCollector) { const status: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, severity: Severity.Info }; terminal.statusList.add(status); @@ -93,6 +86,7 @@ export class TaskTerminalStatus extends Disposable { terminalData.taskRunEnded = true; terminalData.terminal.statusList.remove(terminalData.status); if ((event.exitCode === 0) && (terminalData.problemMatcher.numberOfMatches === 0)) { + this._audioCueService.playAudioCue(AudioCue.taskCompleted); if (terminalData.task.configurationProperties.isBackground) { for (const status of terminalData.terminal.statusList.statuses) { terminalData.terminal.statusList.remove(status); @@ -101,6 +95,7 @@ export class TaskTerminalStatus extends Disposable { terminalData.terminal.statusList.add(SUCCEEDED_TASK_STATUS); } } else if (event.exitCode || terminalData.problemMatcher.maxMarkerSeverity === MarkerSeverity.Error) { + this._audioCueService.playAudioCue(AudioCue.taskFailed); terminalData.terminal.statusList.add(FAILED_TASK_STATUS); } else if (terminalData.problemMatcher.maxMarkerSeverity === MarkerSeverity.Warning) { terminalData.terminal.statusList.add(WARNING_TASK_STATUS); @@ -116,8 +111,10 @@ export class TaskTerminalStatus extends Disposable { } terminalData.terminal.statusList.remove(terminalData.status); if (terminalData.problemMatcher.numberOfMatches === 0) { + this._audioCueService.playAudioCue(AudioCue.taskCompleted); terminalData.terminal.statusList.add(SUCCEEDED_INACTIVE_TASK_STATUS); } else if (terminalData.problemMatcher.maxMarkerSeverity === MarkerSeverity.Error) { + this._audioCueService.playAudioCue(AudioCue.taskFailed); terminalData.terminal.statusList.add(FAILED_INACTIVE_TASK_STATUS); } else if (terminalData.problemMatcher.maxMarkerSeverity === MarkerSeverity.Warning) { terminalData.terminal.statusList.add(WARNING_INACTIVE_TASK_STATUS); diff --git a/src/vs/workbench/contrib/tasks/electron-sandbox/taskService.ts b/src/vs/workbench/contrib/tasks/electron-sandbox/taskService.ts index 5ae81823bcf..76f88556c89 100644 --- a/src/vs/workbench/contrib/tasks/electron-sandbox/taskService.ts +++ b/src/vs/workbench/contrib/tasks/electron-sandbox/taskService.ts @@ -11,7 +11,7 @@ import { ExecutionEngine } from 'vs/workbench/contrib/tasks/common/tasks'; import * as TaskConfig from '../common/taskConfiguration'; import { AbstractTaskService } from 'vs/workbench/contrib/tasks/browser/abstractTaskService'; import { ITaskFilter, ITaskService } from 'vs/workbench/contrib/tasks/common/taskService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { TerminalTaskSystem } from 'vs/workbench/contrib/tasks/browser/terminalTaskSystem'; import { IConfirmationResult, IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { TerminateResponseCode } from 'vs/base/common/processes'; @@ -227,4 +227,4 @@ export class TaskService extends AbstractTaskService { } } -registerSingleton(ITaskService, TaskService, true); +registerSingleton(ITaskService, TaskService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts b/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts index 21cd8e46f4e..ad17e2c08ac 100644 --- a/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts +++ b/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts @@ -234,4 +234,4 @@ export class TelemetryContribution extends Disposable implements IWorkbenchContr } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TelemetryContribution, 'TelemetryContribution', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TelemetryContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh b/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh index 0ab72f1886d..90612eb545b 100644 --- a/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh +++ b/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh @@ -87,6 +87,7 @@ if [[ -o NOUNSET ]]; then fi __vsc_update_prompt() { __vsc_prior_prompt="$PS1" + __vsc_prior_prompt2="$PS2" __vsc_in_command_execution="" PS1="%{$(__vsc_prompt_start)%}$PS1%{$(__vsc_prompt_end)%}" PS2="%{$(__vsc_continuation_start)%}$PS2%{$(__vsc_continuation_end)%}" @@ -115,6 +116,7 @@ __vsc_precmd() { __vsc_preexec() { PS1="$__vsc_prior_prompt" + PS2="$__vsc_prior_prompt2" if [ -n "$RPROMPT" ]; then RPROMPT="$__vsc_prior_rprompt" fi diff --git a/src/vs/workbench/contrib/terminal/browser/media/terminal.css b/src/vs/workbench/contrib/terminal/browser/media/terminal.css index da532922828..237a81753bf 100644 --- a/src/vs/workbench/contrib/terminal/browser/media/terminal.css +++ b/src/vs/workbench/contrib/terminal/browser/media/terminal.css @@ -248,6 +248,10 @@ border-style: solid; } +.xterm-screen .xterm-decoration-container .xterm-decoration.quick-fix { + z-index: 7; +} + .monaco-workbench .part.sidebar > .title > .title-actions .switch-terminal { display: flex; align-items: center; diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts index 8af479229ed..b8f232c2ee4 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts @@ -23,7 +23,7 @@ import { TERMINAL_VIEW_ID, TerminalCommandId, ITerminalProfileService } from 'vs import { registerColors } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { setupTerminalCommands } from 'vs/workbench/contrib/terminal/browser/terminalCommands'; import { TerminalService } from 'vs/workbench/contrib/terminal/browser/terminalService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ITerminalEditorService, ITerminalGroupService, ITerminalInstanceService, ITerminalService, TerminalDataTransfers, terminalEditorId } from 'vs/workbench/contrib/terminal/browser/terminal'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; @@ -54,11 +54,11 @@ import { TerminalMainContribution } from 'vs/workbench/contrib/terminal/browser/ import { Schemas } from 'vs/base/common/network'; // Register services -registerSingleton(ITerminalService, TerminalService, true); -registerSingleton(ITerminalEditorService, TerminalEditorService, true); -registerSingleton(ITerminalGroupService, TerminalGroupService, true); -registerSingleton(ITerminalInstanceService, TerminalInstanceService, true); -registerSingleton(ITerminalProfileService, TerminalProfileService, true); +registerSingleton(ITerminalService, TerminalService, InstantiationType.Delayed); +registerSingleton(ITerminalEditorService, TerminalEditorService, InstantiationType.Delayed); +registerSingleton(ITerminalGroupService, TerminalGroupService, InstantiationType.Delayed); +registerSingleton(ITerminalInstanceService, TerminalInstanceService, InstantiationType.Delayed); +registerSingleton(ITerminalProfileService, TerminalProfileService, InstantiationType.Delayed); // Register quick accesses const quickAccessRegistry = (Registry.as(QuickAccessExtensions.Quickaccess)); @@ -77,8 +77,8 @@ CommandsRegistry.registerCommand({ id: quickAccessNavigatePreviousInTerminalPick // Register workbench contributions const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(TerminalMainContribution, 'TerminalMainContribution', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(RemoteTerminalBackendContribution, 'RemoteTerminalBackendContribution', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(TerminalMainContribution, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(RemoteTerminalBackendContribution, LifecyclePhase.Restored); // Register configurations registerTerminalPlatformConfiguration(); diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.ts b/src/vs/workbench/contrib/terminal/browser/terminal.ts index 984098cd483..61088d6dbf6 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.ts @@ -2,7 +2,6 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - import { Orientation } from 'vs/base/browser/ui/splitview/splitview'; import { IAction } from 'vs/base/common/actions'; import { Event } from 'vs/base/common/event'; @@ -12,14 +11,14 @@ import { OperatingSystem } from 'vs/base/common/platform'; import { URI } from 'vs/base/common/uri'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IKeyMods } from 'vs/platform/quickinput/common/quickInput'; -import { IMarkProperties, ITerminalCapabilityStore, ITerminalCommand } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { IMarkProperties, ITerminalCapabilityStore, ITerminalCommand, ITerminalOutputMatcher } from 'vs/platform/terminal/common/capabilities/capabilities'; import { IExtensionTerminalProfile, IReconnectionProperties, IShellIntegration, IShellLaunchConfig, ITerminalDimensions, ITerminalLaunchError, ITerminalProfile, ITerminalTabLayoutInfoById, TerminalExitReason, TerminalIcon, TerminalLocation, TerminalShellType, TerminalType, TitleEventSource, WaitOnExitValue } from 'vs/platform/terminal/common/terminal'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { EditorInput } from 'vs/workbench/common/editor/editorInput'; import { IEditableData } from 'vs/workbench/common/views'; import { TerminalFindWidget } from 'vs/workbench/contrib/terminal/browser/terminalFindWidget'; import { ITerminalStatusList } from 'vs/workbench/contrib/terminal/browser/terminalStatusList'; -import { IContextualAction } from 'vs/workbench/contrib/terminal/browser/xterm/contextualActionAddon'; +import { ITerminalQuickFix } from 'vs/workbench/contrib/terminal/browser/xterm/quickFixAddon'; import { INavigationMode, IRegisterContributedProfileArgs, IRemoteTerminalAttachTarget, IStartExtensionTerminalRequest, ITerminalBackend, ITerminalConfigHelper, ITerminalFont, ITerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/common/terminal'; import { EditorGroupColumn } from 'vs/workbench/services/editor/common/editorGroupColumn'; import { IMarker } from 'xterm'; @@ -459,7 +458,7 @@ export interface ITerminalInstance { readonly statusList: ITerminalStatusList; - contextualActions: IContextualAction | undefined; + quickFix: ITerminalQuickFix | undefined; readonly findWidget: Lazy; @@ -912,50 +911,32 @@ export interface ITerminalInstance { openRecentLink(type: 'localFile' | 'url'): Promise; /** - * Registers contextual action listeners + * Registers quick fix providers */ - registerContextualActions(...options: ITerminalContextualActionOptions[]): void; + registerQuickFixProvider(...options: ITerminalQuickFixOptions[]): void; freePortKillProcess(port: string): Promise; } -export interface ITerminalContextualActionOptions { - actionName: string | DynamicActionName; +export interface ITerminalQuickFixOptions { commandLineMatcher: string | RegExp; outputMatcher?: ITerminalOutputMatcher; - getActions: ContextualActionCallback; + getQuickFixes: TerminalQuickFixCallback; exitStatus?: boolean; } -export type ContextualMatchResult = { commandLineMatch: RegExpMatchArray; outputMatch?: RegExpMatchArray | null }; -export type DynamicActionName = (matchResult: ContextualMatchResult) => string; -export type ContextualActionCallback = (matchResult: ContextualMatchResult, command: ITerminalCommand) => ICommandAction[] | undefined; +export type TerminalQuickFixMatchResult = { commandLineMatch: RegExpMatchArray; outputMatch?: RegExpMatchArray | null }; +export type TerminalQuickFixAction = IAction | ITerminalQuickFixCommandAction | ITerminalQuickFixOpenerAction; +export type TerminalQuickFixCallback = (matchResult: TerminalQuickFixMatchResult, command: ITerminalCommand) => TerminalQuickFixAction[] | TerminalQuickFixAction | undefined; -export interface ICommandAction extends IAction { - commandToRunInTerminal?: string; - addNewLine?: boolean; +export interface ITerminalQuickFixCommandAction { + type: 'command'; + command: string; + // TODO: Should this depend on whether alt is held? + addNewLine: boolean; } - -/** - * A matcher that runs on a sub-section of a terminal command's output - */ -export interface ITerminalOutputMatcher { - /** - * A string or regex to match against the unwrapped line. - */ - lineMatcher: string | RegExp; - /** - * Which side of the output to anchor the {@link offset} and {@link length} against. - */ - anchor: 'top' | 'bottom'; - /** - * How far from either the top or the bottom of the butter to start matching against. - */ - offset: number; - /** - * The number of rows to match against, this should be as small as possible for performance - * reasons. - */ - length: number; +export interface ITerminalQuickFixOpenerAction { + type: 'opener'; + uri: URI; } export interface IXtermTerminal { diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts index 6818669dbe7..ba94df376a0 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.web.contribution.ts @@ -6,11 +6,11 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { KeybindingWeight, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { ITerminalProfileResolverService, TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { BrowserTerminalProfileResolverService } from 'vs/workbench/contrib/terminal/browser/terminalProfileResolverService'; import { TerminalContextKeys } from 'vs/workbench/contrib/terminal/common/terminalContextKey'; -registerSingleton(ITerminalProfileResolverService, BrowserTerminalProfileResolverService, true); +registerSingleton(ITerminalProfileResolverService, BrowserTerminalProfileResolverService, InstantiationType.Delayed); // Register standard external terminal keybinding as integrated terminal when in web as the // external terminal is not available diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index 1103c1a71ac..c6c85fe83bf 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -52,7 +52,7 @@ import { ITerminalQuickPickItem } from 'vs/workbench/contrib/terminal/browser/te import { IThemeService } from 'vs/platform/theme/common/themeService'; import { getIconId, getColorClass, getUriClasses } from 'vs/workbench/contrib/terminal/browser/terminalIcon'; import { clearShellFileHistory, getCommandHistory } from 'vs/workbench/contrib/terminal/common/history'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; @@ -159,7 +159,7 @@ export function registerTerminalActions() { }); } async run(accessor: ServicesAccessor) { - accessor.get(ITerminalService).activeInstance?.contextualActions?.showQuickFixMenu(); + accessor.get(ITerminalService).activeInstance?.quickFix?.showMenu(); } }); @@ -2232,7 +2232,7 @@ export function registerTerminalActions() { id: TerminalCommandId.WriteDataToTerminal, title: { value: localize('workbench.action.terminal.writeDataToTerminal', "Write Data to Terminal"), original: 'Write Data to Terminal' }, f1: true, - category: CATEGORIES.Developer.value + category: Categories.Developer.value }); } async run(accessor: ServicesAccessor) { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalBaseContextualActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalBaseContextualActions.ts deleted file mode 100644 index ac913f849d1..00000000000 --- a/src/vs/workbench/contrib/terminal/browser/terminalBaseContextualActions.ts +++ /dev/null @@ -1,139 +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 { IAction } from 'vs/base/common/actions'; -import { isWindows } from 'vs/base/common/platform'; -import { localize } from 'vs/nls'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { ContextualMatchResult, ICommandAction, ITerminalContextualActionOptions, ITerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { ITerminalCommand } from 'vs/workbench/contrib/terminal/common/terminal'; - -export const GitCommandLineRegex = /git/; -export const GitPushCommandLineRegex = /git\s+push/; -export const AnyCommandLineRegex = /.{4,}/; -export const GitSimilarOutputRegex = /most similar command is\s+([^\s]{3,})/; -export const FreePortOutputRegex = /address already in use \d\.\d\.\d\.\d:(\d\d\d\d)|Unable to bind [^ ]*:(\d+)|can't listen on port (\d+)|listen EADDRINUSE [^ ]*:(\d+)/; -export const GitPushOutputRegex = /git push --set-upstream origin ([^\s]+)/; -export const GitCreatePrOutputRegex = /Create a pull request for \'([^\s]+)\' on GitHub by visiting:\s+remote:\s+(https:.+pull.+)/; - -export function gitSimilarCommand(): ITerminalContextualActionOptions { - return { - commandLineMatcher: GitCommandLineRegex, - outputMatcher: { - lineMatcher: GitSimilarOutputRegex, - anchor: 'bottom', - offset: 0, - length: 3 - }, - actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Run git ${matchResult.outputMatch[1]}` : ``, - exitStatus: false, - getActions: (matchResult: ContextualMatchResult, command: ITerminalCommand) => { - const actions: ICommandAction[] = []; - const fixedCommand = matchResult?.outputMatch?.[1]; - if (!fixedCommand) { - return; - } - const label = localize("terminal.gitSimilarCommand", "Run git {0}", fixedCommand); - actions.push({ - class: undefined, tooltip: label, id: 'terminal.gitSimilarCommand', label, enabled: true, - commandToRunInTerminal: `git ${fixedCommand}`, - addNewLine: true, - run: () => { } - }); - return actions; - } - }; -} -export function freePort(terminalInstance?: Partial): ITerminalContextualActionOptions { - return { - actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Free port ${matchResult.outputMatch[1]}` : '', - commandLineMatcher: AnyCommandLineRegex, - // TODO: Support free port on Windows https://github.com/microsoft/vscode/issues/161775 - outputMatcher: isWindows ? undefined : { - lineMatcher: FreePortOutputRegex, - anchor: 'bottom', - offset: 0, - length: 20 - }, - exitStatus: false, - getActions: (matchResult: ContextualMatchResult, command: ITerminalCommand) => { - const port = matchResult?.outputMatch?.[1]; - if (!port) { - return; - } - const actions: ICommandAction[] = []; - const label = localize("terminal.freePort", "Free port {0}", port); - actions.push({ - class: undefined, tooltip: label, id: 'terminal.freePort', label, enabled: true, - run: async () => { - await terminalInstance?.freePortKillProcess?.(port); - }, - commandToRunInTerminal: command.command, - addNewLine: false - }); - return actions; - } - }; -} -export function gitPushSetUpstream(): ITerminalContextualActionOptions { - return { - actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Git push ${matchResult.outputMatch[1]}` : '', - commandLineMatcher: GitPushCommandLineRegex, - outputMatcher: { - lineMatcher: GitPushOutputRegex, - anchor: 'bottom', - offset: 0, - length: 5 - }, - exitStatus: false, - getActions: (matchResult: ContextualMatchResult, command: ITerminalCommand) => { - const branch = matchResult?.outputMatch?.[1]; - if (!branch) { - return; - } - const actions: ICommandAction[] = []; - const label = localize("terminal.gitPush", "Git push {0}", branch); - command.command = `git push --set-upstream origin ${branch}`; - actions.push({ - class: undefined, tooltip: label, id: 'terminal.gitPush', label, enabled: true, - commandToRunInTerminal: command.command, - addNewLine: true, - run: () => { } - }); - return actions; - } - }; -} - -export function gitCreatePr(openerService: IOpenerService): ITerminalContextualActionOptions { - return { - actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Create PR for ${matchResult.outputMatch[1]}` : '', - commandLineMatcher: GitPushCommandLineRegex, - outputMatcher: { - lineMatcher: GitCreatePrOutputRegex, - anchor: 'bottom', - offset: 0, - length: 5 - }, - exitStatus: true, - getActions: (matchResult: ContextualMatchResult, command?: ITerminalCommand) => { - if (!command) { - return; - } - const branch = matchResult?.outputMatch?.[1]; - const link = matchResult?.outputMatch?.[2]; - if (!branch || !link) { - return; - } - const actions: IAction[] = []; - const label = localize("terminal.gitCreatePr", "Create PR"); - actions.push({ - class: undefined, tooltip: label, id: 'terminal.gitCreatePr', label, enabled: true, - run: () => openerService.open(link) - }); - return actions; - } - }; -} diff --git a/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts b/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts index 1e7b0333e87..9835ac1fbca 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts @@ -179,7 +179,9 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe if (pane && !pane.isVisible()) { await this._viewsService.openView(TERMINAL_VIEW_ID, focus); } - await instance.focusWhenReady(true); + // Do not await the focus as setVisible must be called immediately to ensure + // something else didn't steal focus + instance.focusWhenReady(true); // HACK: as a workaround for https://github.com/microsoft/vscode/issues/134692, // this will trigger a forced refresh of the viewport to sync the viewport and scroll bar. // This can likely be removed after https://github.com/xtermjs/xterm.js/issues/291 is diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index c17ac12ef00..f067e4088f9 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -60,9 +60,9 @@ import { AudioCue, IAudioCueService } from 'vs/workbench/contrib/audioCues/brows import { TaskSettingId } from 'vs/workbench/contrib/tasks/common/tasks'; import { IDetectedLinks, TerminalLinkManager } from 'vs/workbench/contrib/terminal/browser/links/terminalLinkManager'; import { TerminalLinkQuickpick } from 'vs/workbench/contrib/terminal/browser/links/terminalLinkQuickpick'; -import { IRequestAddInstanceToGroupEvent, ITerminalContextualActionOptions, ITerminalExternalLinkProvider, ITerminalInstance, TerminalDataTransfers } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { IRequestAddInstanceToGroupEvent, ITerminalQuickFixOptions, ITerminalExternalLinkProvider, ITerminalInstance, TerminalDataTransfers } from 'vs/workbench/contrib/terminal/browser/terminal'; import { TerminalLaunchHelpAction } from 'vs/workbench/contrib/terminal/browser/terminalActions'; -import { gitSimilarCommand, gitCreatePr, gitPushSetUpstream, freePort } from 'vs/workbench/contrib/terminal/browser/terminalBaseContextualActions'; +import { gitSimilarCommand, gitCreatePr, gitPushSetUpstream, freePort, gitTwoDashes } from 'vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions'; import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper'; import { TerminalEditorInput } from 'vs/workbench/contrib/terminal/browser/terminalEditorInput'; import { TerminalFindWidget } from 'vs/workbench/contrib/terminal/browser/terminalFindWidget'; @@ -74,7 +74,7 @@ import { TypeAheadAddon } from 'vs/workbench/contrib/terminal/browser/terminalTy import { getTerminalResourcesFromDragEvent, getTerminalUri } from 'vs/workbench/contrib/terminal/browser/terminalUri'; import { EnvironmentVariableInfoWidget } from 'vs/workbench/contrib/terminal/browser/widgets/environmentVariableInfoWidget'; import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/widgets/widgetManager'; -import { ContextualActionAddon, IContextualAction } from 'vs/workbench/contrib/terminal/browser/xterm/contextualActionAddon'; +import { ITerminalQuickFix, TerminalQuickFixAddon } from 'vs/workbench/contrib/terminal/browser/xterm/quickFixAddon'; import { LineDataEventAddon } from 'vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon'; import { NavigationModeAddon } from 'vs/workbench/contrib/terminal/browser/xterm/navigationModeAddon'; import { XtermTerminal } from 'vs/workbench/contrib/terminal/browser/xterm/xtermTerminal'; @@ -207,7 +207,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { private _target?: TerminalLocation | undefined; private _disableShellIntegrationReporting: boolean | undefined; private _usedShellIntegrationInjection: boolean = false; - private _contextualActionAddon: ContextualActionAddon | undefined; + private _quickFixAddon: TerminalQuickFixAddon | undefined; readonly capabilities = new TerminalCapabilityStoreMultiplexer(); readonly statusList: ITerminalStatusList; @@ -216,7 +216,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { * Enables opening the contextual actions, if any, that are available * and registering of command finished listeners */ - get contextualActions(): IContextualAction | undefined { return this._contextualActionAddon; } + get quickFix(): ITerminalQuickFix | undefined { return this._quickFixAddon; } readonly findWidget: Lazy; @@ -610,9 +610,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { return undefined; } - registerContextualActions(...actionOptions: ITerminalContextualActionOptions[]): void { - for (const actionOption of actionOptions) { - this.contextualActions?.registerCommandFinishedListener(actionOption); + registerQuickFixProvider(...options: ITerminalQuickFixOptions[]): void { + for (const actionOption of options) { + this.quickFix?.registerCommandFinishedListener(actionOption); } } @@ -728,10 +728,10 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { const xterm = this._scopedInstantiationService.createInstance(XtermTerminal, Terminal, this._configHelper, this._cols, this._rows, this.target || TerminalLocation.Panel, this.capabilities, this.disableShellIntegrationReporting); this.xterm = xterm; - this._contextualActionAddon = this._scopedInstantiationService.createInstance(ContextualActionAddon, this.capabilities); - this.xterm?.raw.loadAddon(this._contextualActionAddon); - this.registerContextualActions(gitSimilarCommand(), gitCreatePr(this._openerService), gitPushSetUpstream(), freePort(this)); - this._register(this._contextualActionAddon.onDidRequestRerunCommand((e) => this.sendText(e.command, e.addNewLine || false))); + this._quickFixAddon = this._scopedInstantiationService.createInstance(TerminalQuickFixAddon, this.capabilities); + this.xterm?.raw.loadAddon(this._quickFixAddon); + this.registerQuickFixProvider(gitSimilarCommand(), gitTwoDashes(), gitCreatePr(), gitPushSetUpstream(), freePort(this)); + this._register(this._quickFixAddon.onDidRequestRerunCommand((e) => this.sendText(e.command, e.addNewLine || false))); const lineDataEventAddon = new LineDataEventAddon(); this.xterm.raw.loadAddon(lineDataEventAddon); this.updateAccessibilitySupport(); @@ -1709,6 +1709,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { // Print initialText if specified if (shell.initialText) { + this._shellLaunchConfig.initialText = shell.initialText; await new Promise(r => this._writeInitialText(xterm, r)); } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts index 66b8abe772a..0ee01518589 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { ITerminalInstance, ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Disposable } from 'vs/base/common/lifecycle'; import { IShellLaunchConfig, ITerminalProfile, TerminalLocation } from 'vs/platform/terminal/common/terminal'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -90,4 +90,4 @@ export class TerminalInstanceService extends Disposable implements ITerminalInst } } -registerSingleton(ITerminalInstanceService, TerminalInstanceService, true); +registerSingleton(ITerminalInstanceService, TerminalInstanceService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts index 08da73cc57b..4eb15699743 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts @@ -178,10 +178,10 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce try { if (this._process?.freePortKillProcess) { const result = await this._process?.freePortKillProcess(port); - this._notificationService.notify({ message: `Killed process w ID: ${result.processId} to free port ${result.port}`, severity: Severity.Info }); + this._notificationService.notify({ message: localize('killportsuccess', 'Killed process with PID {0} listening on port {1}', result.processId, result.port), severity: Severity.Info }); } } catch (e) { - this._notificationService.notify({ message: `Could not kill process for port ${port} wth error ${e}`, severity: Severity.Warning }); + this._notificationService.notify({ message: localize('killportfailure', 'Could not kill process listening on port {0}, command exited with error {1}', port, e), severity: Severity.Warning }); } } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts new file mode 100644 index 00000000000..24cd302cf34 --- /dev/null +++ b/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts @@ -0,0 +1,154 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { localize } from 'vs/nls'; +import { TerminalQuickFixMatchResult, ITerminalQuickFixOptions, ITerminalInstance, TerminalQuickFixAction } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { ITerminalCommand } from 'vs/workbench/contrib/terminal/common/terminal'; +import { URI } from 'vs/base/common/uri'; + +export const GitCommandLineRegex = /git/; +export const GitPushCommandLineRegex = /git\s+push/; +export const GitTwoDashesRegex = /error: did you mean `--(.+)` \(with two dashes\)\?/; +export const AnyCommandLineRegex = /.+/; +export const GitSimilarOutputRegex = /(?:(most similar (command|commands) (is|are)))((\n\s*[^\s]+)+)/m; +export const FreePortOutputRegex = /address already in use \d+\.\d+\.\d+\.\d+:(\d{4,5})|Unable to bind [^ ]*:(\d{4,5})|can't listen on port (\d{4,5})|listen EADDRINUSE [^ ]*:(\d{4,5})/; +export const GitPushOutputRegex = /git push --set-upstream origin ([^\s]+)/; +// The previous line starts with "Create a pull request for \'([^\s]+)\' on GitHub by visiting:\s*" +// it's safe to assume it's a github pull request if the URL includes `/pull/` +export const GitCreatePrOutputRegex = /remote:\s*(https:\/\/github\.com\/.+\/.+\/pull\/new\/.+)/; + +export function gitSimilarCommand(): ITerminalQuickFixOptions { + return { + commandLineMatcher: GitCommandLineRegex, + outputMatcher: { + lineMatcher: GitSimilarOutputRegex, + anchor: 'bottom', + offset: 0, + length: 10 + }, + exitStatus: false, + getQuickFixes: (matchResult: TerminalQuickFixMatchResult, command: ITerminalCommand) => { + if (!matchResult?.outputMatch) { + return; + } + // const fixedCommand = matchResult?.outputMatch?.[1]; + // if (!fixedCommand) { + // return; + // } + const actions: TerminalQuickFixAction[] = []; + const results = matchResult.outputMatch[0].split('\n').map(r => r.trim()); + for (let i = 1; i < results.length; i++) { + const fixedCommand = results[i]; + if (fixedCommand) { + actions.push({ + type: 'command', + command: `git ${fixedCommand}`, + addNewLine: true + }); + } + } + return actions; + } + }; +} +export function gitTwoDashes(): ITerminalQuickFixOptions { + return { + commandLineMatcher: GitCommandLineRegex, + outputMatcher: { + lineMatcher: GitTwoDashesRegex, + anchor: 'bottom', + offset: 0, + length: 2 + }, + exitStatus: false, + getQuickFixes: (matchResult: TerminalQuickFixMatchResult, command: ITerminalCommand) => { + const problemArg = matchResult?.outputMatch?.[1]; + if (!problemArg) { + return; + } + return { + type: 'command', + command: command.command.replace(` -${problemArg}`, ` --${problemArg}`), + addNewLine: true + }; + } + }; +} +export function freePort(terminalInstance?: Partial): ITerminalQuickFixOptions { + return { + commandLineMatcher: AnyCommandLineRegex, + outputMatcher: { + lineMatcher: FreePortOutputRegex, + anchor: 'bottom', + offset: 0, + length: 30 + }, + exitStatus: false, + getQuickFixes: (matchResult: TerminalQuickFixMatchResult, command: ITerminalCommand) => { + const port = matchResult?.outputMatch?.[1]; + if (!port) { + return; + } + const label = localize("terminal.freePort", "Free port {0}", port); + return { + class: undefined, + tooltip: label, + id: 'terminal.freePort', + label, + enabled: true, + run: async () => terminalInstance?.freePortKillProcess?.(port) + }; + } + }; +} +export function gitPushSetUpstream(): ITerminalQuickFixOptions { + return { + commandLineMatcher: GitPushCommandLineRegex, + outputMatcher: { + lineMatcher: GitPushOutputRegex, + anchor: 'bottom', + offset: 0, + length: 5 + }, + exitStatus: false, + getQuickFixes: (matchResult: TerminalQuickFixMatchResult, command: ITerminalCommand) => { + const branch = matchResult?.outputMatch?.[1]; + if (!branch) { + return; + } + return { + type: 'command', + command: `git push --set-upstream origin ${branch}`, + addNewLine: true + }; + } + }; +} + +export function gitCreatePr(): ITerminalQuickFixOptions { + return { + commandLineMatcher: GitPushCommandLineRegex, + outputMatcher: { + lineMatcher: GitCreatePrOutputRegex, + anchor: 'bottom', + offset: 0, + length: 5 + }, + exitStatus: true, + getQuickFixes: (matchResult: TerminalQuickFixMatchResult, command?: ITerminalCommand) => { + if (!command) { + return; + } + const link = matchResult?.outputMatch?.[1]; + if (!link) { + return; + } + return { + type: 'opener', + uri: URI.parse(link) + }; + } + }; +} diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/contextualActionAddon.ts b/src/vs/workbench/contrib/terminal/browser/xterm/contextualActionAddon.ts deleted file mode 100644 index abc6b021419..00000000000 --- a/src/vs/workbench/contrib/terminal/browser/xterm/contextualActionAddon.ts +++ /dev/null @@ -1,175 +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 { Emitter, Event } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; -import { ITerminalCapabilityStore, ITerminalCommand, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; -// Importing types is safe in any layer -// eslint-disable-next-line local/code-import-patterns -import type { ITerminalAddon } from 'xterm-headless'; -import * as dom from 'vs/base/browser/dom'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { ICommandAction, ITerminalContextualActionOptions } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { DecorationSelector, updateLayout } from 'vs/workbench/contrib/terminal/browser/xterm/decorationStyles'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { Terminal, IDecoration } from 'xterm'; -import { IAction } from 'vs/base/common/actions'; - -export interface IContextualAction { - /** - * Shows the quick fix menu - */ - showQuickFixMenu(): void; - - /** - * Registers a listener on onCommandFinished scoped to a particular command or regular - * expression and provides a callback to be executed for commands that match. - */ - registerCommandFinishedListener(options: ITerminalContextualActionOptions): void; -} - -export interface IContextualActionAdddon extends IContextualAction { - onDidRequestRerunCommand: Event<{ command: string; addNewLine?: boolean }>; -} - -export class ContextualActionAddon extends Disposable implements ITerminalAddon, IContextualActionAdddon { - private readonly _onDidRequestRerunCommand = new Emitter<{ command: string; addNewLine?: boolean }>(); - readonly onDidRequestRerunCommand = this._onDidRequestRerunCommand.event; - - private _terminal: Terminal | undefined; - - private _currentQuickFixElement: HTMLElement | undefined; - - private _decorationMarkerIds = new Set(); - - private _commandListeners: Map = new Map(); - - private _matchActions: ICommandAction[] | undefined; - - private _decoration: IDecoration | undefined; - - constructor(private readonly _capabilities: ITerminalCapabilityStore, - @IContextMenuService private readonly _contextMenuService: IContextMenuService, - @IConfigurationService private readonly _configurationService: IConfigurationService) { - super(); - const commandDetectionCapability = this._capabilities.get(TerminalCapability.CommandDetection); - if (commandDetectionCapability) { - this._registerCommandFinishedHandler(); - } else { - this._capabilities.onDidAddCapability(c => { - if (c === TerminalCapability.CommandDetection) { - this._registerCommandFinishedHandler(); - } - }); - } - } - activate(terminal: Terminal): void { - this._terminal = terminal; - } - - showQuickFixMenu(): void { - this._currentQuickFixElement?.click(); - } - - registerCommandFinishedListener(options: ITerminalContextualActionOptions): void { - const matcherKey = options.commandLineMatcher.toString(); - const currentOptions = this._commandListeners.get(matcherKey) || []; - currentOptions.push(options); - this._commandListeners.set(matcherKey, currentOptions); - } - - private _registerCommandFinishedHandler(): void { - const terminal = this._terminal; - const commandDetection = this._capabilities.get(TerminalCapability.CommandDetection); - if (!terminal || !commandDetection) { - return; - } - this._register(commandDetection.onCommandExecuted(() => { - this._decoration?.dispose(); - this._decoration = undefined; - })); - this._register(commandDetection.onCommandFinished(async command => { - this._decoration?.dispose(); - this._decoration = undefined; - this._matchActions = getMatchActions(command, this._commandListeners, this._onDidRequestRerunCommand); - })); - // The buffer is not ready by the time command finish - // is called. Add the decoration on command start using the actions, if any, - // from the last command - this._register(commandDetection.onCommandStarted(() => { - if (this._matchActions) { - this._registerContextualDecoration(); - this._matchActions = undefined; - } - })); - } - - private _registerContextualDecoration(): void { - if (!this._terminal) { - return; - } - const marker = this._terminal.registerMarker(); - if (!marker) { - return; - } - const actions = this._matchActions; - const decoration = this._terminal.registerDecoration({ marker, layer: 'top' }); - this._decoration = decoration; - decoration?.onRender((e: HTMLElement) => { - if (!this._decorationMarkerIds.has(decoration.marker.id)) { - this._currentQuickFixElement = e; - e.classList.add(DecorationSelector.QuickFix, DecorationSelector.Codicon, DecorationSelector.CommandDecoration, DecorationSelector.XtermDecoration); - e.style.color = '#ffcc00'; - updateLayout(this._configurationService, e); - if (actions) { - this._decorationMarkerIds.add(decoration.marker.id); - dom.addDisposableListener(e, dom.EventType.CLICK, () => { - this._contextMenuService.showContextMenu({ getAnchor: () => e, getActions: () => actions }); - this._contextMenuService.onDidHideContextMenu(() => decoration.dispose()); - }); - } - } - }); - } -} - -export function getMatchActions(command: ITerminalCommand, actionOptions: Map, onDidRequestRerunCommand?: Emitter<{ command: string; addNewLine?: boolean }>): IAction[] | undefined { - const matchActions: IAction[] = []; - const newCommand = command.command; - for (const options of actionOptions.values()) { - for (const actionOption of options) { - if (actionOption.exitStatus !== undefined && actionOption.exitStatus !== (command.exitCode === 0)) { - continue; - } - const commandLineMatch = newCommand.match(actionOption.commandLineMatcher); - if (!commandLineMatch) { - continue; - } - const outputMatcher = actionOption.outputMatcher; - let outputMatch; - if (outputMatcher) { - outputMatch = command.getOutputMatch(outputMatcher); - } - const actions = actionOption.getActions({ commandLineMatch, outputMatch }, command); - if (actions) { - for (const a of actions) { - matchActions.push({ - id: a.id, - label: a.label, - class: a.class, - enabled: a.enabled, - run: async () => { - await a.run(); - if (a.commandToRunInTerminal) { - onDidRequestRerunCommand?.fire({ command: a.commandToRunInTerminal, addNewLine: a.addNewLine }); - } - }, - tooltip: a.tooltip - }); - } - } - } - } - return matchActions.length === 0 ? undefined : matchActions; -} diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts b/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts index e520738108a..3cf8a961eab 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts @@ -3,44 +3,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; -import { ITerminalCommand } from 'vs/workbench/contrib/terminal/common/terminal'; -import { IDecoration, ITerminalAddon, Terminal } from 'xterm'; import * as dom from 'vs/base/browser/dom'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { CommandInvalidationReason, ICommandDetectionCapability, IMarkProperties, ITerminalCapabilityStore, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { IColorTheme, ICssStyleCollector, IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IHoverService } from 'vs/workbench/services/hover/browser/hover'; import { IAction, Separator } from 'vs/base/common/actions'; -import { Emitter } from 'vs/base/common/event'; -import { MarkdownString } from 'vs/base/common/htmlContent'; -import { localize } from 'vs/nls'; -import { Delayer } from 'vs/base/common/async'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { fromNow } from 'vs/base/common/date'; -import { toolbarHoverBackground } from 'vs/platform/theme/common/colorRegistry'; -import { TerminalSettingId } from 'vs/platform/terminal/common/terminal'; -import { TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR, TERMINAL_COMMAND_DECORATION_ERROR_BACKGROUND_COLOR, TERMINAL_COMMAND_DECORATION_SUCCESS_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { Color } from 'vs/base/common/color'; +import { Emitter } from 'vs/base/common/event'; +import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { localize } from 'vs/nls'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; -import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { terminalDecorationError, terminalDecorationIncomplete, terminalDecorationMark, terminalDecorationSuccess } from 'vs/workbench/contrib/terminal/browser/terminalIcons'; +import { CommandInvalidationReason, ICommandDetectionCapability, IMarkProperties, ITerminalCapabilityStore, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { TerminalSettingId } from 'vs/platform/terminal/common/terminal'; +import { toolbarHoverBackground } from 'vs/platform/theme/common/colorRegistry'; +import { IColorTheme, ICssStyleCollector, IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService'; import { TaskSettingId } from 'vs/workbench/contrib/tasks/common/tasks'; -import { DecorationSelector, updateLayout } from 'vs/workbench/contrib/terminal/browser/xterm/decorationStyles'; +import { terminalDecorationError, terminalDecorationIncomplete, terminalDecorationMark, terminalDecorationSuccess } from 'vs/workbench/contrib/terminal/browser/terminalIcons'; +import { DecorationSelector, TerminalDecorationHoverManager, updateLayout } from 'vs/workbench/contrib/terminal/browser/xterm/decorationStyles'; +import { ITerminalCommand } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR, TERMINAL_COMMAND_DECORATION_ERROR_BACKGROUND_COLOR, TERMINAL_COMMAND_DECORATION_SUCCESS_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; +import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; +import { IDecoration, ITerminalAddon, Terminal } from 'xterm'; interface IDisposableDecoration { decoration: IDecoration; disposables: IDisposable[]; exitCode?: number; markProperties?: IMarkProperties } export class DecorationAddon extends Disposable implements ITerminalAddon { protected _terminal: Terminal | undefined; - private _hoverDelayer: Delayer; private _capabilityDisposables: Map = new Map(); - private _contextMenuVisible: boolean = false; private _decorations: Map = new Map(); private _placeholderDecoration: IDecoration | undefined; private _showGutterDecorations?: boolean; private _showOverviewRulerDecorations?: boolean; + private _terminalDecorationHoverService: TerminalDecorationHoverManager; private readonly _onDidRequestRunCommand = this._register(new Emitter<{ command: ITerminalCommand; copyAsHtml?: boolean }>()); readonly onDidRequestRunCommand = this._onDidRequestRunCommand.event; @@ -49,19 +45,15 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { private readonly _capabilities: ITerminalCapabilityStore, @IClipboardService private readonly _clipboardService: IClipboardService, @IContextMenuService private readonly _contextMenuService: IContextMenuService, - @IHoverService private readonly _hoverService: IHoverService, @IConfigurationService private readonly _configurationService: IConfigurationService, @IThemeService private readonly _themeService: IThemeService, @IOpenerService private readonly _openerService: IOpenerService, @IQuickInputService private readonly _quickInputService: IQuickInputService, - @ILifecycleService lifecycleService: ILifecycleService + @ILifecycleService lifecycleService: ILifecycleService, + @IInstantiationService instantiationService: IInstantiationService ) { super(); this._register(toDisposable(() => this._dispose())); - this._register(this._contextMenuService.onDidShowContextMenu(() => this._contextMenuVisible = true)); - this._register(this._contextMenuService.onDidHideContextMenu(() => this._contextMenuVisible = false)); - this._hoverDelayer = this._register(new Delayer(this._configurationService.getValue('workbench.hover.delay'))); - this._register(this._configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(TerminalSettingId.FontSize) || e.affectsConfiguration(TerminalSettingId.LineHeight)) { this.refreshLayouts(); @@ -79,6 +71,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { this._register(this._capabilities.onDidAddCapability(c => this._createCapabilityDisposables(c))); this._register(this._capabilities.onDidRemoveCapability(c => this._removeCapabilityDisposables(c))); this._register(lifecycleService.onWillShutdown(() => this._disposeAllDecorations())); + this._terminalDecorationHoverService = instantiationService.createInstance(TerminalDecorationHoverManager); } private _removeCapabilityDisposables(c: TerminalCapability): void { @@ -184,6 +177,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { } private _dispose(): void { + this._terminalDecorationHoverService.dispose(); for (const disposable of this._capabilityDisposables.values()) { dispose(disposable); } @@ -309,9 +303,9 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { if (command?.exitCode === undefined && !command?.markProperties) { return []; } else if (command?.markProperties || markProperties) { - return [...this._createHover(element, command || markProperties?.hoverMessage)]; + return [this._terminalDecorationHoverService.createHover(element, command || markProperties, markProperties?.hoverMessage)]; } - return [this._createContextMenu(element, command), ...this._createHover(element, command)]; + return [this._createContextMenu(element, command), this._terminalDecorationHoverService.createHover(element, command)]; } private _updateClasses(element?: HTMLElement, exitCode?: number, markProperties?: IMarkProperties): void { @@ -348,49 +342,12 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { // When the xterm Decoration gets disposed of, its element gets removed from the dom // along with its listeners return dom.addDisposableListener(element, dom.EventType.CLICK, async () => { - this._hideHover(); + this._terminalDecorationHoverService.hideHover(); const actions = await this._getCommandActions(command); this._contextMenuService.showContextMenu({ getAnchor: () => element, getActions: () => actions }); }); } - private _createHover(element: HTMLElement, command: ITerminalCommand, markProperties?: IMarkProperties): IDisposable[] { - return [ - dom.addDisposableListener(element, dom.EventType.MOUSE_ENTER, () => { - if (this._contextMenuVisible) { - return; - } - this._hoverDelayer.trigger(() => { - let hoverContent = `${localize('terminalPromptContextMenu', "Show Command Actions")}`; - hoverContent += '\n\n---\n\n'; - if (command.markProperties || markProperties) { - if (command.markProperties?.hoverMessage || markProperties?.hoverMessage) { - hoverContent = command.markProperties?.hoverMessage || markProperties?.hoverMessage || ''; - } else { - return; - } - } else if (command.exitCode) { - if (command.exitCode === -1) { - hoverContent += localize('terminalPromptCommandFailed', 'Command executed {0} and failed', fromNow(command.timestamp, true)); - } else { - hoverContent += localize('terminalPromptCommandFailedWithExitCode', 'Command executed {0} and failed (Exit Code {1})', fromNow(command.timestamp, true), command.exitCode); - } - } else { - hoverContent += localize('terminalPromptCommandSuccess', 'Command executed {0}', fromNow(command.timestamp, true)); - } - this._hoverService.showHover({ content: new MarkdownString(hoverContent), target: element }); - }); - }), - dom.addDisposableListener(element, dom.EventType.MOUSE_LEAVE, () => this._hideHover()), - dom.addDisposableListener(element, dom.EventType.MOUSE_OUT, () => this._hideHover()) - ]; - } - - private _hideHover() { - this._hoverDelayer.cancel(); - this._hoverService.hideHover(); - } - private async _getCommandActions(command: ITerminalCommand): Promise { const actions: IAction[] = []; if (command.command !== '') { @@ -496,6 +453,7 @@ export class DecorationAddon extends Disposable implements ITerminalAddon { } await this._configurationService.updateValue(TerminalSettingId.ShellIntegrationDecorationsEnabled, newValue); }); + quickPick.ok = false; quickPick.show(); } } diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.ts b/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.ts index 5f3a59ec230..87b4d53b5db 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.ts @@ -3,8 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as dom from 'vs/base/browser/dom'; +import { Delayer } from 'vs/base/common/async'; +import { fromNow } from 'vs/base/common/date'; +import { MarkdownString } from 'vs/base/common/htmlContent'; +import { combinedDisposable, Disposable, IDisposable } from 'vs/base/common/lifecycle'; +import { localize } from 'vs/nls'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { TerminalSettingId } from 'vs/platform/terminal/common/terminal'; +import { ITerminalCommand } from 'vs/workbench/contrib/terminal/common/terminal'; +import { IHoverService } from 'vs/workbench/services/hover/browser/hover'; const enum DecorationStyles { DefaultDimension = 16, @@ -20,7 +29,66 @@ export const enum DecorationSelector { Codicon = 'codicon', XtermDecoration = 'xterm-decoration', OverviewRuler = '.xterm-decoration-overview-ruler', - QuickFix = 'codicon-light-bulb' + QuickFix = 'quick-fix', + LightBulb = 'codicon-light-bulb' +} + +export class TerminalDecorationHoverManager extends Disposable { + private _hoverDelayer: Delayer; + private _contextMenuVisible: boolean = false; + + constructor(@IHoverService private readonly _hoverService: IHoverService, + @IConfigurationService configurationService: IConfigurationService, + @IContextMenuService contextMenuService: IContextMenuService) { + super(); + this._register(contextMenuService.onDidShowContextMenu(() => this._contextMenuVisible = true)); + this._register(contextMenuService.onDidHideContextMenu(() => this._contextMenuVisible = false)); + this._hoverDelayer = this._register(new Delayer(configurationService.getValue('workbench.hover.delay'))); + } + + public hideHover() { + this._hoverDelayer.cancel(); + this._hoverService.hideHover(); + } + + createHover(element: HTMLElement, command: ITerminalCommand | undefined, hoverMessage?: string): IDisposable { + return combinedDisposable( + dom.addDisposableListener(element, dom.EventType.MOUSE_ENTER, () => { + if (this._contextMenuVisible) { + return; + } + this._hoverDelayer.trigger(() => { + let hoverContent = `${localize('terminalPromptContextMenu', "Show Command Actions")}`; + hoverContent += '\n\n---\n\n'; + if (!command) { + if (hoverMessage) { + hoverContent = hoverMessage; + } else { + return; + } + } else if (command.markProperties || hoverMessage) { + if (command.markProperties?.hoverMessage || hoverMessage) { + hoverContent = command.markProperties?.hoverMessage || hoverMessage || ''; + } else { + return; + } + } else if (command.exitCode) { + if (command.exitCode === -1) { + hoverContent += localize('terminalPromptCommandFailed', 'Command executed {0} and failed', fromNow(command.timestamp, true)); + } else { + hoverContent += localize('terminalPromptCommandFailedWithExitCode', 'Command executed {0} and failed (Exit Code {1})', fromNow(command.timestamp, true), command.exitCode); + } + } else { + hoverContent += localize('terminalPromptCommandSuccess', 'Command executed {0}', fromNow(command.timestamp, true)); + } + this._hoverService.showHover({ content: new MarkdownString(hoverContent), target: element }); + }); + }), + dom.addDisposableListener(element, dom.EventType.MOUSE_LEAVE, () => this.hideHover()), + dom.addDisposableListener(element, dom.EventType.MOUSE_OUT, () => this.hideHover()) + ); + } + } export function updateLayout(configurationService: IConfigurationService, element?: HTMLElement): void { @@ -39,4 +107,3 @@ export function updateLayout(configurationService: IConfigurationService, elemen element.style.marginLeft = `${scalar * DecorationStyles.MarginLeft}px`; } } - diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts b/src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts new file mode 100644 index 00000000000..a81d5608c54 --- /dev/null +++ b/src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { Emitter, Event } from 'vs/base/common/event'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { ITerminalCapabilityStore, ITerminalCommand, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; +import * as dom from 'vs/base/browser/dom'; +import { IAction } from 'vs/base/common/actions'; +import { asArray } from 'vs/base/common/arrays'; +import { Color } from 'vs/base/common/color'; +import { localize } from 'vs/nls'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { PANEL_BACKGROUND } from 'vs/workbench/common/theme'; +import { AudioCue, IAudioCueService } from 'vs/workbench/contrib/audioCues/browser/audioCueService'; +import { ITerminalQuickFixOptions } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { DecorationSelector, TerminalDecorationHoverManager, updateLayout } from 'vs/workbench/contrib/terminal/browser/xterm/decorationStyles'; +import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TERMINAL_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IDecoration, Terminal } from 'xterm'; +// Importing types is safe in any layer +// eslint-disable-next-line local/code-import-patterns +import type { ITerminalAddon } from 'xterm-headless'; + +export interface ITerminalQuickFix { + showMenu(): void; + /** + * Registers a listener on onCommandFinished scoped to a particular command or regular + * expression and provides a callback to be executed for commands that match. + */ + registerCommandFinishedListener(options: ITerminalQuickFixOptions): void; +} + +export interface ITerminalQuickFixAddon extends ITerminalQuickFix { + onDidRequestRerunCommand: Event<{ command: string; addNewLine?: boolean }>; +} + +export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon, ITerminalQuickFixAddon { + private readonly _onDidRequestRerunCommand = new Emitter<{ command: string; addNewLine?: boolean }>(); + readonly onDidRequestRerunCommand = this._onDidRequestRerunCommand.event; + + private _terminal: Terminal | undefined; + + private _currentQuickFixElement: HTMLElement | undefined; + + private _decorationMarkerIds = new Set(); + + private _commandListeners: Map = new Map(); + + private _quickFixes: IAction[] | undefined; + + private _decoration: IDecoration | undefined; + + private readonly _terminalDecorationHoverService: TerminalDecorationHoverManager; + + constructor(private readonly _capabilities: ITerminalCapabilityStore, + @IContextMenuService private readonly _contextMenuService: IContextMenuService, + @IConfigurationService private readonly _configurationService: IConfigurationService, + @IInstantiationService instantiationService: IInstantiationService, + @IAudioCueService private readonly _audioCueService: IAudioCueService, + @IKeybindingService private readonly _keybindingService: IKeybindingService, + @IOpenerService private readonly _openerService: IOpenerService + ) { + super(); + const commandDetectionCapability = this._capabilities.get(TerminalCapability.CommandDetection); + if (commandDetectionCapability) { + this._registerCommandFinishedHandler(); + } else { + this._capabilities.onDidAddCapability(c => { + if (c === TerminalCapability.CommandDetection) { + this._registerCommandFinishedHandler(); + } + }); + } + this._terminalDecorationHoverService = instantiationService.createInstance(TerminalDecorationHoverManager); + } + activate(terminal: Terminal): void { + this._terminal = terminal; + } + + showMenu(): void { + this._currentQuickFixElement?.click(); + } + + registerCommandFinishedListener(options: ITerminalQuickFixOptions): void { + const matcherKey = options.commandLineMatcher.toString(); + const currentOptions = this._commandListeners.get(matcherKey) || []; + currentOptions.push(options); + this._commandListeners.set(matcherKey, currentOptions); + } + + private _registerCommandFinishedHandler(): void { + const terminal = this._terminal; + const commandDetection = this._capabilities.get(TerminalCapability.CommandDetection); + if (!terminal || !commandDetection) { + return; + } + this._register(commandDetection.onCommandExecuted(() => { + this._decoration?.dispose(); + this._decoration = undefined; + })); + this._register(commandDetection.onCommandFinished(async command => { + this._decoration?.dispose(); + this._decoration = undefined; + this._quickFixes = getQuickFixes(command, this._commandListeners, this._openerService, this._onDidRequestRerunCommand); + })); + // The buffer is not ready by the time command finish + // is called. Add the decoration on command start using the actions, if any, + // from the last command + this._register(commandDetection.onCommandStarted(() => { + if (this._quickFixes) { + this._registerContextualDecoration(); + this._quickFixes = undefined; + } + })); + } + + private _registerContextualDecoration(): void { + if (!this._terminal) { + return; + } + const marker = this._terminal.registerMarker(); + if (!marker) { + return; + } + const actions = this._quickFixes; + const decoration = this._terminal.registerDecoration({ marker, layer: 'top' }); + this._decoration = decoration; + const kb = this._keybindingService.lookupKeybinding(TerminalCommandId.QuickFix); + const hoverLabel = kb ? localize('terminalQuickFixWithKb', "Show Quick Fixes ({0})", kb.getLabel()) : ''; + decoration?.onRender((e: HTMLElement) => { + if (!this._decorationMarkerIds.has(decoration.marker.id)) { + this._currentQuickFixElement = e; + e.classList.add(DecorationSelector.QuickFix, DecorationSelector.LightBulb, DecorationSelector.Codicon, DecorationSelector.CommandDecoration, DecorationSelector.XtermDecoration); + updateLayout(this._configurationService, e); + this._audioCueService.playAudioCue(AudioCue.terminalQuickFix); + if (actions) { + this._decorationMarkerIds.add(decoration.marker.id); + this._register(dom.addDisposableListener(e, dom.EventType.CLICK, () => { + this._contextMenuService.showContextMenu({ getAnchor: () => e, getActions: () => actions, autoSelectFirstItem: true }); + })); + this._register(this._terminalDecorationHoverService.createHover(e, undefined, hoverLabel)); + } + } + }); + } +} + +export function getQuickFixes( + command: ITerminalCommand, + actionOptions: Map, + openerService: IOpenerService, + onDidRequestRerunCommand?: Emitter<{ command: string; addNewLine?: boolean }> +): IAction[] | undefined { + const actions: IAction[] = []; + const newCommand = command.command; + for (const options of actionOptions.values()) { + for (const actionOption of options) { + if (actionOption.exitStatus !== undefined && actionOption.exitStatus !== (command.exitCode === 0)) { + continue; + } + const commandLineMatch = newCommand.match(actionOption.commandLineMatcher); + if (!commandLineMatch) { + continue; + } + const outputMatcher = actionOption.outputMatcher; + let outputMatch; + if (outputMatcher) { + outputMatch = command.getOutputMatch(outputMatcher); + } + const quickFixes = actionOption.getQuickFixes({ commandLineMatch, outputMatch }, command); + if (quickFixes) { + for (const quickFix of asArray(quickFixes)) { + let action: IAction | undefined; + if ('type' in quickFix) { + switch (quickFix.type) { + case 'command': { + const label = localize('quickFix.command', 'Run: {0}', quickFix.command); + action = { + id: `quickFix.command`, + label, + class: undefined, + enabled: true, + run: () => { + onDidRequestRerunCommand?.fire({ + command: quickFix.command, + addNewLine: quickFix.addNewLine + }); + }, + tooltip: label, + command: quickFix.command + } as IAction; + break; + } + case 'opener': { + const label = localize('quickFix.opener', 'Open: {0}', quickFix.uri.toString()); + action = { + id: `quickFix.opener`, + label, + class: undefined, + enabled: true, + run: () => openerService.open(quickFix.uri), + tooltip: label, + uri: quickFix.uri + } as IAction; + break; + } + } + } else { + action = { + id: quickFix.id, + label: quickFix.label, + class: quickFix.class, + enabled: quickFix.enabled, + run: () => quickFix.run(), + tooltip: quickFix.tooltip + }; + } + if (action) { + actions.push(action); + } + } + } + } + } + return actions.length === 0 ? undefined : actions; +} + + + +let foregroundColor: string | Color | undefined; +let backgroundColor: string | Color | undefined; +registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => { + foregroundColor = theme.getColor('editorLightBulb.foreground'); + backgroundColor = theme.getColor(TERMINAL_BACKGROUND_COLOR) || theme.getColor(PANEL_BACKGROUND); + if (foregroundColor) { + collector.addRule(`.${DecorationSelector.CommandDecoration}.${DecorationSelector.QuickFix} { color: ${foregroundColor.toString()} !important; } `); + } + if (backgroundColor) { + collector.addRule(`.${DecorationSelector.CommandDecoration}.${DecorationSelector.QuickFix} { background-color: ${backgroundColor.toString()}; } `); + } +}); diff --git a/src/vs/workbench/contrib/terminal/common/environmentVariable.contribution.ts b/src/vs/workbench/contrib/terminal/common/environmentVariable.contribution.ts index 7fd4e951754..3897ed68693 100644 --- a/src/vs/workbench/contrib/terminal/common/environmentVariable.contribution.ts +++ b/src/vs/workbench/contrib/terminal/common/environmentVariable.contribution.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { EnvironmentVariableService } from 'vs/workbench/contrib/terminal/common/environmentVariableService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IEnvironmentVariableService } from 'vs/workbench/contrib/terminal/common/environmentVariable'; -registerSingleton(IEnvironmentVariableService, EnvironmentVariableService, true); +registerSingleton(IEnvironmentVariableService, EnvironmentVariableService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index e886f17e418..7d3d05d5e16 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -13,7 +13,7 @@ import { IEnvironmentVariableInfo } from 'vs/workbench/contrib/terminal/common/e import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { URI } from 'vs/base/common/uri'; import { Registry } from 'vs/platform/registry/common/platform'; -import { IMarkProperties, ISerializedCommandDetectionCapability, ITerminalCapabilityStore, IXtermMarker } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { IMarkProperties, ISerializedCommandDetectionCapability, ITerminalCapabilityStore, ITerminalOutputMatcher, IXtermMarker } from 'vs/platform/terminal/common/capabilities/capabilities'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { IProcessDetails } from 'vs/platform/terminal/common/terminalProcess'; @@ -96,13 +96,6 @@ export interface IShellLaunchConfigResolveOptions { allowAutomationShell?: boolean; } -export interface ITerminalOutputMatcher { - lineMatcher: string | RegExp; - anchor?: 'top' | 'bottom'; - offset?: number; - length?: number; -} - export interface ITerminalBackend { readonly remoteAuthority: string | undefined; @@ -615,6 +608,7 @@ export const DEFAULT_COMMANDS_TO_SKIP_SHELL: string[] = [ TerminalCommandId.New, TerminalCommandId.Paste, TerminalCommandId.PasteSelection, + TerminalCommandId.QuickFix, TerminalCommandId.ResizePaneDown, TerminalCommandId.ResizePaneLeft, TerminalCommandId.ResizePaneRight, diff --git a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts index 80041aeb869..5a17c3c3f69 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts @@ -229,6 +229,10 @@ async function _resolveCwd(cwd: string, variableResolver: VariableResolver | und } function _sanitizeCwd(cwd: string): string { + // Sanity check that the cwd is not wrapped in quotes (see #160109) + if (cwd.match(/$['"].*['"]^/)) { + cwd = cwd.substring(1, cwd.length - 1); + } // Make the drive letter uppercase on Windows (see #9448) if (OS === OperatingSystem.Windows && cwd && cwd[1] === ':') { return cwd[0].toUpperCase() + cwd.substr(1); diff --git a/src/vs/workbench/contrib/terminal/common/terminalExtensionPoints.contribution.ts b/src/vs/workbench/contrib/terminal/common/terminalExtensionPoints.contribution.ts index d3d2e293eb3..a705e6fc45f 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalExtensionPoints.contribution.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalExtensionPoints.contribution.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ITerminalContributionService, TerminalContributionService } from 'vs/workbench/contrib/terminal/common/terminalExtensionPoints'; -registerSingleton(ITerminalContributionService, TerminalContributionService, true); +registerSingleton(ITerminalContributionService, TerminalContributionService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/terminal/electron-sandbox/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/electron-sandbox/terminal.contribution.ts index 2e768f25878..b47d5943150 100644 --- a/src/vs/workbench/contrib/terminal/electron-sandbox/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/electron-sandbox/terminal.contribution.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { registerSharedProcessRemoteService } from 'vs/platform/ipc/electron-sandbox/services'; import { Registry } from 'vs/platform/registry/common/platform'; import { TerminalIpcChannels } from 'vs/platform/terminal/common/terminal'; @@ -17,9 +17,9 @@ import { LocalTerminalBackendContribution } from 'vs/workbench/contrib/terminal/ // Register services registerSharedProcessRemoteService(ILocalPtyService, TerminalIpcChannels.LocalPty); -registerSingleton(ITerminalProfileResolverService, ElectronTerminalProfileResolverService, true); +registerSingleton(ITerminalProfileResolverService, ElectronTerminalProfileResolverService, InstantiationType.Delayed); // Register workbench contributions const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(LocalTerminalBackendContribution, 'LocalTerminalBackendContribution', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(TerminalNativeContribution, 'TerminalNativeContribution', LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(LocalTerminalBackendContribution, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(TerminalNativeContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts b/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts index e52260f1843..6d2c0b18700 100644 --- a/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts +++ b/src/vs/workbench/contrib/terminal/electron-sandbox/terminalRemote.ts @@ -3,59 +3,52 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { TERMINAL_ACTION_CATEGORY, TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; -import { Action } from 'vs/base/common/actions'; -import { ITerminalGroupService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { Schemas } from 'vs/base/common/network'; +import { URI } from 'vs/base/common/uri'; +import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; +import { localize } from 'vs/nls'; +import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; -import { URI } from 'vs/base/common/uri'; +import { ITerminalGroupService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { TerminalCommandId } from 'vs/workbench/contrib/terminal/common/terminal'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; -import { Schemas } from 'vs/base/common/network'; export function registerRemoteContributions() { - const actionRegistry = Registry.as(ActionExtensions.WorkbenchActions); - actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(CreateNewLocalTerminalAction), 'Terminal: Create New Integrated Terminal (Local)', TERMINAL_ACTION_CATEGORY); -} - -export class CreateNewLocalTerminalAction extends Action { - static readonly ID = TerminalCommandId.NewLocal; - static readonly LABEL = nls.localize('workbench.action.terminal.newLocal', "Create New Integrated Terminal (Local)"); - - constructor( - id: string, label: string, - @ITerminalService private readonly _terminalService: ITerminalService, - @ITerminalGroupService private readonly _terminalGroupService: ITerminalGroupService, - @INativeEnvironmentService private readonly _nativeEnvironmentService: INativeEnvironmentService, - @IRemoteAuthorityResolverService private readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService, - @IHistoryService private readonly _historyService: IHistoryService - ) { - super(id, label); - } - - override async run(): Promise { - let cwd: URI | undefined; - try { - const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.vscodeRemote); - if (activeWorkspaceRootUri) { - const canonicalUri = await this._remoteAuthorityResolverService.getCanonicalURI(activeWorkspaceRootUri); - if (canonicalUri.scheme === Schemas.file) { - cwd = canonicalUri; + registerAction2(class extends Action2 { + constructor() { + super({ + id: TerminalCommandId.NewLocal, + title: { value: localize('workbench.action.terminal.newLocal', "Create New Integrated Terminal (Local)"), original: 'Create New Integrated Terminal (Local)' }, + f1: true + }); + } + async run(accessor: ServicesAccessor) { + const historyService = accessor.get(IHistoryService); + const remoteAuthorityResolverService = accessor.get(IRemoteAuthorityResolverService); + const nativeEnvironmentService = accessor.get(INativeEnvironmentService); + const terminalService = accessor.get(ITerminalService); + const terminalGroupService = accessor.get(ITerminalGroupService); + let cwd: URI | undefined; + try { + const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(Schemas.vscodeRemote); + if (activeWorkspaceRootUri) { + const canonicalUri = await remoteAuthorityResolverService.getCanonicalURI(activeWorkspaceRootUri); + if (canonicalUri.scheme === Schemas.file) { + cwd = canonicalUri; + } } + } catch { } + if (!cwd) { + cwd = nativeEnvironmentService.userHome; + } + const instance = await terminalService.createTerminal({ cwd }); + if (!instance) { + return Promise.resolve(undefined); } - } catch { } - if (!cwd) { - cwd = this._nativeEnvironmentService.userHome; - } - const instance = await this._terminalService.createTerminal({ cwd }); - if (!instance) { - return Promise.resolve(undefined); - } - this._terminalService.setActiveInstance(instance); - return this._terminalGroupService.showPanel(true); - } + terminalService.setActiveInstance(instance); + return terminalGroupService.showPanel(true); + } + }); } diff --git a/src/vs/workbench/contrib/terminal/test/browser/contextualActionAddon.test.ts b/src/vs/workbench/contrib/terminal/test/browser/contextualActionAddon.test.ts deleted file mode 100644 index 686b0e053cd..00000000000 --- a/src/vs/workbench/contrib/terminal/test/browser/contextualActionAddon.test.ts +++ /dev/null @@ -1,278 +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 { strictEqual } from 'assert'; -import { OpenerService } from 'vs/editor/browser/services/openerService'; -import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { ILogService, NullLogService } from 'vs/platform/log/common/log'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { ITerminalCommand, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; -import { CommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/commandDetectionCapability'; -import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore'; -import { ICommandAction, ITerminalInstance, ITerminalOutputMatcher } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { freePort, FreePortOutputRegex, gitCreatePr, GitCreatePrOutputRegex, GitPushOutputRegex, gitPushSetUpstream, gitSimilarCommand, GitSimilarOutputRegex } from 'vs/workbench/contrib/terminal/browser/terminalBaseContextualActions'; -import { ContextualActionAddon, getMatchActions } from 'vs/workbench/contrib/terminal/browser/xterm/contextualActionAddon'; -import { Terminal } from 'xterm'; - -suite('ContextualActionAddon', () => { - let contextualActionAddon: ContextualActionAddon; - let terminalInstance: Pick; - let commandDetection: CommandDetectionCapability; - let openerService: OpenerService; - setup(() => { - const instantiationService = new TestInstantiationService(); - const xterm = new Terminal({ - allowProposedApi: true, - cols: 80, - rows: 30 - }); - const capabilities = new TerminalCapabilityStore(); - instantiationService.stub(ILogService, new NullLogService()); - commandDetection = instantiationService.createInstance(CommandDetectionCapability, xterm); - capabilities.add(TerminalCapability.CommandDetection, commandDetection); - instantiationService.stub(IContextMenuService, instantiationService.createInstance(ContextMenuService)); - openerService = instantiationService.createInstance(OpenerService); - instantiationService.stub(IOpenerService, openerService); - terminalInstance = { - async freePortKillProcess(port: string): Promise { } - } as Pick; - contextualActionAddon = instantiationService.createInstance(ContextualActionAddon, capabilities); - xterm.loadAddon(contextualActionAddon); - }); - suite('registerCommandFinishedListener & getMatchActions', () => { - suite('gitSimilarCommand', async () => { - const expectedMap = new Map(); - const command = `git sttatus`; - const output = `git: 'sttatus' is not a git command. See 'git --help'. - - The most similar command is - status`; - const exitCode = 1; - const actions = [ - { - id: 'terminal.gitSimilarCommand', - label: 'Run git status', - run: true, - tooltip: 'Run git status', - enabled: true - } - ]; - setup(() => { - const command = gitSimilarCommand(); - expectedMap.set(command.commandLineMatcher.toString(), [command]); - contextualActionAddon.registerCommandFinishedListener(command); - }); - suite('returns undefined when', () => { - test('output does not match', () => { - strictEqual(getMatchActions(createCommand(command, `invalid output`, GitSimilarOutputRegex, exitCode), expectedMap), undefined); - }); - test('command does not match', () => { - strictEqual(getMatchActions(createCommand(`gt sttatus`, output, GitSimilarOutputRegex, exitCode), expectedMap), undefined); - }); - }); - suite('returns undefined when', () => { - test('expected unix exit code', () => { - assertMatchOptions(getMatchActions(createCommand(command, output, GitSimilarOutputRegex, exitCode), expectedMap), actions); - }); - test('matching exit status', () => { - assertMatchOptions(getMatchActions(createCommand(command, output, GitSimilarOutputRegex, 2), expectedMap), actions); - }); - }); - }); - suite('freePort', () => { - const expected = new Map(); - const portCommand = `yarn start dev`; - const output = `yarn run v1.22.17 - warning ../../package.json: No license field - Error: listen EADDRINUSE: address already in use 0.0.0.0:3000 - at Server.setupListenHandle [as _listen2] (node:net:1315:16) - at listenInCluster (node:net:1363:12) - at doListen (node:net:1501:7) - at processTicksAndRejections (node:internal/process/task_queues:84:21) - Emitted 'error' event on WebSocketServer instance at: - at Server.emit (node:events:394:28) - at emitErrorNT (node:net:1342:8) - at processTicksAndRejections (node:internal/process/task_queues:83:21) { - } - error Command failed with exit code 1. - info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`; - const actionOptions = [{ - id: 'terminal.freePort', - label: 'Free port 3000', - run: true, - tooltip: 'Free port 3000', - enabled: true - }]; - setup(() => { - const command = freePort(terminalInstance); - expected.set(command.commandLineMatcher.toString(), [command]); - contextualActionAddon.registerCommandFinishedListener(command); - }); - suite('returns undefined when', () => { - test('output does not match', () => { - strictEqual(getMatchActions(createCommand(portCommand, `invalid output`, FreePortOutputRegex), expected), undefined); - }); - }); - test('returns actions', () => { - assertMatchOptions(getMatchActions(createCommand(portCommand, output, FreePortOutputRegex), expected), actionOptions); - }); - }); - suite('gitPushSetUpstream', () => { - const expectedMap = new Map(); - const command = `git push`; - const output = `fatal: The current branch test22 has no upstream branch. - To push the current branch and set the remote as upstream, use - - git push --set-upstream origin test22`; - const exitCode = 128; - const actions = [ - { - id: 'terminal.gitPush', - label: 'Git push test22', - run: true, - tooltip: 'Git push test22', - enabled: true - } - ]; - setup(() => { - const command = gitPushSetUpstream(); - expectedMap.set(command.commandLineMatcher.toString(), [command]); - contextualActionAddon.registerCommandFinishedListener(command); - }); - suite('returns undefined when', () => { - test('output does not match', () => { - strictEqual(getMatchActions(createCommand(command, `invalid output`, GitPushOutputRegex, exitCode), expectedMap), undefined); - }); - test('command does not match', () => { - strictEqual(getMatchActions(createCommand(`git status`, output, GitPushOutputRegex, exitCode), expectedMap), undefined); - }); - }); - suite('returns actions when', () => { - test('expected unix exit code', () => { - assertMatchOptions(getMatchActions(createCommand(command, output, GitPushOutputRegex, exitCode), expectedMap), actions); - }); - test('matching exit status', () => { - assertMatchOptions(getMatchActions(createCommand(command, output, GitPushOutputRegex, 2), expectedMap), actions); - }); - }); - }); - suite('gitCreatePr', () => { - const expectedMap = new Map(); - const command = `git push`; - const output = `Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 - remote: - remote: Create a pull request for 'test22' on GitHub by visiting: - remote: https://github.com/meganrogge/xterm.js/pull/new/test22 - remote: - To https://github.com/meganrogge/xterm.js - * [new branch] test22 -> test22 - Branch 'test22' set up to track remote branch 'test22' from 'origin'. `; - const exitCode = 0; - const actions = [ - { - id: 'terminal.gitCreatePr', - label: 'Create PR', - run: true, - tooltip: 'Create PR', - enabled: true - } - ]; - setup(() => { - const command = gitCreatePr(openerService); - expectedMap.set(command.commandLineMatcher.toString(), [command]); - contextualActionAddon.registerCommandFinishedListener(command); - }); - suite('returns undefined when', () => { - test('output does not match', () => { - strictEqual(getMatchActions(createCommand(command, `invalid output`, GitCreatePrOutputRegex, exitCode), expectedMap), undefined); - }); - test('command does not match', () => { - strictEqual(getMatchActions(createCommand(`git status`, output, GitCreatePrOutputRegex, exitCode), expectedMap), undefined); - }); - test('failure exit status', () => { - strictEqual(getMatchActions(createCommand(command, output, GitCreatePrOutputRegex, 2), expectedMap), undefined); - }); - }); - suite('returns actions when', () => { - test('expected unix exit code', () => { - assertMatchOptions(getMatchActions(createCommand(command, output, GitCreatePrOutputRegex, exitCode), expectedMap), actions); - }); - }); - }); - }); - suite('gitPush - multiple providers', () => { - const expectedMap = new Map(); - const command = `git push`; - const output = `fatal: The current branch test22 has no upstream branch. - To push the current branch and set the remote as upstream, use - - git push --set-upstream origin test22`; - const exitCode = 128; - const actions = [ - { - id: 'terminal.gitPush', - label: 'Git push test22', - run: true, - tooltip: 'Git push test22', - enabled: true - } - ]; - setup(() => { - const pushCommand = gitPushSetUpstream(); - const prCommand = gitCreatePr(openerService); - contextualActionAddon.registerCommandFinishedListener(pushCommand); - contextualActionAddon.registerCommandFinishedListener(prCommand); - expectedMap.set(pushCommand.commandLineMatcher.toString(), [pushCommand, prCommand]); - }); - suite('returns undefined when', () => { - test('output does not match', () => { - strictEqual(getMatchActions(createCommand(command, `invalid output`, GitPushOutputRegex, exitCode), expectedMap), undefined); - }); - test('command does not match', () => { - strictEqual(getMatchActions(createCommand(`git status`, output, GitPushOutputRegex, exitCode), expectedMap), undefined); - }); - }); - suite('returns actions when', () => { - test('expected unix exit code', () => { - assertMatchOptions(getMatchActions(createCommand(command, output, GitPushOutputRegex, exitCode), expectedMap), actions); - }); - test('matching exit status', () => { - assertMatchOptions(getMatchActions(createCommand(command, output, GitPushOutputRegex, 2), expectedMap), actions); - }); - }); - }); -}); - -function createCommand(command: string, output: string, outputMatcher?: RegExp | string, exitCode?: number): ITerminalCommand { - return { - command, - exitCode, - getOutput: () => { return output; }, - getOutputMatch: (matcher: ITerminalOutputMatcher) => { - if (outputMatcher) { - return output.match(outputMatcher) ?? undefined; - } - return undefined; - }, - timestamp: Date.now(), - hasOutput: () => !!output - }; -} - -function assertMatchOptions(actual: ICommandAction[] | undefined, expected: { id: string; label: string; run: boolean; tooltip: string; enabled: boolean }[]): void { - strictEqual(actual?.length, expected.length); - let index = 0; - for (const i of actual) { - const j = expected[index]; - strictEqual(i.id, j.id, `ID`); - strictEqual(i.enabled, j.enabled, `enabled`); - strictEqual(i.label, j.label, `label`); - strictEqual(!!i.run, j.run, `run`); - strictEqual(i.tooltip, j.tooltip, `tooltip`); - index++; - } -} diff --git a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts index 4aaa1f4fedf..528ca7290a2 100644 --- a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts +++ b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts @@ -17,7 +17,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { CommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/commandDetectionCapability'; import { TerminalBuiltinLinkType } from 'vs/workbench/contrib/terminal/browser/links/links'; import { TerminalLocalFileLinkOpener, TerminalLocalFolderInWorkspaceLinkOpener, TerminalSearchLinkOpener } from 'vs/workbench/contrib/terminal/browser/links/terminalLinkOpeners'; -import { TerminalCapability, ITerminalCommand, IXtermMarker } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { TerminalCapability, ITerminalCommand, IXtermMarker, ITerminalOutputMatcher } from 'vs/platform/terminal/common/capabilities/capabilities'; import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -25,7 +25,6 @@ import { TestContextService } from 'vs/workbench/test/common/workbenchTestServic import { Terminal } from 'xterm'; import { IFileQuery, ISearchComplete, ISearchService } from 'vs/workbench/services/search/common/search'; import { SearchService } from 'vs/workbench/services/search/common/searchService'; -import { ITerminalOutputMatcher } from 'vs/workbench/contrib/terminal/common/terminal'; export interface ITerminalLinkActivationResult { source: 'editor' | 'search'; diff --git a/src/vs/workbench/contrib/terminal/test/browser/quickFixAddon.test.ts b/src/vs/workbench/contrib/terminal/test/browser/quickFixAddon.test.ts new file mode 100644 index 00000000000..2b6d1203265 --- /dev/null +++ b/src/vs/workbench/contrib/terminal/test/browser/quickFixAddon.test.ts @@ -0,0 +1,346 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { strictEqual } from 'assert'; +import { IAction } from 'vs/base/common/actions'; +import { isWindows } from 'vs/base/common/platform'; +import { OpenerService } from 'vs/editor/browser/services/openerService'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; +import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { ILogService, NullLogService } from 'vs/platform/log/common/log'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { ITerminalCommand, ITerminalOutputMatcher, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; +import { CommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/commandDetectionCapability'; +import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore'; +import { ITerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { freePort, FreePortOutputRegex, gitCreatePr, GitCreatePrOutputRegex, GitPushOutputRegex, gitPushSetUpstream, gitSimilarCommand, GitSimilarOutputRegex, gitTwoDashes, GitTwoDashesRegex } from 'vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions'; +import { TerminalQuickFixAddon, getQuickFixes } from 'vs/workbench/contrib/terminal/browser/xterm/quickFixAddon'; +import { URI } from 'vs/base/common/uri'; +import { Terminal } from 'xterm'; + +suite('QuickFixAddon', () => { + let quickFixAddon: TerminalQuickFixAddon; + let terminalInstance: Pick; + let commandDetection: CommandDetectionCapability; + let openerService: OpenerService; + setup(() => { + const instantiationService = new TestInstantiationService(); + const xterm = new Terminal({ + allowProposedApi: true, + cols: 80, + rows: 30 + }); + instantiationService.stub(IConfigurationService, new TestConfigurationService()); + const capabilities = new TerminalCapabilityStore(); + instantiationService.stub(ILogService, new NullLogService()); + commandDetection = instantiationService.createInstance(CommandDetectionCapability, xterm); + capabilities.add(TerminalCapability.CommandDetection, commandDetection); + instantiationService.stub(IContextMenuService, instantiationService.createInstance(ContextMenuService)); + openerService = instantiationService.createInstance(OpenerService); + instantiationService.stub(IOpenerService, openerService); + terminalInstance = { + async freePortKillProcess(port: string): Promise { } + } as Pick; + quickFixAddon = instantiationService.createInstance(TerminalQuickFixAddon, capabilities); + xterm.loadAddon(quickFixAddon); + }); + suite('registerCommandFinishedListener & getMatchActions', () => { + suite('gitSimilarCommand', async () => { + const expectedMap = new Map(); + const command = `git sttatus`; + let output = `git: 'sttatus' is not a git command. See 'git --help'. + + The most similar command is + status`; + const exitCode = 1; + const actions = [{ + id: `quickFix.command`, + enabled: true, + label: 'Run: git status', + tooltip: 'Run: git status', + command: 'git status' + }]; + setup(() => { + const command = gitSimilarCommand(); + expectedMap.set(command.commandLineMatcher.toString(), [command]); + quickFixAddon.registerCommandFinishedListener(command); + }); + suite('returns undefined when', () => { + test('output does not match', () => { + strictEqual(getQuickFixes(createCommand(command, `invalid output`, GitSimilarOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + test('command does not match', () => { + strictEqual(getQuickFixes(createCommand(`gt sttatus`, output, GitSimilarOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + }); + suite('returns undefined when', () => { + test('expected unix exit code', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitSimilarOutputRegex, exitCode), expectedMap, openerService), actions); + }); + test('matching exit status', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitSimilarOutputRegex, 2), expectedMap, openerService), actions); + }); + }); + suite('returns match', () => { + test('returns match', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitSimilarOutputRegex), expectedMap, openerService), actions); + }); + + test('returns multiple match', () => { + output = `git: 'pu' is not a git command. See 'git --help'. + + The most similar commands are + pull + push`; + const actions = [{ + id: `quickFix.command`, + enabled: true, + label: 'Run: git pull', + tooltip: 'Run: git pull', + command: 'git pull' + }, { + id: `quickFix.command`, + enabled: true, + label: 'Run: git push', + tooltip: 'Run: git push', + command: 'git push' + }]; + assertMatchOptions(getQuickFixes(createCommand('git pu', output, GitSimilarOutputRegex), expectedMap, openerService), actions); + }); + }); + }); + suite('gitTwoDashes', async () => { + const expectedMap = new Map(); + const command = `git add . -all`; + const output = 'error: did you mean `--all` (with two dashes)?'; + const exitCode = 1; + const actions = [{ + id: `quickFix.command`, + enabled: true, + label: 'Run: git add . --all', + tooltip: 'Run: git add . --all', + command: 'git add . --all' + }]; + setup(() => { + const command = gitTwoDashes(); + expectedMap.set(command.commandLineMatcher.toString(), [command]); + quickFixAddon.registerCommandFinishedListener(command); + }); + suite('returns undefined when', () => { + test('output does not match', () => { + strictEqual(getQuickFixes(createCommand(command, `invalid output`, GitTwoDashesRegex, exitCode), expectedMap, openerService), undefined); + }); + test('command does not match', () => { + strictEqual(getQuickFixes(createCommand(`gt sttatus`, output, GitTwoDashesRegex, exitCode), expectedMap, openerService), undefined); + }); + }); + suite('returns undefined when', () => { + test('expected unix exit code', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitTwoDashesRegex, exitCode), expectedMap, openerService), actions); + }); + test('matching exit status', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitTwoDashesRegex, 2), expectedMap, openerService), actions); + }); + }); + }); + if (!isWindows) { + suite('freePort', () => { + const expected = new Map(); + const portCommand = `yarn start dev`; + const output = `yarn run v1.22.17 + warning ../../package.json: No license field + Error: listen EADDRINUSE: address already in use 0.0.0.0:3000 + at Server.setupListenHandle [as _listen2] (node:net:1315:16) + at listenInCluster (node:net:1363:12) + at doListen (node:net:1501:7) + at processTicksAndRejections (node:internal/process/task_queues:84:21) + Emitted 'error' event on WebSocketServer instance at: + at Server.emit (node:events:394:28) + at emitErrorNT (node:net:1342:8) + at processTicksAndRejections (node:internal/process/task_queues:83:21) { + } + error Command failed with exit code 1. + info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`; + const actionOptions = [{ + id: 'terminal.freePort', + label: 'Free port 3000', + run: true, + tooltip: 'Free port 3000', + enabled: true + }]; + setup(() => { + const command = freePort(terminalInstance); + expected.set(command.commandLineMatcher.toString(), [command]); + quickFixAddon.registerCommandFinishedListener(command); + }); + suite('returns undefined when', () => { + test('output does not match', () => { + strictEqual(getQuickFixes(createCommand(portCommand, `invalid output`, FreePortOutputRegex), expected, openerService), undefined); + }); + }); + test('returns actions', () => { + assertMatchOptions(getQuickFixes(createCommand(portCommand, output, FreePortOutputRegex), expected, openerService), actionOptions); + }); + }); + } + + suite('gitPushSetUpstream', () => { + const expectedMap = new Map(); + const command = `git push`; + const output = `fatal: The current branch test22 has no upstream branch. + To push the current branch and set the remote as upstream, use + + git push --set-upstream origin test22`; + const exitCode = 128; + const actions = [{ + id: `quickFix.command`, + enabled: true, + label: 'Run: git push --set-upstream origin test22', + tooltip: 'Run: git push --set-upstream origin test22', + command: 'git push --set-upstream origin test22' + }]; + setup(() => { + const command = gitPushSetUpstream(); + expectedMap.set(command.commandLineMatcher.toString(), [command]); + quickFixAddon.registerCommandFinishedListener(command); + }); + suite('returns undefined when', () => { + test('output does not match', () => { + strictEqual(getQuickFixes(createCommand(command, `invalid output`, GitPushOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + test('command does not match', () => { + strictEqual(getQuickFixes(createCommand(`git status`, output, GitPushOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + }); + suite('returns actions when', () => { + test('expected unix exit code', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitPushOutputRegex, exitCode), expectedMap, openerService), actions); + }); + test('matching exit status', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitPushOutputRegex, 2), expectedMap, openerService), actions); + }); + }); + }); + suite('gitCreatePr', () => { + const expectedMap = new Map(); + const command = `git push`; + const output = `Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 + remote: + remote: Create a pull request for 'test22' on GitHub by visiting: + remote: https://github.com/meganrogge/xterm.js/pull/new/test22 + remote: + To https://github.com/meganrogge/xterm.js + * [new branch] test22 -> test22 + Branch 'test22' set up to track remote branch 'test22' from 'origin'. `; + const exitCode = 0; + const actions = [{ + id: `quickFix.opener`, + enabled: true, + label: 'Open: https://github.com/meganrogge/xterm.js/pull/new/test22', + tooltip: 'Open: https://github.com/meganrogge/xterm.js/pull/new/test22', + uri: URI.parse('https://github.com/meganrogge/xterm.js/pull/new/test22') + }]; + setup(() => { + const command = gitCreatePr(); + expectedMap.set(command.commandLineMatcher.toString(), [command]); + quickFixAddon.registerCommandFinishedListener(command); + }); + suite('returns undefined when', () => { + test('output does not match', () => { + strictEqual(getQuickFixes(createCommand(command, `invalid output`, GitCreatePrOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + test('command does not match', () => { + strictEqual(getQuickFixes(createCommand(`git status`, output, GitCreatePrOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + test('failure exit status', () => { + strictEqual(getQuickFixes(createCommand(command, output, GitCreatePrOutputRegex, 2), expectedMap, openerService), undefined); + }); + }); + suite('returns actions when', () => { + test('expected unix exit code', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitCreatePrOutputRegex, exitCode), expectedMap, openerService), actions); + }); + }); + }); + }); + suite('gitPush - multiple providers', () => { + const expectedMap = new Map(); + const command = `git push`; + const output = `fatal: The current branch test22 has no upstream branch. + To push the current branch and set the remote as upstream, use + + git push --set-upstream origin test22`; + const exitCode = 128; + const actions = [{ + id: `quickFix.command`, + enabled: true, + label: 'Run: git push --set-upstream origin test22', + tooltip: 'Run: git push --set-upstream origin test22', + command: 'git push --set-upstream origin test22' + }]; + setup(() => { + const pushCommand = gitPushSetUpstream(); + const prCommand = gitCreatePr(); + quickFixAddon.registerCommandFinishedListener(pushCommand); + quickFixAddon.registerCommandFinishedListener(prCommand); + expectedMap.set(pushCommand.commandLineMatcher.toString(), [pushCommand, prCommand]); + }); + suite('returns undefined when', () => { + test('output does not match', () => { + strictEqual(getQuickFixes(createCommand(command, `invalid output`, GitPushOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + test('command does not match', () => { + strictEqual(getQuickFixes(createCommand(`git status`, output, GitPushOutputRegex, exitCode), expectedMap, openerService), undefined); + }); + }); + suite('returns actions when', () => { + test('expected unix exit code', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitPushOutputRegex, exitCode), expectedMap, openerService), actions); + }); + test('matching exit status', () => { + assertMatchOptions(getQuickFixes(createCommand(command, output, GitPushOutputRegex, 2), expectedMap, openerService), actions); + }); + }); + }); +}); + +function createCommand(command: string, output: string, outputMatcher?: RegExp | string, exitCode?: number): ITerminalCommand { + return { + command, + exitCode, + getOutput: () => { return output; }, + getOutputMatch: (matcher: ITerminalOutputMatcher) => { + if (outputMatcher) { + return output.match(outputMatcher) ?? undefined; + } + return undefined; + }, + timestamp: Date.now(), + hasOutput: () => !!output + }; +} + +type TestAction = Pick & { command?: string; uri?: URI }; +function assertMatchOptions(actual: TestAction[] | undefined, expected: TestAction[]): void { + strictEqual(actual?.length, expected.length); + let index = 0; + for (const i of actual) { + const j = expected[index]; + strictEqual(i.id, j.id, `ID`); + strictEqual(i.enabled, j.enabled, `enabled`); + strictEqual(i.label, j.label, `label`); + strictEqual(i.tooltip, j.tooltip, `tooltip`); + if (j.command) { + strictEqual(i.command, j.command); + } + if (j.uri) { + strictEqual(i.uri!.toString(), j.uri.toString()); + } + index++; + } +} diff --git a/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByLocation.ts b/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByLocation.ts index d0929417060..b20d910337b 100644 --- a/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByLocation.ts +++ b/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByLocation.ts @@ -18,6 +18,7 @@ import { InternalTestItem, TestDiffOpType, TestItemExpandState, TestResultState, import { TestResultItemChangeReason } from 'vs/workbench/contrib/testing/common/testResult'; import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService'; import { ITestService } from 'vs/workbench/contrib/testing/common/testService'; +import { TestId } from 'vs/workbench/contrib/testing/common/testId'; const computedStateAccessor: IComputedStateAndDurationAccessor = { getOwnState: i => i instanceof TestItemTreeElement ? i.ownState : TestResultState.Unset, @@ -212,7 +213,8 @@ export class HierarchicalByLocationProjection extends Disposable implements ITes } protected createItem(item: InternalTestItem): ByLocationTestItemElement { - const parent = item.parent ? this.items.get(item.parent)! : null; + const parentId = TestId.parentId(item.item.extId); + const parent = parentId ? this.items.get(parentId)! : null; return new ByLocationTestItemElement(item, parent, n => this.changes.addedOrRemoved(n)); } diff --git a/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts b/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts index cd34647d6d0..eeedf8de3d4 100644 --- a/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts +++ b/src/vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName.ts @@ -12,6 +12,7 @@ import { NodeRenderDirective } from 'vs/workbench/contrib/testing/browser/explor import { InternalTestItem } from 'vs/workbench/contrib/testing/common/testTypes'; import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService'; import { ITestService } from 'vs/workbench/contrib/testing/common/testService'; +import { TestId } from 'vs/workbench/contrib/testing/common/testId'; /** * Type of test element in the list. @@ -97,7 +98,8 @@ export class HierarchicalByNameProjection extends HierarchicalByLocationProjecti * @override */ protected override createItem(item: InternalTestItem): ByLocationTestItemElement { - const actualParent = item.parent ? this.items.get(item.parent) as ByNameTestItemElement : undefined; + const parentId = TestId.parentId(item.item.extId); + const actualParent = parentId ? this.items.get(parentId.toString()) as ByNameTestItemElement : undefined; if (!actualParent) { return new ByNameTestItemElement(item, null, r => this.changes.addedOrRemoved(r)); } diff --git a/src/vs/workbench/contrib/testing/browser/testExplorerActions.ts b/src/vs/workbench/contrib/testing/browser/testExplorerActions.ts index 53579678c41..8e02aecd2f5 100644 --- a/src/vs/workbench/contrib/testing/browser/testExplorerActions.ts +++ b/src/vs/workbench/contrib/testing/browser/testExplorerActions.ts @@ -21,7 +21,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { ViewAction } from 'vs/workbench/browser/parts/views/viewPane'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { FocusedViewContext } from 'vs/workbench/common/contextkeys'; import { ViewContainerLocation } from 'vs/workbench/common/views'; import { IExtensionsViewPaneContainer, VIEWLET_ID as EXTENSIONS_VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions'; @@ -41,7 +41,7 @@ import { expandAndGetTestById, IMainThreadTestCollection, ITestService, testsInF import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; -const category = CATEGORIES.Test; +const category = Categories.Test; const enum ActionOrder { // Navigation: diff --git a/src/vs/workbench/contrib/testing/browser/testing.contribution.ts b/src/vs/workbench/contrib/testing/browser/testing.contribution.ts index 087f7555cff..828affe2faf 100644 --- a/src/vs/workbench/contrib/testing/browser/testing.contribution.ts +++ b/src/vs/workbench/contrib/testing/browser/testing.contribution.ts @@ -11,7 +11,7 @@ import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'v import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IFileService } from 'vs/platform/files/common/files'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IProgressService } from 'vs/platform/progress/common/progress'; @@ -44,15 +44,15 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle import { allTestActions, discoverAndRunTests } from './testExplorerActions'; import './testingConfigurationUi'; -registerSingleton(ITestService, TestService, true); -registerSingleton(ITestResultStorage, TestResultStorage, true); -registerSingleton(ITestProfileService, TestProfileService, true); -registerSingleton(ITestResultService, TestResultService, true); -registerSingleton(ITestExplorerFilterState, TestExplorerFilterState, true); -registerSingleton(ITestingOutputTerminalService, TestingOutputTerminalService, true); -registerSingleton(ITestingPeekOpener, TestingPeekOpener, true); -registerSingleton(ITestingProgressUiService, TestingProgressUiService, true); -registerSingleton(ITestingDecorationsService, TestingDecorationService, true); +registerSingleton(ITestService, TestService, InstantiationType.Delayed); +registerSingleton(ITestResultStorage, TestResultStorage, InstantiationType.Delayed); +registerSingleton(ITestProfileService, TestProfileService, InstantiationType.Delayed); +registerSingleton(ITestResultService, TestResultService, InstantiationType.Delayed); +registerSingleton(ITestExplorerFilterState, TestExplorerFilterState, InstantiationType.Delayed); +registerSingleton(ITestingOutputTerminalService, TestingOutputTerminalService, InstantiationType.Delayed); +registerSingleton(ITestingPeekOpener, TestingPeekOpener, InstantiationType.Delayed); +registerSingleton(ITestingProgressUiService, TestingProgressUiService, InstantiationType.Delayed); +registerSingleton(ITestingDecorationsService, TestingDecorationService, InstantiationType.Delayed); const viewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: Testing.ViewletId, @@ -102,9 +102,9 @@ registerAction2(GoToNextMessageAction); registerAction2(CloseTestPeek); registerAction2(ToggleTestingPeekHistory); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TestingContentProvider, 'TestingContentProvider', LifecyclePhase.Restored); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TestingPeekOpener, 'TestingPeekOpener', LifecyclePhase.Eventually); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TestingProgressTrigger, 'TestingProgressTrigger', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TestingContentProvider, LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TestingPeekOpener, LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(TestingProgressTrigger, LifecyclePhase.Eventually); registerEditorContribution(Testing.OutputPeekContributionId, TestingOutputPeekController); registerEditorContribution(Testing.DecorationsContributionId, TestingDecorations); diff --git a/src/vs/workbench/contrib/testing/browser/testingDecorations.ts b/src/vs/workbench/contrib/testing/browser/testingDecorations.ts index 7287bcccafa..3aaff497077 100644 --- a/src/vs/workbench/contrib/testing/browser/testingDecorations.ts +++ b/src/vs/workbench/contrib/testing/browser/testingDecorations.ts @@ -10,6 +10,8 @@ import { equals } from 'vs/base/common/arrays'; import { RunOnceScheduler } from 'vs/base/common/async'; import { Emitter, Event } from 'vs/base/common/event'; import { IMarkdownString, MarkdownString } from 'vs/base/common/htmlContent'; +import { stripIcons } from 'vs/base/common/iconLabels'; +import { Iterable } from 'vs/base/common/iterator'; import { Disposable, DisposableStore, IReference, MutableDisposable } from 'vs/base/common/lifecycle'; import { ResourceMap } from 'vs/base/common/map'; import { Constants } from 'vs/base/common/uint'; @@ -39,7 +41,7 @@ import { testingRunAllIcon, testingRunIcon, testingStatesToIcons } from 'vs/work import { testMessageSeverityColors } from 'vs/workbench/contrib/testing/browser/theme'; import { DefaultGutterClickAction, getTestingConfiguration, TestingConfigKeys } from 'vs/workbench/contrib/testing/common/configuration'; import { labelForTestInState, Testing } from 'vs/workbench/contrib/testing/common/constants'; -import { IncrementalTestCollectionItem, InternalTestItem, IRichLocation, ITestMessage, ITestRunProfile, TestDiffOpType, TestMessageType, TestResultItem, TestResultState, TestRunProfileBitset } from 'vs/workbench/contrib/testing/common/testTypes'; +import { TestId } from 'vs/workbench/contrib/testing/common/testId'; import { ITestDecoration as IPublicTestDecoration, ITestingDecorationsService, TestDecorations } from 'vs/workbench/contrib/testing/common/testingDecorations'; import { ITestingPeekOpener } from 'vs/workbench/contrib/testing/common/testingPeekOpener'; import { isFailedState, maxPriority } from 'vs/workbench/contrib/testing/common/testingStates'; @@ -48,7 +50,7 @@ import { ITestProfileService } from 'vs/workbench/contrib/testing/common/testPro import { LiveTestResult } from 'vs/workbench/contrib/testing/common/testResult'; import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService'; import { getContextForTestItem, ITestService, testsInFile } from 'vs/workbench/contrib/testing/common/testService'; -import { stripIcons } from 'vs/base/common/iconLabels'; +import { IncrementalTestCollectionItem, InternalTestItem, IRichLocation, ITestMessage, ITestRunProfile, TestDiffOpType, TestMessageType, TestResultItem, TestResultState, TestRunProfileBitset } from 'vs/workbench/contrib/testing/common/testTypes'; const MAX_INLINE_MESSAGE_LENGTH = 128; @@ -79,7 +81,8 @@ export class TestingDecorationService extends Disposable implements ITestingDeco rangeUpdateVersionId?: number; /** Counter for the results rendered in the document */ generation: number; - value: TestDecorations; + value: readonly ITestDecoration[]; + map: ReadonlyMap; }>(); /** @@ -150,15 +153,15 @@ export class TestingDecorationService extends Disposable implements ITestingDeco } /** @inheritdoc */ - public syncDecorations(resource: URI): TestDecorations { + public syncDecorations(resource: URI): ReadonlyMap { const model = this.modelService.getModel(resource); if (!model) { - return new TestDecorations(); + return new Map(); } const cached = this.decorationCache.get(resource); if (cached && cached.generation === this.generation && (cached.rangeUpdateVersionId === undefined || cached.rangeUpdateVersionId !== model.getVersionId())) { - return cached.value; + return cached.map; } return this.applyDecorations(model); @@ -171,7 +174,7 @@ export class TestingDecorationService extends Disposable implements ITestingDeco return undefined; } - const decoration = this.syncDecorations(resource).value.find(v => v instanceof RunTestDecoration && v.isForTest(testId)); + const decoration = Iterable.find(this.syncDecorations(resource).values(), v => v instanceof RunTestDecoration && v.isForTest(testId)); if (!decoration) { return undefined; } @@ -192,10 +195,10 @@ export class TestingDecorationService extends Disposable implements ITestingDeco const uriStr = model.uri.toString(); const cached = this.decorationCache.get(model.uri); const testRangesUpdated = cached?.rangeUpdateVersionId === model.getVersionId(); - const lastDecorations = cached?.value ?? new TestDecorations(); - const newDecorations = new TestDecorations(); + const lastDecorations = cached?.value ?? []; - model.changeDecorations(accessor => { + const map = model.changeDecorations(accessor => { + const newDecorations: ITestDecoration[] = []; const runDecorations = new TestDecorations<{ line: number; id: ''; test: IncrementalTestCollectionItem; resultItem: TestResultItem | undefined }>(); for (const test of this.testService.collection.all) { if (!test.item.range || test.item.uri?.toString() !== uriStr) { @@ -209,7 +212,7 @@ export class TestingDecorationService extends Disposable implements ITestingDeco for (const [line, tests] of runDecorations.lines()) { const multi = tests.length > 1; - let existing = lastDecorations.value.find(d => d instanceof RunTestDecoration && d.exactlyContainsTests(tests)) as RunTestDecoration | undefined; + let existing = lastDecorations.find(d => d instanceof RunTestDecoration && d.exactlyContainsTests(tests)) as RunTestDecoration | undefined; // see comment in the constructor for what's going on here if (existing && testRangesUpdated && model.getDecorationRange(existing.id)?.startLineNumber !== line) { @@ -233,14 +236,14 @@ export class TestingDecorationService extends Disposable implements ITestingDeco for (const task of lastResult.tasks) { for (const m of task.otherMessages) { if (!this.invalidatedMessages.has(m) && m.location?.uri.toString() === uriStr) { - const decoration = lastDecorations.findOnLine(m.location.range.startLineNumber, l => l instanceof TestMessageDecoration && l.testMessage === m) + const decoration = lastDecorations.find(l => l instanceof TestMessageDecoration && l.testMessage === m) || this.instantiationService.createInstance(TestMessageDecoration, m, undefined, model); newDecorations.push(decoration); } } } - const messageLines = new Set(); + const messageLines = new Map(); for (const test of lastResult.tests) { for (let taskId = 0; taskId < test.tasks.length; taskId++) { const state = test.tasks[taskId]; @@ -253,14 +256,17 @@ export class TestingDecorationService extends Disposable implements ITestingDeco // Only add one message per line number. Overlapping messages // don't appear well, and the peek will show all of them (#134129) const line = m.location.range.startLineNumber; + let index: number; if (messageLines.has(line)) { - continue; + index = messageLines.get(line)!; + } else { + index = newDecorations.length; + messageLines.set(line, index); } - messageLines.add(line); - const previous = lastDecorations.findOnLine(line, l => l instanceof TestMessageDecoration && l.testMessage === m); + const previous = lastDecorations.find(l => l instanceof TestMessageDecoration && l.testMessage === m); if (previous) { - newDecorations.push(previous); + newDecorations[index] = previous; continue; } @@ -279,7 +285,7 @@ export class TestingDecorationService extends Disposable implements ITestingDeco } const saveFromRemoval = new Set(); - for (const decoration of newDecorations.value) { + for (const decoration of newDecorations) { if (decoration.id === '') { decoration.id = accessor.addDecoration(decoration.editorDecoration.range, decoration.editorDecoration.options); } else { @@ -287,20 +293,24 @@ export class TestingDecorationService extends Disposable implements ITestingDeco } } - for (const decoration of lastDecorations.value) { + for (const decoration of lastDecorations) { if (!saveFromRemoval.has(decoration.id)) { accessor.removeDecoration(decoration.id); } } + const map = new Map(newDecorations.map(d => [d.id, d])); this.decorationCache.set(model.uri, { generation: this.generation, rangeUpdateVersionId: cached?.rangeUpdateVersionId, value: newDecorations, + map, }); + + return map; }); - return newDecorations; + return map || new Map(); } } @@ -338,8 +348,8 @@ export class TestingDecorations extends Disposable implements IEditorContributio if (e.target.position && this.currentUri) { const modelDecorations = editor.getModel()?.getDecorationsInRange(Range.fromPositions(e.target.position)) ?? []; for (const { id } of modelDecorations) { - const cache = decorations.syncDecorations(this.currentUri) as TestDecorations; - if (cache.get(id)?.click(e)) { + const cache = decorations.syncDecorations(this.currentUri); + if ((cache.get(id) as ITestDecoration | undefined)?.click(e)) { e.event.stopPropagation(); return; } @@ -840,7 +850,7 @@ class MultiRunTestDecoration extends RunTestDecoration implements ITestDecoratio const testItems = this.tests.map(testItem => ({ currentLabel: testItem.test.item.label, testItem, - parent: testItem.test.parent, + parent: TestId.fromString(testItem.test.item.extId).parentId, })); const getLabelConflicts = (tests: typeof testItems) => { @@ -856,9 +866,9 @@ class MultiRunTestDecoration extends RunTestDecoration implements ITestDecoratio while ((conflicts = getLabelConflicts(testItems)).length && hasParent) { for (const conflict of conflicts) { if (conflict.parent) { - const parent = this.testService.collection.getNodeById(conflict.parent); + const parent = this.testService.collection.getNodeById(conflict.parent.toString()); conflict.currentLabel = parent?.item.label + ' > ' + conflict.currentLabel; - conflict.parent = parent?.parent ? parent.parent : null; + conflict.parent = conflict.parent.parentId; } else { hasParent = false; } diff --git a/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.ts b/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.ts index 23ced5391da..e980a313f04 100644 --- a/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.ts +++ b/src/vs/workbench/contrib/testing/browser/testingExplorerFilter.ts @@ -24,6 +24,7 @@ import { StoredValue } from 'vs/workbench/contrib/testing/common/storedValue'; import { denamespaceTestTag } from 'vs/workbench/contrib/testing/common/testTypes'; import { ITestExplorerFilterState, TestFilterTerm } from 'vs/workbench/contrib/testing/common/testExplorerFilterState'; import { ITestService } from 'vs/workbench/contrib/testing/common/testService'; +import { Emitter } from 'vs/base/common/event'; const testFilterDescriptions: { [K in TestFilterTerm]: string } = { [TestFilterTerm.Failed]: localize('testing.filters.showOnlyFailed', "Show Only Failed Tests"), @@ -35,6 +36,8 @@ const testFilterDescriptions: { [K in TestFilterTerm]: string } = { export class TestingExplorerFilter extends BaseActionViewItem { private input!: SuggestEnabledInputWithHistory; private wrapper!: HTMLDivElement; + private readonly focusEmitter = this._register(new Emitter()); + public readonly onDidFocus = this.focusEmitter.event; private readonly history: StoredValue<{ values: string[]; lastValue: string } | string[]> = this.instantiationService.createInstance(StoredValue, { key: 'testing.filterHistory2', scope: StorageScope.WORKSPACE, @@ -111,6 +114,10 @@ export class TestingExplorerFilter extends BaseActionViewItem { input.focus(); })); + this._register(input.onDidFocus(() => { + this.focusEmitter.fire(); + })); + this._register(input.onInputDidChange(() => updateDelayer.trigger(() => { input.addToHistory(); this.state.setText(input.getValue()); @@ -246,6 +253,7 @@ class FiltersDropdownMenuActionViewItem extends DropdownMenuActionViewItem { registerAction2(class extends Action2 { constructor() { super({ + _isFakeAction: true, id: TestCommandId.FilterAction, title: { value: localize('filter', "Filter"), original: 'Filter' }, }); diff --git a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts index 60a5566ddb0..fac697c8f62 100644 --- a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts +++ b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts @@ -69,14 +69,21 @@ import { IMainThreadTestCollection, ITestService, testCollectionIsEmpty } from ' import { InternalTestItem, ITestRunProfile, TestItemExpandState, TestResultState, TestRunProfileBitset } from 'vs/workbench/contrib/testing/common/testTypes'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; +const enum LastFocusState { + Input, + Tree, +} + export class TestingExplorerView extends ViewPane { public viewModel!: TestingExplorerViewModel; private filterActionBar = this._register(new MutableDisposable()); private container!: HTMLElement; private treeHeader!: HTMLElement; private discoveryProgress = this._register(new MutableDisposable()); - private filter?: TestingExplorerFilter; + private readonly filter = this._register(new MutableDisposable()); + private readonly filterFocusListener = this._register(new MutableDisposable()); private readonly dimensions = { width: 0, height: 0 }; + private lastFocusState = LastFocusState.Input; constructor( options: IViewletViewOptions, @@ -110,13 +117,19 @@ export class TestingExplorerView extends ViewPane { this._register(testProfileService.onDidChange(() => this.updateActions())); } - /** - * @override - */ public override shouldShowWelcome() { return this.viewModel?.welcomeExperience === WelcomeExperience.ForWorkspace ?? true; } + public override focus() { + super.focus(); + if (this.lastFocusState === LastFocusState.Tree) { + this.viewModel.tree.domFocus(); + } else { + this.filter.value?.focus(); + } + } + public getSelectedOrVisibleItems(profile?: ITestRunProfile) { const projection = this.viewModel.projection.value; if (!projection) { @@ -226,6 +239,7 @@ export class TestingExplorerView extends ViewPane { const listContainer = dom.append(this.container, dom.$('.test-explorer-tree')); this.viewModel = this.instantiationService.createInstance(TestingExplorerViewModel, listContainer, this.onDidChangeBodyVisibility); + this._register(this.viewModel.tree.onDidFocus(() => this.lastFocusState = LastFocusState.Tree)); this._register(this.viewModel.onChangeWelcomeVisibility(() => this._onDidChangeViewWelcomeState.fire())); this._register(this.viewModel); this._onDidChangeViewWelcomeState.fire(); @@ -235,7 +249,9 @@ export class TestingExplorerView extends ViewPane { public override getActionViewItem(action: IAction): IActionViewItem | undefined { switch (action.id) { case TestCommandId.FilterAction: - return this.filter = this.instantiationService.createInstance(TestingExplorerFilter, action); + this.filter.value = this.instantiationService.createInstance(TestingExplorerFilter, action); + this.filterFocusListener.value = this.filter.value.onDidFocus(() => this.lastFocusState = LastFocusState.Input); + return this.filter.value; case TestCommandId.RunSelectedAction: return this.getRunGroupDropdown(TestRunProfileBitset.Run, action); case TestCommandId.DebugSelectedAction: @@ -321,7 +337,7 @@ export class TestingExplorerView extends ViewPane { * @override */ public override saveState() { - this.filter?.saveState(); + this.filter.value?.saveState(); super.saveState(); } @@ -377,7 +393,7 @@ export class TestingExplorerView extends ViewPane { this.dimensions.width = width; this.container.style.height = `${height}px`; this.viewModel.layout(height - this.treeHeader.clientHeight, width); - this.filter?.layout(width); + this.filter.value?.layout(width); } } @@ -783,6 +799,8 @@ export class TestingExplorerViewModel extends Disposable { this.reevaluateWelcomeState(); this.projection.value?.applyTo(this.tree); + this.tree.refilter(); + if (this.hasPendingReveal) { this.revealById(this.filterState.reveal.value); } diff --git a/src/vs/workbench/contrib/testing/browser/testingOutputPeek.ts b/src/vs/workbench/contrib/testing/browser/testingOutputPeek.ts index bed3955d83c..fb9b48fd009 100644 --- a/src/vs/workbench/contrib/testing/browser/testingOutputPeek.ts +++ b/src/vs/workbench/contrib/testing/browser/testingOutputPeek.ts @@ -55,7 +55,7 @@ import { WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listSe import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { textLinkActiveForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry'; import { IColorTheme, IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { EditorModel } from 'vs/workbench/common/editor/editorModel'; import { flatTestItemDelimiter } from 'vs/workbench/contrib/testing/browser/explorerProjections/display'; import { getTestItemContextOverlay } from 'vs/workbench/contrib/testing/browser/explorerProjections/testItemContextOverlay'; @@ -1166,6 +1166,7 @@ class TestMessageElement implements ITreeElement { public readonly uri: URI; public readonly location?: IRichLocation; public readonly description?: string; + public readonly marker?: number; constructor( public readonly result: ITestResult, @@ -1173,9 +1174,10 @@ class TestMessageElement implements ITreeElement { public readonly taskIndex: number, public readonly messageIndex: number, ) { - const { message, location } = test.tasks[taskIndex].messages[messageIndex]; + const m = test.tasks[taskIndex].messages[messageIndex]; - this.location = location; + this.location = m.location; + this.marker = m.type === TestMessageType.Output ? m.marker : undefined; this.uri = this.context = buildTestUri({ type: TestUriType.ResultMessage, messageIndex, @@ -1186,7 +1188,7 @@ class TestMessageElement implements ITreeElement { this.id = this.uri.toString(); - const asPlaintext = renderStringAsPlaintext(message); + const asPlaintext = renderStringAsPlaintext(m.message); const lines = count(asPlaintext.trimRight(), '\n'); this.label = firstLine(asPlaintext); if (lines > 0) { @@ -1597,6 +1599,18 @@ class TreeActionsProvider { } } + if (element instanceof TestMessageElement) { + if (element.marker !== undefined) { + primary.push(new Action( + 'testing.outputPeek.showMessageInTerminal', + localize('testing.showMessageInTerminal', "Show Output in Terminal"), + Codicon.terminal.classNames, + undefined, + () => this.testTerminalService.open(element.result, element.marker), + )); + } + } + const result = { primary, secondary }; createAndFillInActionBarActions(menu, { shouldForwardArgs: true, @@ -1672,7 +1686,7 @@ export class GoToNextMessageAction extends EditorAction2 { f1: true, title: { value: localize('testing.goToNextMessage', "Go to Next Test Failure"), original: 'Go to Next Test Failure' }, icon: Codicon.arrowDown, - category: CATEGORIES.Test, + category: Categories.Test, keybinding: { primary: KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib + 1, @@ -1702,7 +1716,7 @@ export class GoToPreviousMessageAction extends EditorAction2 { f1: true, title: { value: localize('testing.goToPreviousMessage', "Go to Previous Test Failure"), original: 'Go to Previous Test Failure' }, icon: Codicon.arrowUp, - category: CATEGORIES.Test, + category: Categories.Test, keybinding: { primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib + 1, @@ -1732,7 +1746,7 @@ export class OpenMessageInEditorAction extends EditorAction2 { f1: false, title: { value: localize('testing.openMessageInEditor', "Open in Editor"), original: 'Open in Editor' }, icon: Codicon.linkExternal, - category: CATEGORIES.Test, + category: Categories.Test, menu: [{ id: MenuId.TestPeekTitle }], }); } @@ -1750,7 +1764,7 @@ export class ToggleTestingPeekHistory extends EditorAction2 { f1: true, title: { value: localize('testing.toggleTestingPeekHistory', "Toggle Test History in Peek"), original: 'Toggle Test History in Peek' }, icon: Codicon.history, - category: CATEGORIES.Test, + category: Categories.Test, menu: [{ id: MenuId.TestPeekTitle, group: 'navigation', diff --git a/src/vs/workbench/contrib/testing/browser/testingOutputTerminalService.ts b/src/vs/workbench/contrib/testing/browser/testingOutputTerminalService.ts index 70f9d91907a..1786fe37813 100644 --- a/src/vs/workbench/contrib/testing/browser/testingOutputTerminalService.ts +++ b/src/vs/workbench/contrib/testing/browser/testingOutputTerminalService.ts @@ -17,15 +17,17 @@ import { TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal' import { testingViewIcon } from 'vs/workbench/contrib/testing/browser/icons'; import { ITestResult } from 'vs/workbench/contrib/testing/common/testResult'; import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService'; +import { getMarkId } from 'vs/workbench/contrib/testing/common/testTypes'; export interface ITestingOutputTerminalService { _serviceBrand: undefined; /** - * Opens a terminal for the given test's output. + * Opens a terminal for the given test's output. Optionally, scrolls to and + * selects the given marker in the test results. */ - open(result: ITestResult): Promise; + open(result: ITestResult, marker?: number): Promise; } const friendlyDate = (date: number) => { @@ -78,7 +80,7 @@ export class TestingOutputTerminalService implements ITestingOutputTerminalServi /** * @inheritdoc */ - public async open(result: ITestResult | undefined): Promise { + public async open(result: ITestResult | undefined, marker?: number): Promise { const testOutputPtys = this.terminalService.instances .map(t => { const output = this.outputTerminals.get(t); @@ -95,6 +97,8 @@ export class TestingOutputTerminalService implements ITestingOutputTerminalServi } else { this.terminalGroupService.showPanel(); } + + this.revealMarker(existing[0], marker); return; } @@ -114,10 +118,10 @@ export class TestingOutputTerminalService implements ITestingOutputTerminalServi customPtyImplementation: () => output, name: getTitle(result), }, - }), output, result); + }), output, result, marker); } - private async showResultsInTerminal(terminal: ITerminalInstance, output: TestOutputProcess, result: ITestResult | undefined) { + private async showResultsInTerminal(terminal: ITerminalInstance, output: TestOutputProcess, result: ITestResult | undefined, thenSelectMarker?: number) { this.outputTerminals.set(terminal, output); output.resetFor(result?.id, getTitle(result)); this.terminalService.setActiveInstance(terminal); @@ -151,9 +155,16 @@ export class TestingOutputTerminalService implements ITestingOutputTerminalServi const text = localize('runFinished', 'Test run finished at {0}', completedAt.toLocaleString()); output.pushData(`\r\n\r\n\x1b[1m> ${text} <\x1b[0m\r\n\r\n`); output.ended = true; + this.revealMarker(terminal, thenSelectMarker); }, }); } + + private revealMarker(terminal: ITerminalInstance, marker?: number) { + if (marker !== undefined) { + terminal.scrollToMark(getMarkId(marker, true), getMarkId(marker, false), true); + } + } } class TestOutputProcess extends Disposable implements ITerminalChildProcess { diff --git a/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.ts b/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.ts index f8b3c45493a..4ac746110c3 100644 --- a/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.ts +++ b/src/vs/workbench/contrib/testing/common/mainThreadTestCollection.ts @@ -89,11 +89,11 @@ export class MainThreadTestCollection extends AbstractIncrementalTestCollection< for (const child of queue.pop()!) { const item = this.items.get(child)!; ops.push({ - op: TestDiffOpType.Add, item: { + op: TestDiffOpType.Add, + item: { controllerId: item.controllerId, expand: item.expand, item: item.item, - parent: item.parent, } }); queue.push(item.children); diff --git a/src/vs/workbench/contrib/testing/common/testId.ts b/src/vs/workbench/contrib/testing/common/testId.ts index a5b5323aff9..58b9af85589 100644 --- a/src/vs/workbench/contrib/testing/common/testId.ts +++ b/src/vs/workbench/contrib/testing/common/testId.ts @@ -23,7 +23,7 @@ export const enum TestPosition { IsParent, } -type TestItemLike = { id: string; parent?: TestItemLike }; +type TestItemLike = { id: string; parent?: TestItemLike; _isRoot?: boolean }; /** * The test ID is a stringifiable client that @@ -35,7 +35,7 @@ export class TestId { * Creates a test ID from an ext host test item. */ public static fromExtHostTestItem(item: TestItemLike, rootId: string, parent = item.parent) { - if (item.id === rootId) { + if (item._isRoot) { return new TestId([rootId]); } @@ -56,7 +56,7 @@ export class TestId { } /** - * Cheaply ets whether the ID refers to the root . + * Cheaply gets whether the ID refers to the root . */ public static root(idString: string) { const idx = idString.indexOf(TestIdPathParts.Delimiter); @@ -84,6 +84,14 @@ export class TestId { return base.toString() + TestIdPathParts.Delimiter + b; } + /** + * Cheaply gets the parent ID of a test identified with the string. + */ + public static parentId(idString: string) { + const idx = idString.lastIndexOf(TestIdPathParts.Delimiter); + return idx === -1 ? undefined : idString.slice(0, idx); + } + /** * Compares the position of the two ID strings. */ @@ -115,8 +123,8 @@ export class TestId { /** * Gets the ID of the parent test. */ - public get parentId(): TestId { - return this.viewEnd > 1 ? new TestId(this.path, this.viewEnd - 1) : this; + public get parentId(): TestId | undefined { + return this.viewEnd > 1 ? new TestId(this.path, this.viewEnd - 1) : undefined; } /** @@ -150,6 +158,16 @@ export class TestId { } } + /** + * Returns an iterable that yields IDs of the current item up to the root + * item. + */ + public *idsToRoot() { + for (let i = this.viewEnd; i > 0; i--) { + yield new TestId(this.path, i); + } + } + /** * Compares the other test ID with this one. */ diff --git a/src/vs/workbench/contrib/testing/common/testItemCollection.ts b/src/vs/workbench/contrib/testing/common/testItemCollection.ts index 34ef310d046..e255f1d068d 100644 --- a/src/vs/workbench/contrib/testing/common/testItemCollection.ts +++ b/src/vs/workbench/contrib/testing/common/testItemCollection.ts @@ -16,7 +16,6 @@ import { URI } from 'vs/base/common/uri'; */ interface CollectionItem { readonly fullId: TestId; - readonly parent: TestId | null; actual: T; expand: TestItemExpandState; /** @@ -351,7 +350,6 @@ export class TestItemCollection extends Disposable { internal = { fullId, actual, - parent: parent ? fullId.parentId : null, expandLevels: parent?.expandLevels /* intentionally undefined or 0 */ ? parent.expandLevels - 1 : undefined, expand: TestItemExpandState.NotExpandable, // updated by `connectItemAndChildren` }; @@ -362,7 +360,6 @@ export class TestItemCollection extends Disposable { this.pushDiff({ op: TestDiffOpType.Add, item: { - parent: internal.parent && internal.parent.toString(), controllerId: this.options.controllerId, expand: internal.expand, item: this.options.toITestItem(actual), diff --git a/src/vs/workbench/contrib/testing/common/testResult.ts b/src/vs/workbench/contrib/testing/common/testResult.ts index eb0114497e2..b84725e61d0 100644 --- a/src/vs/workbench/contrib/testing/common/testResult.ts +++ b/src/vs/workbench/contrib/testing/common/testResult.ts @@ -7,14 +7,14 @@ import { newWriteableBufferStream, VSBuffer, VSBufferReadableStream, VSBufferWri import { Emitter } from 'vs/base/common/event'; import { Lazy } from 'vs/base/common/lazy'; import { DisposableStore } from 'vs/base/common/lifecycle'; -import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { IComputedStateAccessor, refreshComputedState } from 'vs/workbench/contrib/testing/common/getComputedState'; import { IObservableValue, MutableObservableValue, staticObservableValue } from 'vs/workbench/contrib/testing/common/observableValue'; -import { IRichLocation, ISerializedTestResults, ITestItem, ITestMessage, ITestOutputMessage, ITestRunTask, ITestTaskState, ResolvedTestRunRequest, TestItemExpandState, TestMessageType, TestResultItem, TestResultState } from 'vs/workbench/contrib/testing/common/testTypes'; +import { getMarkId, IRichLocation, ISerializedTestResults, ITestItem, ITestMessage, ITestOutputMessage, ITestRunTask, ITestTaskState, ResolvedTestRunRequest, TestItemExpandState, TestMessageType, TestResultItem, TestResultState } from 'vs/workbench/contrib/testing/common/testTypes'; import { TestCoverage } from 'vs/workbench/contrib/testing/common/testCoverage'; import { maxPriority, statesInOrder, terminalStatePriorities } from 'vs/workbench/contrib/testing/common/testingStates'; import { removeAnsiEscapeCodes } from 'vs/base/common/strings'; +import { TestId } from 'vs/workbench/contrib/testing/common/testId'; export interface ITestRunTaskResults extends ITestRunTask { /** @@ -88,10 +88,8 @@ export interface ITestResult { } export const resultItemParents = function* (results: ITestResult, item: TestResultItem) { - let i: TestResultItem | undefined = item; - while (i) { - yield i; - i = i.parent ? results.getStateById(i.parent) : undefined; + for (const id of TestId.fromString(item.item.extId).idsToRoot()) { + yield results.getStateById(id.toString())!; } }; @@ -130,6 +128,7 @@ export const maxCountPriority = (counts: Readonly) => { return TestResultState.Unset; }; +const getMarkCode = (marker: number, start: boolean) => `\x1b]633;SetMark;Id=${getMarkId(marker, start)};Hidden\x07`; /** * Deals with output of a {@link LiveTestResult}. By default we pass-through @@ -162,11 +161,19 @@ export class LiveOutputController { /** * Appends data to the output. */ - public append(data: VSBuffer): Promise | void { + public append(data: VSBuffer, marker?: number): Promise | void { if (this.closed) { return this.closed; } + if (marker !== undefined) { + data = VSBuffer.concat([ + VSBuffer.fromString(getMarkCode(marker, true)), + data, + VSBuffer.fromString(getMarkCode(marker, false)), + ]); + } + this.previouslyWritten?.push(data); this.dataEmitter.fire(data); this._offset += data.byteLength; @@ -257,7 +264,6 @@ interface TestResultItemWithChildren extends TestResultItem { } const itemToNode = (controllerId: string, item: ITestItem, parent: string | null): TestResultItemWithChildren => ({ - parent, controllerId, expand: TestItemExpandState.NotExpandable, item: { ...item }, @@ -285,6 +291,7 @@ export class LiveTestResult implements ITestResult { private readonly completeEmitter = new Emitter(); private readonly changeEmitter = new Emitter(); private readonly testById = new Map(); + private testMarkerCounter = 0; private _completedAt?: number; public readonly onChange = this.changeEmitter.event; @@ -319,14 +326,11 @@ export class LiveTestResult implements ITestResult { getParents: i => { const { testById: testByExtId } = this; return (function* () { - for (let parentId = i.parent; parentId;) { - const parent = testByExtId.get(parentId); - if (!parent) { - break; + const parentId = TestId.fromString(i.item.extId).parentId; + if (parentId) { + for (const id of parentId.idsToRoot()) { + yield testByExtId.get(id.toString())!; } - - yield parent; - parentId = parent.parent; } })(); }, @@ -352,15 +356,24 @@ export class LiveTestResult implements ITestResult { */ public appendOutput(output: VSBuffer, taskId: string, location?: IRichLocation, testId?: string): void { const preview = output.byteLength > 100 ? output.slice(0, 100).toString() + '…' : output.toString(); + let marker: number | undefined; + + // currently, the UI only exposes jump-to-message from tests or locations, + // so no need to mark outputs that don't come from either of those. + if (testId || location) { + marker = this.testMarkerCounter++; + } + const message: ITestOutputMessage = { location, message: removeAnsiEscapeCodes(preview), offset: this.output.offset, length: output.byteLength, + marker: marker, type: TestMessageType.Output, }; - this.output.append(output); + this.output.append(output, marker); const index = this.mustGetTaskIndex(taskId); if (testId) { @@ -646,11 +659,9 @@ export class HydratedTestResult implements ITestResult { this.request = serialized.request; for (const item of serialized.items) { - const cast: TestResultItem = { ...item } as any; - cast.item.uri = URI.revive(cast.item.uri); - cast.retired = true; - this.counts[item.ownComputedState]++; - this.testById.set(item.item.extId, cast); + const de = TestResultItem.deserialize(item); + this.counts[de.ownComputedState]++; + this.testById.set(item.item.extId, de); } } diff --git a/src/vs/workbench/contrib/testing/common/testService.ts b/src/vs/workbench/contrib/testing/common/testService.ts index f4a19c91d99..5aeb3815ed6 100644 --- a/src/vs/workbench/contrib/testing/common/testService.ts +++ b/src/vs/workbench/contrib/testing/common/testService.ts @@ -77,10 +77,8 @@ export interface IMainThreadTestCollection extends AbstractIncrementalTestCollec * Iterates through the item and its parents to the root. */ export const getCollectionItemParents = function* (collection: IMainThreadTestCollection, item: InternalTestItem) { - let i: InternalTestItem | undefined = item; - while (i) { - yield i; - i = i.parent ? collection.getNodeById(i.parent) : undefined; + for (const id of TestId.fromString(item.item.extId).idsToRoot()) { + yield collection.getNodeById(id.toString())!; } }; diff --git a/src/vs/workbench/contrib/testing/common/testTypes.ts b/src/vs/workbench/contrib/testing/common/testTypes.ts index bf2ac6d4ba6..b93713245cd 100644 --- a/src/vs/workbench/contrib/testing/common/testTypes.ts +++ b/src/vs/workbench/contrib/testing/common/testTypes.ts @@ -8,6 +8,7 @@ import { MarshalledId } from 'vs/base/common/marshallingIds'; import { URI, UriComponents } from 'vs/base/common/uri'; import { IPosition } from 'vs/editor/common/core/position'; import { IRange, Range } from 'vs/editor/common/core/range'; +import { TestId } from 'vs/workbench/contrib/testing/common/testId'; export const enum TestResultState { Unset = 0, @@ -163,9 +164,16 @@ export interface ITestOutputMessage { type: TestMessageType.Output; offset: number; length: number; + marker?: number; location: IRichLocation | undefined; } +/** + * Gets the TTY marker ID for either starting or ending + * an ITestOutputMessage.marker of the given ID. + */ +export const getMarkId = (marker: number, start: boolean) => `${start ? 's' : 'e'}${marker}`; + export namespace ITestOutputMessage { export interface Serialized { message: string; @@ -326,38 +334,34 @@ export const enum TestItemExpandState { } /** - * TestItem-like shape, butm with an ID and children as strings. + * TestItem-like shape, but with an ID and children as strings. */ export interface InternalTestItem { /** Controller ID from whence this test came */ controllerId: string; /** Expandability state */ expand: TestItemExpandState; - /** Parent ID, if any */ - parent: string | null; /** Raw test item properties */ item: ITestItem; } export namespace InternalTestItem { export interface Serialized { - controllerId: string; expand: TestItemExpandState; - parent: string | null; item: ITestItem.Serialized; } export const serialize = (item: InternalTestItem): Serialized => ({ - controllerId: item.controllerId, expand: item.expand, - parent: item.parent, item: ITestItem.serialize(item.item) }); export const deserialize = (serialized: Serialized): InternalTestItem => ({ - controllerId: serialized.controllerId, + // the `controllerId` is derived from the test.item.extId. It's redundant + // in the non-serialized InternalTestItem too, but there just because it's + // checked against in many hot paths. + controllerId: TestId.root(serialized.item.extId), expand: serialized.expand, - parent: serialized.parent, item: ITestItem.deserialize(serialized.item) }); } @@ -462,6 +466,14 @@ export namespace TestResultItem { tasks: original.tasks.map(ITestTaskState.serialize), retired: original.retired, }); + + export const deserialize = (serialized: Serialized): TestResultItem => ({ + ...InternalTestItem.deserialize(serialized), + ownComputedState: serialized.ownComputedState, + computedState: serialized.computedState, + tasks: serialized.tasks.map(ITestTaskState.deserialize), + retired: true, + }); } export interface ISerializedTestResults { @@ -677,13 +689,14 @@ export abstract class AbstractIncrementalTestCollection; /** * Gets the range where a test ID is displayed, in the given URI. @@ -59,49 +59,12 @@ export interface ITestDecoration { export class TestDecorations { public value: T[] = []; - - private _idMap?: Map; - - /** - * Looks up a decoration by ID. - */ - public get(decorationId: string) { - if (this._idMap) { - return this._idMap.get(decorationId); - } else if (this.value.length > 16) { - this._idMap = new Map(); - for (const value of this.value) { this._idMap.set(value.id, value); } - return this._idMap.get(decorationId); - } else { - return this.value.find(v => v.id === decorationId); - } - } - /** * Adds a new value to the decorations. */ public push(value: T) { const searchIndex = binarySearch(this.value, value, (a, b) => a.line - b.line); this.value.splice(searchIndex < 0 ? ~searchIndex : searchIndex, 0, value); - this._idMap = undefined; - } - - /** - * Finds the value that exists on the given line, if any. - */ - public findOnLine(line: number, predicate: (value: T) => boolean): T | undefined { - const lineStart = binarySearch<{ line: number }>(this.value, { line }, (a, b) => a.line - b.line); - if (lineStart < 0) { - return undefined; - } - - for (let i = lineStart; i < this.value.length && this.value[i].line === line; i++) { - if (predicate(this.value[i])) { - return this.value[i]; - } - } - - return undefined; } /** diff --git a/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByLocation.test.ts b/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByLocation.test.ts index af584d316c4..48c5506112e 100644 --- a/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByLocation.test.ts +++ b/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByLocation.test.ts @@ -55,10 +55,10 @@ suite('Workbench - Testing Explorer Hierarchal by Location Projection', () => { harness.flush(); harness.pushDiff({ op: TestDiffOpType.Add, - item: { controllerId: 'ctrl2', parent: null, expand: TestItemExpandState.Expanded, item: new TestTestItem('ctrl2', 'c', 'c').toTestItem() }, + item: { controllerId: 'ctrl2', expand: TestItemExpandState.Expanded, item: new TestTestItem(new TestId(['ctrlId2']), 'c').toTestItem() }, }, { op: TestDiffOpType.Add, - item: { controllerId: 'ctrl2', parent: new TestId(['ctrl2', 'c']).toString(), expand: TestItemExpandState.NotExpandable, item: new TestTestItem('ctrl2', 'c-a', 'ca').toTestItem() }, + item: { controllerId: 'ctrl2', expand: TestItemExpandState.NotExpandable, item: new TestTestItem(new TestId(['ctrlId2', 'id-c']), 'ca').toTestItem() }, }); assert.deepStrictEqual(harness.flush(), [ @@ -76,7 +76,7 @@ suite('Workbench - Testing Explorer Hierarchal by Location Projection', () => { { e: 'b' } ]); - harness.c.root.children.get('id-a')!.children.add(new TestTestItem('ctrlId', 'ac', 'ac')); + harness.c.root.children.get('id-a')!.children.add(new TestTestItem(new TestId(['ctrlId', 'id-a', 'id-ac']), 'ac')); assert.deepStrictEqual(harness.flush(), [ { e: 'a', children: [{ e: 'aa' }, { e: 'ab' }, { e: 'ac' }] }, @@ -117,7 +117,6 @@ suite('Workbench - Testing Explorer Hierarchal by Location Projection', () => { tags: [], uri: undefined, }, - parent: 'id-root', tasks: [], ownComputedState: state, computedState: state, diff --git a/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByName.test.ts b/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByName.test.ts index ec4424b8edd..05f27076a0a 100644 --- a/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByName.test.ts +++ b/src/vs/workbench/contrib/testing/test/browser/explorerProjections/hierarchalByName.test.ts @@ -8,10 +8,10 @@ import { AbstractTreeViewState } from 'vs/base/browser/ui/tree/abstractTree'; import { Emitter } from 'vs/base/common/event'; import { HierarchicalByNameProjection } from 'vs/workbench/contrib/testing/browser/explorerProjections/hierarchalByName'; import { TestDiffOpType, TestItemExpandState } from 'vs/workbench/contrib/testing/common/testTypes'; -import { TestId } from 'vs/workbench/contrib/testing/common/testId'; import { TestResultItemChange } from 'vs/workbench/contrib/testing/common/testResult'; import { TestTreeTestHarness } from 'vs/workbench/contrib/testing/test/browser/testObjectTree'; import { TestTestItem } from 'vs/workbench/contrib/testing/test/common/testStubs'; +import { TestId } from 'vs/workbench/contrib/testing/common/testId'; suite('Workbench - Testing Explorer Hierarchal by Name Projection', () => { let harness: TestTreeTestHarness; @@ -44,10 +44,10 @@ suite('Workbench - Testing Explorer Hierarchal by Name Projection', () => { harness.flush(); harness.pushDiff({ op: TestDiffOpType.Add, - item: { controllerId: 'ctrl2', parent: null, expand: TestItemExpandState.Expanded, item: new TestTestItem('ctrl2', 'c', 'root2').toTestItem() }, + item: { controllerId: 'ctrl2', expand: TestItemExpandState.Expanded, item: new TestTestItem(new TestId(['ctrl2']), 'root2').toTestItem() }, }, { op: TestDiffOpType.Add, - item: { controllerId: 'ctrl2', parent: new TestId(['ctrl2', 'c']).toString(), expand: TestItemExpandState.NotExpandable, item: new TestTestItem('ctrl2', 'c-a', 'c', undefined).toTestItem() }, + item: { controllerId: 'ctrl2', expand: TestItemExpandState.NotExpandable, item: new TestTestItem(new TestId(['ctrl2', 'id-c']), 'c', undefined).toTestItem() }, }); assert.deepStrictEqual(harness.flush(), [ @@ -59,7 +59,7 @@ suite('Workbench - Testing Explorer Hierarchal by Name Projection', () => { test('updates nodes if they add children', async () => { harness.flush(); - harness.c.root.children.get('id-a')!.children.add(new TestTestItem('ctrl2', 'ac', 'ac')); + harness.c.root.children.get('id-a')!.children.add(new TestTestItem(new TestId(['ctrlId', 'id-a', 'id-ac']), 'ac')); assert.deepStrictEqual(harness.flush(), [ { e: 'aa' }, @@ -81,7 +81,7 @@ suite('Workbench - Testing Explorer Hierarchal by Name Projection', () => { test('swaps when node is no longer leaf', async () => { harness.flush(); - harness.c.root.children.get('id-b')!.children.add(new TestTestItem('ctrl2', 'ba', 'ba')); + harness.c.root.children.get('id-b')!.children.add(new TestTestItem(new TestId(['ctrlId', 'id-b', 'id-ba']), 'ba')); assert.deepStrictEqual(harness.flush(), [ { e: 'aa' }, diff --git a/src/vs/workbench/contrib/testing/test/common/testStubs.ts b/src/vs/workbench/contrib/testing/test/common/testStubs.ts index f05f2a55214..a8770a29e15 100644 --- a/src/vs/workbench/contrib/testing/test/common/testStubs.ts +++ b/src/vs/workbench/contrib/testing/test/common/testStubs.ts @@ -35,18 +35,21 @@ export class TestTestItem implements ITestItemLike { return this.api.parent; } - public api: ITestItemApi = { controllerId: this.controllerId }; + public get id() { + return this._extId.localId; + } + + public api: ITestItemApi = { controllerId: this._extId.controllerId }; public children = createTestItemChildren(this.api, i => i.api, TestTestItem); constructor( - public readonly controllerId: string, - public readonly id: string, + private readonly _extId: TestId, label: string, uri?: URI, ) { this.props = { - extId: '', + extId: _extId.toString(), busy: false, description: null, error: null, @@ -69,20 +72,23 @@ export class TestTestItem implements ITestItemLike { public toTestItem(): ITestItem { const props = { ...this.props }; - props.extId = TestId.fromExtHostTestItem(this, this.controllerId).toString(); + props.extId = this._extId.toString(); return props; } } export class TestTestCollection extends TestItemCollection { constructor(controllerId = 'ctrlId') { + const root = new TestTestItem(new TestId([controllerId]), 'root'); + (root as any)._isRoot = true; + super({ controllerId, getApiFor: t => t.api, toITestItem: t => t.toTestItem(), getChildren: t => t.children, getDocumentVersion: () => undefined, - root: new TestTestItem(controllerId, controllerId, 'root'), + root, }); } @@ -111,14 +117,14 @@ export const testStubs = { const collection = new TestTestCollection(); collection.resolveHandler = item => { if (item === undefined) { - const a = new TestTestItem('ctrlId', idPrefix + 'a', 'a', URI.file('/')); + const a = new TestTestItem(new TestId(['ctrlId', 'id-a']), 'a', URI.file('/')); a.canResolveChildren = true; - const b = new TestTestItem('ctrlId', idPrefix + 'b', 'b', URI.file('/')); + const b = new TestTestItem(new TestId(['ctrlId', 'id-b']), 'b', URI.file('/')); collection.root.children.add(a); collection.root.children.add(b); } else if (item.id === idPrefix + 'a') { - item.children.add(new TestTestItem('ctrlId', idPrefix + 'aa', 'aa', URI.file('/'))); - item.children.add(new TestTestItem('ctrlId', idPrefix + 'ab', 'ab', URI.file('/'))); + item.children.add(new TestTestItem(new TestId(['ctrlId', 'id-a', 'id-aa']), 'aa', URI.file('/'))); + item.children.add(new TestTestItem(new TestId(['ctrlId', 'id-a', 'id-ab']), 'ab', URI.file('/'))); } }; diff --git a/src/vs/workbench/contrib/themes/browser/themes.contribution.ts b/src/vs/workbench/contrib/themes/browser/themes.contribution.ts index adb89a15354..8a094b654d6 100644 --- a/src/vs/workbench/contrib/themes/browser/themes.contribution.ts +++ b/src/vs/workbench/contrib/themes/browser/themes.contribution.ts @@ -8,7 +8,7 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { MenuRegistry, MenuId, Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { equalsIgnoreCase } from 'vs/base/common/strings'; import { Registry } from 'vs/platform/registry/common/platform'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IWorkbenchThemeService, IWorkbenchTheme, ThemeSettingTarget, IWorkbenchColorTheme, IWorkbenchFileIconTheme, IWorkbenchProductIconTheme, ThemeSettings } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { VIEWLET_ID, IExtensionsViewPaneContainer } from 'vs/workbench/contrib/extensions/common/extensions'; import { IExtensionGalleryService, IExtensionManagementService, IGalleryExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -358,7 +358,7 @@ registerAction2(class extends Action2 { super({ id: SelectColorThemeCommandId, title: { value: localize('selectTheme.label', "Color Theme"), original: 'Color Theme' }, - category: CATEGORIES.Preferences, + category: Categories.Preferences, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, @@ -400,7 +400,7 @@ registerAction2(class extends Action2 { super({ id: SelectFileIconThemeCommandId, title: { value: localize('selectIconTheme.label', "File Icon Theme"), original: 'File Icon Theme' }, - category: CATEGORIES.Preferences, + category: Categories.Preferences, f1: true }); } @@ -435,7 +435,7 @@ registerAction2(class extends Action2 { super({ id: SelectProductIconThemeCommandId, title: { value: localize('selectProductIconTheme.label', "Product Icon Theme"), original: 'Product Icon Theme' }, - category: CATEGORIES.Preferences, + category: Categories.Preferences, f1: true }); } @@ -546,7 +546,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.generateColorTheme', title: { value: localize('generateColorTheme.label', "Generate Color Theme From Current Settings"), original: 'Generate Color Theme From Current Settings' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -600,7 +600,7 @@ registerAction2(class extends Action2 { super({ id: toggleLightDarkThemesCommandId, title: { value: localize('toggleLightDarkThemes.label', "Toggle between Light/Dark Themes"), original: 'Toggle between Light/Dark Themes' }, - category: CATEGORIES.Preferences, + category: Categories.Preferences, f1: true, }); } diff --git a/src/vs/workbench/contrib/timeline/browser/timeline.contribution.ts b/src/vs/workbench/contrib/timeline/browser/timeline.contribution.ts index 8aae19bc264..f04d0d41651 100644 --- a/src/vs/workbench/contrib/timeline/browser/timeline.contribution.ts +++ b/src/vs/workbench/contrib/timeline/browser/timeline.contribution.ts @@ -5,7 +5,7 @@ import { localize } from 'vs/nls'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Registry } from 'vs/platform/registry/common/platform'; import { IViewsRegistry, IViewDescriptor, Extensions as ViewExtensions } from 'vs/workbench/common/views'; import { VIEW_CONTAINER } from 'vs/workbench/contrib/files/browser/explorerViewlet'; @@ -99,4 +99,4 @@ MenuRegistry.appendMenuItem(MenuId.TimelineTitle, { icon: timelineFilter }); -registerSingleton(ITimelineService, TimelineService, true); +registerSingleton(ITimelineService, TimelineService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts b/src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts index 9517be6e2e0..8b83776c6b7 100644 --- a/src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts +++ b/src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts @@ -17,7 +17,6 @@ import { generateTokensCSSForColorMap } from 'vs/editor/common/languages/support import { ILanguageService } from 'vs/editor/common/languages/language'; import * as nls from 'vs/nls'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IProductService } from 'vs/platform/product/common/productService'; @@ -63,10 +62,7 @@ export class ReleaseNotesManager { }); } - public async show( - accessor: ServicesAccessor, - version: string - ): Promise { + public async show(version: string): Promise { const releaseNoteText = await this.loadReleaseNotes(version); this._lastText = releaseNoteText; const html = await this.renderBody(releaseNoteText); diff --git a/src/vs/workbench/contrib/update/browser/update.contribution.ts b/src/vs/workbench/contrib/update/browser/update.contribution.ts index f77d43ba166..dfc159cd59d 100644 --- a/src/vs/workbench/contrib/update/browser/update.contribution.ts +++ b/src/vs/workbench/contrib/update/browser/update.contribution.ts @@ -7,9 +7,9 @@ import 'vs/platform/update/common/update.config.contribution'; import { localize } from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { IWorkbenchActionRegistry, Extensions as ActionExtensions, CATEGORIES } from 'vs/workbench/common/actions'; -import { SyncActionDescriptor, MenuRegistry, MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; -import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, CheckForVSCodeUpdateAction, CONTEXT_UPDATE_STATE, SwitchProductQualityContribution } from 'vs/workbench/contrib/update/browser/update'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; +import { MenuRegistry, MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; +import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, CONTEXT_UPDATE_STATE, SwitchProductQualityContribution, RELEASE_NOTES_URL } from 'vs/workbench/contrib/update/browser/update'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import product from 'vs/platform/product/common/product'; import { IUpdateService, StateType } from 'vs/platform/update/common/update'; @@ -17,21 +17,47 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation import { isWindows } from 'vs/base/common/platform'; import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; import { mnemonicButtonLabel } from 'vs/base/common/labels'; +import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/common/update'; const workbench = Registry.as(WorkbenchExtensions.Workbench); -workbench.registerWorkbenchContribution(ProductContribution, 'ProductContribution', LifecyclePhase.Restored); -workbench.registerWorkbenchContribution(UpdateContribution, 'UpdateContribution', LifecyclePhase.Restored); -workbench.registerWorkbenchContribution(SwitchProductQualityContribution, 'SwitchProductQualityContribution', LifecyclePhase.Restored); +workbench.registerWorkbenchContribution(ProductContribution, LifecyclePhase.Restored); +workbench.registerWorkbenchContribution(UpdateContribution, LifecyclePhase.Restored); +workbench.registerWorkbenchContribution(SwitchProductQualityContribution, LifecyclePhase.Restored); -const actionRegistry = Registry.as(ActionExtensions.WorkbenchActions); +// Release notes -// Editor -actionRegistry - .registerWorkbenchAction(SyncActionDescriptor.from(ShowCurrentReleaseNotesAction), `${product.nameShort}: Show Release Notes`, product.nameShort); +registerAction2(ShowCurrentReleaseNotesAction); -actionRegistry - .registerWorkbenchAction(SyncActionDescriptor.from(CheckForVSCodeUpdateAction), `${product.nameShort}: Check for Update`, product.nameShort, CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle)); +MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, { + group: '1_welcome', + command: { + id: ShowCurrentReleaseNotesActionId, + title: localize({ key: 'miReleaseNotes', comment: ['&& denotes a mnemonic'] }, "&&Release Notes") + }, + when: RELEASE_NOTES_URL, + order: 5 +}); + +// Update + +export class CheckForUpdateAction extends Action2 { + + constructor() { + super({ + id: 'update.checkForUpdate', + title: { value: localize('checkForUpdates', "Check for Updates..."), original: 'Check for Updates...' }, + category: { value: product.nameShort, original: product.nameShort }, + f1: true, + precondition: CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle), + }); + } + + async run(accessor: ServicesAccessor): Promise { + const updateService = accessor.get(IUpdateService); + return updateService.checkForUpdates(true); + } +} class DownloadUpdateAction extends Action2 { constructor() { @@ -81,29 +107,18 @@ class RestartToUpdateAction extends Action2 { } } +registerAction2(CheckForUpdateAction); registerAction2(DownloadUpdateAction); registerAction2(InstallUpdateAction); registerAction2(RestartToUpdateAction); -// Menu -if (ShowCurrentReleaseNotesAction.AVAILABE) { - MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, { - group: '1_welcome', - command: { - id: ShowCurrentReleaseNotesAction.ID, - title: localize({ key: 'miReleaseNotes', comment: ['&& denotes a mnemonic'] }, "&&Release Notes") - }, - order: 5 - }); -} - if (isWindows) { class DeveloperApplyUpdateAction extends Action2 { constructor() { super({ id: '_update.applyupdate', title: { value: localize('applyUpdate', "Apply Update..."), original: 'Apply Update...' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, precondition: CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle) }); diff --git a/src/vs/workbench/contrib/update/browser/update.ts b/src/vs/workbench/contrib/update/browser/update.ts index 1ff40d85b54..4b4db5cfb3f 100644 --- a/src/vs/workbench/contrib/update/browser/update.ts +++ b/src/vs/workbench/contrib/update/browser/update.ts @@ -23,7 +23,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { RawContextKey, IContextKey, IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { MenuRegistry, MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ShowCurrentReleaseNotesActionId, CheckForVSCodeUpdateActionId } from 'vs/workbench/contrib/update/common/update'; +import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/common/update'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IProductService } from 'vs/platform/product/common/productService'; import product from 'vs/platform/product/common/product'; @@ -33,7 +33,8 @@ import { Promises } from 'vs/base/common/async'; import { IUserDataSyncWorkbenchService } from 'vs/workbench/services/userDataSync/common/userDataSync'; import { Event } from 'vs/base/common/event'; -export const CONTEXT_UPDATE_STATE = new RawContextKey('updateState', StateType.Idle); +export const CONTEXT_UPDATE_STATE = new RawContextKey('updateState', StateType.Uninitialized); +export const RELEASE_NOTES_URL = new RawContextKey('releaseNotesUrl', ''); let releaseNotesManager: ReleaseNotesManager | undefined = undefined; @@ -42,7 +43,7 @@ function showReleaseNotes(instantiationService: IInstantiationService, version: releaseNotesManager = instantiationService.createInstance(ReleaseNotesManager); } - return instantiationService.invokeFunction(accessor => releaseNotesManager!.show(accessor, version)); + return releaseNotesManager.show(version); } export class OpenLatestReleaseNotesInBrowserAction extends Action { @@ -104,19 +105,32 @@ export class ShowReleaseNotesAction extends AbstractShowReleaseNotesAction { } } -export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesAction { +export class ShowCurrentReleaseNotesAction extends Action2 { - static readonly ID = ShowCurrentReleaseNotesActionId; - static readonly LABEL = nls.localize('showReleaseNotes', "Show Release Notes"); - static readonly AVAILABE = !!product.releaseNotesUrl; + constructor() { + super({ + id: ShowCurrentReleaseNotesActionId, + title: { value: nls.localize('showReleaseNotes', "Show Release Notes"), original: 'Show Release Notes' }, + category: { value: product.nameShort, original: product.nameShort }, + f1: true, + precondition: RELEASE_NOTES_URL, + }); + } - constructor( - id = ShowCurrentReleaseNotesAction.ID, - label = ShowCurrentReleaseNotesAction.LABEL, - @IInstantiationService instantiationService: IInstantiationService, - @IProductService productService: IProductService - ) { - super(id, label, productService.version, instantiationService); + async run(accessor: ServicesAccessor): Promise { + const instantiationService = accessor.get(IInstantiationService); + const productService = accessor.get(IProductService); + + try { + await showReleaseNotes(instantiationService, productService.version); + } catch (err) { + const action = instantiationService.createInstance(OpenLatestReleaseNotesInBrowserAction); + try { + await action.run(); + } catch (err2) { + throw new Error(`${err.message} and ${err2.message}`); + } + } } } @@ -156,8 +170,14 @@ export class ProductContribution implements IWorkbenchContribution { @IOpenerService openerService: IOpenerService, @IConfigurationService configurationService: IConfigurationService, @IHostService hostService: IHostService, - @IProductService productService: IProductService + @IProductService productService: IProductService, + @IContextKeyService contextKeyService: IContextKeyService, ) { + if (productService.releaseNotesUrl) { + const releaseNotesUrlKey = RELEASE_NOTES_URL.bindTo(contextKeyService); + releaseNotesUrlKey.set(productService.releaseNotesUrl); + } + hostService.hadLastFocus().then(async hadLastFocus => { if (!hadLastFocus) { return; @@ -604,21 +624,3 @@ export class SwitchProductQualityContribution extends Disposable implements IWor } } } - -export class CheckForVSCodeUpdateAction extends Action { - - static readonly ID = CheckForVSCodeUpdateActionId; - static LABEL = nls.localize('checkForUpdates', "Check for Updates..."); - - constructor( - id: string, - label: string, - @IUpdateService private readonly updateService: IUpdateService, - ) { - super(id, label, undefined, true); - } - - override run(): Promise { - return this.updateService.checkForUpdates(true); - } -} diff --git a/src/vs/workbench/contrib/update/common/update.ts b/src/vs/workbench/contrib/update/common/update.ts index 5b9303f6eac..c224d76703a 100644 --- a/src/vs/workbench/contrib/update/common/update.ts +++ b/src/vs/workbench/contrib/update/common/update.ts @@ -4,4 +4,3 @@ *--------------------------------------------------------------------------------------------*/ export const ShowCurrentReleaseNotesActionId = 'update.showCurrentReleaseNotes'; -export const CheckForVSCodeUpdateActionId = 'update.checkForVSCodeUpdate'; \ No newline at end of file diff --git a/src/vs/workbench/contrib/url/browser/url.contribution.ts b/src/vs/workbench/contrib/url/browser/url.contribution.ts index 8f0486abd0b..994320e7863 100644 --- a/src/vs/workbench/contrib/url/browser/url.contribution.ts +++ b/src/vs/workbench/contrib/url/browser/url.contribution.ts @@ -17,7 +17,7 @@ import { manageTrustedDomainSettingsCommand } from 'vs/workbench/contrib/url/bro import { TrustedDomainsFileSystemProvider } from 'vs/workbench/contrib/url/browser/trustedDomainsFileSystemProvider'; import { OpenerValidatorContributions } from 'vs/workbench/contrib/url/browser/trustedDomainsValidator'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration'; @@ -27,7 +27,7 @@ class OpenUrlAction extends Action2 { super({ id: 'workbench.action.url.openUrl', title: { value: localize('openUrl', "Open URL"), original: 'Open URL' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -64,17 +64,14 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, { Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution( OpenerValidatorContributions, - 'OpenerValidatorContributions', LifecyclePhase.Restored ); Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution( TrustedDomainsFileSystemProvider, - 'TrustedDomainsFileSystemProvider', LifecyclePhase.Ready ); Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution( ExternalUriResolverContribution, - 'ExternalUriResolverContribution', LifecyclePhase.Ready ); diff --git a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.ts b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.ts index 665ae46d09c..b069dea82cd 100644 --- a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.ts +++ b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.ts @@ -10,4 +10,4 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle import './userDataProfileActions'; const workbenchRegistry = Registry.as(Extensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(UserDataProfilesWorkbenchContribution, 'UserDataProfilesWorkbenchContribution', LifecyclePhase.Ready); +workbenchRegistry.registerWorkbenchContribution(UserDataProfilesWorkbenchContribution, LifecyclePhase.Ready); diff --git a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.ts b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.ts index a196b4d7018..848594527db 100644 --- a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.ts +++ b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.ts @@ -19,11 +19,15 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { RenameProfileAction } from 'vs/workbench/contrib/userDataProfile/browser/userDataProfileActions'; import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { CURRENT_PROFILE_CONTEXT, HAS_PROFILES_CONTEXT, IS_CURRENT_PROFILE_TRANSIENT_CONTEXT, IUserDataProfileManagementService, IUserDataProfileService, ManageProfilesSubMenu, PROFILES_ENABLEMENT_CONTEXT, PROFILES_TTILE } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { CURRENT_PROFILE_CONTEXT, HAS_PROFILES_CONTEXT, IS_CURRENT_PROFILE_TRANSIENT_CONTEXT, IUserDataProfileImportExportService, IUserDataProfileManagementService, IUserDataProfileService, ManageProfilesSubMenu, PROFILES_CATEGORY, PROFILES_ENABLEMENT_CONTEXT, PROFILES_TTILE, PROFILE_EXTENSION, PROFILE_FILTER } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { charCount } from 'vs/base/common/strings'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; +import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; +import { joinPath } from 'vs/base/common/resources'; +import { Codicon } from 'vs/base/common/codicons'; export class UserDataProfilesWorkbenchContribution extends Disposable implements IWorkbenchContribution { @@ -153,17 +157,20 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements this.currentprofileActionsDisposable.value = new DisposableStore(); this.currentprofileActionsDisposable.value.add(this.registerUpdateCurrentProfileShortNameAction()); this.currentprofileActionsDisposable.value.add(this.registerRenameCurrentProfileAction()); + this.currentprofileActionsDisposable.value.add(this.registerExportCurrentProfileAction()); } private registerUpdateCurrentProfileShortNameAction(): IDisposable { const that = this; return registerAction2(class UpdateCurrentProfileShortName extends Action2 { constructor() { + const shortName = that.userDataProfileService.getShortName(that.userDataProfileService.currentProfile); + const themeIcon = ThemeIcon.fromString(shortName); super({ id: `workbench.profiles.actions.updateCurrentProfileShortName`, title: { - value: localize('change short name profile', "Change Short Name ({0})...", that.userDataProfileService.getShortName(that.userDataProfileService.currentProfile)), - original: `Change Short Name (${that.userDataProfileService.currentProfile.shortName})...` + value: localize('change short name profile', "Change Short Name ({0})...", themeIcon?.id ?? shortName), + original: `Change Short Name (${themeIcon?.id ?? shortName})...` }, menu: [ { @@ -181,10 +188,20 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements const profile = that.userDataProfileService.currentProfile; const shortName = await quickInputService.input({ - value: profile.shortName, + value: that.userDataProfileService.getShortName(profile), title: localize('change short name', "Change Short Name..."), validateInput: async (value: string) => { - if (profile.shortName !== value && !ThemeIcon.fromString(value) && charCount(value) > 2) { + if (profile.shortName === value) { + return undefined; + } + const themeIcon = ThemeIcon.fromString(value); + if (themeIcon) { + if (Codicon.getAll().some(c => c.id === themeIcon.id)) { + return undefined; + } + return localize('invalid codicon', "Invalid codicon. Please use a valid codicon id."); + } + if (charCount(value) > 2) { return localize('invalid short name', "Short name should be at most 2 characters long."); } return undefined; @@ -227,4 +244,64 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements }); } + private registerExportCurrentProfileAction(): IDisposable { + const that = this; + const disposables = new DisposableStore(); + const id = 'workbench.profiles.actions.exportProfile'; + disposables.add(registerAction2(class ExportProfileAction extends Action2 { + constructor() { + super({ + id, + title: { + value: localize('export profile', "Export ({0})...", that.userDataProfileService.currentProfile.name), + original: `Export (${that.userDataProfileService.currentProfile.name})...` + }, + category: PROFILES_CATEGORY, + menu: [ + { + id: ManageProfilesSubMenu, + group: '4_import_export_profiles', + when: PROFILES_ENABLEMENT_CONTEXT, + order: 1 + }, { + id: MenuId.CommandPalette + } + ] + }); + } + + async run(accessor: ServicesAccessor) { + const textFileService = accessor.get(ITextFileService); + const fileDialogService = accessor.get(IFileDialogService); + const userDataProfileImportExportService = accessor.get(IUserDataProfileImportExportService); + const notificationService = accessor.get(INotificationService); + + const profileLocation = await fileDialogService.showSaveDialog({ + title: localize('export profile dialog', "Save Profile"), + filters: PROFILE_FILTER, + defaultUri: joinPath(await fileDialogService.defaultFilePath(), `profile.${PROFILE_EXTENSION}`), + }); + + if (!profileLocation) { + return; + } + + const profile = await userDataProfileImportExportService.exportProfile({ skipComments: true }); + await textFileService.create([{ resource: profileLocation, value: JSON.stringify(profile), options: { overwrite: true } }]); + + notificationService.info(localize('export success', "{0}: Exported successfully.", PROFILES_CATEGORY)); + } + })); + disposables.add(MenuRegistry.appendMenuItem(MenuId.MenubarShare, { + command: { + id, + title: { + value: localize('export settings profile', "Export Settings Profile ({0})...", that.userDataProfileService.currentProfile.name), + original: `Export Settings Profile (${that.userDataProfileService.currentProfile.name})...` + } + }, + })); + return disposables; + } + } diff --git a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.ts b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.ts index dbdb4fea927..df6317f8117 100644 --- a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.ts +++ b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.ts @@ -5,19 +5,17 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { DisposableStore } from 'vs/base/common/lifecycle'; -import { joinPath } from 'vs/base/common/resources'; import { localize } from 'vs/nls'; -import { Action2, IMenuService, MenuId, registerAction2 } from 'vs/platform/actions/common/actions'; +import { Action2, IMenuService, registerAction2 } from 'vs/platform/actions/common/actions'; import { IDialogService, IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IFileService } from 'vs/platform/files/common/files'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { QuickPickItem, IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; import { asJson, asText, IRequestService } from 'vs/platform/request/common/request'; -import { IUserDataProfileTemplate, isUserDataProfileTemplate, IUserDataProfileManagementService, IUserDataProfileImportExportService, PROFILES_CATEGORY, PROFILE_EXTENSION, PROFILE_FILTER, ManageProfilesSubMenu, IUserDataProfileService, PROFILES_ENABLEMENT_CONTEXT, HAS_PROFILES_CONTEXT, MANAGE_PROFILES_ACTION_ID } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { IUserDataProfileTemplate, isUserDataProfileTemplate, IUserDataProfileManagementService, IUserDataProfileImportExportService, PROFILES_CATEGORY, ManageProfilesSubMenu, IUserDataProfileService, PROFILES_ENABLEMENT_CONTEXT, HAS_PROFILES_CONTEXT, MANAGE_PROFILES_ACTION_ID, PROFILE_FILTER } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { compare } from 'vs/base/common/strings'; @@ -136,36 +134,50 @@ registerAction2(class CreateProfileAction extends Action2 { const commandService = accessor.get(ICommandService); const pick = await quickInputService.pick( [{ + id: CreateEmptyProfileAction.ID, + label: CreateEmptyProfileAction.TITLE.value, + }, { + type: 'separator', + }, { id: CreateFromCurrentProfileAction.ID, label: CreateFromCurrentProfileAction.TITLE.value, }, { - id: CreateEmptyProfileAction.ID, - label: CreateEmptyProfileAction.TITLE.value, + id: CreateFromTemplateAction.ID, + label: CreateFromTemplateAction.TITLE.value, + }, { + type: 'separator', + }, { + id: CreateTransientProfileAction.ID, + label: CreateTransientProfileAction.TITLE.value, }], { hideInput: true, canPickMany: false, title: localize('create settings profile', "{0}: Create...", PROFILES_CATEGORY) }); - if (pick) { + if (pick?.id) { return commandService.executeCommand(pick.id); } } }); -registerAction2(class CreateTransientProfileAction extends Action2 { +class CreateTransientProfileAction extends Action2 { + static readonly ID = 'workbench.profiles.actions.createTemporaryProfile'; + static readonly TITLE = { + value: localize('create temporary profile', "Create a Temporary Settings Profile"), + original: 'Create a Temporary Settings Profile' + }; constructor() { super({ - id: 'workbench.profiles.actions.createTemporaryProfile', - title: { - value: localize('create temporary profile', "Create a Temporary Settings Profile"), - original: 'Create a Temporary Settings Profile' - }, + id: CreateTransientProfileAction.ID, + title: CreateTransientProfileAction.TITLE, category: PROFILES_CATEGORY, f1: true, - precondition: PROFILES_ENABLEMENT_CONTEXT + precondition: PROFILES_ENABLEMENT_CONTEXT, }); } async run(accessor: ServicesAccessor) { return accessor.get(IUserDataProfileManagementService).createAndEnterTransientProfile(); } -}); +} + +registerAction2(CreateTransientProfileAction); export class RenameProfileAction extends Action2 { static readonly ID = 'workbench.profiles.actions.renameProfile'; @@ -372,70 +384,19 @@ registerAction2(class SwitchProfileAction extends Action2 { } }); -registerAction2(class ExportProfileAction extends Action2 { +class ImportProfileAction extends Action2 { + static readonly ID = 'workbench.profiles.actions.importProfile'; + static readonly TITLE = { + value: localize('import profile', "Import from ..."), + original: 'Import...' + }; constructor() { super({ - id: 'workbench.profiles.actions.exportProfile', - title: { - value: localize('export profile', "Export..."), - original: 'Export...' - }, + id: ImportProfileAction.ID, + title: ImportProfileAction.TITLE, category: PROFILES_CATEGORY, - menu: [ - { - id: ManageProfilesSubMenu, - group: '4_import_export_profiles', - when: PROFILES_ENABLEMENT_CONTEXT, - order: 1 - }, { - id: MenuId.CommandPalette - } - ] - }); - } - - async run(accessor: ServicesAccessor) { - const textFileService = accessor.get(ITextFileService); - const fileDialogService = accessor.get(IFileDialogService); - const userDataProfileImportExportService = accessor.get(IUserDataProfileImportExportService); - const notificationService = accessor.get(INotificationService); - - const profileLocation = await fileDialogService.showSaveDialog({ - title: localize('export profile dialog', "Save Profile"), - filters: PROFILE_FILTER, - defaultUri: joinPath(await fileDialogService.defaultFilePath(), `profile.${PROFILE_EXTENSION}`), - }); - - if (!profileLocation) { - return; - } - - const profile = await userDataProfileImportExportService.exportProfile({ skipComments: true }); - await textFileService.create([{ resource: profileLocation, value: JSON.stringify(profile), options: { overwrite: true } }]); - - notificationService.info(localize('export success', "{0}: Exported successfully.", PROFILES_CATEGORY)); - } -}); - -registerAction2(class ImportProfileAction extends Action2 { - constructor() { - super({ - id: 'workbench.profiles.actions.importProfile', - title: { - value: localize('import profile', "Import..."), - original: 'Import...' - }, - category: PROFILES_CATEGORY, - menu: [ - { - id: ManageProfilesSubMenu, - group: '4_import_export_profiles', - when: PROFILES_ENABLEMENT_CONTEXT, - order: 2 - }, { - id: MenuId.CommandPalette - } - ] + f1: true, + precondition: PROFILES_ENABLEMENT_CONTEXT?.negate(), }); } @@ -463,11 +424,11 @@ registerAction2(class ImportProfileAction extends Action2 { const disposables = new DisposableStore(); const quickPick = disposables.add(quickInputService.createQuickPick()); const updateQuickPickItems = (value?: string) => { - const selectFromFileItem: IQuickPickItem = { label: localize('select from file', "Import from profile file") }; - quickPick.items = value ? [{ label: localize('select from url', "Import from URL"), description: quickPick.value }, selectFromFileItem] : [selectFromFileItem]; + const selectFromFileItem: IQuickPickItem = { label: isSettingProfilesEnabled ? localize('select from file', "Select Settings Profile template file") : localize('import from file', "Import from profile file") }; + quickPick.items = value ? [{ label: isSettingProfilesEnabled ? localize('select from url', "Create from template URL") : localize('import from url', "Import from URL"), description: quickPick.value }, selectFromFileItem] : [selectFromFileItem]; }; - quickPick.title = localize('import profile quick pick title', "Import Settings from a Profile"); - quickPick.placeholder = localize('import profile placeholder', "Provide profile URL or select profile file to import"); + quickPick.title = isSettingProfilesEnabled ? localize('create from profile template quick pick title', "Create from Settings Profile Template") : localize('import profile quick pick title', "Import Settings from a Profile"); + quickPick.placeholder = isSettingProfilesEnabled ? localize('create from profile template placeholder', "Provide a template URL or Select a template file") : localize('import profile placeholder', "Provide profile URL or select profile file to import"); quickPick.ignoreFocusOut = true; disposables.add(quickPick.onDidChangeValue(updateQuickPickItems)); updateQuickPickItems(); @@ -520,7 +481,32 @@ registerAction2(class ImportProfileAction extends Action2 { } } -}); +} +registerAction2(ImportProfileAction); + +class CreateFromTemplateAction extends Action2 { + static readonly ID = 'workbench.profiles.actions.createFromTemplate'; + static readonly TITLE = { + value: localize('create from template profile', "Create from a Settings Profile Template..."), + original: 'Create from a Settings Profile Template...' + }; + constructor() { + super({ + id: CreateFromTemplateAction.ID, + title: CreateFromTemplateAction.TITLE, + category: PROFILES_CATEGORY, + f1: true, + precondition: PROFILES_ENABLEMENT_CONTEXT, + }); + } + + async run(accessor: ServicesAccessor) { + return accessor.get(ICommandService).executeCommand(ImportProfileAction.ID); + } + +} + +registerAction2(CreateFromTemplateAction); // Developer Actions @@ -532,7 +518,7 @@ registerAction2(class CleanupProfilesAction extends Action2 { value: localize('cleanup profile', "Cleanup Settings Profiles"), original: 'Cleanup Profiles' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, precondition: PROFILES_ENABLEMENT_CONTEXT, }); @@ -551,7 +537,7 @@ registerAction2(class ResetWorkspacesAction extends Action2 { value: localize('reset workspaces', "Reset Workspace Settings Profiles Associations"), original: 'Reset Workspace Settings Profiles Associations' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, precondition: PROFILES_ENABLEMENT_CONTEXT, }); diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.contribution.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.contribution.ts index e470b811bc0..64c68ee02e6 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.contribution.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.contribution.ts @@ -69,6 +69,6 @@ class UserDataSyncReportIssueContribution extends Disposable implements IWorkben } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(UserDataSyncWorkbenchContribution, 'UserDataSyncWorkbenchContribution', LifecyclePhase.Restored); -workbenchRegistry.registerWorkbenchContribution(UserDataSyncTrigger, 'UserDataSyncTrigger', LifecyclePhase.Eventually); -workbenchRegistry.registerWorkbenchContribution(UserDataSyncReportIssueContribution, 'UserDataSyncReportIssueContribution', LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(UserDataSyncWorkbenchContribution, LifecyclePhase.Restored); +workbenchRegistry.registerWorkbenchContribution(UserDataSyncTrigger, LifecyclePhase.Eventually); +workbenchRegistry.registerWorkbenchContribution(UserDataSyncReportIssueContribution, LifecyclePhase.Eventually); diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 023bf17fe4c..dda7b8167bd 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -49,7 +49,7 @@ import { UserDataSyncDataViews } from 'vs/workbench/contrib/userDataSync/browser import { IUserDataSyncWorkbenchService, getSyncAreaLabel, AccountStatus, CONTEXT_SYNC_STATE, CONTEXT_SYNC_ENABLEMENT, CONTEXT_ACCOUNT_STATE, CONFIGURE_SYNC_COMMAND_ID, SHOW_SYNC_LOG_COMMAND_ID, SYNC_VIEW_CONTAINER_ID, SYNC_TITLE, SYNC_VIEW_ICON, CONTEXT_HAS_CONFLICTS } from 'vs/workbench/services/userDataSync/common/userDataSync'; import { Codicon } from 'vs/base/common/codicons'; import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IUserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit'; import { MarkdownString } from 'vs/base/common/htmlContent'; import { IHostService } from 'vs/workbench/services/host/browser/host'; @@ -609,7 +609,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo id: SyncResource.GlobalState, label: getSyncAreaLabel(SyncResource.GlobalState), }]; - if (!this.environmentService.isBuilt || (this.productService.enableSyncingProfiles && this.configurationService.getValue('settingsSync.enableSyncingProfiles'))) { + if (!this.environmentService.isBuilt || this.productService.enableSyncingProfiles) { result.push({ id: SyncResource.Profiles, label: getSyncAreaLabel(SyncResource.Profiles), @@ -1127,7 +1127,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo super({ id: 'workbench.userDataSync.actions.help', title: { value: SYNC_TITLE, original: 'Settings Sync' }, - category: CATEGORIES.Help, + category: Categories.Help, menu: [{ id: MenuId.CommandPalette, when: ContextKeyExpr.and(CONTEXT_SYNC_STATE.notEqualsTo(SyncStatus.Uninitialized)), @@ -1139,7 +1139,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo MenuRegistry.appendMenuItem(MenuId.ViewContainerTitle, { command: { id: 'workbench.userDataSync.actions.help', - title: CATEGORIES.Help.value + title: Categories.Help.value }, when: ContextKeyExpr.equals('viewContainer', SYNC_VIEW_CONTAINER_ID), group: '1_help', @@ -1152,7 +1152,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo constructor() { super({ id: 'workbench.userDataSync.actions.acceptMerges', - title: localize('accept merges title', "Accept Merge"), + title: localize('complete merges title', "Complete Merge"), menu: [{ id: MenuId.EditorContent, when: ContextKeyExpr.and(ctxIsMergeResultEditor, ContextKeyExpr.regex(ctxMergeBaseUri.key, new RegExp(`^${USER_DATA_SYNC_SCHEME}:`))), diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.ts index 210601cf0db..2fd68ddc29c 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSyncTrigger.ts @@ -65,4 +65,3 @@ export class UserDataSyncTrigger extends Disposable implements IWorkbenchContrib return undefined; } } - 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 2cd27d2465b..6840848e322 100644 --- a/src/vs/workbench/contrib/userDataSync/electron-sandbox/userDataSync.contribution.ts +++ b/src/vs/workbench/contrib/userDataSync/electron-sandbox/userDataSync.contribution.ts @@ -29,7 +29,7 @@ class UserDataSyncServicesContribution implements IWorkbenchContribution { } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(UserDataSyncServicesContribution, 'UserDataSyncServicesContribution', LifecyclePhase.Starting); +workbenchRegistry.registerWorkbenchContribution(UserDataSyncServicesContribution, LifecyclePhase.Starting); registerAction2(class OpenSyncBackupsFolder extends Action2 { constructor() { diff --git a/src/vs/workbench/contrib/watermark/browser/watermark.ts b/src/vs/workbench/contrib/watermark/browser/watermark.ts index 592b032dfee..d20cf69cc08 100644 --- a/src/vs/workbench/contrib/watermark/browser/watermark.ts +++ b/src/vs/workbench/contrib/watermark/browser/watermark.ts @@ -210,7 +210,7 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WatermarkContribution, 'WatermarkContribution', LifecyclePhase.Restored); + .registerWorkbenchContribution(WatermarkContribution, LifecyclePhase.Restored); Registry.as(ConfigurationExtensions.Configuration) .registerConfiguration({ diff --git a/src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts b/src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts index 2b1bb413023..9ac2a8ce935 100644 --- a/src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts +++ b/src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWebviewService } from 'vs/workbench/contrib/webview/browser/webview'; import { WebviewService } from './webviewService'; -registerSingleton(IWebviewService, WebviewService, true); +registerSingleton(IWebviewService, WebviewService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts index 88266a40eeb..2d7cb9c0866 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts @@ -6,7 +6,6 @@ import { isFirefox } from 'vs/base/browser/browser'; import { addDisposableListener, EventType } from 'vs/base/browser/dom'; import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; -import { IAction } from 'vs/base/common/actions'; import { ThrottledDelayer } from 'vs/base/common/async'; import { streamToBuffer, VSBufferReadableStream } from 'vs/base/common/buffer'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; @@ -17,7 +16,6 @@ import { URI } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; import { localize } from 'vs/nls'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; -import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -340,19 +338,14 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD return; } const elementBox = this.element.getBoundingClientRect(); + const contextKeyService = this._contextKeyService!.createOverlay([ + ...Object.entries(data.context), + [webviewIdContext, this.providedViewType], + ]); contextMenuService.showContextMenu({ - getActions: () => { - const contextKeyService = this._contextKeyService!.createOverlay([ - ...Object.entries(data.context), - [webviewIdContext, this.providedViewType], - ]); - - const result: IAction[] = []; - const menu = menuService.createMenu(MenuId.WebviewContext, contextKeyService); - createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result); - menu.dispose(); - return result; - }, + menuId: MenuId.WebviewContext, + menuActionOptions: { shouldForwardArgs: true }, + contextKeyService, getActionsContext: (): WebviewActionContext => ({ ...data.context, webview: this.providedViewType }), getAnchor: () => ({ x: elementBox.x + data.clientX, diff --git a/src/vs/workbench/contrib/webview/electron-sandbox/webview.contribution.ts b/src/vs/workbench/contrib/webview/electron-sandbox/webview.contribution.ts index 97ca0f24cdc..a19e67cf9c5 100644 --- a/src/vs/workbench/contrib/webview/electron-sandbox/webview.contribution.ts +++ b/src/vs/workbench/contrib/webview/electron-sandbox/webview.contribution.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { registerAction2 } from 'vs/platform/actions/common/actions'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWebviewService } from 'vs/workbench/contrib/webview/browser/webview'; import * as webviewCommands from 'vs/workbench/contrib/webview/electron-sandbox/webviewCommands'; import { ElectronWebviewService } from 'vs/workbench/contrib/webview/electron-sandbox/webviewService'; -registerSingleton(IWebviewService, ElectronWebviewService, true); +registerSingleton(IWebviewService, ElectronWebviewService, InstantiationType.Delayed); registerAction2(webviewCommands.OpenWebviewDeveloperToolsAction); diff --git a/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts b/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts index 086853c99d9..222d6088bfc 100644 --- a/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts +++ b/src/vs/workbench/contrib/webview/electron-sandbox/webviewCommands.ts @@ -7,7 +7,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 { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; export class OpenWebviewDeveloperToolsAction extends Action2 { @@ -15,7 +15,7 @@ export class OpenWebviewDeveloperToolsAction extends Action2 { super({ id: 'workbench.action.webview.openDeveloperTools', title: { value: nls.localize('openToolsLabel', "Open Webview Developer Tools"), original: 'Open Webview Developer Tools' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.ts b/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.ts index 95a869f9ffa..a9f8728585c 100644 --- a/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.ts +++ b/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.ts @@ -10,7 +10,7 @@ import { Action2, MenuId } from 'vs/platform/actions/common/actions'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IWebviewService, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_ENABLED, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE, IWebview } from 'vs/workbench/contrib/webview/browser/webview'; import { WebviewEditor } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditor'; import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput'; @@ -110,7 +110,7 @@ export class ReloadWebviewAction extends Action2 { super({ id: ReloadWebviewAction.ID, title: { value: ReloadWebviewAction.LABEL, original: 'Reload Webviews' }, - category: CATEGORIES.Developer, + category: Categories.Developer, menu: [{ id: MenuId.CommandPalette }] diff --git a/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.ts b/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.ts index 0e6e8e11e66..8d49c0221a1 100644 --- a/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.ts +++ b/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.ts @@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { localize } from 'vs/nls'; import { registerAction2 } from 'vs/platform/actions/common/actions'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/editor'; import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; @@ -82,13 +82,13 @@ class WebviewPanelContribution extends Disposable implements IWorkbenchContribut } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(WebviewPanelContribution, 'WebviewPanelContribution', LifecyclePhase.Starting); +workbenchContributionsRegistry.registerWorkbenchContribution(WebviewPanelContribution, LifecyclePhase.Starting); Registry.as(EditorExtensions.EditorFactory).registerEditorSerializer( WebviewEditorInputSerializer.ID, WebviewEditorInputSerializer); -registerSingleton(IWebviewWorkbenchService, WebviewEditorService, true); +registerSingleton(IWebviewWorkbenchService, WebviewEditorService, InstantiationType.Delayed); registerAction2(ShowWebViewEditorFindWidgetAction); registerAction2(HideWebViewEditorFindCommand); diff --git a/src/vs/workbench/contrib/webviewView/browser/webviewView.contribution.ts b/src/vs/workbench/contrib/webviewView/browser/webviewView.contribution.ts index 9dd05114160..91d7abcc1da 100644 --- a/src/vs/workbench/contrib/webviewView/browser/webviewView.contribution.ts +++ b/src/vs/workbench/contrib/webviewView/browser/webviewView.contribution.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWebviewViewService, WebviewViewService } from 'vs/workbench/contrib/webviewView/browser/webviewViewService'; -registerSingleton(IWebviewViewService, WebviewViewService, true); +registerSingleton(IWebviewViewService, WebviewViewService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/welcomeBanner/browser/welcomeBanner.contribution.ts b/src/vs/workbench/contrib/welcomeBanner/browser/welcomeBanner.contribution.ts index 2aa549c7556..543ff8df1be 100644 --- a/src/vs/workbench/contrib/welcomeBanner/browser/welcomeBanner.contribution.ts +++ b/src/vs/workbench/contrib/welcomeBanner/browser/welcomeBanner.contribution.ts @@ -50,4 +50,4 @@ class WelcomeBannerContribution { } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WelcomeBannerContribution, 'WelcomeBannerContribution', LifecyclePhase.Restored); + .registerWorkbenchContribution(WelcomeBannerContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts index 2c18fde1e75..7b1282eed4e 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts @@ -30,6 +30,7 @@ import { IExtensionManagementServerService } from 'vs/workbench/services/extensi import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { StartupPageContribution, } from 'vs/workbench/contrib/welcomeGettingStarted/browser/startupPage'; import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; export * as icons from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedIcons'; @@ -39,7 +40,7 @@ registerAction2(class extends Action2 { super({ id: 'workbench.action.openWalkthrough', title: { value: localize('miGetStarted', "Get Started"), original: 'Get Started' }, - category: localize('help', "Help"), + category: Categories.Help, f1: true, menu: { id: MenuId.MenubarHelpMenu, @@ -285,7 +286,7 @@ class WorkspacePlatformContribution { } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WorkspacePlatformContribution, 'WorkspacePlatformContribution', LifecyclePhase.Restored); + .registerWorkbenchContribution(WorkspacePlatformContribution, LifecyclePhase.Restored); const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); @@ -336,4 +337,4 @@ configurationRegistry.registerConfiguration({ Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(StartupPageContribution, 'StartupPageContribution', LifecyclePhase.Restored); + .registerWorkbenchContribution(StartupPageContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts index cf5d7f7671a..63ceca1e990 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts @@ -24,7 +24,7 @@ import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILink, LinkedText, parseLinkedText } from 'vs/base/common/linkedText'; import { walkthroughsExtensionPoint } from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { dirname } from 'vs/base/common/path'; import { coalesce, flatten } from 'vs/base/common/arrays'; import { IViewsService } from 'vs/workbench/common/views'; @@ -716,4 +716,4 @@ registerAction2(class extends Action2 { } }); -registerSingleton(IWalkthroughsService, WalkthroughsService, false); +registerSingleton(IWalkthroughsService, WalkthroughsService, InstantiationType.Delayed); diff --git a/src/vs/workbench/contrib/welcomeOverlay/browser/welcomeOverlay.ts b/src/vs/workbench/contrib/welcomeOverlay/browser/welcomeOverlay.ts index 78cd06a4e0f..5ad26e2f482 100644 --- a/src/vs/workbench/contrib/welcomeOverlay/browser/welcomeOverlay.ts +++ b/src/vs/workbench/contrib/welcomeOverlay/browser/welcomeOverlay.ts @@ -12,7 +12,8 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; import { localize } from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { IWorkbenchActionRegistry, Extensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { Disposable } from 'vs/base/common/lifecycle'; @@ -257,10 +258,10 @@ class WelcomeOverlay extends Disposable { } Registry.as(Extensions.WorkbenchActions) - .registerWorkbenchAction(SyncActionDescriptor.from(WelcomeOverlayAction), 'Help: User Interface Overview', CATEGORIES.Help.value); + .registerWorkbenchAction(SyncActionDescriptor.from(WelcomeOverlayAction), 'Help: User Interface Overview', Categories.Help.value); Registry.as(Extensions.WorkbenchActions) - .registerWorkbenchAction(SyncActionDescriptor.from(HideWelcomeOverlayAction, { primary: KeyCode.Escape }, OVERLAY_VISIBLE), 'Help: Hide Interface Overview', CATEGORIES.Help.value); + .registerWorkbenchAction(SyncActionDescriptor.from(HideWelcomeOverlayAction, { primary: KeyCode.Escape }, OVERLAY_VISIBLE), 'Help: Hide Interface Overview', Categories.Help.value); // theming diff --git a/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.ts b/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.ts index a6d0e9e5e03..55ef4113b60 100644 --- a/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.ts +++ b/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.ts @@ -206,7 +206,7 @@ class NewFileTemplatesManager extends Disposable { } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(NewFileTemplatesManager, 'NewFileTemplatesManager', LifecyclePhase.Restored); + .registerWorkbenchContribution(NewFileTemplatesManager, LifecyclePhase.Restored); MenuRegistry.appendMenuItem(MenuId.NewFile, { group: 'file', diff --git a/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.ts b/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.ts index 86e4ddca529..e68958ca71b 100644 --- a/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.ts +++ b/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.ts @@ -22,4 +22,4 @@ class WorkbenchConfigurationContribution { } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WorkbenchConfigurationContribution, 'WorkbenchConfigurationContribution', LifecyclePhase.Restored); + .registerWorkbenchContribution(WorkbenchConfigurationContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution.ts b/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution.ts index 45ba2b555d0..be550f72b66 100644 --- a/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution.ts +++ b/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution.ts @@ -12,7 +12,8 @@ import { EditorWalkThroughAction, EditorWalkThroughInputSerializer } from 'vs/wo import { Registry } from 'vs/platform/registry/common/platform'; import { EditorExtensions, IEditorFactoryRegistry } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { IWorkbenchActionRegistry, Extensions, CATEGORIES } from 'vs/workbench/common/actions'; +import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { IEditorPaneRegistry, EditorPaneDescriptor } from 'vs/workbench/browser/editor'; @@ -30,12 +31,12 @@ Registry.as(EditorExtensions.EditorPane) Registry.as(Extensions.WorkbenchActions) .registerWorkbenchAction( SyncActionDescriptor.from(EditorWalkThroughAction), - 'Help: Interactive Editor Playground', CATEGORIES.Help.value); + 'Help: Interactive Editor Playground', Categories.Help.value); Registry.as(EditorExtensions.EditorFactory).registerEditorSerializer(EditorWalkThroughInputSerializer.ID, EditorWalkThroughInputSerializer); Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WalkThroughSnippetContentProvider, 'WalkThroughSnippetContentProvider', LifecyclePhase.Starting); + .registerWorkbenchContribution(WalkThroughSnippetContentProvider, LifecyclePhase.Starting); KeybindingsRegistry.registerCommandAndKeybindingRule(WalkThroughArrowUp); diff --git a/src/vs/workbench/contrib/workspace/browser/media/trusted-badge.png b/src/vs/workbench/contrib/workspace/browser/media/trusted-badge.png deleted file mode 100644 index c53b0eea12f..00000000000 Binary files a/src/vs/workbench/contrib/workspace/browser/media/trusted-badge.png and /dev/null differ diff --git a/src/vs/workbench/contrib/workspace/browser/media/untrusted-status.png b/src/vs/workbench/contrib/workspace/browser/media/untrusted-status.png deleted file mode 100644 index c8b4f6ae7c8..00000000000 Binary files a/src/vs/workbench/contrib/workspace/browser/media/untrusted-status.png and /dev/null differ diff --git a/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts b/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts index 67ae288b9a6..4dad7461871 100644 --- a/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts +++ b/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts @@ -72,7 +72,7 @@ export class WorkspaceTrustContextKeys extends Disposable implements IWorkbenchC } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTrustContextKeys, 'WorkspaceTrustContextKeys', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTrustContextKeys, LifecyclePhase.Restored); /* @@ -271,7 +271,7 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon localize('addWorkspaceFolderMessage', "Do you trust the authors of the files in this folder?"), [localize('yes', 'Yes'), localize('no', 'No')], { - detail: localize('addWorkspaceFolderDetail', "You are adding files to a trusted workspace that are not currently trusted. Do you trust the authors of these new files?"), + detail: localize('addWorkspaceFolderDetail', "You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"), cancelId: 1, custom: { icon: Codicon.shield } } @@ -578,8 +578,8 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon //#endregion } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTrustRequestHandler, 'WorkspaceTrustRequestHandler', LifecyclePhase.Ready); -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTrustUXHandler, 'WorkspaceTrustUXHandler', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTrustRequestHandler, LifecyclePhase.Ready); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspaceTrustUXHandler, LifecyclePhase.Restored); /** @@ -857,4 +857,4 @@ class WorkspaceTrustTelemetryContribution extends Disposable implements IWorkben } Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(WorkspaceTrustTelemetryContribution, 'WorkspaceTrustTelemetryContribution', LifecyclePhase.Restored); + .registerWorkbenchContribution(WorkspaceTrustTelemetryContribution, LifecyclePhase.Restored); diff --git a/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.ts b/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.ts index c274839d5bd..26d1f82e6b7 100644 --- a/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.ts +++ b/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.ts @@ -94,7 +94,7 @@ export class WorkspacesFinderContribution extends Disposable implements IWorkben } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspacesFinderContribution, 'WorkspacesFinderContribution', LifecyclePhase.Eventually); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkspacesFinderContribution, LifecyclePhase.Eventually); // Render "Open Workspace" button in *.code-workspace files diff --git a/src/vs/workbench/electron-sandbox/actions/developerActions.ts b/src/vs/workbench/electron-sandbox/actions/developerActions.ts index 618b5d37319..ab1d188313e 100644 --- a/src/vs/workbench/electron-sandbox/actions/developerActions.ts +++ b/src/vs/workbench/electron-sandbox/actions/developerActions.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { Action2, MenuId } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -20,7 +20,7 @@ export class ToggleDevToolsAction extends Action2 { super({ id: 'workbench.action.toggleDevTools', title: { value: localize('toggleDevTools', "Toggle Developer Tools"), original: 'Toggle Developer Tools' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib + 50, @@ -49,7 +49,7 @@ export class ConfigureRuntimeArgumentsAction extends Action2 { super({ id: 'workbench.action.configureRuntimeArguments', title: { value: localize('configureRuntimeArguments', "Configure Runtime Arguments"), original: 'Configure Runtime Arguments' }, - category: CATEGORIES.Preferences, + category: Categories.Preferences, f1: true }); } @@ -72,7 +72,7 @@ export class ToggleSharedProcessAction extends Action2 { super({ id: 'workbench.action.toggleSharedProcess', title: { value: localize('toggleSharedProcess', "Toggle Shared Process"), original: 'Toggle Shared Process' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } @@ -88,7 +88,7 @@ export class ReloadWindowWithExtensionsDisabledAction extends Action2 { super({ id: 'workbench.action.reloadWindowWithExtensionsDisabled', title: { value: localize('reloadWindowWithExtensionsDisabled', "Reload With Extensions Disabled"), original: 'Reload With Extensions Disabled' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/electron-sandbox/actions/windowActions.ts b/src/vs/workbench/electron-sandbox/actions/windowActions.ts index 438925fd576..2c8e6d83bfc 100644 --- a/src/vs/workbench/electron-sandbox/actions/windowActions.ts +++ b/src/vs/workbench/electron-sandbox/actions/windowActions.ts @@ -21,7 +21,7 @@ import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; import { Codicon } from 'vs/base/common/codicons'; import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; import { Action2, IAction2Options, MenuId } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -95,7 +95,7 @@ export class ZoomInAction extends BaseZoomAction { mnemonicTitle: localize({ key: 'miZoomIn', comment: ['&& denotes a mnemonic'] }, "&&Zoom In"), original: 'Zoom In' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, @@ -125,7 +125,7 @@ export class ZoomOutAction extends BaseZoomAction { mnemonicTitle: localize({ key: 'miZoomOut', comment: ['&& denotes a mnemonic'] }, "&&Zoom Out"), original: 'Zoom Out' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, @@ -159,7 +159,7 @@ export class ZoomResetAction extends BaseZoomAction { mnemonicTitle: localize({ key: 'miZoomReset', comment: ['&& denotes a mnemonic'] }, "&&Reset Zoom"), original: 'Reset Zoom' }, - category: CATEGORIES.View, + category: Categories.View, f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib, 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 07792869840..60eb43ec230 100644 --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialog.contribution.ts @@ -99,4 +99,4 @@ export class DialogHandlerContribution extends Disposable implements IWorkbenchC } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(DialogHandlerContribution, 'DialogHandlerContribution', LifecyclePhase.Starting); +workbenchRegistry.registerWorkbenchContribution(DialogHandlerContribution, LifecyclePhase.Starting); diff --git a/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts b/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts index b9aa17ff080..391bc05355c 100644 --- a/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/electron-sandbox/parts/titlebar/menubarControl.ts @@ -25,6 +25,7 @@ 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'; import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions'; +import { isICommandActionToggleInfo } from 'vs/platform/action/common/action'; export class NativeMenubarControl extends MenubarControl { @@ -149,6 +150,10 @@ export class NativeMenubarControl extends MenubarControl { label: title }; + if (isICommandActionToggleInfo(menuItem.item.toggled)) { + menubarMenuItem.label = menuItem.item.toggled.mnemonicTitle ?? menuItem.item.toggled.title ?? title; + } + if (menuItem.checked) { menubarMenuItem.checked = true; } diff --git a/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts b/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts index 2f991be2339..062d06db50f 100644 --- a/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts @@ -11,7 +11,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { isMacintosh, isWindows, isLinux, isNative } from 'vs/base/common/platform'; -import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; +import { MenuId } from 'vs/platform/actions/common/actions'; import { TitlebarPart as BrowserTitleBarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -62,13 +62,12 @@ export class TitlebarPart extends BrowserTitleBarPart { @IThemeService themeService: IThemeService, @IStorageService storageService: IStorageService, @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, - @IMenuService menuService: IMenuService, @IContextKeyService contextKeyService: IContextKeyService, @IHostService hostService: IHostService, @INativeHostService private readonly nativeHostService: INativeHostService, @IHoverService hoverService: IHoverService, ) { - super(contextMenuService, configurationService, environmentService, instantiationService, themeService, storageService, layoutService, menuService, contextKeyService, hostService, hoverService); + super(contextMenuService, configurationService, environmentService, instantiationService, themeService, storageService, layoutService, contextKeyService, hostService, hoverService); this.environmentService = environmentService; } diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index 579ad0ea8bc..388e0886346 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -683,7 +683,7 @@ export class NativeWindow extends Disposable { if (this.uriIdentityService.extUri.isEqualOrParent(folder.uri, installLocationUri)) { this.bannerService.show({ id: 'appRootWarning.banner', - message: localize('appRootWarning.banner', "Files you store within the installation folder ('{0}') may be OVERWRITTEN or DELETED IRREVERSIBLY without warning at update time.", this.environmentService.appRoot), + message: localize('appRootWarning.banner', "Files you store within the installation folder ('{0}') may be OVERWRITTEN or DELETED IRREVERSIBLY without warning at update time.", this.labelService.getUriLabel(installLocationUri)), icon: Codicon.warning }); diff --git a/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts b/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts index c02ebba5884..975240757c0 100644 --- a/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts +++ b/src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts @@ -10,7 +10,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Registry } from 'vs/platform/registry/common/platform'; import { AccessibilityService } from 'vs/platform/accessibility/browser/accessibilityService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; 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'; @@ -67,7 +67,7 @@ export class NativeAccessibilityService extends AccessibilityService implements } } -registerSingleton(IAccessibilityService, NativeAccessibilityService, true); +registerSingleton(IAccessibilityService, NativeAccessibilityService, InstantiationType.Delayed); // On linux we do not automatically detect that a screen reader is detected, thus we have to implicitly notify the renderer to enable accessibility when user configures it in settings class LinuxAccessibilityContribution implements IWorkbenchContribution { @@ -87,5 +87,5 @@ class LinuxAccessibilityContribution implements IWorkbenchContribution { } if (isLinux) { - Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LinuxAccessibilityContribution, 'LinuxAccessibilityContribution', LifecyclePhase.Ready); + Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LinuxAccessibilityContribution, LifecyclePhase.Ready); } diff --git a/src/vs/workbench/services/activity/browser/activityService.ts b/src/vs/workbench/services/activity/browser/activityService.ts index 1d12dc5ffd6..77a8841dcb5 100644 --- a/src/vs/workbench/services/activity/browser/activityService.ts +++ b/src/vs/workbench/services/activity/browser/activityService.ts @@ -5,7 +5,7 @@ import { IActivityService, IActivity } from 'vs/workbench/services/activity/common/activity'; import { IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views'; import { GLOBAL_ACTIVITY_ID, ACCOUNTS_ACTIVITY_ID } from 'vs/workbench/common/activity'; import { Event } from 'vs/base/common/event'; @@ -113,4 +113,4 @@ export class ActivityService implements IActivityService { } } -registerSingleton(IActivityService, ActivityService, true); +registerSingleton(IActivityService, ActivityService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/assignment/common/assignmentService.ts b/src/vs/workbench/services/assignment/common/assignmentService.ts index 942388eb947..d3d939253f3 100644 --- a/src/vs/workbench/services/assignment/common/assignmentService.ts +++ b/src/vs/workbench/services/assignment/common/assignmentService.ts @@ -9,7 +9,7 @@ import { MementoObject, Memento } from 'vs/workbench/common/memento'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ITelemetryData } from 'vs/base/common/actions'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IProductService } from 'vs/platform/product/common/productService'; import { IAssignmentService } from 'vs/platform/assignment/common/assignment'; @@ -131,4 +131,4 @@ export class WorkbenchAssignmentService extends BaseAssignmentService { } } -registerSingleton(IWorkbenchAssignmentService, WorkbenchAssignmentService, false); +registerSingleton(IWorkbenchAssignmentService, WorkbenchAssignmentService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/clipboard/browser/clipboardService.ts b/src/vs/workbench/services/clipboard/browser/clipboardService.ts index a59960511a7..21ecf79467e 100644 --- a/src/vs/workbench/services/clipboard/browser/clipboardService.ts +++ b/src/vs/workbench/services/clipboard/browser/clipboardService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { BrowserClipboardService as BaseBrowserClipboardService } from 'vs/platform/clipboard/browser/clipboardService'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; @@ -68,4 +68,4 @@ export class BrowserClipboardService extends BaseBrowserClipboardService { } } -registerSingleton(IClipboardService, BrowserClipboardService, true); +registerSingleton(IClipboardService, BrowserClipboardService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts b/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts index 326d09c3a37..43443e6cdc5 100644 --- a/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts +++ b/src/vs/workbench/services/clipboard/electron-sandbox/clipboardService.ts @@ -6,7 +6,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { URI } from 'vs/base/common/uri'; import { isMacintosh } from 'vs/base/common/platform'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; import { VSBuffer } from 'vs/base/common/buffer'; @@ -78,4 +78,4 @@ export class NativeClipboardService implements IClipboardService { } } -registerSingleton(IClipboardService, NativeClipboardService, true); +registerSingleton(IClipboardService, NativeClipboardService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/commands/common/commandService.ts b/src/vs/workbench/services/commands/common/commandService.ts index 85faaa2fb3d..8a719346c3f 100644 --- a/src/vs/workbench/services/commands/common/commandService.ts +++ b/src/vs/workbench/services/commands/common/commandService.ts @@ -9,7 +9,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten import { Event, Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import { ILogService } from 'vs/platform/log/common/log'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { timeout } from 'vs/base/common/async'; export class CommandService extends Disposable implements ICommandService { @@ -101,4 +101,4 @@ export class CommandService extends Disposable implements ICommandService { } } -registerSingleton(ICommandService, CommandService, true); +registerSingleton(ICommandService, CommandService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/configuration/browser/configurationService.ts b/src/vs/workbench/services/configuration/browser/configurationService.ts index ed219b35242..ea97c694c87 100644 --- a/src/vs/workbench/services/configuration/browser/configurationService.ts +++ b/src/vs/workbench/services/configuration/browser/configurationService.ts @@ -1301,6 +1301,6 @@ class UpdateExperimentalSettingsDefaults extends Disposable implements IWorkbenc } const workbenchContributionsRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchContributionsRegistry.registerWorkbenchContribution(RegisterConfigurationSchemasContribution, 'RegisterConfigurationSchemasContribution', LifecyclePhase.Restored); -workbenchContributionsRegistry.registerWorkbenchContribution(ResetConfigurationDefaultsOverridesCache, 'ResetConfigurationDefaultsOverridesCache', LifecyclePhase.Eventually); -workbenchContributionsRegistry.registerWorkbenchContribution(UpdateExperimentalSettingsDefaults, 'UpdateExperimentalSettingsDefaults', LifecyclePhase.Restored); +workbenchContributionsRegistry.registerWorkbenchContribution(RegisterConfigurationSchemasContribution, LifecyclePhase.Restored); +workbenchContributionsRegistry.registerWorkbenchContribution(ResetConfigurationDefaultsOverridesCache, LifecyclePhase.Eventually); +workbenchContributionsRegistry.registerWorkbenchContribution(UpdateExperimentalSettingsDefaults, LifecyclePhase.Restored); diff --git a/src/vs/workbench/services/configuration/common/jsonEditingService.ts b/src/vs/workbench/services/configuration/common/jsonEditingService.ts index 5251efc25b5..e906a376240 100644 --- a/src/vs/workbench/services/configuration/common/jsonEditingService.ts +++ b/src/vs/workbench/services/configuration/common/jsonEditingService.ts @@ -18,7 +18,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { ITextModelService, IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService'; import { IJSONEditingService, IJSONValue, JSONEditingError, JSONEditingErrorCode } from 'vs/workbench/services/configuration/common/jsonEditing'; import { ITextModel } from 'vs/editor/common/model'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; export class JSONEditingService implements IJSONEditingService { @@ -140,4 +140,4 @@ export class JSONEditingService implements IJSONEditingService { } } -registerSingleton(IJSONEditingService, JSONEditingService, true); +registerSingleton(IJSONEditingService, JSONEditingService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts index 4a7d00a5b4d..70f5d1cd368 100644 --- a/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.ts @@ -5,7 +5,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILabelService } from 'vs/platform/label/common/label'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -33,4 +33,4 @@ export class ConfigurationResolverService extends BaseConfigurationResolverServi } } -registerSingleton(IConfigurationResolverService, ConfigurationResolverService, true); +registerSingleton(IConfigurationResolverService, ConfigurationResolverService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/configurationResolver/electron-sandbox/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/electron-sandbox/configurationResolverService.ts index 14a385e3e06..bb1a8751e6d 100644 --- a/src/vs/workbench/services/configurationResolver/electron-sandbox/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/electron-sandbox/configurationResolverService.ts @@ -10,7 +10,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { BaseConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService'; import { ILabelService } from 'vs/platform/label/common/label'; import { IShellEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/shellEnvironmentService'; @@ -43,4 +43,4 @@ export class ConfigurationResolverService extends BaseConfigurationResolverServi } } -registerSingleton(IConfigurationResolverService, ConfigurationResolverService, true); +registerSingleton(IConfigurationResolverService, ConfigurationResolverService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts b/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts index fa2034e1ee7..4433a8b533f 100644 --- a/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts +++ b/src/vs/workbench/services/contextmenu/electron-sandbox/contextmenuService.ts @@ -5,7 +5,7 @@ import { IAction, IActionRunner, ActionRunner, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification, Separator, SubmenuAction } from 'vs/base/common/actions'; import * as dom from 'vs/base/browser/dom'; -import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; +import { IContextMenuMenuDelegate, IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { getZoomFactor } from 'vs/base/browser/browser'; @@ -13,25 +13,27 @@ import { unmnemonicLabel } from 'vs/base/common/labels'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IContextMenuDelegate, IContextMenuEvent } from 'vs/base/browser/contextmenu'; import { once } from 'vs/base/common/functional'; -import { Disposable } from 'vs/base/common/lifecycle'; import { IContextMenuItem } from 'vs/base/parts/contextmenu/common/contextmenu'; import { popup } from 'vs/base/parts/contextmenu/electron-sandbox/contextmenu'; import { getTitleBarStyle } from 'vs/platform/window/common/window'; import { isMacintosh, isWindows } from 'vs/base/common/platform'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextMenuService as HTMLContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; +import { ContextMenuMenuDelegate, ContextMenuService as HTMLContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { stripIcons } from 'vs/base/common/iconLabels'; import { coalesce } from 'vs/base/common/arrays'; import { Event, Emitter } from 'vs/base/common/event'; import { AnchorAlignment, AnchorAxisAlignment } from 'vs/base/browser/ui/contextview/contextview'; +import { IMenuService } from 'vs/platform/actions/common/actions'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { Disposable } from 'vs/base/common/lifecycle'; -export class ContextMenuService extends Disposable implements IContextMenuService { +export class ContextMenuService implements IContextMenuService { declare readonly _serviceBrand: undefined; - private impl: IContextMenuService; + private impl: HTMLContextMenuService | NativeContextMenuService; get onDidShowContextMenu(): Event { return this.impl.onDidShowContextMenu; } get onDidHideContextMenu(): Event { return this.impl.onDidHideContextMenu; } @@ -42,22 +44,27 @@ export class ContextMenuService extends Disposable implements IContextMenuServic @IKeybindingService keybindingService: IKeybindingService, @IConfigurationService configurationService: IConfigurationService, @IContextViewService contextViewService: IContextViewService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IMenuService menuService: IMenuService, + @IContextKeyService contextKeyService: IContextKeyService, ) { - super(); // Custom context menu: Linux/Windows if custom title is enabled if (!isMacintosh && getTitleBarStyle(configurationService) === 'custom') { - this.impl = new HTMLContextMenuService(telemetryService, notificationService, contextViewService, keybindingService, themeService); + this.impl = new HTMLContextMenuService(telemetryService, notificationService, contextViewService, keybindingService, themeService, menuService, contextKeyService); } // Native context menu: otherwise else { - this.impl = new NativeContextMenuService(notificationService, telemetryService, keybindingService); + this.impl = new NativeContextMenuService(notificationService, telemetryService, keybindingService, menuService, contextKeyService); } } - showContextMenu(delegate: IContextMenuDelegate): void { + dispose(): void { + this.impl.dispose(); + } + + showContextMenu(delegate: IContextMenuDelegate | IContextMenuMenuDelegate): void { this.impl.showContextMenu(delegate); } } @@ -66,21 +73,26 @@ class NativeContextMenuService extends Disposable implements IContextMenuService declare readonly _serviceBrand: undefined; - private readonly _onDidShowContextMenu = new Emitter(); + private readonly _onDidShowContextMenu = this._store.add(new Emitter()); readonly onDidShowContextMenu = this._onDidShowContextMenu.event; - private readonly _onDidHideContextMenu = new Emitter(); + private readonly _onDidHideContextMenu = this._store.add(new Emitter()); readonly onDidHideContextMenu = this._onDidHideContextMenu.event; constructor( @INotificationService private readonly notificationService: INotificationService, @ITelemetryService private readonly telemetryService: ITelemetryService, - @IKeybindingService private readonly keybindingService: IKeybindingService + @IKeybindingService private readonly keybindingService: IKeybindingService, + @IMenuService private readonly menuService: IMenuService, + @IContextKeyService private readonly contextKeyService: IContextKeyService, ) { super(); } - showContextMenu(delegate: IContextMenuDelegate): void { + showContextMenu(delegate: IContextMenuDelegate | IContextMenuMenuDelegate): void { + + delegate = ContextMenuMenuDelegate.transform(delegate, this.menuService, this.contextKeyService); + const actions = delegate.getActions(); if (actions.length) { const onHide = once(() => { @@ -247,4 +259,4 @@ class NativeContextMenuService extends Disposable implements IContextMenuService } } -registerSingleton(IContextMenuService, ContextMenuService, true); +registerSingleton(IContextMenuService, ContextMenuService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/decorations/browser/decorationsService.ts b/src/vs/workbench/services/decorations/browser/decorationsService.ts index 42a7850a675..b8d5d9491ad 100644 --- a/src/vs/workbench/services/decorations/browser/decorationsService.ts +++ b/src/vs/workbench/services/decorations/browser/decorationsService.ts @@ -16,7 +16,7 @@ import { isFalsyOrWhitespace } from 'vs/base/common/strings'; import { localize } from 'vs/nls'; import { isCancellationError } from 'vs/base/common/errors'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { hash } from 'vs/base/common/hash'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { asArray, distinct } from 'vs/base/common/arrays'; @@ -408,4 +408,4 @@ export class DecorationsService implements IDecorationsService { } } -registerSingleton(IDecorationsService, DecorationsService, true); +registerSingleton(IDecorationsService, DecorationsService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/dialogs/browser/fileDialogService.ts b/src/vs/workbench/services/dialogs/browser/fileDialogService.ts index 87f6e2ca052..68aab5fc304 100644 --- a/src/vs/workbench/services/dialogs/browser/fileDialogService.ts +++ b/src/vs/workbench/services/dialogs/browser/fileDialogService.ts @@ -5,7 +5,7 @@ import { IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions, IFileDialogService, FileFilter } from 'vs/platform/dialogs/common/dialogs'; import { URI } from 'vs/base/common/uri'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { AbstractFileDialogService } from 'vs/workbench/services/dialogs/browser/abstractFileDialogService'; import { Schemas } from 'vs/base/common/network'; import { memoize } from 'vs/base/common/decorators'; @@ -270,4 +270,4 @@ export class FileDialogService extends AbstractFileDialogService implements IFil } } -registerSingleton(IFileDialogService, FileDialogService, true); +registerSingleton(IFileDialogService, FileDialogService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/dialogs/common/dialogService.ts b/src/vs/workbench/services/dialogs/common/dialogService.ts index 7360fe7d875..13da7563bae 100644 --- a/src/vs/workbench/services/dialogs/common/dialogService.ts +++ b/src/vs/workbench/services/dialogs/common/dialogService.ts @@ -7,7 +7,7 @@ import Severity from 'vs/base/common/severity'; import { Disposable } from 'vs/base/common/lifecycle'; import { IConfirmation, IConfirmationResult, IDialogOptions, IDialogService, IInput, IInputResult, IShowResult } from 'vs/platform/dialogs/common/dialogs'; import { DialogsModel } from 'vs/workbench/common/dialogs'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { ILogService } from 'vs/platform/log/common/log'; @@ -78,4 +78,4 @@ export class DialogService extends Disposable implements IDialogService { } } -registerSingleton(IDialogService, DialogService, true); +registerSingleton(IDialogService, DialogService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts b/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts index 36f7e3e76a1..bfbc3211a7f 100644 --- a/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts +++ b/src/vs/workbench/services/dialogs/electron-sandbox/fileDialogService.ts @@ -12,7 +12,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/ import { URI } from 'vs/base/common/uri'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; @@ -200,4 +200,4 @@ export class FileDialogService extends AbstractFileDialogService implements IFil } } -registerSingleton(IFileDialogService, FileDialogService, true); +registerSingleton(IFileDialogService, FileDialogService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/editor/browser/codeEditorService.ts b/src/vs/workbench/services/editor/browser/codeEditorService.ts index 492e5077def..657f203312c 100644 --- a/src/vs/workbench/services/editor/browser/codeEditorService.ts +++ b/src/vs/workbench/services/editor/browser/codeEditorService.ts @@ -11,7 +11,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { isEqual } from 'vs/base/common/resources'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { applyTextEditorOptions } from 'vs/workbench/common/editor/editorOptions'; @@ -113,4 +113,4 @@ export class CodeEditorService extends AbstractCodeEditorService { } } -registerSingleton(ICodeEditorService, CodeEditorService, true); +registerSingleton(ICodeEditorService, CodeEditorService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/editor/browser/editorResolverService.ts b/src/vs/workbench/services/editor/browser/editorResolverService.ts index b35aabc0711..6731ee8717c 100644 --- a/src/vs/workbench/services/editor/browser/editorResolverService.ts +++ b/src/vs/workbench/services/editor/browser/editorResolverService.ts @@ -19,7 +19,7 @@ import { QuickPickItem, IKeyMods, IQuickInputService, IQuickPickItem, IQuickPick import { localize } from 'vs/nls'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; @@ -829,4 +829,4 @@ export class EditorResolverService extends Disposable implements IEditorResolver } } -registerSingleton(IEditorResolverService, EditorResolverService, false); +registerSingleton(IEditorResolverService, EditorResolverService, InstantiationType.Eager); diff --git a/src/vs/workbench/services/encryption/browser/encryptionService.ts b/src/vs/workbench/services/encryption/browser/encryptionService.ts index e204f45bd49..8e745e85578 100644 --- a/src/vs/workbench/services/encryption/browser/encryptionService.ts +++ b/src/vs/workbench/services/encryption/browser/encryptionService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; import { IEncryptionService } from 'vs/workbench/services/encryption/common/encryptionService'; import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; @@ -35,4 +35,4 @@ export class EncryptionService implements IEncryptionService { } } -registerSingleton(IEncryptionService, EncryptionService, true); +registerSingleton(IEncryptionService, EncryptionService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/environment/electron-sandbox/shellEnvironmentService.ts b/src/vs/workbench/services/environment/electron-sandbox/shellEnvironmentService.ts index cee48fc8657..71ac3a7fbe6 100644 --- a/src/vs/workbench/services/environment/electron-sandbox/shellEnvironmentService.ts +++ b/src/vs/workbench/services/environment/electron-sandbox/shellEnvironmentService.ts @@ -6,7 +6,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; export const IShellEnvironmentService = createDecorator('shellEnvironmentService'); @@ -26,4 +26,4 @@ export class ShellEnvironmentService implements IShellEnvironmentService { } } -registerSingleton(IShellEnvironmentService, ShellEnvironmentService, true); +registerSingleton(IShellEnvironmentService, ShellEnvironmentService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts b/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts index 7fd4e622342..e614f82d01b 100644 --- a/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts +++ b/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts @@ -7,7 +7,7 @@ import { IBuiltinExtensionsScannerService, ExtensionType, IExtensionManifest, Ta import { isWeb, Language } from 'vs/base/common/platform'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { FileAccess } from 'vs/base/common/network'; import { URI } from 'vs/base/common/uri'; @@ -113,4 +113,4 @@ export class BuiltinExtensionsScannerService implements IBuiltinExtensionsScanne } } -registerSingleton(IBuiltinExtensionsScannerService, BuiltinExtensionsScannerService, true); +registerSingleton(IBuiltinExtensionsScannerService, BuiltinExtensionsScannerService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts b/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts index 2a099ed043a..c9d26ad3b32 100644 --- a/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts +++ b/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { IExtensionManagementService, IGlobalExtensionEnablementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ExtensionType, IExtension, isResolverExtension } from 'vs/platform/extensions/common/extensions'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { INotificationService, IPromptChoice, Severity } from 'vs/platform/notification/common/notification'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; @@ -23,7 +23,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; // --- bisect service @@ -161,7 +161,7 @@ class ExtensionBisectService implements IExtensionBisectService { } } -registerSingleton(IExtensionBisectService, ExtensionBisectService, true); +registerSingleton(IExtensionBisectService, ExtensionBisectService, InstantiationType.Delayed); // --- bisect UI @@ -211,7 +211,6 @@ class ExtensionBisectUi { Registry.as(Extensions.Workbench).registerWorkbenchContribution( ExtensionBisectUi, - 'ExtensionBisectUi', LifecyclePhase.Restored ); @@ -220,7 +219,7 @@ registerAction2(class extends Action2 { super({ id: 'extension.bisect.start', title: { value: localize('title.start', "Start Extension Bisect"), original: 'Start Extension Bisect' }, - category: CATEGORIES.Help, + category: Categories.Help, f1: true, precondition: ExtensionBisectUi.ctxIsBisectActive.negate(), menu: { @@ -260,7 +259,7 @@ registerAction2(class extends Action2 { super({ id: 'extension.bisect.next', title: { value: localize('title.isBad', "Continue Extension Bisect"), original: 'Continue Extension Bisect' }, - category: localize('help', "Help"), + category: Categories.Help, f1: true, precondition: ExtensionBisectUi.ctxIsBisectActive }); @@ -347,7 +346,7 @@ registerAction2(class extends Action2 { super({ id: 'extension.bisect.stop', title: { value: localize('title.stop', "Stop Extension Bisect"), original: 'Stop Extension Bisect' }, - category: localize('help', "Help"), + category: Categories.Help, f1: true, precondition: ExtensionBisectUi.ctxIsBisectActive }); diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts b/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts index 3c350eae2d8..94369a63ef3 100644 --- a/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts +++ b/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts @@ -14,7 +14,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IExtension, isAuthenticationProviderExtension, isLanguagePackExtension, isResolverExtension } from 'vs/platform/extensions/common/extensions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { StorageManager } from 'vs/platform/extensionManagement/common/extensionEnablementService'; import { webWorkerExtHostConfig, WebWorkerExtHostConfigValue } from 'vs/workbench/services/extensions/common/extensions'; import { IUserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount'; @@ -236,7 +236,7 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench checked.push(extension); } - const extensionsToDisable: IExtension[] = []; + const extensionsToEnable: IExtension[] = []; for (const extension of allExtensions) { // Extension is already checked if (checked.some(e => areSameExtensions(e.identifier, extension.identifier))) { @@ -244,8 +244,13 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench } const enablementStateOfExtension = this.getEnablementState(extension); - // Extension enablement state is same as the end enablement state - if (enablementStateOfExtension === enablementState) { + // Extension is enabled + if (this.isEnabledEnablementState(enablementStateOfExtension)) { + continue; + } + + // Skip if dependency extension is disabled by extension kind + if (enablementStateOfExtension === EnablementState.DisabledByExtensionKind) { continue; } @@ -254,11 +259,11 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench (options.dependencies && e.manifest.extensionDependencies?.some(id => areSameExtensions({ id }, extension.identifier))) || (options.pack && e.manifest.extensionPack?.some(id => areSameExtensions({ id }, extension.identifier))))) { - const index = extensionsToDisable.findIndex(e => areSameExtensions(e.identifier, extension.identifier)); + const index = extensionsToEnable.findIndex(e => areSameExtensions(e.identifier, extension.identifier)); // Extension is not aded to the disablement list so add it if (index === -1) { - extensionsToDisable.push(extension); + extensionsToEnable.push(extension); } // Extension is there already in the disablement list. @@ -266,17 +271,17 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench try { // Replace only if the enablement state can be changed this.throwErrorIfEnablementStateCannotBeChanged(extension, enablementStateOfExtension, true); - extensionsToDisable.splice(index, 1, extension); + extensionsToEnable.splice(index, 1, extension); } catch (error) { /*Do not add*/ } } } } - if (extensionsToDisable.length) { - extensionsToDisable.push(...this.getExtensionsToEnableRecursively(extensionsToDisable, allExtensions, enablementState, options, checked)); + if (extensionsToEnable.length) { + extensionsToEnable.push(...this.getExtensionsToEnableRecursively(extensionsToEnable, allExtensions, enablementState, options, checked)); } - return extensionsToDisable; + return extensionsToEnable; } private _setUserEnablementState(extension: IExtension, newState: EnablementState): Promise { @@ -711,4 +716,4 @@ class ExtensionsManager extends Disposable { } } -registerSingleton(IWorkbenchExtensionEnablementService, ExtensionEnablementService, true); +registerSingleton(IWorkbenchExtensionEnablementService, ExtensionEnablementService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionUrlTrustService.ts b/src/vs/workbench/services/extensionManagement/browser/extensionUrlTrustService.ts index 9df7560ac34..31127de9b07 100644 --- a/src/vs/workbench/services/extensionManagement/browser/extensionUrlTrustService.ts +++ b/src/vs/workbench/services/extensionManagement/browser/extensionUrlTrustService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IExtensionUrlTrustService } from 'vs/platform/extensionManagement/common/extensionUrlTrust'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; class ExtensionUrlTrustService implements IExtensionUrlTrustService { @@ -15,4 +15,4 @@ class ExtensionUrlTrustService implements IExtensionUrlTrustService { } } -registerSingleton(IExtensionUrlTrustService, ExtensionUrlTrustService, false); +registerSingleton(IExtensionUrlTrustService, ExtensionUrlTrustService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.ts b/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.ts index 34432033ea5..cfde0bbd984 100644 --- a/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.ts +++ b/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.ts @@ -7,7 +7,7 @@ import { IBuiltinExtensionsScannerService, ExtensionType, IExtensionIdentifier, import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; import { IScannedExtension, IWebExtensionsScannerService, ScanOptions } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { isWeb, Language } from 'vs/base/common/platform'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { joinPath } from 'vs/base/common/resources'; import { URI, UriComponents } from 'vs/base/common/uri'; import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; @@ -27,7 +27,7 @@ import { ResourceMap } from 'vs/base/common/map'; import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService'; import { IExtensionResourceLoaderService } from 'vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader'; import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; @@ -874,7 +874,7 @@ if (isWeb) { super({ id: 'workbench.extensions.action.openInstalledWebExtensionsResource', title: { value: localize('openInstalledWebExtensionsResource', "Open Installed Web Extensions Resource"), original: 'Open Installed Web Extensions Resource' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true, precondition: IsWebContext }); @@ -887,4 +887,4 @@ if (isWeb) { }); } -registerSingleton(IWebExtensionsScannerService, WebExtensionsScannerService, true); +registerSingleton(IWebExtensionsScannerService, WebExtensionsScannerService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts index 4db3f9b85cc..198844be7de 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.ts @@ -9,7 +9,7 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA import { Schemas } from 'vs/base/common/network'; import { Event } from 'vs/base/common/event'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILabelService } from 'vs/platform/label/common/label'; import { isWeb } from 'vs/base/common/platform'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -71,4 +71,4 @@ export class ExtensionManagementServerService implements IExtensionManagementSer } } -registerSingleton(IExtensionManagementServerService, ExtensionManagementServerService, true); +registerSingleton(IExtensionManagementServerService, ExtensionManagementServerService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts index d39ae8f4315..a8d11483188 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts @@ -96,26 +96,26 @@ export class ExtensionManagementService extends Disposable implements IWorkbench } if (this.servers.length > 1) { if (isLanguagePackExtension(extension.manifest)) { - return this.uninstallEverywhere(extension); + return this.uninstallEverywhere(extension, options); } return this.uninstallInServer(extension, server, options); } - return server.extensionManagementService.uninstall(extension); + return server.extensionManagementService.uninstall(extension, options); } - private async uninstallEverywhere(extension: ILocalExtension): Promise { + private async uninstallEverywhere(extension: ILocalExtension, options?: UninstallOptions): Promise { const server = this.getServer(extension); if (!server) { return Promise.reject(`Invalid location ${extension.location.toString()}`); } - const promise = server.extensionManagementService.uninstall(extension); + const promise = server.extensionManagementService.uninstall(extension, options); const otherServers: IExtensionManagementServer[] = this.servers.filter(s => s !== server); if (otherServers.length) { for (const otherServer of otherServers) { const installed = await otherServer.extensionManagementService.getInstalled(); extension = installed.filter(i => !i.isBuiltin && areSameExtensions(i.identifier, extension.identifier))[0]; if (extension) { - await otherServer.extensionManagementService.uninstall(extension); + await otherServer.extensionManagementService.uninstall(extension, options); } } } diff --git a/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.ts b/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.ts index a1c21c2593e..a0e3bcd903e 100644 --- a/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.ts +++ b/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.ts @@ -65,6 +65,7 @@ export class WebExtensionManagementService extends AbstractExtensionManagementSe } private filterEvent({ profileLocation, applicationScoped }: { profileLocation?: URI; applicationScoped?: boolean }): boolean { + profileLocation = profileLocation ?? this.userDataProfileService.currentProfile.extensionsResource; return applicationScoped || this.uriIdentityService.extUri.isEqual(this.userDataProfileService.currentProfile.extensionsResource, profileLocation); } diff --git a/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementServerService.ts b/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementServerService.ts index 9c920ab4057..d539186ddb6 100644 --- a/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementServerService.ts +++ b/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementServerService.ts @@ -9,7 +9,7 @@ import { ExtensionInstallLocation, IExtensionManagementServer, IExtensionManagem import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { NativeRemoteExtensionManagementService } from 'vs/workbench/services/extensionManagement/electron-sandbox/remoteExtensionManagementService'; import { ILabelService } from 'vs/platform/label/common/label'; import { IExtension } from 'vs/platform/extensions/common/extensions'; @@ -66,4 +66,4 @@ export class ExtensionManagementServerService extends Disposable implements IExt } } -registerSingleton(IExtensionManagementServerService, ExtensionManagementServerService, true); +registerSingleton(IExtensionManagementServerService, ExtensionManagementServerService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementService.ts b/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementService.ts index 54ad833ec8b..21033abfbe8 100644 --- a/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementService.ts +++ b/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementService.ts @@ -7,7 +7,7 @@ import { generateUuid } from 'vs/base/common/uuid'; import { ILocalExtension, IExtensionGalleryService, InstallVSIXOptions } from 'vs/platform/extensionManagement/common/extensionManagement'; import { URI } from 'vs/base/common/uri'; import { ExtensionManagementService as BaseExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagementService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IExtensionManagementServer, IExtensionManagementServerService, IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { Schemas } from 'vs/base/common/network'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -53,4 +53,4 @@ export class ExtensionManagementService extends BaseExtensionManagementService { } } -registerSingleton(IWorkbenchExtensionManagementService, ExtensionManagementService, true); +registerSingleton(IWorkbenchExtensionManagementService, ExtensionManagementService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionTipsService.ts b/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionTipsService.ts index e99f8822f0a..fa12c6b9d13 100644 --- a/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionTipsService.ts +++ b/src/vs/workbench/services/extensionManagement/electron-sandbox/extensionTipsService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; import { IExtensionTipsService, IExecutableBasedExtensionTip, IWorkspaceTips, IConfigBasedExtensionTip } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -53,4 +53,4 @@ class NativeExtensionTipsService extends ExtensionTipsService implements IExtens } -registerSingleton(IExtensionTipsService, NativeExtensionTipsService, true); +registerSingleton(IExtensionTipsService, NativeExtensionTipsService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test.ts b/src/vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test.ts index 8e8c6678cfc..3bbb6fe1ebe 100644 --- a/src/vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test.ts +++ b/src/vs/workbench/services/extensionManagement/test/browser/extensionEnablementService.test.ts @@ -402,6 +402,32 @@ suite('ExtensionEnablementService Test', () => { assert.strictEqual(testObject.getEnablementState(dep), EnablementState.EnabledGlobally); }); + test('test enable an extension in workspace with a dependency extension that has auth providers', async () => { + installed.push(...[aLocalExtension2('pub.a', { extensionDependencies: ['pub.b'] }), aLocalExtension('pub.b', { authentication: [{ id: 'a', label: 'a' }] })]); + const target = installed[0]; + await (testObject).waitUntilInitialized(); + await testObject.setEnablement([target], EnablementState.DisabledWorkspace); + await testObject.setEnablement([target], EnablementState.EnabledWorkspace); + assert.ok(testObject.isEnabled(target)); + assert.strictEqual(testObject.getEnablementState(target), EnablementState.EnabledWorkspace); + }); + + test('test enable an extension with a dependency extension that cannot be enabled', async () => { + instantiationService.stub(IExtensionManagementServerService, anExtensionManagementServerService(anExtensionManagementServer('vscode-local', instantiationService), anExtensionManagementServer('vscode-remote', instantiationService), null)); + const localWorkspaceDepExtension = aLocalExtension2('pub.b', { extensionKind: ['workspace'] }, { location: URI.file(`pub.b`) }); + const remoteWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['workspace'], extensionDependencies: ['pub.b'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); + const remoteWorkspaceDepExtension = aLocalExtension2('pub.b', { extensionKind: ['workspace'] }, { location: URI.file(`pub.b`).with({ scheme: Schemas.vscodeRemote }) }); + installed.push(localWorkspaceDepExtension, remoteWorkspaceExtension, remoteWorkspaceDepExtension); + + testObject = new TestExtensionEnablementService(instantiationService); + await (testObject).waitUntilInitialized(); + + await testObject.setEnablement([remoteWorkspaceExtension], EnablementState.DisabledGlobally); + await testObject.setEnablement([remoteWorkspaceExtension], EnablementState.EnabledGlobally); + assert.ok(testObject.isEnabled(remoteWorkspaceExtension)); + assert.strictEqual(testObject.getEnablementState(remoteWorkspaceExtension), EnablementState.EnabledGlobally); + }); + test('test enable an extension also enables packed extensions', async () => { installed.push(...[aLocalExtension2('pub.a', { extensionPack: ['pub.b'] }), aLocalExtension('pub.b')]); const target = installed[0]; diff --git a/src/vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService.ts b/src/vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService.ts index bed9c346aee..1c4b365f2d2 100644 --- a/src/vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService.ts +++ b/src/vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService.ts @@ -6,7 +6,7 @@ import { distinct } from 'vs/base/common/arrays'; import { Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IStorageService, IStorageValueChangeEvent, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { IExtensionIgnoredRecommendationsService, IgnoredRecommendationChangeNotification } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations'; import { IWorkspaceExtensionsConfigService } from 'vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig'; @@ -108,4 +108,4 @@ export class ExtensionIgnoredRecommendationsService extends Disposable implement } -registerSingleton(IExtensionIgnoredRecommendationsService, ExtensionIgnoredRecommendationsService, true); +registerSingleton(IExtensionIgnoredRecommendationsService, ExtensionIgnoredRecommendationsService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.ts b/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.ts index e2495875344..4fe17405e22 100644 --- a/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.ts +++ b/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.ts @@ -9,7 +9,7 @@ import { parse } from 'vs/base/common/json'; import { Disposable } from 'vs/base/common/lifecycle'; import { getIconClasses } from 'vs/editor/common/services/getIconClasses'; import { FileKind, IFileService } from 'vs/platform/files/common/files'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { isWorkspace, IWorkspace, IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IQuickInputService, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput'; @@ -266,4 +266,4 @@ export class WorkspaceExtensionsConfigService extends Disposable implements IWor } -registerSingleton(IWorkspaceExtensionsConfigService, WorkspaceExtensionsConfigService, true); +registerSingleton(IWorkspaceExtensionsConfigService, WorkspaceExtensionsConfigService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionResourceLoader/browser/extensionResourceLoaderService.ts b/src/vs/workbench/services/extensionResourceLoader/browser/extensionResourceLoaderService.ts index de8912cf33d..897d54766fb 100644 --- a/src/vs/workbench/services/extensionResourceLoader/browser/extensionResourceLoaderService.ts +++ b/src/vs/workbench/services/extensionResourceLoader/browser/extensionResourceLoaderService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { URI } from 'vs/base/common/uri'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IFileService } from 'vs/platform/files/common/files'; import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from 'vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader'; import { FileAccess, Schemas } from 'vs/base/common/network'; @@ -52,4 +52,4 @@ class ExtensionResourceLoaderService extends AbstractExtensionResourceLoaderServ } } -registerSingleton(IExtensionResourceLoaderService, ExtensionResourceLoaderService, true); +registerSingleton(IExtensionResourceLoaderService, ExtensionResourceLoaderService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensionResourceLoader/electron-sandbox/extensionResourceLoaderService.ts b/src/vs/workbench/services/extensionResourceLoader/electron-sandbox/extensionResourceLoaderService.ts index 3b30c2dc1f3..c3db91f3a38 100644 --- a/src/vs/workbench/services/extensionResourceLoader/electron-sandbox/extensionResourceLoaderService.ts +++ b/src/vs/workbench/services/extensionResourceLoader/electron-sandbox/extensionResourceLoaderService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { URI } from 'vs/base/common/uri'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IFileService } from 'vs/platform/files/common/files'; import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from 'vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader'; import { IProductService } from 'vs/platform/product/common/productService'; @@ -39,4 +39,4 @@ export class ExtensionResourceLoaderService extends AbstractExtensionResourceLoa } -registerSingleton(IExtensionResourceLoaderService, ExtensionResourceLoaderService, true); +registerSingleton(IExtensionResourceLoaderService, ExtensionResourceLoaderService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts b/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts index e147dac6cc2..13924b49ef0 100644 --- a/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts +++ b/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts @@ -416,7 +416,7 @@ class ExtensionUrlBootstrapHandler implements IWorkbenchContribution, IURLHandle } const workbenchRegistry = Registry.as(WorkbenchExtensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(ExtensionUrlBootstrapHandler, 'ExtensionUrlBootstrapHandler', LifecyclePhase.Ready); +workbenchRegistry.registerWorkbenchContribution(ExtensionUrlBootstrapHandler, LifecyclePhase.Ready); class ManageAuthorizedExtensionURIsAction extends Action2 { diff --git a/src/vs/workbench/services/extensions/common/extensionHostManager.ts b/src/vs/workbench/services/extensions/common/extensionHostManager.ts index 2aceff7689b..41e7ef11f1d 100644 --- a/src/vs/workbench/services/extensions/common/extensionHostManager.ts +++ b/src/vs/workbench/services/extensions/common/extensionHostManager.ts @@ -20,7 +20,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { StopWatch } from 'vs/base/common/stopwatch'; import { VSBuffer } from 'vs/base/common/buffer'; import { IExtensionHost, ExtensionHostKind, ActivationKind, extensionHostKindToString, ExtensionActivationReason, IInternalExtensionService, ExtensionRunningLocation, ExtensionHostExtensions } from 'vs/workbench/services/extensions/common/extensions'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Barrier } from 'vs/base/common/async'; import { URI } from 'vs/base/common/uri'; import { ILogService } from 'vs/platform/log/common/log'; @@ -708,7 +708,7 @@ registerAction2(class MeasureExtHostLatencyAction extends Action2 { value: nls.localize('measureExtHostLatency', "Measure Extension Host Latency"), original: 'Measure Extension Host Latency' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts b/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts index efaeb062e84..63c348cc399 100644 --- a/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts +++ b/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts @@ -11,7 +11,7 @@ import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/ex import { isNonEmptyArray } from 'vs/base/common/arrays'; import { IProductService } from 'vs/platform/product/common/productService'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ExtensionUntrustedWorkspaceSupport } from 'vs/base/common/product'; import { Disposable } from 'vs/base/common/lifecycle'; import { WORKSPACE_TRUST_EXTENSION_SUPPORT } from 'vs/workbench/services/workspaces/common/workspaceTrust'; @@ -371,4 +371,4 @@ export class ExtensionManifestPropertiesService extends Disposable implements IE } } -registerSingleton(IExtensionManifestPropertiesService, ExtensionManifestPropertiesService, true); +registerSingleton(IExtensionManifestPropertiesService, ExtensionManifestPropertiesService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts index 280b0f3fef6..d9a2af80b2c 100644 --- a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts +++ b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts @@ -70,7 +70,6 @@ export const allApiProposals = Object.freeze({ treeItemCheckbox: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeItemCheckbox.d.ts', treeViewReveal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts', tunnels: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts', - workspaceEditIsRefactoring: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceEditIsRefactoring.d.ts', workspaceTrust: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts' }); export type ApiProposalName = keyof typeof allApiProposals; diff --git a/src/vs/workbench/services/extensions/electron-sandbox/electronExtensionService.ts b/src/vs/workbench/services/extensions/electron-sandbox/electronExtensionService.ts index 4077c1661e4..71edeaee506 100644 --- a/src/vs/workbench/services/extensions/electron-sandbox/electronExtensionService.ts +++ b/src/vs/workbench/services/extensions/electron-sandbox/electronExtensionService.ts @@ -34,7 +34,7 @@ import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEn import { IWebWorkerExtensionHostDataProvider, IWebWorkerExtensionHostInitData, WebWorkerExtensionHost } from 'vs/workbench/services/extensions/browser/webWorkerExtensionHost'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ILogService } from 'vs/platform/log/common/log'; -import { CATEGORIES } from 'vs/workbench/common/actions'; +import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { Schemas } from 'vs/base/common/network'; import { ExtensionHostExitCode } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; import { updateProxyConfigurationsScope } from 'vs/platform/request/common/request'; @@ -704,7 +704,7 @@ class RestartExtensionHostAction extends Action2 { super({ id: 'workbench.action.restartExtensionHost', title: { value: nls.localize('restartExtensionHost', "Restart Extension Host"), original: 'Restart Extension Host' }, - category: CATEGORIES.Developer, + category: Categories.Developer, f1: true }); } diff --git a/src/vs/workbench/services/files/browser/elevatedFileService.ts b/src/vs/workbench/services/files/browser/elevatedFileService.ts index 7c2eef326fc..3e950a0f417 100644 --- a/src/vs/workbench/services/files/browser/elevatedFileService.ts +++ b/src/vs/workbench/services/files/browser/elevatedFileService.ts @@ -6,7 +6,7 @@ import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from 'vs/base/common/buffer'; import { URI } from 'vs/base/common/uri'; import { IFileStatWithMetadata, IWriteFileOptions } from 'vs/platform/files/common/files'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IElevatedFileService } from 'vs/workbench/services/files/common/elevatedFileService'; export class BrowserElevatedFileService implements IElevatedFileService { @@ -25,4 +25,4 @@ export class BrowserElevatedFileService implements IElevatedFileService { } } -registerSingleton(IElevatedFileService, BrowserElevatedFileService, true); +registerSingleton(IElevatedFileService, BrowserElevatedFileService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts b/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts index 3f2ff21e4aa..189612f7115 100644 --- a/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts +++ b/src/vs/workbench/services/files/electron-sandbox/elevatedFileService.ts @@ -8,7 +8,7 @@ import { randomPath } from 'vs/base/common/extpath'; 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 { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { IElevatedFileService } from 'vs/workbench/services/files/common/elevatedFileService'; @@ -49,4 +49,4 @@ export class NativeElevatedFileService implements IElevatedFileService { } } -registerSingleton(IElevatedFileService, NativeElevatedFileService, true); +registerSingleton(IElevatedFileService, NativeElevatedFileService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/host/browser/browserHostService.ts b/src/vs/workbench/services/host/browser/browserHostService.ts index 63ddc762602..f17e7a256a0 100644 --- a/src/vs/workbench/services/host/browser/browserHostService.ts +++ b/src/vs/workbench/services/host/browser/browserHostService.ts @@ -5,7 +5,7 @@ import { Event } from 'vs/base/common/event'; import { IHostService } from 'vs/workbench/services/host/browser/host'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -531,4 +531,4 @@ export class BrowserHostService extends Disposable implements IHostService { //#endregion } -registerSingleton(IHostService, BrowserHostService, true); +registerSingleton(IHostService, BrowserHostService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts b/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts index 6f3f1ab1a80..f9181a1a376 100644 --- a/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts +++ b/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts @@ -6,7 +6,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 { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILabelService } from 'vs/platform/label/common/label'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IWindowOpenable, IOpenWindowOptions, isFolderToOpen, isWorkspaceToOpen, IOpenEmptyWindowOptions } from 'vs/platform/window/common/window'; @@ -138,5 +138,5 @@ class WorkbenchHostService extends Disposable implements IHostService { //#endregion } -registerSingleton(IHostService, WorkbenchHostService, true); -registerSingleton(INativeHostService, WorkbenchNativeHostService, true); +registerSingleton(IHostService, WorkbenchHostService, InstantiationType.Delayed); +registerSingleton(INativeHostService, WorkbenchNativeHostService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/hover/browser/hoverService.ts b/src/vs/workbench/services/hover/browser/hoverService.ts index 69f7457daa6..3a33a5ed48e 100644 --- a/src/vs/workbench/services/hover/browser/hoverService.ts +++ b/src/vs/workbench/services/hover/browser/hoverService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./media/hover'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorHoverBackground, editorHoverBorder, textLinkForeground, editorHoverForeground, editorHoverStatusBarBackground, textCodeBlockBackground, widgetShadow, textLinkActiveForeground, focusBorder, toolbarHoverBackground } from 'vs/platform/theme/common/colorRegistry'; import { IHoverService, IHoverOptions, IHoverWidget } from 'vs/workbench/services/hover/browser/hover'; @@ -156,7 +156,7 @@ class HoverContextViewDelegate implements IDelegate { } } -registerSingleton(IHoverService, HoverService, true); +registerSingleton(IHoverService, HoverService, InstantiationType.Delayed); registerThemingParticipant((theme, collector) => { const hoverBackground = theme.getColor(editorHoverBackground); diff --git a/src/vs/workbench/services/integrity/browser/integrityService.ts b/src/vs/workbench/services/integrity/browser/integrityService.ts index f29a3dfe552..e2285f53c04 100644 --- a/src/vs/workbench/services/integrity/browser/integrityService.ts +++ b/src/vs/workbench/services/integrity/browser/integrityService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IIntegrityService, IntegrityTestResult } from 'vs/workbench/services/integrity/common/integrity'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; export class IntegrityService implements IIntegrityService { @@ -15,4 +15,4 @@ export class IntegrityService implements IIntegrityService { } } -registerSingleton(IIntegrityService, IntegrityService, true); +registerSingleton(IIntegrityService, IntegrityService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/integrity/electron-sandbox/integrityService.ts b/src/vs/workbench/services/integrity/electron-sandbox/integrityService.ts index 7125f82440e..ad51e6ef946 100644 --- a/src/vs/workbench/services/integrity/electron-sandbox/integrityService.ts +++ b/src/vs/workbench/services/integrity/electron-sandbox/integrityService.ts @@ -11,7 +11,7 @@ import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecyc import { IProductService } from 'vs/platform/product/common/productService'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { FileAccess } from 'vs/base/common/network'; import { IChecksumService } from 'vs/platform/checksum/common/checksumService'; @@ -163,4 +163,4 @@ export class IntegrityService implements IIntegrityService { } } -registerSingleton(IIntegrityService, IntegrityService, true); +registerSingleton(IIntegrityService, IntegrityService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts b/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts index 0e630dc4ce8..c83b9e0a72c 100644 --- a/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts +++ b/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; import { KeymapInfo, IRawMixedKeyboardMapping, IKeymapInfo } from 'vs/workbench/services/keybinding/common/keymapInfo'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { DispatchConfig } from 'vs/platform/keyboardLayout/common/dispatchConfig'; import { IKeyboardMapper, CachedKeyboardMapper } from 'vs/platform/keyboardLayout/common/keyboardMapper'; import { OS, OperatingSystem, isMacintosh, isWindows } from 'vs/base/common/platform'; @@ -618,7 +618,7 @@ export class BrowserKeyboardLayoutService extends Disposable implements IKeyboar } } -registerSingleton(IKeyboardLayoutService, BrowserKeyboardLayoutService, true); +registerSingleton(IKeyboardLayoutService, BrowserKeyboardLayoutService, InstantiationType.Delayed); // Configuration const configurationRegistry = Registry.as(ConfigExtensions.Configuration); diff --git a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts index a064d35bee6..4ddcceda908 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts @@ -22,7 +22,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; export const IKeybindingEditingService = createDecorator('keybindingEditingService'); @@ -293,4 +293,4 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding } } -registerSingleton(IKeybindingEditingService, KeybindingsEditingService, true); +registerSingleton(IKeybindingEditingService, KeybindingsEditingService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/label/common/labelService.ts b/src/vs/workbench/services/label/common/labelService.ts index bf0c0c1f5b2..5e3e0114503 100644 --- a/src/vs/workbench/services/label/common/labelService.ts +++ b/src/vs/workbench/services/label/common/labelService.ts @@ -18,7 +18,7 @@ import { ILabelService, ResourceLabelFormatter, ResourceLabelFormatting, IFormat import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; import { match } from 'vs/base/common/glob'; import { ILifecycleService, LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IPathService } from 'vs/workbench/services/path/common/pathService'; import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; import { OperatingSystem, OS } from 'vs/base/common/platform'; @@ -103,7 +103,7 @@ class ResourceLabelFormattersHandler implements IWorkbenchContribution { }); } } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ResourceLabelFormattersHandler, 'ResourceLabelFormattersHandler', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ResourceLabelFormattersHandler, LifecyclePhase.Restored); const FORMATTER_CACHE_SIZE = 50; @@ -455,4 +455,4 @@ export class LabelService extends Disposable implements ILabelService { } } -registerSingleton(ILabelService, LabelService, true); +registerSingleton(ILabelService, LabelService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/languageStatus/common/languageStatusService.ts b/src/vs/workbench/services/languageStatus/common/languageStatusService.ts index 7f8bbc8ae19..a7a49dad0be 100644 --- a/src/vs/workbench/services/languageStatus/common/languageStatusService.ts +++ b/src/vs/workbench/services/languageStatus/common/languageStatusService.ts @@ -13,7 +13,7 @@ import { Command } from 'vs/editor/common/languages'; import { LanguageFeatureRegistry } from 'vs/editor/common/languageFeatureRegistry'; import { LanguageSelector } from 'vs/editor/common/languageSelector'; import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export interface ILanguageStatus { @@ -73,4 +73,4 @@ class LanguageStatusServiceImpl implements ILanguageStatusService { } } -registerSingleton(ILanguageStatusService, LanguageStatusServiceImpl, true); +registerSingleton(ILanguageStatusService, LanguageStatusServiceImpl, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/model/common/modelService.ts b/src/vs/workbench/services/model/common/modelService.ts index e72f0272a98..7765c84da55 100644 --- a/src/vs/workbench/services/model/common/modelService.ts +++ b/src/vs/workbench/services/model/common/modelService.ts @@ -10,7 +10,7 @@ import { ModelService } from 'vs/editor/common/services/modelService'; import { ILanguageService } from 'vs/editor/common/languages/language'; import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; @@ -42,4 +42,4 @@ export class WorkbenchModelService extends ModelService { } } -registerSingleton(IModelService, WorkbenchModelService, true); +registerSingleton(IModelService, WorkbenchModelService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/notification/common/notificationService.ts b/src/vs/workbench/services/notification/common/notificationService.ts index 1a768532b79..545f9104c05 100644 --- a/src/vs/workbench/services/notification/common/notificationService.ts +++ b/src/vs/workbench/services/notification/common/notificationService.ts @@ -8,7 +8,7 @@ import { INotificationService, INotification, INotificationHandle, Severity, Not import { NotificationsModel, ChoiceAction, NotificationChangeType } from 'vs/workbench/common/notifications'; import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; import { Emitter, Event } from 'vs/base/common/event'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IAction, Action } from 'vs/base/common/actions'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; @@ -271,4 +271,4 @@ export class NotificationService extends Disposable implements INotificationServ } } -registerSingleton(INotificationService, NotificationService, true); +registerSingleton(INotificationService, NotificationService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/outline/browser/outlineService.ts b/src/vs/workbench/services/outline/browser/outlineService.ts index fac1d91dd08..f4707432371 100644 --- a/src/vs/workbench/services/outline/browser/outlineService.ts +++ b/src/vs/workbench/services/outline/browser/outlineService.ts @@ -6,7 +6,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { LinkedList } from 'vs/base/common/linkedList'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IEditorPane } from 'vs/workbench/common/editor'; import { IOutline, IOutlineCreator, IOutlineService, OutlineTarget } from 'vs/workbench/services/outline/browser/outline'; import { Event, Emitter } from 'vs/base/common/event'; @@ -49,4 +49,4 @@ class OutlineService implements IOutlineService { } -registerSingleton(IOutlineService, OutlineService, true); +registerSingleton(IOutlineService, OutlineService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/path/browser/pathService.ts b/src/vs/workbench/services/path/browser/pathService.ts index 215f1ec36ad..664884d60ba 100644 --- a/src/vs/workbench/services/path/browser/pathService.ts +++ b/src/vs/workbench/services/path/browser/pathService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { IPathService, AbstractPathService } from 'vs/workbench/services/path/common/pathService'; import { URI } from 'vs/base/common/uri'; @@ -57,4 +57,4 @@ function guessLocalUserHome(environmentService: IWorkbenchEnvironmentService, co }); } -registerSingleton(IPathService, BrowserPathService, true); +registerSingleton(IPathService, BrowserPathService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/path/electron-sandbox/pathService.ts b/src/vs/workbench/services/path/electron-sandbox/pathService.ts index 07159a128c5..7888fc6ab71 100644 --- a/src/vs/workbench/services/path/electron-sandbox/pathService.ts +++ b/src/vs/workbench/services/path/electron-sandbox/pathService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { IPathService, AbstractPathService } from 'vs/workbench/services/path/common/pathService'; @@ -20,4 +20,4 @@ export class NativePathService extends AbstractPathService { } } -registerSingleton(IPathService, NativePathService, true); +registerSingleton(IPathService, NativePathService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.ts b/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.ts index 0e2f929af32..8987b464b18 100644 --- a/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.ts +++ b/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.ts @@ -44,7 +44,7 @@ export class KeybindingsEditorInput extends EditorInput { } override matches(otherInput: EditorInput | IUntypedEditorInput): boolean { - return super.matches(otherInput) || otherInput instanceof KeybindingsEditorInput; + return otherInput instanceof KeybindingsEditorInput; } override dispose(): void { diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index 1759898bf46..473e718663b 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -20,7 +20,7 @@ import * as nls from 'vs/nls'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Extensions, getDefaultValue, IConfigurationRegistry, OVERRIDE_PROPERTY_REGEX } from 'vs/platform/configuration/common/configurationRegistry'; import { FileOperationError, FileOperationResult } from 'vs/platform/files/common/files'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ILabelService } from 'vs/platform/label/common/label'; @@ -605,4 +605,4 @@ export class PreferencesService extends Disposable implements IPreferencesServic } } -registerSingleton(IPreferencesService, PreferencesService, true); +registerSingleton(IPreferencesService, PreferencesService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index 5d95e1984f7..c3a0416f735 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -14,7 +14,7 @@ import { ProgressBadge, IActivityService } from 'vs/workbench/services/activity/ import { INotificationService, Severity, INotificationHandle } from 'vs/platform/notification/common/notification'; import { Action } from 'vs/base/common/actions'; import { Event, Emitter } from 'vs/base/common/event'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; import { Dialog } from 'vs/base/browser/ui/dialog/dialog'; import { attachDialogStyler } from 'vs/platform/theme/common/styler'; @@ -622,4 +622,4 @@ export class ProgressService extends Disposable implements IProgressService { } } -registerSingleton(IProgressService, ProgressService, true); +registerSingleton(IProgressService, ProgressService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/quickinput/browser/quickInputService.ts b/src/vs/workbench/services/quickinput/browser/quickInputService.ts index 891e6b6fe1b..34572df63e0 100644 --- a/src/vs/workbench/services/quickinput/browser/quickInputService.ts +++ b/src/vs/workbench/services/quickinput/browser/quickInputService.ts @@ -12,7 +12,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { QuickInputController } from 'vs/base/parts/quickinput/browser/quickInput'; import { QuickInputService as BaseQuickInputService } from 'vs/platform/quickinput/browser/quickInput'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { InQuickPickContextKey } from 'vs/workbench/browser/quickaccess'; @@ -47,4 +47,4 @@ export class QuickInputService extends BaseQuickInputService { } } -registerSingleton(IQuickInputService, QuickInputService, true); +registerSingleton(IQuickInputService, QuickInputService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/remote/browser/remoteAgentService.ts b/src/vs/workbench/services/remote/browser/remoteAgentService.ts index 69a816ad6b9..dc897db8241 100644 --- a/src/vs/workbench/services/remote/browser/remoteAgentService.ts +++ b/src/vs/workbench/services/remote/browser/remoteAgentService.ts @@ -69,4 +69,4 @@ class RemoteConnectionFailureNotificationContribution implements IWorkbenchContr } const workbenchRegistry = Registry.as(Extensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(RemoteConnectionFailureNotificationContribution, 'RemoteConnectionFailureNotificationContribution', LifecyclePhase.Ready); +workbenchRegistry.registerWorkbenchContribution(RemoteConnectionFailureNotificationContribution, LifecyclePhase.Ready); diff --git a/src/vs/workbench/services/remote/common/remoteExplorerService.ts b/src/vs/workbench/services/remote/common/remoteExplorerService.ts index ff29e0375ca..cbc2eef9ea9 100644 --- a/src/vs/workbench/services/remote/common/remoteExplorerService.ts +++ b/src/vs/workbench/services/remote/common/remoteExplorerService.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { Event, Emitter } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ALL_INTERFACES_ADDRESSES, isAllInterfaces, isLocalhost, ITunnelService, LOCALHOST_ADDRESSES, PortAttributesProvider, ProvidedOnAutoForward, ProvidedPortAttributes, RemoteTunnel, TunnelPrivacyId, TunnelProtocol } from 'vs/platform/tunnel/common/tunnel'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; @@ -1015,4 +1015,4 @@ class RemoteExplorerService implements IRemoteExplorerService { } } -registerSingleton(IRemoteExplorerService, RemoteExplorerService, true); +registerSingleton(IRemoteExplorerService, RemoteExplorerService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts b/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts index 38556bbcb9a..997cfc7cda5 100644 --- a/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts +++ b/src/vs/workbench/services/remote/electron-sandbox/remoteAgentService.ts @@ -90,4 +90,4 @@ class RemoteConnectionFailureNotificationContribution implements IWorkbenchContr } const workbenchRegistry = Registry.as(Extensions.Workbench); -workbenchRegistry.registerWorkbenchContribution(RemoteConnectionFailureNotificationContribution, 'RemoteConnectionFailureNotificationContribution', LifecyclePhase.Ready); +workbenchRegistry.registerWorkbenchContribution(RemoteConnectionFailureNotificationContribution, LifecyclePhase.Ready); diff --git a/src/vs/workbench/services/request/electron-sandbox/requestService.ts b/src/vs/workbench/services/request/electron-sandbox/requestService.ts index 4fb44ec4e00..2ff418a52e1 100644 --- a/src/vs/workbench/services/request/electron-sandbox/requestService.ts +++ b/src/vs/workbench/services/request/electron-sandbox/requestService.ts @@ -6,7 +6,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService } from 'vs/platform/log/common/log'; import { RequestService } from 'vs/platform/request/browser/requestService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; @@ -25,4 +25,4 @@ export class NativeRequestService extends RequestService { } } -registerSingleton(IRequestService, NativeRequestService, true); +registerSingleton(IRequestService, NativeRequestService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/search/browser/searchService.ts b/src/vs/workbench/services/search/browser/searchService.ts index 21bb410c03e..bea85f71a43 100644 --- a/src/vs/workbench/services/search/browser/searchService.ts +++ b/src/vs/workbench/services/search/browser/searchService.ts @@ -17,7 +17,7 @@ import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity' import { IWorkerClient, logOnceWebWorkerWarning, SimpleWorkerClient } from 'vs/base/common/worker/simpleWorker'; import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { DefaultWorkerFactory } from 'vs/base/browser/defaultWorkerFactory'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILocalFileSearchSimpleWorker, ILocalFileSearchSimpleWorkerHost } from 'vs/workbench/services/search/common/localFileSearchWorkerTypes'; import { memoize } from 'vs/base/common/decorators'; import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider'; @@ -196,4 +196,4 @@ export class LocalFileSearchWorkerClient extends Disposable implements ISearchRe } } -registerSingleton(ISearchService, RemoteSearchService, true); +registerSingleton(ISearchService, RemoteSearchService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/search/electron-sandbox/searchService.ts b/src/vs/workbench/services/search/electron-sandbox/searchService.ts index 1bb5a83da06..cf9c6c6fd91 100644 --- a/src/vs/workbench/services/search/electron-sandbox/searchService.ts +++ b/src/vs/workbench/services/search/electron-sandbox/searchService.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ISearchService } from 'vs/workbench/services/search/common/search'; import { SearchService } from 'vs/workbench/services/search/common/searchService'; -registerSingleton(ISearchService, SearchService, true); +registerSingleton(ISearchService, SearchService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/telemetry/browser/telemetryService.ts b/src/vs/workbench/services/telemetry/browser/telemetryService.ts index dbf075cf7d2..6d5739aed97 100644 --- a/src/vs/workbench/services/telemetry/browser/telemetryService.ts +++ b/src/vs/workbench/services/telemetry/browser/telemetryService.ts @@ -6,7 +6,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IObservableValue } from 'vs/base/common/observableValue'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILoggerService } from 'vs/platform/log/common/log'; import { IProductService } from 'vs/platform/product/common/productService'; import { IStorageService } from 'vs/platform/storage/common/storage'; @@ -108,4 +108,4 @@ export class TelemetryService extends Disposable implements ITelemetryService { } } -registerSingleton(ITelemetryService, TelemetryService, false); +registerSingleton(ITelemetryService, TelemetryService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/telemetry/electron-sandbox/telemetryService.ts b/src/vs/workbench/services/telemetry/electron-sandbox/telemetryService.ts index 4e2103332d1..7a1e6498df9 100644 --- a/src/vs/workbench/services/telemetry/electron-sandbox/telemetryService.ts +++ b/src/vs/workbench/services/telemetry/electron-sandbox/telemetryService.ts @@ -14,7 +14,7 @@ import { TelemetryAppenderClient } from 'vs/platform/telemetry/common/telemetryI import { IStorageService } from 'vs/platform/storage/common/storage'; import { resolveWorkbenchCommonProperties } from 'vs/workbench/services/telemetry/electron-sandbox/workbenchCommonProperties'; import { TelemetryService as BaseTelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ClassifiedEvent, StrictPropertyCheck, OmitMetadata, IGDPRProperty } from 'vs/platform/telemetry/common/gdprTypings'; import { IFileService } from 'vs/platform/files/common/files'; import { IObservableValue } from 'vs/base/common/observableValue'; @@ -84,4 +84,4 @@ export class TelemetryService extends Disposable implements ITelemetryService { } } -registerSingleton(ITelemetryService, TelemetryService, false); +registerSingleton(ITelemetryService, TelemetryService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/textfile/test/browser/textFileEditorModel.test.ts b/src/vs/workbench/services/textfile/test/browser/textFileEditorModel.test.ts index 0fc86c74e4f..a6fb673f437 100644 --- a/src/vs/workbench/services/textfile/test/browser/textFileEditorModel.test.ts +++ b/src/vs/workbench/services/textfile/test/browser/textFileEditorModel.test.ts @@ -21,6 +21,7 @@ import { DisposableStore } from 'vs/base/common/lifecycle'; import { SaveReason, SaveSourceRegistry } from 'vs/workbench/common/editor'; import { isEqual } from 'vs/base/common/resources'; import { UTF16be } from 'vs/workbench/services/textfile/common/encoding'; +import { isWeb } from 'vs/base/common/platform'; suite('Files - TextFileEditorModel', () => { @@ -655,8 +656,18 @@ suite('Files - TextFileEditorModel', () => { await accessor.textFileService.save(toResource.call(this, '/path/index_async2.txt')); assert.ok(!accessor.textFileService.isDirty(toResource.call(this, '/path/index_async.txt'))); assert.ok(!accessor.textFileService.isDirty(toResource.call(this, '/path/index_async2.txt'))); - assert.ok(assertIsDefined(getLastResolvedFileStat(model1)).mtime > m1Mtime); - assert.ok(assertIsDefined(getLastResolvedFileStat(model2)).mtime > m2Mtime); + + if (isWeb) { + // web tests does not ensure timeouts are respected at all, so we cannot + // really assert the mtime to be different, only that it is equal or greater. + // https://github.com/microsoft/vscode/issues/161886 + assert.ok(assertIsDefined(getLastResolvedFileStat(model1)).mtime >= m1Mtime); + assert.ok(assertIsDefined(getLastResolvedFileStat(model2)).mtime >= m2Mtime); + } else { + // on desktop we want to assert this condition more strictly though + assert.ok(assertIsDefined(getLastResolvedFileStat(model1)).mtime > m1Mtime); + assert.ok(assertIsDefined(getLastResolvedFileStat(model2)).mtime > m2Mtime); + } model1.dispose(); model2.dispose(); diff --git a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts index 1c0ba078d72..e9a8f68117e 100644 --- a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts +++ b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts @@ -14,7 +14,7 @@ import { Schemas } from 'vs/base/common/network'; import { ITextModelService, ITextModelContentProvider, ITextEditorModel, IResolvedTextEditorModel, isResolvedTextEditorModel } from 'vs/editor/common/services/resolverService'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { IFileService } from 'vs/platform/files/common/files'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; import { ModelUndoRedoParticipant } from 'vs/editor/common/services/modelUndoRedoParticipant'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; @@ -246,4 +246,4 @@ export class TextModelResolverService extends Disposable implements ITextModelSe } } -registerSingleton(ITextModelService, TextModelResolverService, true); +registerSingleton(ITextModelService, TextModelResolverService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/textresourceProperties/common/textResourcePropertiesService.ts b/src/vs/workbench/services/textresourceProperties/common/textResourcePropertiesService.ts index 3cdfdc486cf..0118d3d4e27 100644 --- a/src/vs/workbench/services/textresourceProperties/common/textResourcePropertiesService.ts +++ b/src/vs/workbench/services/textresourceProperties/common/textResourcePropertiesService.ts @@ -10,7 +10,7 @@ import { OperatingSystem, OS } from 'vs/base/common/platform'; import { Schemas } from 'vs/base/common/network'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; @@ -54,4 +54,4 @@ export class TextResourcePropertiesService implements ITextResourcePropertiesSer } } -registerSingleton(ITextResourcePropertiesService, TextResourcePropertiesService, true); +registerSingleton(ITextResourcePropertiesService, TextResourcePropertiesService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.ts b/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.ts index 469ada1f878..09cabf53111 100644 --- a/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.ts +++ b/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.ts @@ -5,7 +5,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { addMatchMediaChangeListener } from 'vs/base/browser/browser'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; @@ -54,4 +54,4 @@ export class BrowserHostColorSchemeService extends Disposable implements IHostCo } -registerSingleton(IHostColorSchemeService, BrowserHostColorSchemeService, true); +registerSingleton(IHostColorSchemeService, BrowserHostColorSchemeService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts b/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts index f9578f6805a..10769a87465 100644 --- a/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts +++ b/src/vs/workbench/services/themes/electron-sandbox/nativeHostColorSchemeService.ts @@ -5,7 +5,7 @@ import { Emitter } from 'vs/base/common/event'; import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; @@ -70,4 +70,4 @@ export class NativeHostColorSchemeService extends Disposable implements IHostCol } -registerSingleton(IHostColorSchemeService, NativeHostColorSchemeService, true); +registerSingleton(IHostColorSchemeService, NativeHostColorSchemeService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts index 2a778a46ca8..7f54ca6ea75 100644 --- a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts +++ b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts @@ -14,7 +14,7 @@ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessib import { IStartupMetrics, AbstractTimerService, Writeable, ITimerService } from 'vs/workbench/services/timer/browser/timerService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { IProductService } from 'vs/platform/product/common/productService'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; @@ -85,7 +85,7 @@ export class TimerService extends AbstractTimerService { } } -registerSingleton(ITimerService, TimerService, true); +registerSingleton(ITimerService, TimerService, InstantiationType.Delayed); //#region cached data logic diff --git a/src/vs/workbench/services/tunnel/browser/tunnelService.ts b/src/vs/workbench/services/tunnel/browser/tunnelService.ts index 622b9c7d62a..179594037d5 100644 --- a/src/vs/workbench/services/tunnel/browser/tunnelService.ts +++ b/src/vs/workbench/services/tunnel/browser/tunnelService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { URI } from 'vs/base/common/uri'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; import { IAddressProvider } from 'vs/platform/remote/common/remoteAgentConnection'; import { AbstractTunnelService, ITunnelService, RemoteTunnel } from 'vs/platform/tunnel/common/tunnel'; @@ -18,6 +18,10 @@ export class TunnelService extends AbstractTunnelService { super(logService); } + public isPortPrivileged(_port: number): boolean { + return false; + } + protected retainOrCreateTunnel(_addressProvider: IAddressProvider, remoteHost: string, remotePort: number, localPort: number | undefined, elevateIfNeeded: boolean, privacy?: string, protocol?: string): Promise | undefined { const existing = this.getTunnelFromMap(remoteHost, remotePort); if (existing) { @@ -36,4 +40,4 @@ export class TunnelService extends AbstractTunnelService { } } -registerSingleton(ITunnelService, TunnelService, true); +registerSingleton(ITunnelService, TunnelService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/tunnel/electron-sandbox/tunnelService.ts b/src/vs/workbench/services/tunnel/electron-sandbox/tunnelService.ts index eb6835f334d..dcc855a7e9d 100644 --- a/src/vs/workbench/services/tunnel/electron-sandbox/tunnelService.ts +++ b/src/vs/workbench/services/tunnel/electron-sandbox/tunnelService.ts @@ -14,6 +14,8 @@ import { ISharedProcessTunnelService } from 'vs/platform/remote/common/sharedPro import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; +import { isMacintosh, isWindows } from 'vs/base/common/platform'; class SharedProcessTunnel extends Disposable implements RemoteTunnel { @@ -59,6 +61,7 @@ export class TunnelService extends AbstractTunnelService { @ISharedProcessTunnelService private readonly _sharedProcessTunnelService: ISharedProcessTunnelService, @IInstantiationService private readonly _instantiationService: IInstantiationService, @ILifecycleService lifecycleService: ILifecycleService, + @INativeWorkbenchEnvironmentService private readonly _nativeWorkbenchEnvironmentService: INativeWorkbenchEnvironmentService ) { super(logService); @@ -70,6 +73,10 @@ export class TunnelService extends AbstractTunnelService { }); } + public isPortPrivileged(port: number): boolean { + return this.doIsPortPrivileged(port, isWindows, isMacintosh, this._nativeWorkbenchEnvironmentService.os.release); + } + protected retainOrCreateTunnel(addressProvider: IAddressProvider, remoteHost: string, remotePort: number, localPort: number | undefined, elevateIfNeeded: boolean, privacy?: string, protocol?: string): Promise | undefined { const existing = this.getTunnelFromMap(remoteHost, remotePort); if (existing) { diff --git a/src/vs/workbench/services/untitled/common/untitledTextEditorService.ts b/src/vs/workbench/services/untitled/common/untitledTextEditorService.ts index 3b31b992f6f..919d45b23d1 100644 --- a/src/vs/workbench/services/untitled/common/untitledTextEditorService.ts +++ b/src/vs/workbench/services/untitled/common/untitledTextEditorService.ts @@ -12,7 +12,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { ResourceMap } from 'vs/base/common/map'; import { Schemas } from 'vs/base/common/network'; import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; export const IUntitledTextEditorService = createDecorator('untitledTextEditorService'); @@ -261,4 +261,4 @@ export class UntitledTextEditorService extends Disposable implements IUntitledTe } } -registerSingleton(IUntitledTextEditorService, UntitledTextEditorService, true); +registerSingleton(IUntitledTextEditorService, UntitledTextEditorService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/url/browser/urlService.ts b/src/vs/workbench/services/url/browser/urlService.ts index 7aec4c76552..602d6d32c6b 100644 --- a/src/vs/workbench/services/url/browser/urlService.ts +++ b/src/vs/workbench/services/url/browser/urlService.ts @@ -5,7 +5,7 @@ import { IURLService } from 'vs/platform/url/common/url'; import { URI, UriComponents } from 'vs/base/common/uri'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { AbstractURLService } from 'vs/platform/url/common/urlService'; import { Event } from 'vs/base/common/event'; import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; @@ -91,4 +91,4 @@ export class BrowserURLService extends AbstractURLService { } } -registerSingleton(IURLService, BrowserURLService, true); +registerSingleton(IURLService, BrowserURLService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userData/browser/userDataInit.ts b/src/vs/workbench/services/userData/browser/userDataInit.ts index 67ab3ee9976..e7cfccfe177 100644 --- a/src/vs/workbench/services/userData/browser/userDataInit.ts +++ b/src/vs/workbench/services/userData/browser/userDataInit.ts @@ -445,5 +445,5 @@ class InitializeOtherResourcesContribution implements IWorkbenchContribution { if (isWeb) { const workbenchRegistry = Registry.as(Extensions.Workbench); - workbenchRegistry.registerWorkbenchContribution(InitializeOtherResourcesContribution, 'InitializeOtherResourcesContribution', LifecyclePhase.Restored); + workbenchRegistry.registerWorkbenchContribution(InitializeOtherResourcesContribution, LifecyclePhase.Restored); } diff --git a/src/vs/workbench/services/userDataProfile/common/userDataProfileImportExportService.ts b/src/vs/workbench/services/userDataProfile/common/userDataProfileImportExportService.ts index 61da2875775..b9b95d027fd 100644 --- a/src/vs/workbench/services/userDataProfile/common/userDataProfileImportExportService.ts +++ b/src/vs/workbench/services/userDataProfile/common/userDataProfileImportExportService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; @@ -93,4 +93,4 @@ export class UserDataProfileImportExportService implements IUserDataProfileImpor } -registerSingleton(IUserDataProfileImportExportService, UserDataProfileImportExportService, true); +registerSingleton(IUserDataProfileImportExportService, UserDataProfileImportExportService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userDataProfile/common/userDataProfileService.ts b/src/vs/workbench/services/userDataProfile/common/userDataProfileService.ts index 8b34656b973..63b78ba06b7 100644 --- a/src/vs/workbench/services/userDataProfile/common/userDataProfileService.ts +++ b/src/vs/workbench/services/userDataProfile/common/userDataProfileService.ts @@ -4,11 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import { Promises } from 'vs/base/common/async'; +import { Codicon } from 'vs/base/common/codicons'; import { Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; +import { localize } from 'vs/nls'; +import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; import { IUserDataProfile, IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; import { DidChangeUserDataProfileEvent, IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +const defaultUserDataProfileIcon = registerIcon('defaultSettingsProfiles-icon', Codicon.settings, localize('settingsProfilesIcon', 'Icon for Default Settings Profiles.')); + export class UserDataProfileService extends Disposable implements IUserDataProfileService { readonly _serviceBrand: undefined; @@ -65,6 +70,9 @@ export class UserDataProfileService extends Disposable implements IUserDataProfi } getShortName(profile: IUserDataProfile): string { + if (profile.isDefault) { + return `$(${defaultUserDataProfileIcon.id})`; + } if (profile.shortName) { return profile.shortName; } diff --git a/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.ts b/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.ts index c5eb692ab0a..a24838309e6 100644 --- a/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.ts +++ b/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IUserDataSyncEnablementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync'; import { UserDataSyncEnablementService as BaseUserDataSyncEnablementService } from 'vs/platform/userDataSync/common/userDataSyncEnablementService'; import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; @@ -18,4 +18,4 @@ export class UserDataSyncEnablementService extends BaseUserDataSyncEnablementSer } -registerSingleton(IUserDataSyncEnablementService, UserDataSyncEnablementService, true); +registerSingleton(IUserDataSyncEnablementService, UserDataSyncEnablementService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts index 8cf00b48ffd..36368bb699e 100644 --- a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts +++ b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts @@ -381,7 +381,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat if (status === SyncStatus.HasConflicts) { progress.report({ message: localize('resolving conflicts', "Resolving conflicts...") }); } else { - progress.report({ message: localize('syncing...', "Turnin on...") }); + progress.report({ message: localize('syncing...', "Turning on...") }); } })); await manualSyncTask.merge(); diff --git a/src/vs/workbench/services/userDataSync/browser/webUserDataSyncEnablementService.ts b/src/vs/workbench/services/userDataSync/browser/webUserDataSyncEnablementService.ts index 896f506c826..a05ae03d23d 100644 --- a/src/vs/workbench/services/userDataSync/browser/webUserDataSyncEnablementService.ts +++ b/src/vs/workbench/services/userDataSync/browser/webUserDataSyncEnablementService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IUserDataSyncEnablementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync'; import { UserDataSyncEnablementService } from 'vs/workbench/services/userDataSync/browser/userDataSyncEnablementService'; @@ -51,4 +51,4 @@ export class WebUserDataSyncEnablementService extends UserDataSyncEnablementServ } -registerSingleton(IUserDataSyncEnablementService, WebUserDataSyncEnablementService, true); +registerSingleton(IUserDataSyncEnablementService, WebUserDataSyncEnablementService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts b/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts index aeafb075e5d..45329df40c4 100644 --- a/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts +++ b/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts @@ -6,7 +6,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IUserDataSyncUtilService, getDefaultIgnoredSettings } from 'vs/platform/userDataSync/common/userDataSync'; import { IStringDictionary } from 'vs/base/common/collections'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { FormattingOptions } from 'vs/base/common/jsonFormatter'; import { URI } from 'vs/base/common/uri'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; @@ -53,4 +53,4 @@ class UserDataSyncUtilService implements IUserDataSyncUtilService { } -registerSingleton(IUserDataSyncUtilService, UserDataSyncUtilService, true); +registerSingleton(IUserDataSyncUtilService, UserDataSyncUtilService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataAutoSyncService.ts b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataAutoSyncService.ts index d373b910b87..62da5d44f2e 100644 --- a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataAutoSyncService.ts +++ b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataAutoSyncService.ts @@ -7,7 +7,7 @@ import { IUserDataAutoSyncService, UserDataSyncError } from 'vs/platform/userDat import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; import { Event } from 'vs/base/common/event'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; class UserDataAutoSyncService implements IUserDataAutoSyncService { @@ -36,4 +36,4 @@ class UserDataAutoSyncService implements IUserDataAutoSyncService { } -registerSingleton(IUserDataAutoSyncService, UserDataAutoSyncService, true); +registerSingleton(IUserDataAutoSyncService, UserDataAutoSyncService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncAccountService.ts b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncAccountService.ts index c9806977001..134525e6d86 100644 --- a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncAccountService.ts +++ b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncAccountService.ts @@ -5,7 +5,7 @@ import { IChannel } from 'vs/base/parts/ipc/common/ipc'; import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Disposable } from 'vs/base/common/lifecycle'; import { Event, Emitter } from 'vs/base/common/event'; import { IUserDataSyncAccountService, IUserDataSyncAccount } from 'vs/platform/userDataSync/common/userDataSyncAccount'; @@ -44,4 +44,4 @@ export class UserDataSyncAccountService extends Disposable implements IUserDataS } -registerSingleton(IUserDataSyncAccountService, UserDataSyncAccountService, true); +registerSingleton(IUserDataSyncAccountService, UserDataSyncAccountService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncMachinesService.ts b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncMachinesService.ts index 059d4989d7d..766386ba6a9 100644 --- a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncMachinesService.ts +++ b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncMachinesService.ts @@ -6,7 +6,7 @@ import { ISharedProcessService } from 'vs/platform/ipc/electron-sandbox/services'; import { Disposable } from 'vs/base/common/lifecycle'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IUserDataSyncMachinesService, IUserDataSyncMachine } from 'vs/platform/userDataSync/common/userDataSyncMachines'; import { Event } from 'vs/base/common/event'; @@ -47,4 +47,4 @@ class UserDataSyncMachinesService extends Disposable implements IUserDataSyncMac } -registerSingleton(IUserDataSyncMachinesService, UserDataSyncMachinesService, true); +registerSingleton(IUserDataSyncMachinesService, UserDataSyncMachinesService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncStoreManagementService.ts b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncStoreManagementService.ts index 0ff3079372c..a85e432cd86 100644 --- a/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncStoreManagementService.ts +++ b/src/vs/workbench/services/userDataSync/electron-sandbox/userDataSyncStoreManagementService.ts @@ -9,7 +9,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { AbstractUserDataSyncStoreManagementService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; import { IProductService } from 'vs/platform/product/common/productService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { UserDataSyncStoreManagementServiceChannelClient } from 'vs/platform/userDataSync/common/userDataSyncIpc'; class UserDataSyncStoreManagementService extends AbstractUserDataSyncStoreManagementService implements IUserDataSyncStoreManagementService { @@ -37,4 +37,4 @@ class UserDataSyncStoreManagementService extends AbstractUserDataSyncStoreManage } -registerSingleton(IUserDataSyncStoreManagementService, UserDataSyncStoreManagementService, true); +registerSingleton(IUserDataSyncStoreManagementService, UserDataSyncStoreManagementService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/views/browser/viewDescriptorService.ts b/src/vs/workbench/services/views/browser/viewDescriptorService.ts index de843eacab8..12750975fc0 100644 --- a/src/vs/workbench/services/views/browser/viewDescriptorService.ts +++ b/src/vs/workbench/services/views/browser/viewDescriptorService.ts @@ -11,7 +11,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { toDisposable, DisposableStore, Disposable, IDisposable } from 'vs/base/common/lifecycle'; import { ViewPaneContainer, ViewPaneContainerAction, ViewsSubMenu } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Event, Emitter } from 'vs/base/common/event'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { generateUuid } from 'vs/base/common/uuid'; @@ -924,4 +924,4 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor } } -registerSingleton(IViewDescriptorService, ViewDescriptorService, true); +registerSingleton(IViewDescriptorService, ViewDescriptorService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workingCopy/browser/workingCopyBackupService.ts b/src/vs/workbench/services/workingCopy/browser/workingCopyBackupService.ts index 9b6ac4489eb..14f99f72911 100644 --- a/src/vs/workbench/services/workingCopy/browser/workingCopyBackupService.ts +++ b/src/vs/workbench/services/workingCopy/browser/workingCopyBackupService.ts @@ -32,4 +32,4 @@ export class BrowserWorkingCopyBackupService extends WorkingCopyBackupService { registerSingleton(IWorkingCopyBackupService, BrowserWorkingCopyBackupService, InstantiationType.Eager); // Register Backup Tracker -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(BrowserWorkingCopyBackupTracker, 'BrowserWorkingCopyBackupTracker', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(BrowserWorkingCopyBackupTracker, LifecyclePhase.Starting); diff --git a/src/vs/workbench/services/workingCopy/browser/workingCopyHistoryService.ts b/src/vs/workbench/services/workingCopy/browser/workingCopyHistoryService.ts index 5b620f0b1e8..8be2e38e3c5 100644 --- a/src/vs/workbench/services/workingCopy/browser/workingCopyHistoryService.ts +++ b/src/vs/workbench/services/workingCopy/browser/workingCopyHistoryService.ts @@ -11,7 +11,7 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { ILogService } from 'vs/platform/log/common/log'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkingCopyHistoryModelOptions, WorkingCopyHistoryService } from 'vs/workbench/services/workingCopy/common/workingCopyHistoryService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkingCopyHistoryService } from 'vs/workbench/services/workingCopy/common/workingCopyHistory'; export class BrowserWorkingCopyHistoryService extends WorkingCopyHistoryService { @@ -34,4 +34,4 @@ export class BrowserWorkingCopyHistoryService extends WorkingCopyHistoryService } // Register Service -registerSingleton(IWorkingCopyHistoryService, BrowserWorkingCopyHistoryService, true); +registerSingleton(IWorkingCopyHistoryService, BrowserWorkingCopyHistoryService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workingCopy/common/workingCopyEditorService.ts b/src/vs/workbench/services/workingCopy/common/workingCopyEditorService.ts index e4af0ad9baa..f95cb71ff84 100644 --- a/src/vs/workbench/services/workingCopy/common/workingCopyEditorService.ts +++ b/src/vs/workbench/services/workingCopy/common/workingCopyEditorService.ts @@ -5,7 +5,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { EditorsOrder, IEditorIdentifier } from 'vs/workbench/common/editor'; import { EditorInput } from 'vs/workbench/common/editor/editorInput'; import { IWorkingCopy, IWorkingCopyIdentifier } from 'vs/workbench/services/workingCopy/common/workingCopy'; @@ -97,4 +97,4 @@ export class WorkingCopyEditorService extends Disposable implements IWorkingCopy } // Register Service -registerSingleton(IWorkingCopyEditorService, WorkingCopyEditorService, true); +registerSingleton(IWorkingCopyEditorService, WorkingCopyEditorService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workingCopy/common/workingCopyFileService.ts b/src/vs/workbench/services/workingCopy/common/workingCopyFileService.ts index 5e830f345ef..b70d40f4676 100644 --- a/src/vs/workbench/services/workingCopy/common/workingCopyFileService.ts +++ b/src/vs/workbench/services/workingCopy/common/workingCopyFileService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Event, AsyncEmitter, IWaitUntil } from 'vs/base/common/event'; import { Promises } from 'vs/base/common/async'; import { insert } from 'vs/base/common/arrays'; @@ -525,4 +525,4 @@ export class WorkingCopyFileService extends Disposable implements IWorkingCopyFi //#endregion } -registerSingleton(IWorkingCopyFileService, WorkingCopyFileService, true); +registerSingleton(IWorkingCopyFileService, WorkingCopyFileService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.ts b/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.ts index d758a61f093..1e299593f87 100644 --- a/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.ts +++ b/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.ts @@ -787,4 +787,4 @@ export abstract class WorkingCopyHistoryService extends Disposable implements IW } // Register History Tracker -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkingCopyHistoryTracker, 'WorkingCopyHistoryTracker', LifecyclePhase.Restored); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(WorkingCopyHistoryTracker, LifecyclePhase.Restored); diff --git a/src/vs/workbench/services/workingCopy/common/workingCopyService.ts b/src/vs/workbench/services/workingCopy/common/workingCopyService.ts index a7522cbcb77..e9a5927e310 100644 --- a/src/vs/workbench/services/workingCopy/common/workingCopyService.ts +++ b/src/vs/workbench/services/workingCopy/common/workingCopyService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Event, Emitter } from 'vs/base/common/event'; import { URI } from 'vs/base/common/uri'; import { Disposable, IDisposable, toDisposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; @@ -290,4 +290,4 @@ export class WorkingCopyService extends Disposable implements IWorkingCopyServic //#endregion } -registerSingleton(IWorkingCopyService, WorkingCopyService, true); +registerSingleton(IWorkingCopyService, WorkingCopyService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupService.ts b/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupService.ts index f2c28188a53..1aa006ca6e6 100644 --- a/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupService.ts +++ b/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyBackupService.ts @@ -42,4 +42,4 @@ export class NativeWorkingCopyBackupService extends WorkingCopyBackupService { registerSingleton(IWorkingCopyBackupService, NativeWorkingCopyBackupService, InstantiationType.Eager); // Register Backup Tracker -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NativeWorkingCopyBackupTracker, 'NativeWorkingCopyBackupTracker', LifecyclePhase.Starting); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NativeWorkingCopyBackupTracker, LifecyclePhase.Starting); diff --git a/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyHistoryService.ts b/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyHistoryService.ts index 55167103df8..173e036770e 100644 --- a/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyHistoryService.ts +++ b/src/vs/workbench/services/workingCopy/electron-sandbox/workingCopyHistoryService.ts @@ -15,7 +15,7 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { ILogService } from 'vs/platform/log/common/log'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkingCopyHistoryModelOptions, WorkingCopyHistoryService } from 'vs/workbench/services/workingCopy/common/workingCopyHistoryService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkingCopyHistoryService, MAX_PARALLEL_HISTORY_IO_OPS } from 'vs/workbench/services/workingCopy/common/workingCopyHistory'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; @@ -98,4 +98,4 @@ export class NativeWorkingCopyHistoryService extends WorkingCopyHistoryService { } // Register Service -registerSingleton(IWorkingCopyHistoryService, NativeWorkingCopyHistoryService, true); +registerSingleton(IWorkingCopyHistoryService, NativeWorkingCopyHistoryService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts b/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts index 637bf9d0a62..9a90505743f 100644 --- a/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts +++ b/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts @@ -16,7 +16,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile import { IHostService } from 'vs/workbench/services/host/browser/host'; import { AbstractWorkspaceEditingService } from 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { URI } from 'vs/base/common/uri'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust'; @@ -57,4 +57,4 @@ export class BrowserWorkspaceEditingService extends AbstractWorkspaceEditingServ } } -registerSingleton(IWorkspaceEditingService, BrowserWorkspaceEditingService, true); +registerSingleton(IWorkspaceEditingService, BrowserWorkspaceEditingService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workspaces/browser/workspacesService.ts b/src/vs/workbench/services/workspaces/browser/workspacesService.ts index cddb23ae96a..08562f80207 100644 --- a/src/vs/workbench/services/workspaces/browser/workspacesService.ts +++ b/src/vs/workbench/services/workspaces/browser/workspacesService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkspacesService, IWorkspaceFolderCreationData, IEnterWorkspaceResult, IRecentlyOpened, restoreRecentlyOpened, IRecent, isRecentFile, isRecentFolder, toStoreData, IStoredWorkspaceFolder, getStoredWorkspaceFolder, IStoredWorkspace, isRecentWorkspace } from 'vs/platform/workspaces/common/workspaces'; import { URI } from 'vs/base/common/uri'; import { Emitter } from 'vs/base/common/event'; @@ -215,4 +215,4 @@ export class BrowserWorkspacesService extends Disposable implements IWorkspacesS //#endregion } -registerSingleton(IWorkspacesService, BrowserWorkspacesService, true); +registerSingleton(IWorkspacesService, BrowserWorkspacesService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workspaces/common/editSessionIdentityService.ts b/src/vs/workbench/services/workspaces/common/editSessionIdentityService.ts index a9b4a8cd98e..bf8d83d43ee 100644 --- a/src/vs/workbench/services/workspaces/common/editSessionIdentityService.ts +++ b/src/vs/workbench/services/workspaces/common/editSessionIdentityService.ts @@ -5,7 +5,7 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation'; import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; import { IEditSessionIdentityProvider, IEditSessionIdentityService } from 'vs/platform/workspace/common/editSessions'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; @@ -54,4 +54,4 @@ export class EditSessionIdentityService implements IEditSessionIdentityService { } } -registerSingleton(IEditSessionIdentityService, EditSessionIdentityService, true); +registerSingleton(IEditSessionIdentityService, EditSessionIdentityService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts b/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts index 0cf6f3892c2..3d4f731f544 100644 --- a/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts +++ b/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts @@ -20,7 +20,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService'; import { ILifecycleService, ShutdownReason } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IFileDialogService, IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILabelService } from 'vs/platform/label/common/label'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IHostService } from 'vs/workbench/services/host/browser/host'; @@ -190,4 +190,4 @@ export class NativeWorkspaceEditingService extends AbstractWorkspaceEditingServi } } -registerSingleton(IWorkspaceEditingService, NativeWorkspaceEditingService, true); +registerSingleton(IWorkspaceEditingService, NativeWorkspaceEditingService, InstantiationType.Delayed); diff --git a/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts b/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts index 48fbb4e5a1c..e5cb1078e35 100644 --- a/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts +++ b/src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts @@ -5,7 +5,7 @@ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces'; import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +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'; @@ -22,4 +22,4 @@ export class NativeWorkspacesService implements IWorkspacesService { } } -registerSingleton(IWorkspacesService, NativeWorkspacesService, true); +registerSingleton(IWorkspacesService, NativeWorkspacesService, InstantiationType.Delayed); diff --git a/src/vs/workbench/workbench.common.main.ts b/src/vs/workbench/workbench.common.main.ts index 89d79d75b2e..bf9f350efe9 100644 --- a/src/vs/workbench/workbench.common.main.ts +++ b/src/vs/workbench/workbench.common.main.ts @@ -128,21 +128,21 @@ import { IUserDataSyncLogService } from 'vs/platform/userDataSync/common/userDat import { UserDataSyncLogService } from 'vs/platform/userDataSync/common/userDataSyncLog'; import { IExtensionsProfileScannerService, ExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService'; -registerSingleton(IUserDataSyncLogService, UserDataSyncLogService, true); -registerSingleton(IIgnoredExtensionsManagementService, IgnoredExtensionsManagementService, true); -registerSingleton(IGlobalExtensionEnablementService, GlobalExtensionEnablementService, true); -registerSingleton(IExtensionStorageService, ExtensionStorageService, true); -registerSingleton(IExtensionGalleryService, ExtensionGalleryService, true); -registerSingleton(IContextViewService, ContextViewService, true); -registerSingleton(IListService, ListService, true); +registerSingleton(IUserDataSyncLogService, UserDataSyncLogService, InstantiationType.Delayed); +registerSingleton(IIgnoredExtensionsManagementService, IgnoredExtensionsManagementService, InstantiationType.Delayed); +registerSingleton(IGlobalExtensionEnablementService, GlobalExtensionEnablementService, InstantiationType.Delayed); +registerSingleton(IExtensionStorageService, ExtensionStorageService, InstantiationType.Delayed); +registerSingleton(IExtensionGalleryService, ExtensionGalleryService, InstantiationType.Delayed); +registerSingleton(IContextViewService, ContextViewService, InstantiationType.Delayed); +registerSingleton(IListService, ListService, InstantiationType.Delayed); registerSingleton(IEditorWorkerService, EditorWorkerService, InstantiationType.Eager /* registers link detection and word based suggestions for any document */); -registerSingleton(IMarkerDecorationsService, MarkerDecorationsService, true); -registerSingleton(IMarkerService, MarkerService, true); -registerSingleton(IContextKeyService, ContextKeyService, true); -registerSingleton(ITextResourceConfigurationService, TextResourceConfigurationService, true); -registerSingleton(IDownloadService, DownloadService, true); -registerSingleton(IOpenerService, OpenerService, true); -registerSingleton(IExtensionsProfileScannerService, ExtensionsProfileScannerService, true); +registerSingleton(IMarkerDecorationsService, MarkerDecorationsService, InstantiationType.Delayed); +registerSingleton(IMarkerService, MarkerService, InstantiationType.Delayed); +registerSingleton(IContextKeyService, ContextKeyService, InstantiationType.Delayed); +registerSingleton(ITextResourceConfigurationService, TextResourceConfigurationService, InstantiationType.Delayed); +registerSingleton(IDownloadService, DownloadService, InstantiationType.Delayed); +registerSingleton(IOpenerService, OpenerService, InstantiationType.Delayed); +registerSingleton(IExtensionsProfileScannerService, ExtensionsProfileScannerService, InstantiationType.Delayed); //#endregion diff --git a/src/vs/workbench/workbench.desktop.main.ts b/src/vs/workbench/workbench.desktop.main.ts index 187cb6c2a77..628a581d5a2 100644 --- a/src/vs/workbench/workbench.desktop.main.ts +++ b/src/vs/workbench/workbench.desktop.main.ts @@ -85,10 +85,10 @@ import 'vs/workbench/services/workingCopy/electron-sandbox/workingCopyHistorySer import 'vs/workbench/services/userDataSync/browser/userDataSyncEnablementService'; import 'vs/workbench/services/extensions/electron-sandbox/sandboxExtensionService'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IUserDataInitializationService, UserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit'; -registerSingleton(IUserDataInitializationService, UserDataInitializationService, true); +registerSingleton(IUserDataInitializationService, UserDataInitializationService, InstantiationType.Delayed); //#endregion diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index ec48c866af4..c1dee216d10 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -92,22 +92,22 @@ import { IDiagnosticsService, NullDiagnosticsService } from 'vs/platform/diagnos import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks'; import { WebLanguagePacksService } from 'vs/platform/languagePacks/browser/languagePacks'; -registerSingleton(IWorkbenchExtensionManagementService, ExtensionManagementService, true); -registerSingleton(IAccessibilityService, AccessibilityService, true); -registerSingleton(IContextMenuService, ContextMenuService, true); -registerSingleton(ILoggerService, FileLoggerService, true); -registerSingleton(IUserDataSyncStoreService, UserDataSyncStoreService, true); -registerSingleton(IUserDataSyncMachinesService, UserDataSyncMachinesService, true); -registerSingleton(IUserDataSyncBackupStoreService, UserDataSyncBackupStoreService, true); -registerSingleton(IUserDataSyncAccountService, UserDataSyncAccountService, true); -registerSingleton(IUserDataSyncService, UserDataSyncService, true); +registerSingleton(IWorkbenchExtensionManagementService, ExtensionManagementService, InstantiationType.Delayed); +registerSingleton(IAccessibilityService, AccessibilityService, InstantiationType.Delayed); +registerSingleton(IContextMenuService, ContextMenuService, InstantiationType.Delayed); +registerSingleton(ILoggerService, FileLoggerService, InstantiationType.Delayed); +registerSingleton(IUserDataSyncStoreService, UserDataSyncStoreService, InstantiationType.Delayed); +registerSingleton(IUserDataSyncMachinesService, UserDataSyncMachinesService, InstantiationType.Delayed); +registerSingleton(IUserDataSyncBackupStoreService, UserDataSyncBackupStoreService, InstantiationType.Delayed); +registerSingleton(IUserDataSyncAccountService, UserDataSyncAccountService, InstantiationType.Delayed); +registerSingleton(IUserDataSyncService, UserDataSyncService, InstantiationType.Delayed); registerSingleton(IUserDataAutoSyncService, UserDataAutoSyncService, InstantiationType.Eager /* Eager to start auto sync */); registerSingleton(ITitleService, TitlebarPart, InstantiationType.Eager); -registerSingleton(IExtensionTipsService, ExtensionTipsService, true); -registerSingleton(ITimerService, TimerService, true); -registerSingleton(ICustomEndpointTelemetryService, NullEndpointTelemetryService, true); -registerSingleton(IDiagnosticsService, NullDiagnosticsService, true); -registerSingleton(ILanguagePackService, WebLanguagePacksService, true); +registerSingleton(IExtensionTipsService, ExtensionTipsService, InstantiationType.Delayed); +registerSingleton(ITimerService, TimerService, InstantiationType.Delayed); +registerSingleton(ICustomEndpointTelemetryService, NullEndpointTelemetryService, InstantiationType.Delayed); +registerSingleton(IDiagnosticsService, NullDiagnosticsService, InstantiationType.Delayed); +registerSingleton(ILanguagePackService, WebLanguagePacksService, InstantiationType.Delayed); //#endregion diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index d1c831212b1..9939daa9e5c 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -3579,6 +3579,16 @@ declare module 'vscode' { iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon; } + /** + * Additional data about a workspace edit. + */ + export interface WorkspaceEditMetadata { + /** + * Signal to the editor that this edit is a refactoring. + */ + isRefactoring?: boolean; + } + /** * A workspace edit is a collection of textual and files changes for * multiple resources and documents. @@ -10726,7 +10736,7 @@ declare module 'vscode' { * Whether the terminal process environment should be exactly as provided in * `TerminalOptions.env`. When this is false (default), the environment will be based on the * window's environment and also apply configured platform settings like - * `terminal.integrated.windows.env` on top. When this is true, the complete environment + * `terminal.integrated.env.windows` on top. When this is true, the complete environment * must be provided as nothing will be inherited from the process or any configuration. */ strictEnv?: boolean; @@ -12165,9 +12175,10 @@ declare module 'vscode' { * not be attempted, when a single edit fails. * * @param edit A workspace edit. + * @param metadata Optional {@link WorkspaceEditMetadata metadata} for the edit. * @return A thenable that resolves when the edit could be applied. */ - export function applyEdit(edit: WorkspaceEdit): Thenable; + export function applyEdit(edit: WorkspaceEdit, metadata?: WorkspaceEditMetadata): Thenable; /** * All text documents currently known to the editor. @@ -15818,9 +15829,9 @@ declare module 'vscode' { /** * A TestRunRequest is a precursor to a {@link TestRun}, which in turn is - * created by passing a request to {@link tests.runTests}. The TestRunRequest - * contains information about which tests should be run, which should not be - * run, and how they are run (via the {@link TestRunRequest.profile profile}). + * created by passing a request to {@link TestController.createTestRun}. The + * TestRunRequest contains information about which tests should be run, which + * should not be run, and how they are run (via the {@link TestRunRequest.profile profile}). * * In general, TestRunRequests are created by the editor and pass to * {@link TestRunProfile.runHandler}, however you can also create test @@ -15863,7 +15874,8 @@ declare module 'vscode' { } /** - * Options given to {@link TestController.runTests} + * A TestRun represents an in-progress or completed test run and + * provides methods to report the state of individual tests in the run. */ export interface TestRun { /** diff --git a/src/vscode-dts/vscode.proposed.localization.d.ts b/src/vscode-dts/vscode.proposed.localization.d.ts index e57d4477b74..40a3b83118e 100644 --- a/src/vscode-dts/vscode.proposed.localization.d.ts +++ b/src/vscode-dts/vscode.proposed.localization.d.ts @@ -4,21 +4,57 @@ *--------------------------------------------------------------------------------------------*/ declare module 'vscode' { + /** + * The namespace for localization-related functionality in the extension API. To use this properly, + * you must have `l10n` defined in your `package.json` and have bundle.l10n..json files. + * For more information on how to generate bundle.l10n..json files, check out the + * [vscode-l10n repo](https://github.com/microsoft/vscode-l10n). + */ export namespace l10n { /** - * A string that can be pulled out of a localization bundle if it exists. + * Marks a string for localization. If a localized bundle is available for the language specified by + * {@link env.language} and the bundle has a localized value for this message, then that localized + * value will be returned (with injected {@link args} values for any templated values). + * @param message The message to localize. Supports index templating where strings like {0} and {1} are + * replaced by the item at that index in the {@link args} array. + * @param args The arguments to be used in the localized string. The index of the argument is used to + * match the template placeholder in the localized string. + * @returns localized string with injected arguments. */ export function t(message: string, ...args: any[]): string; /** - * A string that can be pulled out of a localization bundle if it exists. + * Marks a string for localization. If a localized bundle is available for the language specified by + * {@link env.language} and the bundle has a localized value for this message, then that localized + * value will be returned (with injected args values for any templated values). + * @param options The options to use when localizing the message. + * @returns localized string with injected arguments. */ - export function t(options: { message: string; args?: any[]; comment: string[] }): string; + export function t(options: { + /** + * The message to localize. Supports index templating where strings like {0} and {1} are + * replaced by the item at that index in the {@link args} array. + */ + message: string; + /** + * The arguments to be used in the localized string. The index of the argument is used to + * match the template placeholder in the localized string. + */ + args?: any[]; + /** + * A comment to help translators understand the context of the message. + */ + comment: string[]; + }): string; /** * The bundle of localized strings that have been loaded for the extension. + * It's undefined if no bundle has been loaded. The bundle is typically not loaded if + * there was no bundle found or when we are running with the default language. */ - export const bundle: { [key: string]: string }; + export const bundle: { [key: string]: string } | undefined; /** * The URI of the localization bundle that has been loaded for the extension. + * It's undefined if no bundle has been loaded. The bundle is typically not loaded if + * there was no bundle found or when we are running with the default language. */ export const uri: Uri | undefined; } diff --git a/src/vscode-dts/vscode.proposed.workspaceEditIsRefactoring.d.ts b/src/vscode-dts/vscode.proposed.workspaceEditIsRefactoring.d.ts deleted file mode 100644 index 2589a016e4c..00000000000 --- a/src/vscode-dts/vscode.proposed.workspaceEditIsRefactoring.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'vscode' { - - // https://github.com/microsoft/vscode/issues/112109 - - /** - * Additional data about a workspace edit. - */ - export interface WorkspaceEditMetadata { - /** - * Signal to the editor that this edit is a refactoring. - */ - isRefactoring?: boolean; - } - - export namespace workspace { - - /** - * @param metadata Optional {@link WorkspaceEditMetadata metadata} for the edit. - */ - export function applyEdit(edit: WorkspaceEdit, metadata?: WorkspaceEditMetadata): Thenable; - } -} diff --git a/test/automation/src/electron.ts b/test/automation/src/electron.ts index f818b2b8136..1fea286c6cf 100644 --- a/test/automation/src/electron.ts +++ b/test/automation/src/electron.ts @@ -49,6 +49,15 @@ export async function resolveElectronConfiguration(options: LaunchOptions): Prom args.push('--disable-dev-shm-usage'); } + if (process.platform === 'darwin') { + // On macOS force software based rendering since we are seeing GPU process + // hangs when initializing GL context. This is very likely possible + // that there are new displays available in the CI hardware and + // the relevant drivers couldn't be loaded via the GPU sandbox. + // TODO(deepak1556): remove this switch with Electron update. + args.push('--use-gl=swiftshader'); + } + if (remote) { // Replace workspace path with URI args[0] = `--${workspacePath.endsWith('.code-workspace') ? 'file' : 'folder'}-uri=vscode-remote://test+test/${URI.file(workspacePath).path}`; diff --git a/test/smoke/src/areas/search/search.test.ts b/test/smoke/src/areas/search/search.test.ts index 28796e9b0d7..92c75f14404 100644 --- a/test/smoke/src/areas/search/search.test.ts +++ b/test/smoke/src/areas/search/search.test.ts @@ -29,14 +29,16 @@ export function setup(logger: Logger) { it('searches only for *.js files & checks for correct result number', async function () { const app = this.app as Application; - await app.workbench.search.searchFor('body'); - await app.workbench.search.showQueryDetails(); - await app.workbench.search.setFilesToIncludeText('*.js'); - await app.workbench.search.submitSearch(); + try { + await app.workbench.search.setFilesToIncludeText('*.js'); + await app.workbench.search.searchFor('body'); + await app.workbench.search.showQueryDetails(); - await app.workbench.search.waitForResultText('4 results in 1 file'); - await app.workbench.search.setFilesToIncludeText(''); - await app.workbench.search.hideQueryDetails(); + await app.workbench.search.waitForResultText('4 results in 1 file'); + } finally { + await app.workbench.search.setFilesToIncludeText(''); + await app.workbench.search.hideQueryDetails(); + } }); it('dismisses result & checks for correct result number', async function () { diff --git a/test/unit/electron/renderer.js b/test/unit/electron/renderer.js index 9b291fd0bd7..47f8fb0a53e 100644 --- a/test/unit/electron/renderer.js +++ b/test/unit/electron/renderer.js @@ -298,7 +298,7 @@ function runTests(opts) { mocha.grep(opts.grep); } - if (!opts.debug) { + if (!opts.dev) { mocha.reporter(IPCReporter); } @@ -308,7 +308,7 @@ function runTests(opts) { }); }); - if (opts.debug) { + if (opts.dev) { runner.on('fail', (test, err) => { console.error(test.fullTitle()); diff --git a/yarn.lock b/yarn.lock index d85a254fc80..ebf28175131 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11653,15 +11653,15 @@ xterm-addon-webgl@0.14.0-beta.8: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.14.0-beta.8.tgz#486ae22b2eb88a12ebded366c4019ee26409cbb8" integrity sha512-G0F70f6zGWtXuZxKiTn9BQswaVz85wcCuadnWRdPFDBlgdEfcboCvVZgQetklOIkluVpt8tYYK013/25iMRKTA== -xterm-headless@5.1.0-beta.10: - version "5.1.0-beta.10" - resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.1.0-beta.10.tgz#2a747a1fa96a877c26aea3311b0a62ddae7e2578" - integrity sha512-tRoXL1e87XOIuZ5yIjK43q3x9/MqZ+K24Na7UTl+AqmkXjb5svXfShMV3x8HiNAyxcrnL/MXNilfLoniQGacIA== +xterm-headless@5.1.0-beta.15: + version "5.1.0-beta.15" + resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.1.0-beta.15.tgz#fba76c8e95b552e922354409864c0f55d3b499f7" + integrity sha512-LVtB+KkHs1R2RG8ug3IfOOU0J+qEGttfXagGxfzNq8zxxoSsgoY4D0YvLpM7M/5FK6eGK5K8/yol9XAK63ENog== -xterm@5.1.0-beta.10: - version "5.1.0-beta.10" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.1.0-beta.10.tgz#2f55e4e6d63b45152c768857accc06c47920f898" - integrity sha512-McztCKJJ2QvY28oXwK9ACMbbNTKiKQSbli+tZJIROkICmA7QFizwsQBQDoOtAw0po0dP1CInLJXwurqZmfCymQ== +xterm@5.1.0-beta.15: + version "5.1.0-beta.15" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.1.0-beta.15.tgz#146b70c81fd286dbb003d18449918326fa355b6b" + integrity sha512-fO87pEPFMr+h7eo51+6+ew3OhzLm2wwSYz6w/y5lH986rD1lgAeEqFuzjr64pjBzwAihnoaTpumYg5lTZDQpSA== y18n@^3.2.1: version "3.2.2"