Vscode: [html] Add support for custom tag providers for HTML

Created on 8 Feb 2016  路  7Comments  路  Source: microsoft/vscode

It would be nice to have option to create custom tag providers for HTML as part of vs code extensions. For example, it'd allowed to implement Angular 2 or Ionic support in extension. Right now extensibility is limited to snippets which is nice but not enough.

feature-request html on-testplan

Most helpful comment

To add to this: it would be a great addition to move the existing Angular Tag provider into a custom extension. Using this approach, Angular tag hints would only appear if a user needs them. At the moment tag hints are displayed even if we do not use Angular.

All 7 comments

To add to this: it would be a great addition to move the existing Angular Tag provider into a custom extension. Using this approach, Angular tag hints would only appear if a user needs them. At the moment tag hints are displayed even if we do not use Angular.

@lafe great idea!

Yes please!

I would like to have this functionality for use with web components so I could build a system that updates intellisense when I bring in a new web component.

You can already write extensions that contribute to the code complete in HTML file. Only catch is that you would need to have your own scanner to figure out what is completed at the current offset.
The plan is to extract that code from our HTML support to a node_module so it can be used by extensions

@aeschli Can you point me at any documentation or example that shows how to add completion options for HTML language as you mentioned? Did some searching yesterday and didn't find anything.

You would write an extension like this one:
https://github.com/Microsoft/vscode/blob/master/extensions/configuration-editing/src/extension.ts
That one adds completion proposals to the keyboard.json file.
That code uses a library called 'jsonc-parser' to find out where the cursor is and what to complete. That's where the work will be.
Check out our documentation on how to scaffold an extension and how to publish it when done.
https://code.visualstudio.com/docs/extensions/example-hello-world

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omidgolparvar picture omidgolparvar  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

lukehoban picture lukehoban  路  3Comments

NikosEfthias picture NikosEfthias  路  3Comments

shanalikhan picture shanalikhan  路  3Comments