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

The annotation function of vue file synchronizes vscode to parse annotations of js/ts files #2807

Open
shaobeichen opened this issue Mar 24, 2021 · 1 comment

Comments

@shaobeichen
Copy link

The annotation function of vue file synchronizes vscode to parse annotations of js/ts files

At present, vetur's support for vue file comments is not friendly, I hope this function can be optimized

js-file.mp4
vue-file.mp4
@jasonlyu123
Copy link
Contributor

This is not hard to implement. Only that typescript language service only generate type comment for .js and .jsx files. So it would look like the comment generated in the ts file.

If anyone is interested in implement it. You can add your implementation before this line

if (NON_SCRIPT_TRIGGERS.includes(triggerChar)) {

And you can reference these files for how to implement it
https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/src/languageFeatures/jsDocCompletions.ts

https://github.com/sveltejs/language-tools/blob/master/packages/language-server/src/plugins/typescript/features/getJsDocTemplateCompletion.ts

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

No branches or pull requests

3 participants