从 VSCode 中提取的 CSS、LESS 和 SCSS 语言服务可重复使用,例如在 Monaco 编辑器中。
从 VSCode 中提取的 CSS、LESS 和 SCSS 语言服务可重复使用,例如在 Monaco 编辑器中。
The vscode-css-languageservice contains the language smarts behind the CSS, LESS and SCSS editing experience of Visual Studio Code and the Monaco editor.
The vscode-css-languageservice does not cover syntax highlighting. VS Code uses TextMate grammars for that, with a grammar that is maintained in https://github.com/microsoft/vscode-css.
All CSS entities (properties, at-rules, etc) are sourced from https://github.com/microsoft/vscode-custom-data/tree/master/web-data and transpiled here. For adding new property or fixing existing properties' completion/hover description, please open PR there.
npm install --save vscode-css-languageserviceFor the complete API see cssLanguageService.ts and cssLanguageTypes.ts
npm installnpm test to compile and run testsHow can I run and debug the service?
cssCompletion.tsHow can I run and debug the service inside an instance of VSCode?
run VSCode out of sources setup as described here: https://github.com/Microsoft/vscode/wiki/How-to-Contribute
run npm link in the folder of vscode-css-languageservice
use npm link vscode-css-languageservice in vscode/extensions/css-language-features/server to run VSCode with the latest changes from vscode-css-languageservice
run VSCode out of source (vscode/scripts/code.sh|bat) and open a .css file
in VSCode window that is open on the vscode-css-languageservice sources, run command Debug: Attach to Node process and pick the code-oss process with the css-language-features path
set breakpoints, e.g. in cssCompletion.ts
in the instance run from sources, invoke code completion in the .css file
(MIT License)
Copyright 2016, 25 Microsoft
With the exceptions of build/mdn-documentation.js, which is built upon content from Mozilla Developer Network
and distributed under CC BY-SA 2.5.
暂无开放 Issues,或尚未同步最近议题。