mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
HackStudio: Add syntax highlighting for HTML, Shell, and SQL files
.html files were recognised before -- the name was shown on the statusbar, but it didn't actually enable the syntax highlighting. This also sneaks a highlighting for JSON using JS highlighting. It isn't technically correct, but so does TextEditor. :^)
This commit is contained in:
committed by
Gunnar Beutner
parent
68088b629b
commit
bf322e072f
@@ -29,9 +29,11 @@
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibJS/SyntaxHighlighter.h>
|
||||
#include <LibMarkdown/Document.h>
|
||||
#include <LibSQL/AST/SyntaxHighlighter.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/HTML/HTMLHeadElement.h>
|
||||
#include <LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <Shell/SyntaxHighlighter.h>
|
||||
#include <fcntl.h>
|
||||
@@ -597,6 +599,9 @@ void Editor::set_syntax_highlighter_for(const CodeDocument& document)
|
||||
case Language::GML:
|
||||
set_syntax_highlighter(make<GUI::GMLSyntaxHighlighter>());
|
||||
break;
|
||||
case Language::HTML:
|
||||
set_syntax_highlighter(make<Web::HTML::SyntaxHighlighter>());
|
||||
break;
|
||||
case Language::JavaScript:
|
||||
set_syntax_highlighter(make<JS::SyntaxHighlighter>());
|
||||
break;
|
||||
@@ -606,6 +611,9 @@ void Editor::set_syntax_highlighter_for(const CodeDocument& document)
|
||||
case Language::Shell:
|
||||
set_syntax_highlighter(make<Shell::SyntaxHighlighter>());
|
||||
break;
|
||||
case Language::SQL:
|
||||
set_syntax_highlighter(make<SQL::AST::SyntaxHighlighter>());
|
||||
break;
|
||||
default:
|
||||
set_syntax_highlighter({});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user