Crate html_languageservice

source
Expand description

§HTMLLanguageService

The basics of an HTML language server.

HTMLLanguageService

§Examples

use html_languageservice::{HTMLDataManager, HTMLLanguageService, HTMLLanguageServiceOptions};
use lsp_textdocument::FullTextDocument;
use lsp_types::Position;

#[tokio::main]
async fn main() {
    // prepare
    let document = FullTextDocument::new("html".to_string(), 1, "<div></div>".to_string());
    let position = Position::new(0, 1);
    // parse_html_document
    let data_manager = HTMLDataManager::new(true, None);
    let html_document = HTMLLanguageService::parse_html_document(&document, &data_manager);
    assert!(html_document.roots.len() > 0);
}

Re-exports§

Modules§

Structs§

Enums§

Traits§