microsoft/vscode-html-languageservice
关于
Language services for HTML
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文vscode-html-languageservice
HTML language service extracted from VSCode to be reused, e.g in the Monaco editor.
Why?
The vscode-html-languageservice contains the language smarts behind the HTML editing experience of Visual Studio Code and the Monaco editor.
doComplete / doComplete2 (async) provide completion proposals for a given location.
setCompletionParticipants allows participant to provide suggestions for specific tokens.
doHover provides hover information at a given location.
format formats the code at the given range.
findDocumentLinks finds all links in the document.
findDocumentSymbols finds all the symbols in the document.
getFoldingRanges return folding ranges for the given document.
getSelectionRanges return the selection ranges for the given document. ...
For the complete API see htmlLanguageService.ts and htmlLanguageTypes.ts
The vscode-html-languageservice does not cover syntax highlighting. VS Code uses TextMate grammars for that, with a grammar that is maintained in https://github.com/textmate/html.tmbundle.
All HTML entities (elements, properties, etc) are sourced from https://github.com/microsoft/vscode-custom-data/tree/master/web-data and transpiled here. For adding or fixing existing properties' completion/hover description, please open PR there.
Installation
npm install --save vscode-html-languageservice
Development
- clone this repo, run
npm i npm testto compile and run tests
How can I run and debug the service?
- open the folder in VSCode.
- set breakpoints, e.g. in
htmlCompletion.ts - run the Unit tests from the run viewlet and wait until a breakpoint is hit:

How 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
- link the folder of the
vscode-html-languageservicerepo tovscode/extensions/html-language-features/serverto run VSCode with the latest changes from that folder:- cd
vscode-html-languageservice,npm link - cd
vscode/extensions/html-language-features/server,npm link vscode-html-languageservice
- cd
- run VSCode out of source (
vscode/scripts/code.sh|bat) and open a.htmlfile - in VSCode window that is open on the
vscode-html-languageservicesources, run commandDebug: Attach to Node processand pick thecode-ossprocess with thehtml-language-featurespath
- set breakpoints, e.g. in
htmlCompletion.ts - in the instance run from sources, invoke code completion in the
.htmlfile
License
(MIT License)
Copyright 2016-2026, Microsoft
src/languageFacts/data/webCustomData.ts (shipped as lib/esm/languageFacts/data/webCustomData.js)
are built upon content from Mozilla Developer Network and distributed under CC BY-SA 2.5.
探索相关项目
加载中…