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 | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/helix-core/tests/indent.rs b/helix-core/tests/indent.rs index ab733f93..56b4d2ba 100644 --- a/helix-core/tests/indent.rs +++ b/helix-core/tests/indent.rs @@ -1,11 +1,12 @@ +use arc_swap::ArcSwap; use helix_core::{ indent::{indent_level_for_line, treesitter_indent_for_pos, IndentStyle}, - syntax::{config::Configuration, Loader}, + syntax::{Configuration, Loader}, Syntax, }; use helix_stdx::rope::RopeSliceExt; use ropey::Rope; -use std::{ops::Range, path::PathBuf, process::Command}; +use std::{ops::Range, path::PathBuf, process::Command, sync::Arc}; #[test] fn test_treesitter_indent_rust() { @@ -195,12 +196,17 @@ fn test_treesitter_indent( runtime.push("../runtime"); std::env::set_var("HELIX_RUNTIME", runtime.to_str().unwrap()); - let language = loader.language_for_scope(lang_scope).unwrap(); - let language_config = loader.language(language).config(); + let language_config = loader.language_config_for_scope(lang_scope).unwrap(); 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, language, &loader).unwrap(); - let indent_query = loader.indent_query(language).unwrap(); + let syntax = Syntax::new( + text, + highlight_config, + Arc::new(ArcSwap::from_pointee(loader)), + ) + .unwrap(); + let indent_query = language_config.indent_query().unwrap(); for i in 0..doc.len_lines() { let line = text.line(i); |