summaryrefslogtreecommitdiff
path: root/test/document_symbol
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-08-29 17:21:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-08-29 17:21:59 +0800
commitfa0fe1c857a83d8595d687e49205d7d548aba0b7 (patch)
tree34c91d4e2f824e7445e2862b009f770f8245132d /test/document_symbol
parentcfda344c9e0db732e72128e74f40d2ad2b4ea3a5 (diff)
downloadlua-language-server-fa0fe1c857a83d8595d687e49205d7d548aba0b7.zip
`document-symbol` supports block
Diffstat (limited to 'test/document_symbol')
-rw-r--r--test/document_symbol/init.lua95
1 files changed, 95 insertions, 0 deletions
diff --git a/test/document_symbol/init.lua b/test/document_symbol/init.lua
index 6f80287f..17728efc 100644
--- a/test/document_symbol/init.lua
+++ b/test/document_symbol/init.lua
@@ -743,3 +743,98 @@ local t = { 1, 2, [5] = 3, [true] = 4, x = 5 }
children = EXISTS
}
}
+
+TEST [[
+if 1 then
+
+elseif 2 then
+
+elseif 3 then
+
+else
+
+end
+]]
+{
+ {
+ name = 'if',
+ detail = 'if 1 then',
+ kind = define.SymbolKind.Package,
+ range = {0, 20000},
+ selectionRange = {0, 2},
+ valueRange = {0, 20000},
+ },
+ {
+ name = 'elseif',
+ detail = 'elseif 2 then',
+ kind = define.SymbolKind.Package,
+ range = {20000, 40000},
+ selectionRange = {20000, 20006},
+ valueRange = {20000, 40000},
+ },
+ {
+ name = 'elseif',
+ detail = 'elseif 3 then',
+ kind = define.SymbolKind.Package,
+ range = {40000, 60000},
+ selectionRange = {40000, 40006},
+ valueRange = {40000, 60000},
+ },
+ {
+ name = 'else',
+ detail = 'else',
+ kind = define.SymbolKind.Package,
+ range = {60000, 80000},
+ selectionRange = {60000, 60004},
+ valueRange = {60000, 80000},
+ },
+}
+
+TEST [[
+while true do
+
+end
+]]
+{
+ {
+ name = 'while',
+ detail = 'while true do',
+ kind = define.SymbolKind.Package,
+ range = {0, 20003},
+ selectionRange = {0, 5},
+ valueRange = {0, 20003},
+ },
+}
+
+TEST [[
+repeat
+
+until true
+]]
+{
+ {
+ name = 'repeat',
+ detail = 'until true',
+ kind = define.SymbolKind.Package,
+ range = {0, 20010},
+ selectionRange = {0, 6},
+ valueRange = {0, 20010},
+ },
+}
+
+TEST [[
+for i = 1, 10 do
+
+end
+]]
+{
+ {
+ name = 'for',
+ detail = 'for i = 1, 10 do',
+ kind = define.SymbolKind.Package,
+ range = {0, 20003},
+ selectionRange = {0, 3},
+ valueRange = {0, 20003},
+ children = EXISTS,
+ },
+}