From 1ec9c8e266df6db7a72608bfb5431f444e3a12ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 24 Dec 2018 18:26:57 +0800 Subject: =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=B8=80=E4=BA=9B=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/matcher/completion.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'server/src/matcher/completion.lua') diff --git a/server/src/matcher/completion.lua b/server/src/matcher/completion.lua index 64ed9428..6debe930 100644 --- a/server/src/matcher/completion.lua +++ b/server/src/matcher/completion.lua @@ -231,7 +231,9 @@ local function searchAsArg(vm, inCall, inString, callback) return end for _, v in ipairs(results) do - callback(v, CompletionItemKind.Module) + if v ~= inString[1] then + callback(v, CompletionItemKind.Module) + end end end end @@ -344,14 +346,15 @@ return function (vm, pos) if not result then return nil end - inString = getString(vm, pos) - if inString then - local calls = findCall(vm, pos) - if not calls then - return nil - end - inCall = calls[#calls] + end + + inString = getString(vm, pos) + if inString then + local calls = findCall(vm, pos) + if not calls then + return nil end + inCall = calls[#calls] end local list = {} -- cgit v1.2.3