diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-01 16:39:52 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-01 16:39:52 +0800 |
commit | 36404de31bff1228ce1a785883918491db814676 (patch) | |
tree | 92f8f712dbe1c6a8336155ed8781bcf1c9c45d9d /server/src/core | |
parent | caed96510b21d6bdd9e1c4a175be7486c8c8ff5c (diff) | |
download | lua-language-server-36404de31bff1228ce1a785883918491db814676.zip |
支持标签
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/definition.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/server/src/core/definition.lua b/server/src/core/definition.lua index 6685f00d..fddd8744 100644 --- a/server/src/core/definition.lua +++ b/server/src/core/definition.lua @@ -176,6 +176,22 @@ local function parseValueSimily(vm, source, lsp) return positions end +local function parseLabel(vm, label, lsp) + local positions = {} + label:eachInfo(function (info) + if info.type == 'set' then + positions[#positions+1] = { + info.source.start, + info.source.finish, + } + end + end) + if #positions == 0 then + return nil + end + return positions +end + return function (vm, source, lsp) if not source then return nil @@ -187,4 +203,7 @@ return function (vm, source, lsp) return parseValue(vm, source:bindValue(), lsp) or parseValueSimily(vm, source, lsp) end + if source:bindLabel() then + return parseLabel(vm, source:bindLabel(), lsp) + end end |