Socket
Socket
Sign inDemoInstall

@johnsoncodehk/vscode-html-languageservice

Package Overview
Dependencies
4
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @johnsoncodehk/vscode-html-languageservice

Language service for HTML


Version published
Maintainers
1
Install size
2.12 MB
Created

Readme

Source

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.

FAQs

Last updated on 24 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc