angular / vscode-ng-language-service

Angular extension for Visual Studio Code
MIT License
773 stars 116 forks source link

v9 regression: custom structural directives are not typed anymore #649

Closed kondi closed 4 years ago

kondi commented 4 years ago

🐞 bug report

Affected Package

The issue is caused by package @angular/language-service ### Is this a regression? Yes, the previous version in which this bug was not present was: v8.2.14 ### Description The type of structural directive context is not propagated to the template. It's handled as any, therefore there is no content assist and type errors are not detected. During the build, the compiler sees the type and catches the errors. However, the built-in ngFor directive is handled correctly in the language service and during the build too. ## πŸ”¬ Minimal Reproduction https://stackblitz.com/edit/angular-issue-35537 ## πŸ”₯ Exception or Error Angular v8.2.14 with vscode-ng-language-service v0.802.3, error and content assist as expected: ![ng8](https://user-images.githubusercontent.com/278688/74787695-19469800-52b0-11ea-936a-0525cd433d26.PNG) Angular v9.0.1 with vscode-ng-language-service v0.900.12, no error and no content assist: ![ng9](https://user-images.githubusercontent.com/278688/74787706-219ed300-52b0-11ea-84c4-a0431aa8874b.PNG) ## 🌍 Your Environment **Angular Version:**
Angular CLI: 9.0.2
Node: 10.15.0
OS: win32 x64
Angular: 9.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.2
@angular-devkit/build-angular     0.900.2
@angular-devkit/build-optimizer   0.900.2
@angular-devkit/build-webpack     0.900.2
@angular-devkit/core              9.0.2
@angular-devkit/schematics        9.0.2
@angular/cli                      9.0.2
@ngtools/webpack                  9.0.2
@schematics/angular               9.0.2
@schematics/update                0.900.2
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2
**Anything else relevant?** This is not duplicate of: - angular/angular#33896: his bug was there in v8 already and the type is incorrect, not any - angular/angular#20739: the directive is working, but the type is missing
tonivj5 commented 4 years ago

https://github.com/angular/angular/issues/35426 related?

kondi commented 4 years ago

angular/angular#35426 related?

Yes, true, I think its the same, I just did not find it before.

By the way, this is not a feature request, because this was working in latest angular v8. I have filed a PR with the fix (#35561).

kondi commented 4 years ago

Fix released in @angular/language-service v9.0.3 and v9.1.0-next.2, and it is in vscode-ng-language-service master.

angular-automatic-lock-bot[bot] commented 4 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.