diff options
author | Blaž Hrastnik | 2021-06-04 01:50:03 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-04 02:03:40 +0000 |
commit | 06d8d3f55fbf02bb4d938ecbc479cd60309a0a5d (patch) | |
tree | c47d95747397d3b5e00a8b57717b3fc5093646df /helix-core/src/indent.rs | |
parent | 8afd4e1bc21c244a4ed241630a0e845f4ab81f74 (diff) |
Try to detect language when document file path is set
Fixes #91
Diffstat (limited to 'helix-core/src/indent.rs')
-rw-r--r-- | helix-core/src/indent.rs | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs index fc253f91..7ab810fd 100644 --- a/helix-core/src/indent.rs +++ b/helix-core/src/indent.rs @@ -251,22 +251,25 @@ where Configuration, IndentationConfiguration, Lang, LanguageConfiguration, Loader, }; use once_cell::sync::OnceCell; - let loader = Loader::new(Configuration { - language: vec![LanguageConfiguration { - scope: "source.rust".to_string(), - file_types: vec!["rs".to_string()], - language_id: Lang::Rust, - highlight_config: OnceCell::new(), - // - roots: vec![], - language_server: None, - indent: Some(IndentationConfiguration { - tab_width: 4, - unit: String::from(" "), - }), - indent_query: OnceCell::new(), - }], - }); + let loader = Loader::new( + Configuration { + language: vec![LanguageConfiguration { + scope: "source.rust".to_string(), + file_types: vec!["rs".to_string()], + language_id: Lang::Rust, + highlight_config: OnceCell::new(), + // + roots: vec![], + language_server: None, + indent: Some(IndentationConfiguration { + tab_width: 4, + unit: String::from(" "), + }), + indent_query: OnceCell::new(), + }], + }, + Vec::new(), + ); // set runtime path so we can find the queries let mut runtime = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); |