From e5bcfb04cd32045aaea778752350ea6ed0725953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 16 Jan 2019 15:32:36 +0800 Subject: =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=AE=8C=E6=88=90=E4=B9=9F=E8=83=BD?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=89=80=E6=9C=89=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/completion.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'server/src/core/completion.lua') diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 9e7b72ab..5bf55053 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -461,6 +461,19 @@ local function searchInResult(result, source, vm, pos, callback) end end +local function searchAllWords(result, vm, callback) + if result.key == '' then + return + end + for source in pairs(vm.results.sources) do + if source.type == 'name' then + if result.key ~= source[1] and matchKey(result.key, source[1]) then + callback(source[1], CompletionItemKind.Text) + end + end + end +end + local function searchSpecial(vm, pos, callback) -- 尝试 # local result, source = findResult(vm, pos, 2) @@ -532,6 +545,7 @@ return function (vm, pos) if result then callback = makeList(list, source) searchInResult(result, source, vm, pos, callback) + searchAllWords(result, vm, callback) clearList(list, source) end end -- cgit v1.2.3