Skip to main content

gpui_component/highlighter/
mod.rs

1mod language_name;
2pub use gpui_base::input::{
3    Diagnostic, DiagnosticEntry, DiagnosticRelatedInformation, DiagnosticSet, DiagnosticSeverity,
4    DiagnosticSummary, DiagnosticTag, RelatedInformation,
5};
6pub(crate) use language_name::language_name;
7
8mod diagnostic_styles;
9pub(crate) use diagnostic_styles::*;
10
11#[cfg(feature = "tree-sitter")]
12mod input_adapter;
13#[cfg(feature = "tree-sitter")]
14pub(crate) use input_adapter::input_highlighter_factory;
15
16#[cfg(not(feature = "tree-sitter"))]
17pub(crate) fn input_highlighter_factory() -> gpui_base::input::InputHighlighterFactory {
18    std::rc::Rc::new(|_| None)
19}
20
21// Native implementation with full tree-sitter support
22#[cfg(feature = "tree-sitter")]
23mod highlighter;
24#[cfg(feature = "tree-sitter")]
25mod languages;
26#[cfg(feature = "tree-sitter")]
27mod registry;
28
29#[cfg(feature = "tree-sitter")]
30pub use highlighter::*;
31#[cfg(feature = "tree-sitter")]
32pub use languages::*;
33#[cfg(feature = "tree-sitter")]
34pub use registry::*;
35
36// WASM stub implementation (no tree-sitter support or disabled)
37#[cfg(not(feature = "tree-sitter"))]
38mod wasm_stub;
39#[cfg(not(feature = "tree-sitter"))]
40pub use wasm_stub::*;