Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/tests/indent.rs')
| -rw-r--r-- | helix-core/tests/indent.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/helix-core/tests/indent.rs b/helix-core/tests/indent.rs index b41b2f64..ab733f93 100644 --- a/helix-core/tests/indent.rs +++ b/helix-core/tests/indent.rs @@ -1,4 +1,3 @@ -use arc_swap::ArcSwap; use helix_core::{ indent::{indent_level_for_line, treesitter_indent_for_pos, IndentStyle}, syntax::{config::Configuration, Loader}, @@ -6,7 +5,7 @@ use helix_core::{ }; use helix_stdx::rope::RopeSliceExt; use ropey::Rope; -use std::{ops::Range, path::PathBuf, process::Command, sync::Arc}; +use std::{ops::Range, path::PathBuf, process::Command}; #[test] fn test_treesitter_indent_rust() { @@ -196,17 +195,12 @@ fn test_treesitter_indent( runtime.push("../runtime"); std::env::set_var("HELIX_RUNTIME", runtime.to_str().unwrap()); - let language_config = loader.language_config_for_scope(lang_scope).unwrap(); + let language = loader.language_for_scope(lang_scope).unwrap(); + let language_config = loader.language(language).config(); let indent_style = IndentStyle::from_str(&language_config.indent.as_ref().unwrap().unit); - let highlight_config = language_config.highlight_config(&[]).unwrap(); let text = doc.slice(..); - let syntax = Syntax::new( - text, - highlight_config, - Arc::new(ArcSwap::from_pointee(loader)), - ) - .unwrap(); - let indent_query = language_config.indent_query().unwrap(); + let syntax = Syntax::new(text, language, &loader).unwrap(); + let indent_query = loader.indent_query(language).unwrap(); for i in 0..doc.len_lines() { let line = text.line(i); |