diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-24 18:26:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-24 18:26:57 +0800 |
commit | 1ec9c8e266df6db7a72608bfb5431f444e3a12ff (patch) | |
tree | c1f9bb92e9a350e1bd335ca38029b84f0e75884c /server/src/matcher/completion.lua | |
parent | b7782be38cb8f9d3f94b615976cdfed00e4c183f (diff) | |
download | lua-language-server-1ec9c8e266df6db7a72608bfb5431f444e3a12ff.zip |
过滤一些结果
Diffstat (limited to 'server/src/matcher/completion.lua')
-rw-r--r-- | server/src/matcher/completion.lua | 19 |
1 files changed, 11 insertions, 8 deletions
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 = {} |