diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-29 11:49:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-29 11:49:29 +0800 |
commit | d2884244100983a6a84d456cbe399889d8dde392 (patch) | |
tree | d36601c4058de7320a6cae5bfee62bf7548eedbd /server/test/document_symbol | |
parent | f443b2f2ee4f7fc7d67856259b3e976674a9bdc9 (diff) | |
download | lua-language-server-d2884244100983a6a84d456cbe399889d8dde392.zip |
必须验证表是局部变量声明时直接赋值的
Diffstat (limited to 'server/test/document_symbol')
-rw-r--r-- | server/test/document_symbol/init.lua | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/server/test/document_symbol/init.lua b/server/test/document_symbol/init.lua index 7f88f63e..699f50cd 100644 --- a/server/test/document_symbol/init.lua +++ b/server/test/document_symbol/init.lua @@ -231,7 +231,7 @@ local y = true name = 'y', detail = 'local y: {}', kind = SymbolKind.Variable, - range = {60, 60}, + range = {60, 65}, selectionRange = {60, 60}, }, }, @@ -244,3 +244,43 @@ local y = true selectionRange = {77, 77}, }, } + +TEST [[ +local t = { + a = 1, + b = 2, + c = 3, +} +]] +{ + [1] = { + name = 't', + detail = EXISTS, + kind = SymbolKind.Variable, + range = {7, 46}, + selectionRange = {7, 7}, + children = { + [1] = { + name = 'a', + detail = 'field a: number = 1', + kind = SymbolKind.Struct, + range = {17, 17}, + selectionRange = {17, 17}, + }, + [2] = { + name = 'b', + detail = 'field b: number = 2', + kind = SymbolKind.Struct, + range = {28, 28}, + selectionRange = {28, 28}, + }, + [3] = { + name = 'c', + detail = 'field c: number = 3', + kind = SymbolKind.Struct, + range = {39, 39}, + selectionRange = {39, 39}, + }, + } + } +} |