diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/core/hover/table.lua | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/script/core/hover/table.lua b/script/core/hover/table.lua index 02be5271..f26731be 100644 --- a/script/core/hover/table.lua +++ b/script/core/hover/table.lua @@ -32,7 +32,20 @@ local function getKey(src) return ('[%s]'):format(key) end +local function getFieldFull(src) + local tp = vm.getInferType(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 tp, literal +end + local function getFieldFast(src) + if src.bindDocs then + return getFieldFull(src) + end local value = guide.getObjectValue(src) or src if not value then return 'any' @@ -63,16 +76,6 @@ local function getFieldFast(src) end end -local function getFieldFull(src) - local tp = vm.getInferType(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 tp, literal -end - local function getField(src, timeUp, mark, key) if src.type == 'table' or src.type == 'function' then |