@teacss/language-service
v0.9.4
Published
Framework-agnostic editor intelligence for TeaCSS (completion, hover, color, token highlighting).
Readme
@teacss/language-service
Transport-neutral TeaCSS editor intelligence.
Use it for an in-process editor, playground, or tool. It returns
vscode-languageserver-types data and does not own an LSP connection.
import { TeacssLanguageService } from "@teacss/language-service";
const service = new TeacssLanguageService({ rootPath: process.cwd() });
await service.ready;
await service.getHover(document, { line: 0, character: 13 });
await service.getSemanticTokens(document);
await service.getClassNameEdits(document);
service.contextManager.releaseDocument(filePath);The service provides completion, hover, colors, references, diagnostics, Quick
Fixes, semantic tokens, and canonical class edits. References use the active
entry's @source graph. Class edits preserve unknown classes.
DOM context attributes (lang, the seven data-css-<role> attributes, data-css-appearance, data-css-group, and
data-css-peer) contain values, not class usages. Their values, including JSX and
Vue bindings, are excluded from utility intelligence. Class tokens such as
p:4@lang-zh retain completion, hover, references, and highlighting.
Generic data-theme, data-mode, data-group, and data-peer have no special
TeaCSS context handling.
Use contextManager.setRoots(roots) to replace workspace roots; [] unloads
all contexts. Release a document or call reload() when a nearer entry becomes
available after the document was cached.
@teacss/language-server adds LSP transport and watchers.
@teacss/vscode provides the ready-made VS Code extension.
Pre-1.0. Results follow the active CSS entry.
