diff --git a/src/languages/built_in.rs b/src/languages/built_in.rs index 9ab36f6..4f111d7 100644 --- a/src/languages/built_in.rs +++ b/src/languages/built_in.rs @@ -121,8 +121,13 @@ pub fn cpp_hl_factory() -> Result { tree_sitter_cpp::language(), &format!( "{}{}", - tree_sitter_c::HIGHLIGHT_QUERY, - tree_sitter_cpp::HIGHLIGHT_QUERY + tree_sitter_cpp::HIGHLIGHT_QUERY, + tree_sitter_c::HIGHLIGHT_QUERY + .replace( + "(null) @constant", + "(true) @constant\n(false) @constant\n(null) @constant" + ) + .replace("(primitive_type) @type", "(primitive_type) @type.builtin"), ), "", "", @@ -134,14 +139,14 @@ pub fn typescript_hl_factory() -> Result { tree_sitter_typescript::language_typescript(), &format!( "{}{}", + tree_sitter_javascript::HIGHLIGHT_QUERY, tree_sitter_typescript::HIGHLIGHT_QUERY, - tree_sitter_javascript::HIGHLIGHT_QUERY ), tree_sitter_javascript::INJECTION_QUERY, &format!( "{}{}", + tree_sitter_typescript::LOCALS_QUERY, tree_sitter_javascript::LOCALS_QUERY, - tree_sitter_typescript::LOCALS_QUERY ), ) } @@ -151,14 +156,14 @@ pub fn tsx_hl_factory() -> Result { tree_sitter_typescript::language_tsx(), &format!( "{}{}", + tree_sitter_javascript::HIGHLIGHT_QUERY, tree_sitter_typescript::HIGHLIGHT_QUERY, - tree_sitter_javascript::HIGHLIGHT_QUERY ), tree_sitter_javascript::INJECTION_QUERY, &format!( "{}{}", + tree_sitter_typescript::LOCALS_QUERY, tree_sitter_javascript::LOCALS_QUERY, - tree_sitter_typescript::LOCALS_QUERY ), ) }