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//! fn main() {
15//!     // prepare
16//!     let document = FullTextDocument::new("html".to_string(), 1, "<div></div>".to_string());
17//!     let position = Position::new(0, 1);
18//!     // parse_html_document
19//!     let ls = HTMLLanguageService::new(&HTMLLanguageServiceOptions::default());
20//!     let data_manager = ls.create_data_manager(true, None);
21//!     let html_document = ls.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;
38
39#[cfg(feature = "completion")]
40pub use services::html_completion::{CompletionConfiguration, Quotes};
41
42#[cfg(feature = "folding")]
43pub use services::html_folding::FoldingRangeContext;
44
45#[cfg(feature = "formatter")]
46pub use services::html_formatter::HTMLFormatConfiguration;
47#[cfg(feature = "hover")]
48pub use services::html_hover::HoverSettings;
49
50pub use html_language_service::HTMLLanguageService;
51pub use html_language_types::{
52    DefaultDocumentContext, DocumentContext, FileStat, FileSystemProvider, FileType,
53    HTMLLanguageServiceOptions,
54};