summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-06-11 20:52:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-06-11 20:52:28 +0800
commit3101cfb948694389cf1cc9cdbba99267f6290508 (patch)
treef3bd3325af4c64695b7d85a7150ba9c797624206 /test/completion
parentf437ac3594cf56cbd6ce5160a03e716f5192e85e (diff)
downloadlua-language-server-3101cfb948694389cf1cc9cdbba99267f6290508.zip
`FIX` Sometimes providing incorrect autocompletion when chaining calls
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index b5ffe173..fc2183d7 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -4462,3 +4462,30 @@ new 'A' {
kind = define.CompletionItemKind.Property,
}
}
+
+TEST [[
+---@enum(key) enum
+local t = {
+ a = 1,
+ b = 2,
+ c = 3,
+}
+
+---@class A
+local M
+
+---@param optional enum
+function M:optional(optional)
+end
+
+---@return A
+function M:self()
+ return self
+end
+
+---@type A
+local m
+
+m:self(<??>):optional()
+]]
+(nil)