angular / vscode-ng-language-service

Angular extension for Visual Studio Code
MIT License
781 stars 119 forks source link

`angular.ngdk` override setting does not work as expected #1325

Closed bobderrico80 closed 3 years ago

bobderrico80 commented 3 years ago

🐞 bug report

Is this a regression?

No

Description

Overriding the angular.ngdk setting does not seem to work (i.e, the bundled version of @angular/language-service is used instead of the one I am attempting to override.

Bug Type

What does this bug affect

Reproduction

Steps to reproduce the behavior:

  1. Install an earlier version of @angular/language-service globally (npm install -g @angular/language-service@v8-lts)
  2. Open settings.json (Cmd+, click Open Settings (JSON))
  3. Add the following entry to the JSON:
"angular.ngdk": "<path_to_global_node_modules>/@angular/language-service/language-service.js"
  1. Save the settings.json file.
  2. Restart the Angular Language Server (Cmd+Shift+P, type and select Angular: Restart Angular Language server)
  3. Open the Output pane, and select Angular Language Service from the dropdown
  4. Observe the output, specifically this line:
    Using @angular/language-service v11.2.12 from /Users/bob.derrico/.vscode/extensions/angular.ng-template-11.2.13/node_modules/@angular/language-service/bundles/language-service.js

Expected behavior

The output line pasted above would be as follows:

Using @angular/language-service v8.2.14 from <path_to_global_node_modules>
[ngls-verbose.log](https://github.com/angular/vscode-ng-language-service/files/6423723/ngls-verbose.log)
/@angular/language-service/bundles/language-service.js

Logs

Log file gives us deep insight into the behavior and performance of the extension. If the issue is a performance problem or an error occured, please provide the output of the log file below.

Set Angular Log level to verbose.

ngls-verbose.log

Screenshots

If applicable, add screenshots to help explain your problem.

Screen Shot 2021-05-04 at 4 28 35 PM

Screen Shot 2021-05-04 at 4 28 46 PM

🌍 Your Environment

Angular Version:



Angular CLI: 8.3.21
Node: 10.18.1
OS: darwin x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.803.21
@angular-devkit/core         8.3.21
@angular-devkit/schematics   8.3.21
@schematics/angular          8.3.21
@schematics/update           0.803.21
rxjs                         6.4.0

Extension Version:



11.2.13

VSCode Version:



Version: 1.55.1 (Universal)
Commit: 08a217c4d27a02a5bcde898fd7981bda5b49391b
Date: 2021-04-07T18:22:52.186Z (3 wks ago)
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0

Operating System:



macOS Big Sur Version 11.2.3

Anything else relevant?

kyliau commented 3 years ago

@bobderrico80 Thanks for bringing this to our attention. We are actually planning to remove the ngdk option, because there is no guarantee that the latest extension will work well with an older version of @angular/language-service. In fact, there is check in place to make sure we don't load a version that's too old.

https://github.com/angular/vscode-ng-language-service/blob/458efc8f5c956f7b39be73f654b10eff20ee7f89/server/src/version_provider.ts#L91-L94

Instead, we recommend users to install an older version of the extension from the marketplace should they need to revert for any reasons.

The original intention of introducing ngdk is to allow the extension to load @angular/language-service from user's workspace / project, but we found that approach non-ideal because it hampers our ability to fix bugs (users have to upgrade both @angular/language-service in their project and the extension in their IDE to get the latest fixes).

angular-automatic-lock-bot[bot] commented 3 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.