summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-11 18:07:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-11 18:07:54 +0800
commit1ae7b425b75f630b3cdb3479137ace7215389580 (patch)
tree115e738e91a5538bfd06aa37b272877e2dd16c73
parentf3c18b9573f31981f8e09c4cb63424f8de816929 (diff)
downloadlua-language-server-1ae7b425b75f630b3cdb3479137ace7215389580.zip
修正一些bug
-rw-r--r--script-beta/config.lua7
-rw-r--r--script-beta/core/definition.lua3
-rw-r--r--script-beta/vm/getLinks.lua10
3 files changed, 17 insertions, 3 deletions
diff --git a/script-beta/config.lua b/script-beta/config.lua
index 1f5a2eb0..7ce0cbd7 100644
--- a/script-beta/config.lua
+++ b/script-beta/config.lua
@@ -124,9 +124,10 @@ local ConfigTemplate = {
)}
},
completion = {
- enable = {true, Boolean},
- callSnippet = {'Both', String},
- keywordSnippet = {'Both', String},
+ enable = {true, Boolean},
+ callSnippet = {'Disable', String},
+ keywordSnippet = {'Replace', String},
+ displayContext = {6, Integer},
},
signatureHelp = {
enable = {true, Boolean},
diff --git a/script-beta/core/definition.lua b/script-beta/core/definition.lua
index e51d12aa..0259536f 100644
--- a/script-beta/core/definition.lua
+++ b/script-beta/core/definition.lua
@@ -73,6 +73,9 @@ local function checkRequire(source, offset)
end
local function convertIndex(source)
+ if not source then
+ return
+ end
if source.type == 'string'
or source.type == 'boolean'
or source.type == 'number' then
diff --git a/script-beta/vm/getLinks.lua b/script-beta/vm/getLinks.lua
index 8032f55a..b034fd24 100644
--- a/script-beta/vm/getLinks.lua
+++ b/script-beta/vm/getLinks.lua
@@ -19,3 +19,13 @@ function vm.getLinksTo(uri)
vm.getCache('getLinksTo')[uri] = cache
return cache
end
+
+function vm.getFileLinks(uri)
+ local cache = vm.getCache('getFileLinks')[uri]
+ if cache ~= nil then
+ return cache
+ end
+ cache = getFileLinks(uri)
+ vm.getCache('getFileLinks')[uri] = cache
+ return cache
+end