@oddsquad/lit-language-server
v0.29.0
Published
Completion, hover and diagnostics for Lit components in VS Code, Zed and any LSP editor, read from your sources and your dependencies' Custom Elements Manifests.
Maintainers
Readme
@oddsquad/lit-language-server
A language server for Lit components. In html and svg templates, HTML
files, JSX, Astro and MDX, and css templates, it completes your
components' tags, attributes, properties and events, shows their docs on
hover, leads to their source, types your event handlers, and reports a
handler that doesn't fit its event. It reads your components
from source as you type, and your dependencies' Custom Elements Manifests, in
one package or a whole monorepo, with or without Vite.
html`<x-button @submit-start=${(ev) => ev.detail.‸}></x-button>`;
// ^^ CustomEvent<{size: 'small' | 'large'; at: number}>
// completion: size, atUse it
VS Code: install Lit DevTools; it starts this server, the project's own copy when it installs one.
Zed: install Lit DevTools; it starts this server.
Any LSP editor: run
lit-language-server --stdio, from a project that installs it:npm install -D @oddsquad/lit-language-serverOxlint:
@oddsquad/oxlint-plugin-litreports the same problems in a lint run.
Use the Lit language server sets it up; the reference lists everything it completes, shows and reports.
Settings
It needs none. In a Vite project, set languageServer in
litPlugin() from @oddsquad/lit-devtools/vite; elsewhere, in a
lit-devtools.config.ts:
import {defineConfig} from '@oddsquad/lit-language-server';
export default defineConfig({
languageServer: {
diagnostics: {css: 'off'},
},
});License
BSD-3-Clause
