Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code IntelliSense for custom HTML elements

Is there a way to add custom HTML elements with custom attributes to VS Code so that I will get some autocomplete / IntelliSense on it?

For example in my framework (here Aurelia) I have added a <my-component is-telling-lies="true" aria-type="hidden" default-target="north">Do you believe?</my-component> and would like to have the element show up when starting to type a new element and inside it the attribute when typing in the attribute space of the element.

like image 895
ZoolWay Avatar asked May 01 '26 23:05

ZoolWay


1 Answers

Yes, there's a way.

You can extend VS Code's HTML support through a declarative custom data format. By setting html.customData to a list of JSON files following the custom data format, you can enhance VS Code's understanding of new HTML tags, attributes and attribute values. VS Code will then offer language support such as completion & hover information for the provided tags, attributes and attribute values.

See: https://code.visualstudio.com/docs/languages/html#_html-custom-data

You can read more about using custom data in the vscode-custom-data repository.

like image 99
Alex G. Wolff Avatar answered May 04 '26 23:05

Alex G. Wolff