Built-in: Highlighting quality improvements
This commit is contained in:
		
							parent
							
								
									f105b38723
								
							
						
					
					
						commit
						d36feb184f
					
				
					 1 changed files with 11 additions and 6 deletions
				
			
		|  | @ -121,8 +121,13 @@ pub fn cpp_hl_factory() -> Result<HighlightConfiguration, QueryError> { | |||
|         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<HighlightConfiguration, QueryError> { | |||
|         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<HighlightConfiguration, QueryError> { | |||
|         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 | ||||
|         ), | ||||
|     ) | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue