Fix highlight factory names

main
Charlotte Som 2022-04-28 20:43:59 +01:00
parent cab4401df0
commit e3d680a813
1 changed files with 11 additions and 11 deletions

View File

@ -47,15 +47,15 @@ pub fn register_builtin_languages() {
register_language("regex", regex_hl_factory); register_language("regex", regex_hl_factory);
register_language("python", regex_hl_python); register_language("python", python_hl_factory);
register_language("py", regex_hl_python); register_language("py", python_hl_factory);
register_language("cpp", regex_hl_cpp); register_language("cpp", cpp_hl_factory);
register_language("c++", regex_hl_cpp); register_language("c++", cpp_hl_factory);
register_language("typescript", regex_hl_typescript); register_language("typescript", typescript_hl_factory);
register_language("ts", regex_hl_typescript); register_language("ts", typescript_hl_factory);
register_language("tsx", regex_hl_tsx); register_language("tsx", tsx_hl_factory);
} }
pub fn rust_hl_factory() -> Result<HighlightConfiguration, QueryError> { pub fn rust_hl_factory() -> Result<HighlightConfiguration, QueryError> {
@ -94,7 +94,7 @@ pub fn regex_hl_factory() -> Result<HighlightConfiguration, QueryError> {
) )
} }
pub fn regex_hl_python() -> Result<HighlightConfiguration, QueryError> { pub fn python_hl_factory() -> Result<HighlightConfiguration, QueryError> {
HighlightConfiguration::new( HighlightConfiguration::new(
tree_sitter_python::language(), tree_sitter_python::language(),
tree_sitter_python::HIGHLIGHT_QUERY, tree_sitter_python::HIGHLIGHT_QUERY,
@ -103,7 +103,7 @@ pub fn regex_hl_python() -> Result<HighlightConfiguration, QueryError> {
) )
} }
pub fn regex_hl_cpp() -> Result<HighlightConfiguration, QueryError> { pub fn cpp_hl_factory() -> Result<HighlightConfiguration, QueryError> {
HighlightConfiguration::new( HighlightConfiguration::new(
tree_sitter_cpp::language(), tree_sitter_cpp::language(),
tree_sitter_cpp::HIGHLIGHT_QUERY, tree_sitter_cpp::HIGHLIGHT_QUERY,
@ -112,7 +112,7 @@ pub fn regex_hl_cpp() -> Result<HighlightConfiguration, QueryError> {
) )
} }
pub fn regex_hl_typescript() -> Result<HighlightConfiguration, QueryError> { pub fn typescript_hl_factory() -> Result<HighlightConfiguration, QueryError> {
HighlightConfiguration::new( HighlightConfiguration::new(
tree_sitter_typescript::language_typescript(), tree_sitter_typescript::language_typescript(),
tree_sitter_typescript::HIGHLIGHT_QUERY, tree_sitter_typescript::HIGHLIGHT_QUERY,
@ -121,7 +121,7 @@ pub fn regex_hl_typescript() -> Result<HighlightConfiguration, QueryError> {
) )
} }
pub fn regex_hl_tsx() -> Result<HighlightConfiguration, QueryError> { pub fn tsx_hl_factory() -> Result<HighlightConfiguration, QueryError> {
HighlightConfiguration::new( HighlightConfiguration::new(
tree_sitter_typescript::language_tsx(), tree_sitter_typescript::language_tsx(),
tree_sitter_typescript::HIGHLIGHT_QUERY, tree_sitter_typescript::HIGHLIGHT_QUERY,