@@ -1,5 +1,5 @@
1use crate::{Change, Rope, RopeSlice, Transaction};
1use crate::{Change, Rope, RopeSlice, Transaction};
2−pub use helix_syntax::LANG;
2+pub use helix_syntax::Lang;
3pub use helix_syntax::{get_language, get_language_name};
3pub use helix_syntax::{get_language, get_language_name};
5use std::collections::HashMap;
5use std::collections::HashMap;
@@ -21,7 +21,7 @@ pub struct LanguageConfiguration {
22 // root_path
22 // root_path
24− pub(crate) language_id: LANG,
24+ pub(crate) language_id: Lang,
25 pub(crate) highlight_config: OnceCell<Option<Arc<HighlightConfiguration>>>,
25 pub(crate) highlight_config: OnceCell<Option<Arc<HighlightConfiguration>>>,
26 // tags_config OnceCell<> https://github.com/tree-sitter/tree-sitter/pull/583
26 // tags_config OnceCell<> https://github.com/tree-sitter/tree-sitter/pull/583
@@ -87,7 +87,7 @@ impl Loader {
87 LanguageConfiguration {
87 LanguageConfiguration {
88 scope: "source.rust".to_string(),
88 scope: "source.rust".to_string(),
89 file_types: vec!["rs".to_string()],
89 file_types: vec!["rs".to_string()],
90− language_id: LANG::Rust,
90+ language_id: Lang::Rust,
91 highlight_config: OnceCell::new(),
91 highlight_config: OnceCell::new(),
93 path: "../helix-syntax/languages/tree-sitter-rust".into(),
93 path: "../helix-syntax/languages/tree-sitter-rust".into(),
@@ -95,7 +95,7 @@ impl Loader {
95 LanguageConfiguration {
95 LanguageConfiguration {
96 scope: "source.toml".to_string(),
96 scope: "source.toml".to_string(),
97 file_types: vec!["toml".to_string()],
97 file_types: vec!["toml".to_string()],
98− language_id: LANG::Toml,
98+ language_id: Lang::Toml,
99 highlight_config: OnceCell::new(),
99 highlight_config: OnceCell::new(),
101 path: "../helix-syntax/languages/tree-sitter-toml".into(),
101 path: "../helix-syntax/languages/tree-sitter-toml".into(),
@@ -160,7 +160,7 @@ pub struct Syntax {
160impl Syntax {
160impl Syntax {
161 // buffer, grammar, config, grammars, sync_timeout?
161 // buffer, grammar, config, grammars, sync_timeout?
162 pub fn new(
162 pub fn new(
163− /*language: LANG,*/ source: &Rope,
163+ /*language: Lang,*/ source: &Rope,
164 config: Arc<HighlightConfiguration>,
164 config: Arc<HighlightConfiguration>,
165 ) -> Self {
165 ) -> Self {
166 // fetch grammar for parser based on language string
166 // fetch grammar for parser based on language string
@@ -779,10 +779,10 @@ impl HighlightConfiguration {
779 non_local_variable_patterns,
779 non_local_variable_patterns,
780 injection_content_capture_index,
780 injection_content_capture_index,
781 injection_language_capture_index,
781 injection_language_capture_index,
782+ local_scope_capture_index,
782 local_def_capture_index,
783 local_def_capture_index,
783 local_def_value_capture_index,
784 local_def_value_capture_index,
784 local_ref_capture_index,
785 local_ref_capture_index,
785− local_scope_capture_index,
@@ -1475,7 +1475,7 @@ fn test_parser() {
1475 .map(String::from)
1475 .map(String::from)
1476 .collect();
1476 .collect();
1478− let language = get_language(LANG::Rust);
1478+ let language = get_language(Lang::Rust);
1479 let mut config = HighlightConfiguration::new(
1479 let mut config = HighlightConfiguration::new(
1480 language,
1480 language,
1481 &std::fs::read_to_string(
1481 &std::fs::read_to_string(