28 releases (11 breaking)
| 0.12.0 | Aug 1, 2025 |
|---|---|
| 0.11.3 | Jul 23, 2025 |
| 0.11.1 | Jun 18, 2025 |
| 0.7.4 | Mar 24, 2025 |
| 0.1.0 | Dec 4, 2023 |
#1816 in Development tools
1,751 downloads per month
650KB
13K
SLoC
html-languageservice
The project is a rewrite of vscode-html-languageservice use
rust. It has all the features of the original project while still having higher performance.
This project is a collection of features necessary to implement an HTML language server.
Features
- customize data providers
- parse html document
- scanner
- completion -
completionfeature activate - hover -
hoverfeature activate - formatter -
formatterfeature activate - find document highlights -
highlightfeature activate - find document links -
linksfeature activate - find document symbols -
symbolsfeature activate - get folding ranges -
foldingfeature activate - get selection ranges -
selection_rangefeature activate - quote complete -
completionfeature activate - tag complete -
completionfeature activate - rename -
renamefeature activate - find matching tag position -
matching_tag_positionfeature activate - find linked editing ranges -
linked_editingfeature activate
Usage
Make sure you activated the full features of the html-languageservice crate on Cargo.toml:
html-languageservice = { version = "0.6.1", features = ["full"] }
You can also activate only some of the features you need on Cargo.toml:
html-languageservice = { version = "0.6.1", features = ["completion", "hover"] }
Create the HTMLLanguageService struct in first.
Second, You need to prepare: document and position.
Then, parse document as html_document you need to HTMLDataManager, tags, attributes, and attribute value data are stored in the HTMLDataManager.
Finally, call a function or method to get the result.
For more see docs.rs
Dependencies
~3–5MB
~91K SLoC