html_languageservice/
lib.rs

1//! # HTMLLanguageService
2//!
3//! The basics of an HTML language server.
4//!
5//! [HTMLLanguageService]
6//!
7//! # Examples
8//!
9//! ```rust
10//! use html_languageservice::{HTMLDataManager, HTMLLanguageService, HTMLLanguageServiceOptions};
11//! use lsp_textdocument::FullTextDocument;
12//! use lsp_types::Position;
13//!
14//! #[tokio::main]
15//! async fn main() {
16//!     // prepare
17//!     let document = FullTextDocument::new("html".to_string(), 1, "<div></div>".to_string());
18//!     let position = Position::new(0, 1);
19//!     // parse_html_document
20//!     let data_manager = HTMLDataManager::new(true, None);
21//!     let html_document = HTMLLanguageService::parse_html_document(&document, &data_manager);
22//!     assert!(html_document.roots.len() > 0);
23//! }
24//! ```
25
26#[cfg(feature = "formatter")]
27mod beautify;
28pub mod html_data;
29mod html_language_service;
30mod html_language_types;
31pub mod language_facts;
32pub mod parser;
33pub mod participant;
34mod services;
35mod utils;
36
37pub use language_facts::data_manager::HTMLDataManager;
38pub use parser::html_parse::parse_html_document;
39
40#[cfg(feature = "completion")]
41pub use services::html_completion::{CompletionConfiguration, Quotes};
42
43#[cfg(feature = "folding")]
44pub use services::html_folding::FoldingRangeContext;
45
46#[cfg(feature = "formatter")]
47pub use services::html_formatter::HTMLFormatConfiguration;
48#[cfg(feature = "hover")]
49pub use services::html_hover::HoverSettings;
50
51pub use html_language_service::HTMLLanguageService;
52pub use html_language_types::{
53    DefaultDocumentContext, DocumentContext, FileStat, FileSystemProvider, FileType,
54    HTMLLanguageServiceOptions,
55};