diff options
-rw-r--r-- | script-beta/core/hover/table.lua | 7 | ||||
-rw-r--r-- | script-beta/provider/provider.lua | 4 | ||||
-rw-r--r-- | script/method/initialize.lua | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua index 87c3b3e1..0da2a18b 100644 --- a/script-beta/core/hover/table.lua +++ b/script-beta/core/hover/table.lua @@ -227,7 +227,8 @@ return function (source) local clock = os.clock() local timeUp local mark = {} - for _, src in ipairs(vm.getFields(source, 'deep')) do + local fields = vm.getFields(source, 'deep') + for _, src in ipairs(fields) do local key = getKey(src) if not key then goto CONTINUE @@ -238,7 +239,7 @@ return function (source) if not literals[key] then literals[key] = {} end - if not TEST and os.clock() - clock > 5 then + if not TEST and os.clock() - clock > 3 then timeUp = true end local class, literal = getField(src, timeUp, mark, key) @@ -276,7 +277,7 @@ return function (source) end -- TODO if timeUp then - result = '\n-- TODO: Too much time has been spent, type inference has been abandoned. Optimize later.\n' .. result + result = '\n--出于性能考虑,已禁用了部分类型推断。\n' .. result end return result end diff --git a/script-beta/provider/provider.lua b/script-beta/provider/provider.lua index bf584935..c892bfee 100644 --- a/script-beta/provider/provider.lua +++ b/script-beta/provider/provider.lua @@ -85,6 +85,10 @@ proto.on('initialize', function (params) end return { capabilities = cap.initer, + serverInfo = { + name = 'sumneko.lua', + version = 'beta', + }, } end) diff --git a/script/method/initialize.lua b/script/method/initialize.lua index 98c543b0..dfa066b3 100644 --- a/script/method/initialize.lua +++ b/script/method/initialize.lua @@ -28,6 +28,10 @@ return function (lsp, params) end local server = { + serverInfo = { + name = 'sumneko.lua', + version = 'alpha', + }, capabilities = { hoverProvider = true, definitionProvider = true, |