-
Notifications
You must be signed in to change notification settings - Fork 389
Open
Labels
Description
Hi, this is Pine from VS Code team. I'm working on expanding our HTML Language Server to better support WebComponents. I'd like to get some feedback from the WebComponents commitee / community on implementing WC editor support.
I also work on Vue Language Server where I'm already shipping such support for Vue-based frameworks.
Current Status
https://github.com/octref/web-components-examples
- User includes
web-components.jsonandweb-component-attributes.jsonin a project - User points to these JSON files with
html.experimental.custom.tagsandhtml.experimental.custom.attributesconfigurations - VS Code gets HTML completion and hover for the custom tags / attributes.
Some Background
- The TypeScript community has adopted Type Definition Files, which drives the completions, hover messages and many other language features in VS Code and other editors through javascript-typescript-langserver.
- Through Language Server Protocol, HTML Language Server in VS Code can be used in other editors too.
Use Cases
The main two use cases are:
- Someone ships
my-wc-libslibrary. He includesweb-components.jsonin his NPM distribution (similar to packages included.tsfiles for TypeScript) and putswebComponents: "./web-components.jsonin hispackage.json. VS Code finds the JSON files to enhance its HTML support. - Someone just wrote
my-component.jslocally in a project. It would be awesome if an Analyzer (non-existent yet) would figure out thecustomElements.definecalls, generate such JSON files and feed them to the HTML Language Server to enhance its functionalities. When the user navigates to a HTML file, he should get HTML completions for the WebComponent he just defined.
Discussions
I'd like to get some input for questions below. But if you have other questions / concerns, feel welcome to chime in.
- What are some additional editor features that could be implemented for Web Components? For example, jump to definition on
<my-component>in HTML goes to the JS source where the component is defined? - Would the WebComponents committee be interested in specifying a format for such JSON files?
- Would WebComponents implement an Analyzer, similar to Polymer Analyzer for generating such JSON files on-the-fly?
adamdbradley, jameschurchman, J0ne, daKmoR, graynorton and 77 morejustinfagnani, bahrus, abdonrd, LostInBrittany, sibbl and 17 moresdykae, piotrekwitkowski, apalaniuk, eduferfer, wilomgfx and 7 more
