mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:42:44 +00:00 
			
		
		
		
	HackStudio: Enable CMakeCache.txt highlighting
This commit is contained in:
		
							parent
							
								
									c6a2e8eb08
								
							
						
					
					
						commit
						b1ce852c37
					
				
					 3 changed files with 9 additions and 0 deletions
				
			
		|  | @ -14,6 +14,7 @@ | |||
| #include <AK/Debug.h> | ||||
| #include <AK/JsonParser.h> | ||||
| #include <AK/LexicalPath.h> | ||||
| #include <LibCMake/CMakeCache/SyntaxHighlighter.h> | ||||
| #include <LibCMake/SyntaxHighlighter.h> | ||||
| #include <LibConfig/Client.h> | ||||
| #include <LibCore/DeprecatedFile.h> | ||||
|  | @ -641,6 +642,9 @@ void Editor::set_syntax_highlighter_for(CodeDocument const& document) | |||
|     case Language::CMake: | ||||
|         set_syntax_highlighter(make<CMake::SyntaxHighlighter>()); | ||||
|         break; | ||||
|     case Language::CMakeCache: | ||||
|         set_syntax_highlighter(make<CMake::Cache::SyntaxHighlighter>()); | ||||
|         break; | ||||
|     case Language::CSS: | ||||
|         set_syntax_highlighter(make<Web::CSS::SyntaxHighlighter>()); | ||||
|         break; | ||||
|  |  | |||
|  | @ -20,6 +20,8 @@ Language language_from_file(LexicalPath const& file) | |||
|         return Language::Cpp; | ||||
|     if (extension == "cmake" || (extension == "txt" && file.title() == "CMakeLists")) | ||||
|         return Language::CMake; | ||||
|     if (extension == "txt" && file.title() == "CMakeCache") | ||||
|         return Language::CMakeCache; | ||||
|     if (extension == "js" || extension == "mjs" || extension == "json") | ||||
|         return Language::JavaScript; | ||||
|     if (extension == "html" || extension == "htm") | ||||
|  | @ -64,6 +66,8 @@ DeprecatedString language_name_from_file(LexicalPath const& file) | |||
|         return "C++"; | ||||
|     if (extension == "cmake" || (extension == "txt" && file.title() == "CMakeLists")) | ||||
|         return "CMake"; | ||||
|     if (extension == "txt" && file.title() == "CMakeCache") | ||||
|         return "CMakeCache"; | ||||
|     if (extension == "js" || extension == "mjs" || extension == "json") | ||||
|         return "JavaScript"; | ||||
|     if (extension == "gml") | ||||
|  |  | |||
|  | @ -13,6 +13,7 @@ namespace HackStudio { | |||
| enum class Language { | ||||
|     Unknown, | ||||
|     CMake, | ||||
|     CMakeCache, | ||||
|     Cpp, | ||||
|     CSS, | ||||
|     JavaScript, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sam Atkins
						Sam Atkins