Skip to content

Commit

Permalink
feat(extension): Update virtualWorkspace support to allow syntax high…
Browse files Browse the repository at this point in the history
…lighting

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.
  • Loading branch information
atscott committed Jun 9, 2022
1 parent 2c6b585 commit bd82397
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"name": "Launch Dev Client",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
Expand Down
22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"untrustedWorkspaces": {
"supported": false,
"description": "This extension requires workspace trust because it needs to execute ngcc from the node_modules in the workspace."
},
"virtualWorkspaces": {
"supported": "limited",
"description": "The Language Server Protocol does not support remote file systems. Functionality is limited to syntax highlighting only."
}
},
"categories": [
Expand Down Expand Up @@ -59,26 +63,34 @@
"commandPalette": [
{
"command": "angular.goToComponentWithTemplateFile",
"when": "editorLangId == html"
"when": "editorLangId == html && !virtualWorkspace"
},
{
"command": "angular.goToTemplateForComponent",
"when": "editorLangId == typescript"
"when": "editorLangId == typescript && !virtualWorkspace"
},
{
"command": "angular.runNgcc",
"when": "!virtualWorkspace"
},
{
"command": "angular.getTemplateTcb",
"when": "!virtualWorkspace"
}
],
"editor/context": [
{
"when": "resourceLangId == html || resourceLangId == typescript",
"when": "(resourceLangId == html || resourceLangId == typescript) && !virtualWorkspace",
"command": "angular.getTemplateTcb",
"group": "angular"
},
{
"when": "resourceLangId == html",
"when": "resourceLangId == html && !virtualWorkspace",
"command": "angular.goToComponentWithTemplateFile",
"group": "angular"
},
{
"when": "resourceLangId == typescript",
"when": "resourceLangId == typescript && !virtualWorkspace",
"command": "angular.goToTemplateForComponent",
"group": "angular"
}
Expand Down

0 comments on commit bd82397

Please sign in to comment.