summaryrefslogtreecommitdiff
path: root/server/test/document_symbol
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-28 16:57:46 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-28 16:57:46 +0800
commitebdfb86387f51fd29ec37b6ca586a062b086f525 (patch)
treee7f84d82687c544f14ea484c067fa561f59672bf /server/test/document_symbol
parent08ad84a4f6c579a12e7a7e92d438f60c5c360044 (diff)
downloadlua-language-server-ebdfb86387f51fd29ec37b6ca586a062b086f525.zip
支持部分函数写法
Diffstat (limited to 'server/test/document_symbol')
-rw-r--r--server/test/document_symbol/init.lua36
1 files changed, 32 insertions, 4 deletions
diff --git a/server/test/document_symbol/init.lua b/server/test/document_symbol/init.lua
index 746ec108..4f806bfe 100644
--- a/server/test/document_symbol/init.lua
+++ b/server/test/document_symbol/init.lua
@@ -84,16 +84,44 @@ end
}
}
+TEST [[
+function f()
+end
+]]
+{
+ [1] = {
+ name = 'f',
+ detail = 'function f()',
+ kind = SymbolKind.Function,
+ range = {1, 16},
+ selectionRange = {10, 10},
+ }
+}
+
+TEST [[
+return function ()
+end
+]]
+{
+ [1] = {
+ name = '',
+ detail = 'function ()',
+ kind = SymbolKind.Function,
+ range = {8, 22},
+ selectionRange = {8, 8},
+ }
+}
+
--TEST [[
---return function ()
+--local f = function ()
--end
--]]
--{
-- [1] = {
--- name = '',
+-- name = 'f',
-- detail = 'function f()',
-- kind = SymbolKind.Function,
--- range = {8, 22},
--- selectionRange = {8, 8},
+-- range = {11, 25},
+-- selectionRange = {11, 11},
-- }
--}