From ff6a7e95e1a6be16338bcd1819b512cb36960e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 24 Aug 2021 17:36:25 +0800 Subject: fix --- script/core/completion.lua | 3 ++- test/completion/continue.lua | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3