summaryrefslogtreecommitdiff
path: root/modules/gdscript/editor
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/editor')
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp6
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.h12
2 files changed, 11 insertions, 7 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index 4be83877be..8ab3dc1d56 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -387,6 +387,8 @@ void GDScriptSyntaxHighlighter::_update_cache() {
type_color = EDITOR_GET("text_edit/highlighting/base_type_color");
}
-SyntaxHighlighter *GDScriptSyntaxHighlighter::create() {
- return memnew(GDScriptSyntaxHighlighter);
+Ref<SyntaxHighlighter> GDScriptSyntaxHighlighter::_create() const {
+ Ref<GDScriptSyntaxHighlighter> syntax_highlighter;
+ syntax_highlighter.instance();
+ return syntax_highlighter;
}
diff --git a/modules/gdscript/editor/gdscript_highlighter.h b/modules/gdscript/editor/gdscript_highlighter.h
index 47ea5a3d62..c1de22167a 100644
--- a/modules/gdscript/editor/gdscript_highlighter.h
+++ b/modules/gdscript/editor/gdscript_highlighter.h
@@ -34,6 +34,8 @@
#include "scene/gui/text_edit.h"
class GDScriptSyntaxHighlighter : public SyntaxHighlighter {
+ GDCLASS(GDScriptSyntaxHighlighter, SyntaxHighlighter)
+
private:
enum Type {
NONE,
@@ -60,13 +62,13 @@ private:
Color type_color;
public:
- static SyntaxHighlighter *create();
+ virtual void _update_cache() override;
+ virtual Dictionary _get_line_syntax_highlighting(int p_line) override;
- virtual void _update_cache();
- virtual Dictionary _get_line_syntax_highlighting(int p_line);
+ virtual String _get_name() const override;
+ virtual Array _get_supported_languages() const override;
- virtual String _get_name() const;
- virtual Array _get_supported_languages() const;
+ virtual Ref<SyntaxHighlighter> _create() const override;
};
#endif // GDSCRIPT_HIGHLIGHTER_H