diff options
-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}, + } + } + } } |