angular_analyzer_plugin icon indicating copy to clipboard operation
angular_analyzer_plugin copied to clipboard

Code compleation/errors does not work in IntelliJ in HTML template files

Open Antoniossss opened this issue 6 years ago • 9 comments

I have fresh Dart installation VM version: 2.1.0-dev.5.0 (Wed Sep 19 19:15:19 2018 +0200) on "windows_x64" IntelliJ image Stagehand 3.1.3

I have created new stagehand project using instructions from https://webdev.dartlang.org/guides/get-started

Now I am in state that application runs ok, and Dart Analysis seems to be working, but (image below)

  1. IDE does not display analisys errors
  2. Autocomplete/code suggestion does not work at all for *ngIf and other basic Angular directives
  3. Material components are not recognized as known elements

so basicly I can state that I have no dart/angular support in template files. Analisys works for dart files.

image

Analysis Server Diagnostics shows as follows image

But in code completion tab I can see no request beeing made for template file, only for todo_list_component.dart. Looks like IDE configuration issue. How to include html files for autocompletion/analisys ?

Antoniossss avatar Sep 21 '18 15:09 Antoniossss

Also when I check analizer web tool, I can see that there are no autocompletion requests made for HTML files just like they are made for autocomplete in dart files.

Antoniossss avatar Sep 24 '18 06:09 Antoniossss

I think the angular plugin maybe crashed?

For instance, the lower panel includes an error for 'somefield' in todo_list_component.html. That has to have been supplied by the plugin. Note that since its technically a warning rather than an error (it mirrors dart in this way), it is yellow in the HTML file, which makes it easy to miss.

The remaining chunks of yellow are probably there because you have IntelliJ's HTML diagnostics on. They are on by default, unfortunately, and we've explored ways to automatically turn them off but don't yet have any great ideas on that. You can turn them off from settings -> inspections -> html.

Not sure why autocomplete isn't working, I will look into that further here...

MichaelRFairhurst avatar Sep 24 '18 16:09 MichaelRFairhurst

It looks like the code completion diagnostics page does not track plugin completions, filed here: https://github.com/dart-lang/sdk/issues/34562

What OS are you using?

And did you by chance check the analyzer plugins section of the diagnostic page?

MichaelRFairhurst avatar Sep 24 '18 18:09 MichaelRFairhurst

I am on windows All required and advertised features works for .dart files but does not work for htmls. is plugin for angular dart template different then for dart files? Thats regarding plugin crash. Can I verify it somehow?

As for html validation, it is yes and no.

  1. Material components are angular specific and should be somehow covered by analyzer to (somehow) point to the right codebase in HTML just like it works for plain Angular CLI applocations. 
  2. *ngFor should be known attribute because of the same reasons like above.

All scenarios are working  fine for angular cli applications, so I would expect the same to happen here. Obviously I dont know if it should come from dart analyzer or maybe dart plugin itself.

If you would be interested i  fixing this issue (as others keeps reporting the same) I am glad to give you even life feedback on any questions or clarifications you may have till the end of this week.

Antoniossss avatar Sep 25 '18 21:09 Antoniossss

I have the exact same issues with WebStorm.

MderM avatar Oct 23 '18 07:10 MderM

Plugin page of diagnostic server is showing this after a clean install of dart sdk and cleaning the pub cache and then creating a new project from material components template:

image

MderM avatar Oct 23 '18 08:10 MderM

Any news on this one? Tested on Linux too. Plugin is not running (it states: for unknown reason)... sooo, plein not usable from a fresh install of everything. Kind of a bummer

MderM avatar Nov 02 '18 10:11 MderM

@MderM I have the same issue on OSX, no luck yet - at least I'm not alone I guess?

schnaser avatar Nov 20 '18 02:11 schnaser

This should work fine in IntelliJ IDEA / WebStorm 2019.1.3. But you might need to clear Analysis Server caches after enabling 'angular' plugin in the analysis_options.yaml file. It means - delete .dartServer folder (on Windows it's in C:\Users\user_name\AppData\Local.dartServer). Filed https://github.com/dart-lang/angular_analyzer_plugin/issues/709.

alexander-doroshko avatar May 30 '19 12:05 alexander-doroshko