summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-25 17:54:28 +0800
committersumneko <sumneko@hotmail.com>2019-04-25 17:54:28 +0800
commit7b326c86ab117428e6361f6977e6c4e8aa42a9da (patch)
tree60c12f78de393aa1380aa0f6627e9a3467c4152d /server/test
parent39e7ac384e45781331fc8c33a6a76746d770f031 (diff)
downloadlua-language-server-7b326c86ab117428e6361f6977e6c4e8aa42a9da.zip
参数自动完成与诊断
Diffstat (limited to 'server/test')
-rw-r--r--server/test/completion/init.lua22
-rw-r--r--server/test/diagnostics/init.lua33
2 files changed, 52 insertions, 3 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index 340af415..f8d1bef0 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -851,14 +851,30 @@ end
{
{
label = 'a',
- kind = CompletionItemKind.Unit,
+ kind = CompletionItemKind.Interface,
},
{
label = 'b',
- kind = CompletionItemKind.Unit,
+ kind = CompletionItemKind.Interface,
},
{
label = 'c',
- kind = CompletionItemKind.Unit,
+ kind = CompletionItemKind.Interface,
+ },
+}
+
+TEST [[
+---@param xyz Class
+---@param xxx Class
+function f(x$)
+]]
+{
+ {
+ label = 'xyz',
+ kind = CompletionItemKind.Interface,
+ },
+ {
+ label = 'xxx',
+ kind = CompletionItemKind.Interface,
},
}
diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua
index 827df06a..60c029bb 100644
--- a/server/test/diagnostics/init.lua
+++ b/server/test/diagnostics/init.lua
@@ -382,3 +382,36 @@ TEST [[
---@class B
---@alias <!A B!>
]]
+
+TEST [[
+---@param x <!Class!>
+]]
+
+TEST [[
+---@class Class
+---@param <!y!> Class
+local function f(x)
+ return x
+end
+f()
+]]
+
+TEST [[
+---@class Class
+---@param <!y!> Class
+function F(x)
+ return x
+end
+F()
+]]
+
+TEST [[
+---@class Class
+---@param <!x!> Class
+---@param y Class
+---@param <!x!> Class
+local function f(x, y)
+ return x, y
+end
+f()
+]]