Vscode-ng-language-service: Update plugin to use Angular 6

Created on 25 Jun 2018  路  15Comments  路  Source: angular/vscode-ng-language-service

Plugin is still built against Angular 5, should be updated to Angular 6. Might resolve #256 , and this comment on an Angular issue suggests that it's necessary for the new type checker to show up (?), which would make

<p *ngIf="foo">{{foo.length}}</p>

stop red-lining foo.length when strictNullChecks is turned on.

As an aside, if that comment is mistaken and that edge-case still isn't handled even when built against latest Angular, please let me know and I'll open a separate issue to make sure it gets tracked. I thought this was what #71 was talking about but it's a separate case. I'm hoping that this is an easy fix, and will also cover *ngIf="foo && (foo.length > 2)" red-lining foo.length (even though the and-operator should remove null from foo's type before evaluating).

Most helpful comment

This plugin is basically unusable for us right now since we take advantage of TS 2.7 features like strictPropertyInitialization. Because of this our HTML files are covered in errors like this:

[Angular] Identifier 'xxx' is not defined. '<anonymous>' does not contain such a member

Angular 6 has been out for 2 months now - it would be nice to see this plugin updated.

All 15 comments

Maybe duplicate of #256

I did reference that issue, but I think this should remain open as its own thing because a) it might be possible to resolve #256 without switching to Angular 6 and b) it might be possible to build against Angular 6 without actually resolving the template-scope problem I give as an example. I would like to make sure my specific problem (incorrect redlining in templates) actually gets resolved.

This plugin is basically unusable for us right now since we take advantage of TS 2.7 features like strictPropertyInitialization. Because of this our HTML files are covered in errors like this:

[Angular] Identifier 'xxx' is not defined. '<anonymous>' does not contain such a member

Angular 6 has been out for 2 months now - it would be nice to see this plugin updated.

Is work even happening on this plugin? I see that the last commit was over 6 months ago.

@JitinDhillon Seems like this has been abandoned. Unfortunately I don't know of any maintained forks or alternatives.

Real shame that this has been abandoned.

@chuckjaz @DBosley is it possible to get some information regarding the Angular team's intention to keep this project alive? There are lots of glaring open issues at the moment and it seems like this project is abandoned. If you guys are no longer maintaining this, is it possible to assign someone else from the Angular team?

Edit: just noticed that @chuckjaz hasn't been active on Github for almost a year, so just to try and poke some other Angular members: @IgorMinar @vicb @petebacondarwin ?

Hey guys, I have just made a PR to the master branch in order to support the latest Angular v6. (#276 ). I need someone to help me to take a look at those changes.

v0.1.10 is out with angular-language-service 6.1 and TS 2.7, thanks @kyliau

I still get the "does not contain such a member" error for myControl.errors?.someErrorName. Is that expected to be fixed now that it's using the newer language service / TS version?

Likewise. I'm on version 0.1.10 now, but I still seem to be getting all the spurious errors I was getting before.

Here's a an example of a case where the language service complains about a nullable value even though I have a surrounding *ngIf="model !== null check.

model-can-not-be-null

Yeah, as far as I can tell the improved scoping for ngIf that's supposed to come with the new language service, isn't working. Other kinds of narrowing don't work either. For example, I have a class with a method isFoo(x: any): x is Foo. The AOT compiler correctly recognizes this as narrowing the type of the passed variable to be Foo, but I get "does not contain such a member" errors in Code when I reference Foo members inside an *ngIf="isFoo(thing)".

Closing this, since as @zacnomore mentioned, the latest version is now using @angular/language-service version 8.
Moving forward, I'll make sure the extension is kept up-to-date with Angular release.

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