Insert an extra newline between brackets

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2021-10-19 13:17:16 +02:00
parent 561857fdf2
commit 5558d553bb
5 changed files with 245 additions and 60 deletions

View file

@ -11,13 +11,15 @@ pub use tree_sitter::{Parser, Tree};
pub struct LanguageConfig {
pub name: String,
pub path_suffixes: Vec<String>,
pub autoclose_pairs: Vec<AutoclosePair>,
pub brackets: Vec<BracketPair>,
}
#[derive(Clone, Deserialize)]
pub struct AutoclosePair {
#[derive(Clone, Debug, Deserialize)]
pub struct BracketPair {
pub start: String,
pub end: String,
pub close: bool,
pub newline: bool,
}
pub struct Language {
@ -95,8 +97,8 @@ impl Language {
self.config.name.as_str()
}
pub fn autoclose_pairs(&self) -> &[AutoclosePair] {
&self.config.autoclose_pairs
pub fn brackets(&self) -> &[BracketPair] {
&self.config.brackets
}
pub fn highlight_map(&self) -> HighlightMap {