@@ -293,9 +293,28 @@ where
293293 );
294294
295295 let doc = Rope::from(doc);
296− let language_config = crate::syntax::LOADER
297− .language_config_for_scope("source.rust")
298− .unwrap();
296+ use crate::syntax::{
297+ Configuration, IndentationConfiguration, Lang, LanguageConfiguration, Loader,
298+ };
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(),
306+ //
307+ path: "../helix-syntax/languages/tree-sitter-rust".into(),
308+ roots: vec![],
309+ language_server: None,
310+ indent: Some(IndentationConfiguration {
311+ tab_width: 4,
312+ unit: String::from(" "),
313+ }),
314+ }],
315+ });
316+
317+ let language_config = loader.language_config_for_scope("source.rust").unwrap();
299318 let highlight_config = language_config.highlight_config(&[]).unwrap();
300319 let syntax = Syntax::new(&doc, highlight_config.clone());
301320 let text = doc.slice(..);