From e3d680a813e87db41647efa327cdd574e4896f5e Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Thu, 28 Apr 2022 20:43:59 +0100 Subject: [PATCH] Fix highlight factory names --- src/languages/built_in.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/languages/built_in.rs b/src/languages/built_in.rs index 7076f9a..1b4eaf4 100644 --- a/src/languages/built_in.rs +++ b/src/languages/built_in.rs @@ -47,15 +47,15 @@ pub fn register_builtin_languages() { register_language("regex", regex_hl_factory); - register_language("python", regex_hl_python); - register_language("py", regex_hl_python); + register_language("python", python_hl_factory); + register_language("py", python_hl_factory); - register_language("cpp", regex_hl_cpp); - register_language("c++", regex_hl_cpp); + register_language("cpp", cpp_hl_factory); + register_language("c++", cpp_hl_factory); - register_language("typescript", regex_hl_typescript); - register_language("ts", regex_hl_typescript); - register_language("tsx", regex_hl_tsx); + register_language("typescript", typescript_hl_factory); + register_language("ts", typescript_hl_factory); + register_language("tsx", tsx_hl_factory); } pub fn rust_hl_factory() -> Result { @@ -94,7 +94,7 @@ pub fn regex_hl_factory() -> Result { ) } -pub fn regex_hl_python() -> Result { +pub fn python_hl_factory() -> Result { HighlightConfiguration::new( tree_sitter_python::language(), tree_sitter_python::HIGHLIGHT_QUERY, @@ -103,7 +103,7 @@ pub fn regex_hl_python() -> Result { ) } -pub fn regex_hl_cpp() -> Result { +pub fn cpp_hl_factory() -> Result { HighlightConfiguration::new( tree_sitter_cpp::language(), tree_sitter_cpp::HIGHLIGHT_QUERY, @@ -112,7 +112,7 @@ pub fn regex_hl_cpp() -> Result { ) } -pub fn regex_hl_typescript() -> Result { +pub fn typescript_hl_factory() -> Result { HighlightConfiguration::new( tree_sitter_typescript::language_typescript(), tree_sitter_typescript::HIGHLIGHT_QUERY, @@ -121,7 +121,7 @@ pub fn regex_hl_typescript() -> Result { ) } -pub fn regex_hl_tsx() -> Result { +pub fn tsx_hl_factory() -> Result { HighlightConfiguration::new( tree_sitter_typescript::language_tsx(), tree_sitter_typescript::HIGHLIGHT_QUERY,