Skip to content

[BUG] An issue with Angular Language Service #8

Open
pshurygin opened this issue Nov 26, 2020 · 3 comments
Open

[BUG] An issue with Angular Language Service #8

pshurygin opened this issue Nov 26, 2020 · 3 comments

Comments

@pshurygin
Copy link

pshurygin commented Nov 26, 2020

馃悶 Bug report

Description

.stop and .prevent syntax is not correctly handled by angular language service. This leads to errors being displayed by IDE when such syntax is used:
Screenshot 2020-11-26 at 17 24 25
Compare it to the standard click event:
Screenshot 2020-11-26 at 17 24 46

Expected behavior

No error is displayed, type of $event is displayed on hover, description of event is displayed on hover.

Versions

  • OS: MacOS
  • Angular 11
  • JetBrains IDE (WebStorm/Rider/RubyMine etc) (not sure if the issue persists in VSCode, but i would think so)

Additional context

I'm not sure that this can be fixed on the plugin side, but still creating an issue, as this is very annoying to have these errors all around the IDE.

Added by @waterplea:
Also exact type of the $event variable is lost when using .stop and .prevent. This leads to compilation errors like this:

Argument of type 'Event' is not assignable to parameter of type 'MouseEvent'.
@waterplea
Copy link
Contributor

Hi Pavel. Thank you for raising this issue. I will try to investigate where those types and descriptions come from and if it's possible to somehow augment it with plugin events.

@waterplea
Copy link
Contributor

waterplea commented Jun 9, 2021

@pshurygin so I looked into it and forgot to report back. There's nothing we can do on our side. Here are issues you can vote on with a like to show they are relevant.

Angular Language Service:
angular/angular#40553

WebStorm:
https://youtrack.jetbrains.com/issue/WEB-47399

@waterplea
Copy link
Contributor

@pshurygin I've added web types for WebStorm to the latest version, autocomplete and event types should work properly in WebStorm 2021.3.1

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

No branches or pull requests

2 participants