1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Expose the EditorScriptHighlighter::_create() method to GDExtension

This commit is contained in:
David Snopek
2024-11-07 12:22:55 -06:00
parent 77d6283d22
commit 1474ecc121
3 changed files with 15 additions and 3 deletions

View File

@@ -86,9 +86,13 @@ PackedStringArray EditorSyntaxHighlighter::_get_supported_languages() const {
Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const {
Ref<EditorSyntaxHighlighter> syntax_highlighter;
syntax_highlighter.instantiate();
if (get_script_instance()) {
syntax_highlighter->set_script(get_script_instance()->get_script());
if (GDVIRTUAL_IS_OVERRIDDEN(_create)) {
GDVIRTUAL_CALL(_create, syntax_highlighter);
} else {
syntax_highlighter.instantiate();
if (get_script_instance()) {
syntax_highlighter->set_script(get_script_instance()->get_script());
}
}
return syntax_highlighter;
}
@@ -98,6 +102,7 @@ void EditorSyntaxHighlighter::_bind_methods() {
GDVIRTUAL_BIND(_get_name)
GDVIRTUAL_BIND(_get_supported_languages)
GDVIRTUAL_BIND(_create)
}
////