JSDoc with Composition API doesn't work with PropType format on hover
See original GitHub issueWhen using the composition API and defineComponent(), Volar doesn’t seem to pick up the comments when we use the PropType format (that might not be the right term, but example will be below showing what I mean).
We have a number of pure TS file components. These can’t easily be changed to .vue files so we are kind of stuck with them. Some of them don’t even have a template, so I’m not sure if those even could be converted to SFC files.
Anyway, we have props declared like this:
props: {
/** JSDoc comment that does not get detected. */
msg: {
type: String as PropType<string>,
default: "Some value here."
}
}
When we use that component in a .vue SFC file and hover over the “msg” prop, it correctly picks up the type but not the comment.
If we use the simple format of just:
props: {
/** JSDoc comment that does get detected. */
msg: String
}
Below are two images that show what I am referring to. The comment for “inlineMsg” is detected, but the comment for “msg” is not.
So, questions: A) Is there anything that can be changed in Volar to work with these? B) Is there another syntax we can use (without going to SFC files for the components in question) that would make the comments be detected?
Bonus points: I tried cloning the volar repo to run inside VSCode so I could set breakpoints and try to figure out if this was something I could help with and provide a pull request, but I wasn’t even able to get the repo to build. After running “pnpm i” and then running “npm run build” I get build errors about things like “ws” not having type definitions. Is there a doc or wiki page or something that describes how to get going in this way?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
@cabal95 Build error fixed by https://github.com/johnsoncodehk/volar/commit/de487c165ebec13b4e345f6a582ddd99c0c9a8b4, thanks to report it.
Duplicate of #703