-
Notifications
You must be signed in to change notification settings - Fork 33
Description
I'm trying to understand how/if I can add custom data for HTML/CSS language providers in modern-monaco. It would allow showing intellisense for custom HTML elements / web components.
I believe modern-monaco has all the pieces in place already, as this type of Custom Data is already used for DOM intellisense (coming from here:
modern-monaco/src/lsp/html/worker.ts
Line 35 in c5a540c
| const customDataProviders: htmlService.IHTMLDataProvider[] = []; |
VS Code does this from the html.customData settings entry. One common approach is that packages have a file custom-elements.json at the root, or have a package.json entry called customElements that points at a json file within that package.
Here's an example:
{
"html.customData": [
"./node_modules/@needle-tools/engine/custom-elements.json"
]
}This allows having code like
<needle-engine src=""></needle-engine>and getting intellisense for that custom element:
I would like to be able to provide that intellisense in modern-monaco as well, as it fits nicely with the automatic types from esm.sh.
I think in VS Code the feature lives approximately here: https://github.com/microsoft/vscode/blob/4a04ab66fcce9de3cf8770245c08124aca1eadc9/extensions/html-language-features/client/src/customData.ts#L11
Thanks!