summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/completion.lua3
-rw-r--r--test/completion/continue.lua14
2 files changed, 16 insertions, 1 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index 843a8317..a2eaca4e 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -1956,7 +1956,8 @@ local function getCache(uri, offset)
if results.enableCommon and result.kind == define.CompletionItemKind.Text then
results[i] = results[#results]
results[#results] = nil
- elseif matchKey(word, match) then
+ elseif matchKey(word, match)
+ or (result.textEdit and matchKey(word, result.textEdit.newText:match '[%w_]*')) then
if result.textEdit then
result.textEdit.finish = result.textEdit.finish + ext
end
diff --git a/test/completion/continue.lua b/test/completion/continue.lua
index 96ec4964..a548859a 100644
--- a/test/completion/continue.lua
+++ b/test/completion/continue.lua
@@ -41,4 +41,18 @@ pro$
}
}
+TEST [[
+---@param n '"abcdefg"'
+local function f(n) end
+
+f 'abc$'
+]]
+{
+ {
+ label = "'abcdefg'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = EXISTS,
+ }
+}
+
ContinueTyping = false