@@ -293,9 +293,28 @@ where
295 let doc = Rope::from(doc);
295 let doc = Rope::from(doc);
296− let language_config = crate::syntax::LOADER
296+ use crate::syntax::{
297+ Configuration, IndentationConfiguration, Lang, LanguageConfiguration, Loader,
299+ use once_cell::sync::OnceCell;
300+ let loader = Loader::new(Configuration {
301+ language: vec![LanguageConfiguration {
302+ scope: "source.rust".to_string(),
303+ file_types: vec!["rs".to_string()],
304+ language_id: Lang::Rust,
305+ highlight_config: OnceCell::new(),
307+ path: "../helix-syntax/languages/tree-sitter-rust".into(),
309+ language_server: None,
310+ indent: Some(IndentationConfiguration {
312+ unit: String::from(" "),
297− .language_config_for_scope("source.rust")
317+ let language_config = loader.language_config_for_scope("source.rust").unwrap();
299 let highlight_config = language_config.highlight_config(&[]).unwrap();
318 let highlight_config = language_config.highlight_config(&[]).unwrap();
300 let syntax = Syntax::new(&doc, highlight_config.clone());
319 let syntax = Syntax::new(&doc, highlight_config.clone());
301 let text = doc.slice(..);
320 let text = doc.slice(..);