summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-08-25 18:42:34 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-08-25 18:42:34 +0800
commitf0375c8fb10c9205be49ec9cbbaa83a9c0638641 (patch)
treec78afb285f144e5419b22257993914ebc49d38ed /test
parent95deef9c3415dfa83b39a4e4f039dc7728fce544 (diff)
downloadlua-language-server-f0375c8fb10c9205be49ec9cbbaa83a9c0638641.zip
update document-symbol
Diffstat (limited to 'test')
-rw-r--r--test/document_symbol/init.lua84
1 files changed, 51 insertions, 33 deletions
diff --git a/test/document_symbol/init.lua b/test/document_symbol/init.lua
index 2150e879..6f80287f 100644
--- a/test/document_symbol/init.lua
+++ b/test/document_symbol/init.lua
@@ -320,46 +320,19 @@ local t = {
b = 2,
c = 3,
d = 4,
+ e = 5,
+ f = 6,
}
]]
{
[1] = {
name = 't',
- detail = '{a, b, c, ...(+1)}',
+ detail = '{a, b, c, d, e, ...(+1)}',
kind = define.SymbolKind.Object,
- range = {6, 50001},
+ range = {6, 70001},
selectionRange = {6, 7},
- valueRange = {10, 50001},
- children = {
- [1] = {
- name = 'a',
- detail = '1',
- kind = define.SymbolKind.Number,
- range = {10004, 10009},
- selectionRange = {10004, 10005},
- },
- [2] = {
- name = 'b',
- detail = '2',
- kind = define.SymbolKind.Number,
- range = {20004, 20009},
- selectionRange = {20004, 20005},
- },
- [3] = {
- name = 'c',
- detail = '3',
- kind = define.SymbolKind.Number,
- range = {30004, 30009},
- selectionRange = {30004, 30005},
- },
- [4] = {
- name = 'd',
- detail = '4',
- kind = define.SymbolKind.Number,
- range = {40004, 40009},
- selectionRange = {40004, 40005},
- },
- }
+ valueRange = {10, 70001},
+ children = EXISTS,
}
}
@@ -725,3 +698,48 @@ local root = {
},
}
}
+
+TEST [[
+local t = { 1, 2, 3 }
+]]
+{
+ [1] = {
+ name = 't',
+ detail = '[1, 2, 3]',
+ kind = define.SymbolKind.Array,
+ range = {6, 21},
+ selectionRange = {6, 7},
+ valueRange = {10, 21},
+ children = EXISTS
+ }
+}
+
+TEST [[
+local t = { 1, 2, 3, 4, 5, 6 }
+]]
+{
+ [1] = {
+ name = 't',
+ detail = '[1, 2, 3, 4, 5, ...(+1)]',
+ kind = define.SymbolKind.Array,
+ range = {6, 30},
+ selectionRange = {6, 7},
+ valueRange = {10, 30},
+ children = EXISTS,
+ }
+}
+
+TEST [[
+local t = { 1, 2, [5] = 3, [true] = 4, x = 5 }
+]]
+{
+ [1] = {
+ name = 't',
+ detail = '{[1], [2], [5], [true], x}',
+ kind = define.SymbolKind.Object,
+ range = {6, 46},
+ selectionRange = {6, 7},
+ valueRange = {10, 46},
+ children = EXISTS
+ }
+}