Vscode-ng-language-service: v9 regression: custom structural directives are not typed anymore

Created on 19 Feb 2020  路  4Comments  路  Source: angular/vscode-ng-language-service

馃悶 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

Angular v9.0.1 with vscode-ng-language-service v0.900.12, no error and no content assist:

ng9

馃實 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
bug lib

Most helpful comment

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

All 4 comments

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).

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

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._

Was this page helpful?
0 / 5 - 0 ratings