Skip to content

Commit 797140c

Browse files
Keen Yee Liauatscott
authored andcommitted
fix: remove angular.ngdk configuration (#1361)
This configuration does not work well in practice because we cannot guarantee the compatibility between the extension and an older version of `@angular/language-service`. If users have to revert to an older version for any reason, they should download an older extension from the VSCode marketplace. Close #1325 (cherry picked from commit fb0b900)
1 parent 0fdc5fb commit 797140c

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Download the extension from [Visual Studio Marketplace](https://marketplace.visu
1818

1919
## Configuring compiler options for the Angular Language Service
2020

21-
The Angular Language Service uses the same set of options that are used to compile the application.
21+
The Angular Language Service uses the same set of options that are used to compile the application.
2222
To get the most complete information in the editor, set the `strictTemplates` option in `tsconfig.json`,
2323
as shown in the following example:
2424

@@ -33,15 +33,16 @@ For more information, see the [Angular compiler options](https://angular.io/guid
3333
## Versioning
3434

3535
The language service extension relies on the `@angular/language-service` and `typescript` packages
36-
for its backend. These packages are loaded, in order of priority, from:
36+
for its backend. `@angular/language-service` is always bundled with the extension, and is always
37+
the latest version at the time of the release.
38+
`typescript` is loaded, in order of priority, from:
3739

38-
1. The path specified by `angular.ngdk` and `typescript.tsdk`, respectively, in project or global
39-
settings.
40-
2. _(Recommended)_ The version of these packages bundled with the Angular Language Service extension.
41-
3. The version of these packages present in the current workspace's node_modules.
40+
1. The path specified by `typescript.tsdk` in project or global settings.
41+
2. _(Recommended)_ The version of `typescript` bundled with the Angular Language Service extension.
42+
3. The version of `typescript` present in the current workspace's node_modules.
4243

43-
We suggest **not** specifying neither `angular.ngdk` nor `typescript.tsdk` in your VSCode settings
44-
per method (1) above. If the `@angular/language-service` and `typescript` packages are loaded by
44+
We suggest **not** specifying `typescript.tsdk` in your VSCode settings
45+
per method (1) above. If the `typescript` package is loaded by
4546
methods (1) or (3), there is a potential for a mismatch between
4647
the API expected by `@angular/language-service` and the API provided by `typescript`. This could
4748
lead to a failure of the language service extension.

client/src/client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ export class AngularLanguageClient implements vscode.Disposable {
168168
// Create the language client and start the client.
169169
const forceDebug = process.env['NG_DEBUG'] === 'true';
170170
this.client = new lsp.LanguageClient(
171-
// This is the ID for Angular-specific configurations, like angular.log,
172-
// angular.ngdk, etc. See contributes.configuration in package.json.
171+
// This is the ID for Angular-specific configurations, like "angular.log".
172+
// See contributes.configuration in package.json.
173173
'angular',
174174
this.name,
175175
serverOptions,
@@ -374,8 +374,7 @@ function constructArgs(ctx: vscode.ExtensionContext): string[] {
374374
args.push('--logVerbosity', ngLog);
375375
}
376376

377-
const ngdk: string|null = config.get('angular.ngdk', null);
378-
const ngProbeLocations = getProbeLocations(ngdk, ctx.extensionPath);
377+
const ngProbeLocations = getProbeLocations(null, ctx.extensionPath);
379378
args.push('--ngProbeLocations', ngProbeLocations.join(','));
380379

381380
// Because the configuration is typed as "boolean" in package.json, vscode

package.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,6 @@
6262
"configuration": {
6363
"title": "Angular Language Service",
6464
"properties": {
65-
"angular.ngdk": {
66-
"type": [
67-
"string",
68-
"null"
69-
],
70-
"default": null,
71-
"description": "Specifies the folder path to @angular/language-service.",
72-
"scope": "machine"
73-
},
7465
"angular.log": {
7566
"type": "string",
7667
"enum": [

0 commit comments

Comments
 (0)