question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unrecognized tags in WebStorm

See original GitHub issue

Steps to reproduce

create a template with <v-layout>, <v-flex>, <v-card>, <v-card-*> components

Versions

0.14.8

What is expected ?

v-layout and other tags should be recognized by WebStorm as known elements

What is actually happening ?

Get a warning “Unknown html tag”

Reproduction Link

screenshot: http://imgur.com/a/UOAZr

Fix

Just my guess - I didn’t checked all but some of the tags that are not recognized don’t have the “name” property. For example <v-card> doesn’t have it and it’s not recognized but <v-card-media> has and it’s recognized

Edit: some components without “name” have “functional” property set to true, and those with “name” are not “functional”, I’m not sure if adding “name” to “functional” components doesn’t break anything

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
sdarnellcommented, Aug 15, 2017

As per @jacekkarczmarczyk’s comment, I found that if I added a name: entry to the functional components in the src directory of node_modules, Webstorm would then correctly detect the component. For example, in VCardTitle I added a name: 'v-card-title',.

To be fair on the Webstorm plugin, Vue is so flexible in what can be a component, it is pretty hard to detect what is a Vue component. Even working back from the Vue.component() calls in this case requires non-trivial data flow analysis/code simulation:

  Object.keys(Components).forEach(key => {
    Vue.component(key, Components[key])
  })

Note that webstorm does detect components declared with Vue.extends and Vue.component(‘literal-name’, …).

For reference, the part of the webstorm plugin that does the detection seems to be: https://github.com/JetBrains/intellij-plugins/blob/9e149f9a12c6844a767aa674e7da44c2d07a4f54/vuejs/src/org/jetbrains/vuejs/codeInsight/VueFrameworkHandler.kt#L106

@ChavaSobreyra I created a Webstorm issue (https://youtrack.jetbrains.com/issue/WEB-28318), but I’m not convinced Webstorm can do a sensible job without some hints.

At the cost of adding a name property to the remaining components that don’t already have one, the result would be pretty good support in Webstorm. The benefits aren’t just tag detection, but also pretty good intellisense for component props/attributes (mixin props aren’t detected yet though).

4reactions
ChavaSobreyracommented, Aug 4, 2017

Sound like an issue to take up with the WebStorm vue plugin team, no? Doesn’t look like there’s anything invalid on the vuetify side…

By the way, in Webstorm you can click on the unrecognized elements and hit alt + enter which will bring up a menu with an option add x to custom html tags

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting a custom tag – IDEs Support (IntelliJ Platform)
So I created a custom tag by accident in Webstorm (I typed something that didn't exist and then I clicked on 'add to...
Read more >
Adding custom html tags to Intellij? - Stack Overflow
Place the caret over the highlighted tag, hit ALT + ENTER and select Add tag to custom tags. However that works only for...
Read more >
WebStorm Unknown ionic html tag
WebStorm 2020.1 Build #WS-201.6668.106, built on April 7, 2020 macOS 10.15.7 My package.json as below, { "name": "sleep", "version": "0.0.1" ...
Read more >
unknown html tag in phpstorm - Laracasts
unknown html tag in phpstorm. I am using phpstorm but the error on blade files is really annoying. how can I fix this...
Read more >
Code Inspections in HTML - Help | PhpStorm - JetBrains
Inspection Description Default Severity Deprecated HTML attribute Highlights attributes deprecated in HTML5. Warning Non‑existent web resource Highlights links to non‑existent web resources. Disabled
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found