From 2e634c583108b627ec941b8e178e74f19104ee7e 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, 19 Dec 2018 14:26:08 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/completion.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/src/method/textDocument/completion.lua') diff --git a/server/src/method/textDocument/completion.lua b/server/src/method/textDocument/completion.lua index 24961f43..2ecc06a5 100644 --- a/server/src/method/textDocument/completion.lua +++ b/server/src/method/textDocument/completion.lua @@ -9,6 +9,9 @@ return function (lsp, params) -- lua是从1开始的,因此都要+1 local position = lines:position(params.position.line + 1, params.position.character + 1) local items = matcher.completion(vm, position) + if not items then + return nil + end for i, item in ipairs(items) do item.sortText = ('%04d'):format(i) end -- cgit v1.2.3