summaryrefslogtreecommitdiff
path: root/script-beta/core/hover/table.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-05 17:38:26 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-05 17:38:26 +0800
commit281a534973be7d66dd0d99b100b639fd137e205a (patch)
tree8d28e95c8a1c7a6ec15b762eeae8b902871661f3 /script-beta/core/hover/table.lua
parentb6a1e73020e692dca2ead2cb4a5b5e9201f62288 (diff)
downloadlua-language-server-281a534973be7d66dd0d99b100b639fd137e205a.zip
hover支持快速全局变脸
Diffstat (limited to 'script-beta/core/hover/table.lua')
-rw-r--r--script-beta/core/hover/table.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua
index 75342925..899306dc 100644
--- a/script-beta/core/hover/table.lua
+++ b/script-beta/core/hover/table.lua
@@ -73,12 +73,12 @@ end
local function getFieldFull(src)
local tp = vm.getInferType(src)
- local class = vm.getClass(src)
+ --local class = vm.getClass(src)
local literal = vm.getInferLiteral(src)
if type(literal) == 'string' and #literal >= 50 then
literal = literal:sub(1, 47) .. '...'
end
- return class or tp, literal
+ return tp, literal
end
local function getField(src, timeUp, mark, key)
@@ -228,7 +228,13 @@ return function (source)
local clock = os.clock()
local timeUp
local mark = {}
- local fields = vm.getFields(source, 'deep')
+ local fields
+ if source.special == '_G'
+ and config.config.intelliSense.fastGlobal then
+ fields = vm.getGlobals('*', 'fast')
+ else
+ fields = vm.getFields(source, 'deep')
+ end
for _, src in ipairs(fields) do
local key = getKey(src)
if not key then