From 55f143578193ac434b18d77bbbdacc468ff340c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 29 Dec 2018 10:54:21 +0800 Subject: =?UTF-8?q?=E5=A4=A7=E7=BA=B2=E6=94=AF=E6=8C=81=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test/document_symbol/init.lua | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'server/test/document_symbol') diff --git a/server/test/document_symbol/init.lua b/server/test/document_symbol/init.lua index eac54f8a..52896461 100644 --- a/server/test/document_symbol/init.lua +++ b/server/test/document_symbol/init.lua @@ -151,6 +151,15 @@ end kind = SymbolKind.Field, range = {1, 21}, selectionRange = {13, 15}, + children = { + [1] = { + name = 'self', + detail = EXISTS, + kind = SymbolKind.Variable, + range = {10, 11}, + selectionRange = {10, 11}, + } + } } } @@ -196,3 +205,51 @@ end selectionRange = {79, 79}, }, } + +TEST [[ +local x = 1 +local function f() + local x = 'x' + local y = {} +end +local y = true +]] +{ + [1] = { + name = 'x', + detail = 'local x: number = 1', + kind = SymbolKind.Variable, + range = {7, 7}, + selectionRange = {7, 7}, + }, + [2] = { + name = 'f', + detail = 'function f()', + kind = SymbolKind.Function, + range = {13, 69}, + selectionRange = {28, 28}, + children = { + [1] = { + name = 'x', + detail = 'local x: string = "x"', + kind = SymbolKind.Variable, + range = {42, 42}, + selectionRange = {42, 42}, + }, + [2] = { + name = 'y', + detail = 'local y: {}', + kind = SymbolKind.Variable, + range = {60, 60}, + selectionRange = {60, 60}, + }, + }, + }, + [3] = { + name = 'y', + detail = 'local y: boolean = true', + kind = SymbolKind.Variable, + range = {77, 77}, + selectionRange = {77, 77}, + }, +} -- cgit v1.2.3