diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-05 17:38:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-05 17:38:26 +0800 |
commit | 281a534973be7d66dd0d99b100b639fd137e205a (patch) | |
tree | 8d28e95c8a1c7a6ec15b762eeae8b902871661f3 /script-beta/core/hover/table.lua | |
parent | b6a1e73020e692dca2ead2cb4a5b5e9201f62288 (diff) | |
download | lua-language-server-281a534973be7d66dd0d99b100b639fd137e205a.zip |
hover支持快速全局变脸
Diffstat (limited to 'script-beta/core/hover/table.lua')
-rw-r--r-- | script-beta/core/hover/table.lua | 12 |
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 |