diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-28 02:11:41 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-28 02:11:41 +0800 |
commit | bae604f2485e1a601d5ac30e5761ee601ba00c7e (patch) | |
tree | 09143693ec2aa7e1b2d4727b5ee7434ea65cfcf3 /script-beta/core/hover | |
parent | 6032d2ad73bd583b7077a15a38f515494068698e (diff) | |
download | lua-language-server-bae604f2485e1a601d5ac30e5761ee601ba00c7e.zip |
支持局部变量属性
Diffstat (limited to 'script-beta/core/hover')
-rw-r--r-- | script-beta/core/hover/name.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/script-beta/core/hover/name.lua b/script-beta/core/hover/name.lua index 0711461d..83b779db 100644 --- a/script-beta/core/hover/name.lua +++ b/script-beta/core/hover/name.lua @@ -2,7 +2,16 @@ local guide = require 'parser.guide' local vm = require 'vm' local function asLocal(source) - return guide.getName(source) + local name = guide.getName(source) + if not source.attrs then + return name + end + local label = {} + label[#label+1] = name + for _, attr in ipairs(source.attrs) do + label[#label+1] = ('<%s>'):format(attr[1]) + end + return table.concat(label, ' ') end local function asMethod(source) |