Start on autoclosing pairs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
3cb7ba0f57
commit
05d7e9c4e7
6 changed files with 174 additions and 3 deletions
|
@ -11,6 +11,13 @@ pub use tree_sitter::{Parser, Tree};
|
|||
pub struct LanguageConfig {
|
||||
pub name: String,
|
||||
pub path_suffixes: Vec<String>,
|
||||
pub autoclose_pairs: Vec<AutoclosePair>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
pub struct AutoclosePair {
|
||||
pub start: String,
|
||||
pub end: String,
|
||||
}
|
||||
|
||||
pub struct Language {
|
||||
|
@ -81,6 +88,10 @@ impl Language {
|
|||
self.config.name.as_str()
|
||||
}
|
||||
|
||||
pub fn autoclose_pairs(&self) -> &[AutoclosePair] {
|
||||
&self.config.autoclose_pairs
|
||||
}
|
||||
|
||||
pub fn highlight_map(&self) -> HighlightMap {
|
||||
self.highlight_map.lock().clone()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue