diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-19 14:26:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-19 14:26:08 +0800 |
commit | 2e634c583108b627ec941b8e178e74f19104ee7e (patch) | |
tree | 54d9b7c5b4fbb5d177d78eb0d26809d65faf7f87 /server/src | |
parent | 16019a66f988f24fa0dd195cea4497d1b08acdc8 (diff) | |
download | lua-language-server-2e634c583108b627ec941b8e178e74f19104ee7e.zip |
修正报错
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/method/textDocument/completion.lua | 3 |
1 files changed, 3 insertions, 0 deletions
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 |