Skip to content

Commit f8b0db8

Browse files
authored
feat(extension): Update virtualWorkspace support to allow syntax highlighting (#1694)
You can find more information about virtual workspaces here: https://code.visualstudio.com/api/extension-guides/virtual-workspaces The LSP does not support access to virtual resources: microsoft/language-server-protocol#1264 As a result, we cannot provide much in the way of features since the extension relies on the LSP for every provider. While we cannot provide any features from the @angular/language-server, we still can provide "limited" support to enable syntax highlighting in virtual workspaces.
1 parent 2c6b585 commit f8b0db8

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

package.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"untrustedWorkspaces": {
1818
"supported": false,
1919
"description": "This extension requires workspace trust because it needs to execute ngcc from the node_modules in the workspace."
20+
},
21+
"virtualWorkspaces": {
22+
"supported": "limited",
23+
"description": "The Language Server Protocol does not support remote file systems. Functionality is limited to syntax highlighting only."
2024
}
2125
},
2226
"categories": [
@@ -59,26 +63,34 @@
5963
"commandPalette": [
6064
{
6165
"command": "angular.goToComponentWithTemplateFile",
62-
"when": "editorLangId == html"
66+
"when": "editorLangId == html && !virtualWorkspace"
6367
},
6468
{
6569
"command": "angular.goToTemplateForComponent",
66-
"when": "editorLangId == typescript"
70+
"when": "editorLangId == typescript && !virtualWorkspace"
71+
},
72+
{
73+
"command": "angular.runNgcc",
74+
"when": "!virtualWorkspace"
75+
},
76+
{
77+
"command": "angular.getTemplateTcb",
78+
"when": "!virtualWorkspace"
6779
}
6880
],
6981
"editor/context": [
7082
{
71-
"when": "resourceLangId == html || resourceLangId == typescript",
83+
"when": "(resourceLangId == html || resourceLangId == typescript) && !virtualWorkspace",
7284
"command": "angular.getTemplateTcb",
7385
"group": "angular"
7486
},
7587
{
76-
"when": "resourceLangId == html",
88+
"when": "resourceLangId == html && !virtualWorkspace",
7789
"command": "angular.goToComponentWithTemplateFile",
7890
"group": "angular"
7991
},
8092
{
81-
"when": "resourceLangId == typescript",
93+
"when": "resourceLangId == typescript && !virtualWorkspace",
8294
"command": "angular.goToTemplateForComponent",
8395
"group": "angular"
8496
}

0 commit comments

Comments
 (0)