Add indent and indent_nodes configs in the language config.toml

This commit is contained in:
Antonio Scandurra
2021-05-26 15:45:34 +02:00
parent 04c7989720
commit d38d944fef
2 changed files with 5 additions and 1 deletions

View File

@@ -1,2 +1,4 @@
name = "Rust"
path_suffixes = ["rs"]
indent = 4
indent_nodes = ["mod_item", "block"]

View File

@@ -2,7 +2,7 @@ use crate::settings::{Theme, ThemeMap};
use parking_lot::Mutex;
use rust_embed::RustEmbed;
use serde::Deserialize;
use std::{path::Path, str, sync::Arc};
use std::{collections::HashSet, path::Path, str, sync::Arc};
use tree_sitter::{Language as Grammar, Query};
pub use tree_sitter::{Parser, Tree};
@@ -13,6 +13,8 @@ pub struct LanguageDir;
#[derive(Default, Deserialize)]
pub struct LanguageConfig {
pub name: String,
pub indent: usize,
pub indent_nodes: HashSet<String>,
pub path_suffixes: Vec<String>,
}