diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-25 01:08:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-25 01:08:16 +0800 |
commit | ebc2ef19285dd2fef428420e6956146ac56af24e (patch) | |
tree | 8daec93427284af652b46c3a52cce20eff13ac28 | |
parent | 0a90a32bd49e1beb586b1698694ed2621431b4c9 (diff) | |
download | lua-language-server-ebc2ef19285dd2fef428420e6956146ac56af24e.zip |
修正一个bug
-rw-r--r-- | script-beta/core/document-symbol.lua | 4 | ||||
-rw-r--r-- | test-beta/document_symbol/init.lua | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/script-beta/core/document-symbol.lua b/script-beta/core/document-symbol.lua index 30f71d8f..86ddfbe6 100644 --- a/script-beta/core/document-symbol.lua +++ b/script-beta/core/document-symbol.lua @@ -23,6 +23,10 @@ end local function buildFunction(source, symbols) local name = lname(source) local func = source.value + if source.type == 'tablefield' + or source.type == 'setfield' then + source = source.field + end local range, kind if func.start > source.finish then -- a = function() diff --git a/test-beta/document_symbol/init.lua b/test-beta/document_symbol/init.lua index e9ba68e1..31024429 100644 --- a/test-beta/document_symbol/init.lua +++ b/test-beta/document_symbol/init.lua @@ -579,4 +579,22 @@ local a = f { } ]] { + [1] = { + name = 'a', + detail = 'local a', + kind = SymbolKind.Variable, + range = {7, 43}, + selectionRange = {7, 7}, + valueRange = {11, 43}, + children = { + [1] = { + name = 'x', + detail = 'function x()', + kind = SymbolKind.Function, + range = {19, 41}, + selectionRange = {19, 19}, + valueRange = {23, 41}, + } + } + } } |