on master help sign in
Default 'roots' field of language config

Previously roots needed to be specified by every language and `[]` was used as an explicit default. Root files don't make sense for every language (for example TOML) so I think we should allow languages to not explicitly mention the key and have the `[]` default automatically.

commit8b2d97eb56d6cffcc6ce235d6a6bf2d56055fe4b authorMichael Davis <mcarsondavis@gmail.com> dateMon 13 Nov 2023, 09:24 (3 years ago) parent13386a4
1 file changed+2−1
helix-core/src/syntax.rs+2−1
helix-core/src/syntax.rs+2−1
@@ -101,7 +101,8 @@ pub struct LanguageConfiguration {
101101 pub file_types: Vec<FileType>, // filename extension or ends_with? <Gemfile, rb, etc>
102102 #[serde(default)]
103103 pub shebangs: Vec<String>, // interpreter(s) associated with language
104− pub roots: Vec<String>, // these indicate project roots <.git, Cargo.toml>
104+ #[serde(default)]
105+ pub roots: Vec<String>, // these indicate project roots <.git, Cargo.toml>
105106 pub comment_token: Option<String>,
106107 pub text_width: Option<usize>,
107108 pub soft_wrap: Option<SoftWrap>,