diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-11 14:52:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-11 14:52:09 +0800 |
commit | 764084f9d2e8f7bb69aea8fc97453f10c9ba7f77 (patch) | |
tree | b1db5b23a9e7569eec21f7df250fd61d0cd7a343 /server/src/core/hover/name.lua | |
parent | f34e6c5ff4ed205881db18049c4a3db542c90b6b (diff) | |
download | lua-language-server-764084f9d2e8f7bb69aea8fc97453f10c9ba7f77.zip |
更新crossfile
Diffstat (limited to 'server/src/core/hover/name.lua')
-rw-r--r-- | server/src/core/hover/name.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/src/core/hover/name.lua b/server/src/core/hover/name.lua index 78c30b4d..4419e4b5 100644 --- a/server/src/core/hover/name.lua +++ b/server/src/core/hover/name.lua @@ -11,7 +11,15 @@ return function (source) declarat = source end if not declarat then - return source:getName() or '' + -- 如果声明者没有给名字,则找一个合适的名字 + local name = value:eachInfo(function (info) + if info.type == 'local' or info.type == 'set' or info.type == 'return' then + if info.source.type == 'name' and info.source.uri == value.uri then + return info.source[1] + end + end + end) + return name or '' end local key |