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

How do I add vue Custom Directives intellisense? #19

Open
hxdyj opened this issue May 14, 2021 · 4 comments
Open

How do I add vue Custom Directives intellisense? #19

hxdyj opened this issue May 14, 2021 · 4 comments

Comments

@hxdyj
Copy link

hxdyj commented May 14, 2021

I define vue Custom Directives like v-permission,
and how to intellisense at every Html tag.

@mesqueeb
Copy link
Member

My CLI vue-intellisense currently works by generating the files required for the Vetur plugin.

Can you do some research on what Vetur needs in order to give intellisense for custom directives ? Then I'll gladly add support for it.

@hxdyj
Copy link
Author

hxdyj commented May 14, 2021

Thank you for reply, I checkout vuter source code try to find location of define derective snippet, and add custom derective rebuild to use.
but have not any way to define custom directive snippet.

@hxdyj
Copy link
Author

hxdyj commented May 18, 2021

I have modify vetur source code and your vue-intellisense code. and published a npm package named bbl-vue-intellisense,

package.json
"vetur": {
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json",
"globalAttributes": "vetur/globalAttributes.json"
}

usage same as your lib.
vue-int --input ./src --output vetur --recursive

It will auto detect custom derective name and Generate globalAttributes.json like :

app.directive("foo")
or
app.directive("bar",()=>{})

whill be generated file like:
[
{
"name":"foo",
"tip":""
},
{
"name":"bar",
"tip":""
}
]

and restart vscode , you can intellisense foo and bar at Html tag attribute.

@ipcjs
Copy link

ipcjs commented Nov 13, 2023

There is no need to modify the extension, just use html.customData to specify html custom data:
vscode-custom-data
vue v-else directive

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

No branches or pull requests

3 participants