summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/language_server/lsp.hpp
diff options
context:
space:
mode:
authorKurt Lachmann <lachmannk@gmail.com>2022-03-24 20:24:47 +0100
committerKurt Lachmann <lachmannk@gmail.com>2022-03-24 20:24:47 +0100
commitbbb07ff8cbd182c46f988b192b2d3882ed78cd5c (patch)
tree5e362465a0ee2a195744e68194076d81da0e09b1 /modules/gdscript/language_server/lsp.hpp
parentbab2ad4d3283a9b4e6050a2345a4ea408001484e (diff)
downloadredot-engine-bbb07ff8cbd182c46f988b192b2d3882ed78cd5c.tar.gz
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.
Diffstat (limited to 'modules/gdscript/language_server/lsp.hpp')
-rw-r--r--modules/gdscript/language_server/lsp.hpp2
1 files changed, 1 insertions, 1 deletions
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;