Language services for HTML
Перейти к файлу
microsoft-github-policy-service[bot] df627a715b
Updated for https://dev.azure.com/monacotools/a6d41577-0fa3-498e-af22-257312ff0545/_build?definitionId=411 by using baselines generated in https://dev.azure.com/monacotools/a6d41577-0fa3-498e-af22-257312ff0545/_build/results?buildId=307347
2024-11-27 15:39:56 +00:00
.config/1espt Updated for https://dev.azure.com/monacotools/a6d41577-0fa3-498e-af22-257312ff0545/_build?definitionId=411 by using baselines generated in https://dev.azure.com/monacotools/a6d41577-0fa3-498e-af22-257312ff0545/_build/results?buildId=307347 2024-11-27 15:39:56 +00:00
.github run ci with node 18 (#193) 2024-08-26 12:29:14 -07:00
.vscode add publish pipeline (#140) 2022-11-03 16:24:05 +01:00
build Engineering - remove preReleaseTagAddToLatest pipeline template parameter (#195) 2024-11-27 16:30:15 +01:00
docs Docs link to deleted file. Fixes #122 2022-03-18 17:23:07 +01:00
src prepare 5.3.0 (#191) 2024-06-24 08:59:40 -07:00
.eslintrc.json update dependencies 2020-09-16 09:43:44 +02:00
.gitignore prepare 5.1.2 (#175) 2024-01-22 21:03:41 +00:00
.mocharc.json update dependencies 2020-09-16 09:43:44 +02:00
.npmignore prepare 5.0.8 (#169) 2023-09-08 15:17:10 +02:00
.prettierrc.json HTML service doRename. Part of microsoft/vscode#47069 2019-11-19 11:12:00 -08:00
CHANGELOG.md prepare 5.2.0 (#182) 2024-03-22 07:05:53 -07:00
LICENSE.md Add license 2016-09-15 22:14:01 +02:00
README.md prepare 5.1.2 (#175) 2024-01-22 21:03:41 +00:00
SECURITY.md Microsoft mandatory file 2023-06-02 20:41:28 +00:00
eslint.config.mjs prepare 5.3.1 (#192) 2024-08-26 20:16:02 +02:00
package-lock.json prepare 5.3.1 (#192) 2024-08-26 20:16:02 +02:00
package.json prepare 5.3.1 (#192) 2024-08-26 20:16:02 +02:00
thirdpartynotices.txt Drop outdated ionic/angular/razor support 2019-02-06 10:54:22 -08:00

README.md

vscode-html-languageservice

HTML language service extracted from VSCode to be reused, e.g in the Monaco editor.

npm Package NPM Downloads Build Status License: MIT

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

Installation

npm install --save vscode-html-languageservice

Development

  • clone this repo, run `npm i``
  • npm test to 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: image

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-languageservice repo to vscode/extensions/html-language-features/server to 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
  • run VSCode out of source (vscode/scripts/code.sh|bat) and open a .html file
  • in VSCode window that is open on the vscode-html-languageservice sources, run command Debug: Attach to Node process and pick the code-oss process with the html-language-features path image
  • set breakpoints, e.g. in htmlCompletion.ts
  • in the instance run from sources, invoke code completion in the .html file

License

(MIT License)

Copyright 2016-2023, Microsoft

src/languageFacts/data/webCustomData.ts (shipped as lib/esm/languageFacts/data/webCustomData.ts and lib/umd/languageFacts/data/webCustomData.ts) are built upon content from Mozilla Developer Network and distributed under CC BY-SA 2.5.