Web Components Language Server is a VS Code extension that adds help pop-ups and IntelliSense for custom elements described by a Custom Elements Manifest (CEM). The manifest records component attributes, properties, styling, and events as API documentation. section 1.5 section 10.5
Use the extension with a project CEM file to:
- Hover over a custom-element instance to see its documented API. section 10.5
- Receive matching custom-element names as you type. section 10.5
- Choose supported attributes and receive suggested attribute values. section 10.5
- Refresh VS Code after generating or changing custom-elements.json so the extension rereads the manifest. section 10.5
Editing a documented component
In a project containing the vanilla hello-world component, type part of its custom-element name in VS Code and select the suggested match. After typing a space, choose one of its documented attributes and accept a suggested value. Hovering over the completed element opens its help pop-up. section 10.5
export default {
libraries: {
"ch10/cem-demo": {
manifestSrc: "./ch10/cem-demo/custom-elements.json",
},
},
};
When the VS Code window is opened on an ancestor directory, wc.config.js can identify the CEM file for each project subdirectory. section 10.5
