From bbb07ff8cbd182c46f988b192b2d3882ed78cd5c Mon Sep 17 00:00:00 2001 From: Kurt Lachmann Date: Thu, 24 Mar 2022 20:24:47 +0100 Subject: Use insertText from the internal autocompletion * GDScriptLanguage::complete_code already adds parentheses to function calls, and does this a lot smarter than the language server right now. * Instead of the previous naive approach we now reuse the same logic as the internal editor. * For this to have any effect we also have to send the `insertText` field already during the completionRequest and not only during resolve. --- modules/gdscript/language_server/lsp.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gdscript/language_server/lsp.hpp') diff --git a/modules/gdscript/language_server/lsp.hpp b/modules/gdscript/language_server/lsp.hpp index a63f9df918..ae6f2abb12 100644 --- a/modules/gdscript/language_server/lsp.hpp +++ b/modules/gdscript/language_server/lsp.hpp @@ -1004,8 +1004,8 @@ struct CompletionItem { dict["label"] = label; dict["kind"] = kind; dict["data"] = data; + dict["insertText"] = insertText; if (resolved) { - dict["insertText"] = insertText; dict["detail"] = detail; dict["documentation"] = documentation.to_json(); dict["deprecated"] = deprecated; -- cgit v1.2.3