Angular Template Syntax Highlighting not Working in IntelliJ after Upgrading to 2019.2.3 (build 192.6817.14)
EDIT: After deleting all of my angular modules' .iml files and recreating the modules from existing sources, everything works again.
Angular syntax highlighting was working fine in IntelliJ 2019.1.3 (build 191.6183.87). After upgrading to version 2019.2.3 (build 192.6817.14), none of the angular bindings and directives are highlighted in templates, and ctrl+click does not take me into the code. When I upgraded I simply allowed IntelliJ to pull my IDE settings from the previous version.
I tried disabling and re-enabling the AngularJS plugin to no avail, and I do wait for indexing to complete.
If I open back up 2019.1.3, it loads my same project that I'm using in 2019.2.3 just fine with the Angular syntax highlighting and code completion working just fine. When I switch back to 2019.2.3, it is still broken.
Please sign in to leave a comment.
looks like the Angular support is not enabled. If invalidating caches (File > Invalidate caches, Invalidate and restart) doesn't help, please select your template
.htmlfile in Project tool window and hitF1( View | Quick documentation) - what docs are shown? Please provide a screenshot and your idea.log (Help | Show log in ...)When I hit F1 with my angular template file selected in the Project pane, this page https://www.jetbrains.com/help/idea/2019.2/project-tool-window.html?utm_campaign=IU&utm_medium=link&utm_source=product&utm_content=2019.2 opens.
When I select View | Quick Documentation I get this:
Screenshot shows that your
.htmlfiles are not treated as Angular templates, i.e. Angular support is not enabled for your project.please make sure that
@angular/coredirectory is indexed (not shown as excluded in the Project tool window): please expand thenode_modulesnode there and take a screenshot so that I can see what the modules folders look likeMaking sure @angular/core was indexed was one of the first things I did.
the structure looks strange - as if each of modules is added as a separate content root.
Can you share a project the issue can be reproduced with? You can delete all your .ts/.html files, leaving the configuration stuff (.idea folder, .iml files, package.json, angular.json, etc.) and folders structure only
I noticed that in 2019.1.3 (the working version) that under Settings > Editor > File Types, the `Angular HTML Template` has a registered pattern of "Angular HTML Template", which isn't even a valid syntactical pattern as far as I can tell, but it works.
In 2019.2.3 (the broken version), there are no patterns registered. I did manually register `*.component.html` and the syntax highlighting did enable in my angular templates, but it was not properly linking the variables and functions to the component, so it displayed the angular bindings, interpolation, and directives in red and they do not link to the relevant place in code.
After deleting all of my angular modules' .iml files and recreating the modules from existing sources, everything works again.
in my case - errors in package json prevented highlighting in code. After errors was fixed - reindex was started again and all worked after that