Merge pull request #98929 from dsnopek/editor-syntax-highlighter-create

Expose the `EditorScriptHighlighter::_create()` method to GDExtension
This commit is contained in:
Rémi Verschelde 2025-06-10 16:22:22 +02:00
commit 7b9e7b9162
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 15 additions and 3 deletions

View file

@ -91,9 +91,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;
}
@ -103,6 +107,7 @@ void EditorSyntaxHighlighter::_bind_methods() {
GDVIRTUAL_BIND(_get_name)
GDVIRTUAL_BIND(_get_supported_languages)
GDVIRTUAL_BIND(_create)
}
////