vue-intellisense
vue-intellisense copied to clipboard
How do I add vue Custom Directives intellisense?
I define vue Custom Directives like v-permission,
and how to intellisense at every Html tag.
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.
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.
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.
There is no need to modify the extension, just use html.customData to specify html custom data:
vscode-custom-data
vue v-else directive