diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-28 17:30:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-28 17:30:31 +0800 |
commit | 023a8085524b1b6368722fd0b0485132c9dfb725 (patch) | |
tree | 412b52194f42e095e12a062c4fd114f131a59e3a /server/test | |
parent | ebdfb86387f51fd29ec37b6ca586a062b086f525 (diff) | |
download | lua-language-server-023a8085524b1b6368722fd0b0485132c9dfb725.zip |
各种函数声明类型
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/document_symbol/init.lua | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/server/test/document_symbol/init.lua b/server/test/document_symbol/init.lua index 4f806bfe..869e2939 100644 --- a/server/test/document_symbol/init.lua +++ b/server/test/document_symbol/init.lua @@ -112,16 +112,44 @@ end } } ---TEST [[ ---local f = function () ---end ---]] ---{ --- [1] = { --- name = 'f', --- detail = 'function f()', --- kind = SymbolKind.Function, --- range = {11, 25}, --- selectionRange = {11, 11}, --- } ---} +TEST [[ +f = function () +end +]] +{ + [1] = { + name = 'f', + detail = 'function f()', + kind = SymbolKind.Function, + range = {1, 19}, + selectionRange = {1, 1}, + } +} + +TEST [[ +local f = function () +end +]] +{ + [1] = { + name = 'f', + detail = 'function f()', + kind = SymbolKind.Function, + range = {7, 25}, + selectionRange = {7, 7}, + } +} + +TEST [[ +function mt:add() +end +]] +{ + [1] = { + name = 'mt:add', + detail = 'function mt:add()', + kind = SymbolKind.Method, + range = {1, 21}, + selectionRange = {13, 15}, + } +} |