diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-08-15 17:13:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-08-15 17:13:57 +0800 |
commit | b02d03a71f9a41e67cc8b2d0e64d6762de30384b (patch) | |
tree | 4108a69bdfed76bde640a06bc3c0f370ef39e214 /script-beta/core | |
parent | 820efa941bfc591c77cafcb4205386ea1795a03e (diff) | |
download | lua-language-server-b02d03a71f9a41e67cc8b2d0e64d6762de30384b.zip |
hover将合并定义与推测
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/hover/label.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua index e82c9c6f..d3fbe6af 100644 --- a/script-beta/core/hover/label.lua +++ b/script-beta/core/hover/label.lua @@ -18,6 +18,22 @@ end local function asValue(source, title) local name = buildName(source) local class, type, literal, cont + local values = vm.getValue(source) + if values then + for _, value in ipairs(values) do + local src = value.source + local tp = value.type + class = vm.mergeViews(class, vm.getClass(src)) + type = vm.mergeViews(type, tp) + local sl = vm.getLiteral(src) + if sl then + literal = vm.mergeViews(literal, util.viewLiteral(sl)) + end + if tp == 'table' then + cont = buildTable(src) + end + end + end vm.eachDef(source, function (src) class = vm.mergeViews(class, vm.getClass(src)) type = vm.mergeViews(type, vm.getType(src)) |