JSPM

vscode-css-languageservice

1.0.7-next.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 821985
  • Score
    100M100P100Q208604F
  • License MIT

Language service for CSS, LESS and SCSS

Package Exports

  • vscode-css-languageservice

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vscode-css-languageservice) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vscode-css-languageservice

Language services for CSS, LESS and SCSS

npm Package NPM Downloads

Why?

The vscode-css-languageservice contains the language smarts behind the CSS, LESS and SCSS editing experience of Visual Studio Code and the Moanco editor.

  • doValidation analyses an input string and returns syntax and lint errros.
  • doComplete provides completion proposals for a given location.
  • doHover provides a hover text for a given location.
  • findDefinition finds the definition of the symbol at the given location.
  • findReferences finds all references to the symbol at the given location.
  • findDocumentHighlights finds all symbols connected to the given location.
  • findDocumentSymbols provides all symbols in the given document
  • doCodeActions evaluats code actions for the given location, typically to fix a problem.
  • findColorSymbols evaluates all color symbols in the given document
  • doRename renames all symbols connected connected to the given location.

Installation

npm install --save vscode-css-languageservice

API

export interface LanguageService {
    configure(raw: LanguageSettings): void;
    doValidation(document: TextDocument, stylesheet: Stylesheet): Diagnostic[];
    parseStylesheet(document: TextDocument): Stylesheet;
    doComplete(document: TextDocument, position: Position, stylesheet: Stylesheet): CompletionList;
    doHover(document: TextDocument, position: Position, stylesheet: Stylesheet): Hover;
    findDefinition(document: TextDocument, position: Position, stylesheet: Stylesheet): Location;
    findReferences(document: TextDocument, position: Position, stylesheet: Stylesheet): Location[];
    findDocumentHighlights(document: TextDocument, position: Position, stylesheet: Stylesheet): DocumentHighlight[];
    findDocumentSymbols(document: TextDocument, stylesheet: Stylesheet): SymbolInformation[];
    doCodeActions(document: TextDocument, range: Range, context: CodeActionContext, stylesheet: Stylesheet): Command[];
    findColorSymbols(document: TextDocument, stylesheet: Stylesheet): Range[];
    doRename(document: TextDocument, position: Position, newName: string, stylesheet: Stylesheet): WorkspaceEdit;
}

export interface LanguageSettings {
    validate?: boolean;
    lint?: any;
}

License

(MIT License)

Copyright 2016, Microsoft