tui_syntax/languages/
mod.rs1mod html;
6mod json;
7mod sql;
8
9pub use html::html;
10pub use json::json;
11pub use sql::sql;
12
13use tree_sitter::Language as TsLanguage;
14
15#[derive(Debug)]
17pub enum LanguageError {
18 HighlightConfig(String),
20}
21
22impl std::fmt::Display for LanguageError {
23 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24 match self {
25 LanguageError::HighlightConfig(msg) => write!(f, "Highlight config error: {}", msg),
26 }
27 }
28}
29
30impl std::error::Error for LanguageError {}
31
32pub struct Language {
34 pub name: &'static str,
36 pub ts_language: TsLanguage,
38 pub highlights_query: &'static str,
40 pub injections_query: &'static str,
42 pub locals_query: &'static str,
44}