Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@let template variable not supported #78

Open
motohead400 opened this issue Dec 4, 2024 · 4 comments
Open

@let template variable not supported #78

motohead400 opened this issue Dec 4, 2024 · 4 comments

Comments

@motohead400
Copy link

Using the newer @let template variable functionality gives an error in Visual Studio of: Unrecognized block @let variablename

Additionally, the template variable is not recognized by intellisense.

@Khyalis
Copy link

Khyalis commented Dec 23, 2024

Its the same for me.
From my understanding, the extension intends to allow for using the current solution directory when loading the language service, but in my case, the solution folder is an ancestor to the project folder containing the node_modules folder.
This might cause the extension to use the bundled version of the angular language service, which appears to be 17.0.0-rc3.

Info: Using typescript/lib/tsserverlibrary v5.2.2 from ...\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\...\EXTENSIONS\...\node_modules\typescript\lib\tsserverlibrary.js
Info: Using @angular/language-service v17.0.0-rc.3 from ...\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\...\EXTENSIONS\...\node_modules\@angular\language-service\index.js

This version may not include support for @let yet.

I do not know whether the dependency could safely be updated without breaking for users depending on older versions of angular. At the time of #54, it looks like the minimum supported version may have been 13, while it might be 15 now.

As a possible workaround, I tried moving node_modules, angular.json, tsconfig.json, ... from the project folder to the solution folder.

This appears to have the effect of utilizing the project specific angular version:

Info: Using typescript/lib/tsserverlibrary v5.6.3 from (solution-directory)\node_modules\typescript\lib\tsserverlibrary.js
Info: Using @angular/language-service v19.0.1 from (solution-directory)\node_modules\@angular\language-service\index.js

It would also recognize @let.

But I believe this may not be viable for everyone who relies on nested folders for organizing solution sources.

@Khyalis
Copy link

Khyalis commented Dec 23, 2024

(As a different workaround I tried installing typescript 5.6 and @angular/language-server 19.0.3 in the extension's folder. This also appears to have the intended effect.)

@Neutrino-Sunset
Copy link

So how do we install typescript 5.6 and @angular/language-server 19.0.3 to the extension folder? I see there is a node_modules directory, but there is no package.json so I don't see how npm will work.

@Khyalis
Copy link

Khyalis commented Dec 27, 2024

What I did was download the most recent package.json / package-lock.json from this repo and put those into the extension folder. Then I changed package.json to use the newer versions and executed npm i.
There might be a risk of the the extension code being not entirely compatible with the update language server, I did not look into whether the api has remained unchanged. But so far, I haven't noticed issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants