pub struct LanguageConfig {
pub id: LanguageId,
pub display_name: String,
pub file_extensions: Vec<String>,
pub file_names: Vec<String>,
pub comments: CommentConfig,
pub auto_pairs: AutoPairsConfig,
pub indentation: IndentationConfig,
pub word_boundary: WordBoundaryLanguageConfig,
pub treesitter: Option<TreeSitterLanguageConfig>,
pub lsp: Option<LspLanguageConfig>,
pub extra: BTreeMap<String, String>,
}Expand description
Unified per-language configuration.
Fields§
§id: LanguageIdStable language id (e.g. "rust").
display_name: StringHuman-friendly name (e.g. "Rust").
file_extensions: Vec<String>File extensions matched by this language (lowercase, without the leading dot).
file_names: Vec<String>Exact file names matched by this language (case-sensitive).
comments: CommentConfigComment tokens.
auto_pairs: AutoPairsConfigAuto-pairs rules (typically applied via EditCommand::TypeChar).
indentation: IndentationConfigIndentation preferences and trigger chars.
word_boundary: WordBoundaryLanguageConfigWord boundary override (for word movement/selection).
treesitter: Option<TreeSitterLanguageConfig>Optional Tree-sitter config.
lsp: Option<LspLanguageConfig>Optional LSP config.
extra: BTreeMap<String, String>Free-form extra settings for hosts (UI-specific knobs, etc).
This is intentionally not interpreted by the workspace crates.
Implementations§
Source§impl LanguageConfig
impl LanguageConfig
Sourcepub fn new(id: impl Into<LanguageId>, display_name: impl Into<String>) -> Self
pub fn new(id: impl Into<LanguageId>, display_name: impl Into<String>) -> Self
Create a minimal language config.
Sourcepub fn with_extension(self, ext: impl Into<String>) -> Self
pub fn with_extension(self, ext: impl Into<String>) -> Self
Add a file extension match (without the leading dot).
Sourcepub fn with_file_name(self, name: impl Into<String>) -> Self
pub fn with_file_name(self, name: impl Into<String>) -> Self
Add an exact file name match.
Sourcepub fn matches_path(&self, path: &Path) -> bool
pub fn matches_path(&self, path: &Path) -> bool
Returns true if this language config matches the given path (file name or extension).
Trait Implementations§
Source§impl Clone for LanguageConfig
impl Clone for LanguageConfig
Source§fn clone(&self) -> LanguageConfig
fn clone(&self) -> LanguageConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LanguageConfig
impl Debug for LanguageConfig
Source§impl Default for LanguageConfig
impl Default for LanguageConfig
impl Eq for LanguageConfig
Source§impl PartialEq for LanguageConfig
impl PartialEq for LanguageConfig
Source§fn eq(&self, other: &LanguageConfig) -> bool
fn eq(&self, other: &LanguageConfig) -> bool
self and other values to be equal, and is used by ==.