diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 7 | ||||
-rw-r--r-- | modules/gdscript/language_server/gdscript_text_document.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index a01a7397fe..eef39da8b5 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -500,6 +500,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a Object *obj_A = *a; Object *obj_B = *b; +#ifdef DEBUG_ENABLED + if (!ObjectDB::instance_validate(obj_A)) { + err_text = "Left operand of 'is' was already freed."; + OPCODE_BREAK; + } +#endif // DEBUG_ENABLED + GDScript *scr_B = Object::cast_to<GDScript>(obj_B); if (scr_B) { diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index 33ca4a5d15..0572c5f746 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -269,7 +269,7 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) { if ((item.kind == lsp::CompletionItemKind::Method || item.kind == lsp::CompletionItemKind::Function) && !item.label.ends_with("):")) { item.insertText = item.label + "("; - if (symbol && symbol->detail.find(",") == -1) { + if (symbol && symbol->children.empty()) { item.insertText += ")"; } } else if (item.kind == lsp::CompletionItemKind::Event) { |