This project provides a language server and editor extensions for using Web Components and custom elements. It offers advanced HTML diagnostics, completion, and validation for custom elements, including support for attribute types, deprecation, and duplicate attribute detection.
- HTML diagnostics for custom elements and attributes
- Attribute type validation (boolean, number, enum, string)
- Deprecated element and attribute warnings
- Duplicate attribute detection
- Completion and hover support for custom elements
- Configurable diagnostics severity
- Works with any Web Components library that provides a Custom Elements Manifest
packages/language-server
: Core language server implementationpackages/vscode
: VSCode extension clientpackages/cem-utilities
: Utilities for parsing custom element manifests
-
Install dependencies:
pnpm install
-
Build the project:
pnpm run build
-
Open in VSCode:
- Open this folder in VSCode.
- Press
Ctrl+Shift+B
to compile the client and server.
-
Debug the extension:
- Switch to the Debug view.
- Select
Launch Client
and start debugging. - Optionally, use
Attach to Server
to debug the server process.
-
Try it out:
- Open an HTML file and use custom elements.
- See diagnostics for invalid attributes, deprecated usage, and duplicates.
- To create a local
.vsix
package run:pnpm vscode:pack
- The
.vsix
file will be created inpackages/vscode/
for manual installation. - To publish the package run:
pnpm vscode:release
You can customize diagnostics and other behaviors via a wc.config.js
file in your workspace root. See the documentation in packages/language-server/src/services/configuration-service.ts
for available options.