JetBrains / web-types

JSON standard for documenting web component libraries for IDEs, documentation generators and other tools
Apache License 2.0
279 stars 25 forks source link

"Unknown HTML Tag" - IntelliJ 2020.3.2 #27

Closed dancarasco closed 3 years ago

dancarasco commented 3 years ago

web-types version: "vue-docgen-web-types": "^0.1.7",

App: "vue": "^2.6.12"

IntelliJ is giving the following warning message when trying to use web-types with 2020.3.2 (latest release as of writing):

Screenshot from 2021-01-27 12-52-49

web-types.json has been generated with no errors:

Screenshot from 2021-01-27 12-53-18

When rolling back to IntelliJ 2020.3, web-types works fine. Seems to only be an issue with the latest releases. Happy to provide any logs necessary.

piotrtomiak commented 3 years ago

Hi @dancarasco ! Sorry for the problem! Could you please tell me, where the web-types file is linked from? Is it the project package.json or is it a node_modules package? Have you tried invalidating caches (File > Invalidate Caches / Restart...) ?

dancarasco commented 3 years ago

Hi @piotrtomiak !

No worries - the web-types file is located in an npm module in the node_modules folder. It is a Vue app (plugin) that is hosted in GitHub's NPM registry. The web-types file is located in the root directory of this npm module (next to package.json) and the module's package.json contains the entry:

"web-types": "./web-types.json",

File -> Invalidate Caches seems to have no effect - only reverting to 2020.3.0 makes web-types work again. Hope this helps, happy to provide logs.

dancarasco commented 3 years ago

Hey again @piotrtomiak

https://github.com/JetBrains/web-types/issues/19

After reading this similar issue posted, I saw one of your replies mentioned checking if the node_modules folder was indexed or excluded (orange) - turns out mine were excluded.

After right clicking these and setting "Not Excluded" and letting IntelliJ re-index the project, the web-types started working again!

So it seems there is some difference with the newer IntelliJ builds where these folders are excluded by default and web-types ignores them. Hope this helps!

piotrtomiak commented 3 years ago

@dancarasco Your node_modules folder should have following "colors":

logo-bw svg 2021-01-27 15-02-38

So some of the packages should be indexed and some others not - we index only direct dependencies from your package.json due to performance reasons. If the package with web-types have orange color, please ensure that it's in your project's package.json as a dependency.

dancarasco commented 3 years ago

@piotrtomiak Perfect - this makes sense now. The dependency is included in package.json "dependencies" section, but IntelliJ still marked it as excluded. Not sure if this is something to do with the "@company/package" namespacing convention GitHub registry uses:

Screenshot from 2021-01-27 14-12-09

However, I have manually marked these as "Not Excluded" now and IntelliJ is indexing them fine,. and web-types has started working again for 2020.3.2 :)

piotrtomiak commented 3 years ago

@dancarasco Thanks! It looks like an issue with WebStorm. It would be great if you can file an issue in our WebStorm issue tracker: https://youtrack.jetbrains.com/issues/WEB and provide more details about your setup. You can make the issue private.