Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component data attribute description missing for dynamic attributes #2878

Closed
4 tasks done
rchl opened this issue Apr 21, 2021 · 1 comment · Fixed by #2879
Closed
4 tasks done

Component data attribute description missing for dynamic attributes #2878

rchl opened this issue Apr 21, 2021 · 1 comment · Fixed by #2879

Comments

@rchl
Copy link
Collaborator

rchl commented Apr 21, 2021

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: -
  • VS Code version: -
  • VLS version: 0.7.2

Problem

The hover info shows the attribute description if the attribute is not dynamic (doesn't start with the :):

Screenshot 2021-04-21 at 15 38 24

But the description is nowhere to be found when the attribute is dynamic:

Screenshot 2021-04-21 at 15 38 03

Reproducible Case

Repo: https://github.com/rchl/vetur-hover-component-data

  1. Create component data like:
// tags.json
{
  "foo-tag": {
    "attributes": ["foo-attr"],
    "description": "A foo tag"
  }
}

// attributes.json
{
    "foo-attr": {
        "description": "Some property"
    }
}

// package.json
  "vetur": {
    "tags": "./tags.json",
    "attributes": "./attributes.json"
  }
  1. Create a template:
<template>
  <div>
    <foo-tag foo-attr="v" /><foo-tag :foo-attr="'v'" />
  </div>
</template>
  1. Hover the first and then the second foo-attr.

The first one shows the description from attributes.json while the second one doesn't.

@rchl
Copy link
Collaborator Author

rchl commented Apr 21, 2021

Forgot to mention that this is only a problem with vetur.experimental.templateInterpolationService enabled.

rchl added a commit to rchl/vetur that referenced this issue Apr 21, 2021
In cases where template interpolation provided some data for the hover
popup, it overrode the popup contents without letting component data
hover info to show.

Ask both services and merge the results together so that nothing is
lost.

Fixes vuejs#2878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants