mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
HackStudio: Enable CMakeCache.txt highlighting
This commit is contained in:
parent
c6a2e8eb08
commit
b1ce852c37
Notes:
sideshowbarker
2024-07-17 00:47:29 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/b1ce852c37 Pull-request: https://github.com/SerenityOS/serenity/pull/17758 Reviewed-by: https://github.com/linusg ✅
3 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <AK/Debug.h>
|
#include <AK/Debug.h>
|
||||||
#include <AK/JsonParser.h>
|
#include <AK/JsonParser.h>
|
||||||
#include <AK/LexicalPath.h>
|
#include <AK/LexicalPath.h>
|
||||||
|
#include <LibCMake/CMakeCache/SyntaxHighlighter.h>
|
||||||
#include <LibCMake/SyntaxHighlighter.h>
|
#include <LibCMake/SyntaxHighlighter.h>
|
||||||
#include <LibConfig/Client.h>
|
#include <LibConfig/Client.h>
|
||||||
#include <LibCore/DeprecatedFile.h>
|
#include <LibCore/DeprecatedFile.h>
|
||||||
|
@ -641,6 +642,9 @@ void Editor::set_syntax_highlighter_for(CodeDocument const& document)
|
||||||
case Language::CMake:
|
case Language::CMake:
|
||||||
set_syntax_highlighter(make<CMake::SyntaxHighlighter>());
|
set_syntax_highlighter(make<CMake::SyntaxHighlighter>());
|
||||||
break;
|
break;
|
||||||
|
case Language::CMakeCache:
|
||||||
|
set_syntax_highlighter(make<CMake::Cache::SyntaxHighlighter>());
|
||||||
|
break;
|
||||||
case Language::CSS:
|
case Language::CSS:
|
||||||
set_syntax_highlighter(make<Web::CSS::SyntaxHighlighter>());
|
set_syntax_highlighter(make<Web::CSS::SyntaxHighlighter>());
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -20,6 +20,8 @@ Language language_from_file(LexicalPath const& file)
|
||||||
return Language::Cpp;
|
return Language::Cpp;
|
||||||
if (extension == "cmake" || (extension == "txt" && file.title() == "CMakeLists"))
|
if (extension == "cmake" || (extension == "txt" && file.title() == "CMakeLists"))
|
||||||
return Language::CMake;
|
return Language::CMake;
|
||||||
|
if (extension == "txt" && file.title() == "CMakeCache")
|
||||||
|
return Language::CMakeCache;
|
||||||
if (extension == "js" || extension == "mjs" || extension == "json")
|
if (extension == "js" || extension == "mjs" || extension == "json")
|
||||||
return Language::JavaScript;
|
return Language::JavaScript;
|
||||||
if (extension == "html" || extension == "htm")
|
if (extension == "html" || extension == "htm")
|
||||||
|
@ -64,6 +66,8 @@ DeprecatedString language_name_from_file(LexicalPath const& file)
|
||||||
return "C++";
|
return "C++";
|
||||||
if (extension == "cmake" || (extension == "txt" && file.title() == "CMakeLists"))
|
if (extension == "cmake" || (extension == "txt" && file.title() == "CMakeLists"))
|
||||||
return "CMake";
|
return "CMake";
|
||||||
|
if (extension == "txt" && file.title() == "CMakeCache")
|
||||||
|
return "CMakeCache";
|
||||||
if (extension == "js" || extension == "mjs" || extension == "json")
|
if (extension == "js" || extension == "mjs" || extension == "json")
|
||||||
return "JavaScript";
|
return "JavaScript";
|
||||||
if (extension == "gml")
|
if (extension == "gml")
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace HackStudio {
|
||||||
enum class Language {
|
enum class Language {
|
||||||
Unknown,
|
Unknown,
|
||||||
CMake,
|
CMake,
|
||||||
|
CMakeCache,
|
||||||
Cpp,
|
Cpp,
|
||||||
CSS,
|
CSS,
|
||||||
JavaScript,
|
JavaScript,
|
||||||
|
|
Loading…
Reference in a new issue