summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-21 13:59:21 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-21 18:26:18 +0100
commitab549cf942eaf9ce8aeff3e67688e600b94868c5 (patch)
tree202baff856aeb02b2af00a25fd4655170efa9633 /DevTools
parent3d3084f0881249b01c58985dbad90970e2cc3f99 (diff)
downloadserenity-ab549cf942eaf9ce8aeff3e67688e600b94868c5.zip
LibGUI+TextEditor+HackStudio: Add GML syntax highlighter :^)
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/HackStudio/CodeDocument.cpp2
-rw-r--r--DevTools/HackStudio/Editor.cpp4
-rw-r--r--DevTools/HackStudio/Language.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/DevTools/HackStudio/CodeDocument.cpp b/DevTools/HackStudio/CodeDocument.cpp
index 58b3b57035..54f7e4d5f6 100644
--- a/DevTools/HackStudio/CodeDocument.cpp
+++ b/DevTools/HackStudio/CodeDocument.cpp
@@ -48,6 +48,8 @@ CodeDocument::CodeDocument(const String& file_path, Client* client)
m_language = Language::Cpp;
else if (lexical_path.has_extension(".js"))
m_language = Language::JavaScript;
+ else if (lexical_path.has_extension(".gml"))
+ m_language = Language::GML;
else if (lexical_path.has_extension(".ini"))
m_language = Language::Ini;
else if (lexical_path.has_extension(".sh"))
diff --git a/DevTools/HackStudio/Editor.cpp b/DevTools/HackStudio/Editor.cpp
index 901d1d054a..79f59d403e 100644
--- a/DevTools/HackStudio/Editor.cpp
+++ b/DevTools/HackStudio/Editor.cpp
@@ -35,6 +35,7 @@
#include <LibCore/File.h>
#include <LibGUI/Application.h>
#include <LibGUI/CppSyntaxHighlighter.h>
+#include <LibGUI/GMLSyntaxHighlighter.h>
#include <LibGUI/INISyntaxHighlighter.h>
#include <LibGUI/JSSyntaxHighlighter.h>
#include <LibGUI/Label.h>
@@ -467,6 +468,9 @@ void Editor::set_document(GUI::TextDocument& doc)
set_syntax_highlighter(make<GUI::CppSyntaxHighlighter>());
m_language_client = get_language_client<LanguageClients::Cpp::ServerConnection>(project().root_path());
break;
+ case Language::GML:
+ set_syntax_highlighter(make<GUI::GMLSyntaxHighlighter>());
+ break;
case Language::JavaScript:
set_syntax_highlighter(make<GUI::JSSyntaxHighlighter>());
break;
diff --git a/DevTools/HackStudio/Language.h b/DevTools/HackStudio/Language.h
index 6295fcde25..d763a8ac8a 100644
--- a/DevTools/HackStudio/Language.h
+++ b/DevTools/HackStudio/Language.h
@@ -31,6 +31,7 @@ enum class Language {
Unknown,
Cpp,
JavaScript,
+ GML,
Ini,
Shell,
};