diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-07-19 18:03:20 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-07-19 18:03:20 +0800 |
commit | 8b681399d4a5098fd1ec35e053f775df7cd67a5a (patch) | |
tree | bcea9fed8c281823c0250b324d114e670a214e19 /test/completion | |
parent | 682614e0004472d485b834e3608bfa9c62a6fee6 (diff) | |
download | lua-language-server-8b681399d4a5098fd1ec35e053f775df7cd67a5a.zip |
sort results of completion
Diffstat (limited to 'test/completion')
-rw-r--r-- | test/completion/common.lua | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua index d38f2912..a6df8da7 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -4227,3 +4227,83 @@ bar.<??> }, } Cared['description'] = false + +TEST [[ +---@class A +local M = {} + +function M:method1() +end + +function M.static1(tt) +end + +function M:method2() +end + +function M.static2(tt) +end + +---@type A +local a + +a.<??> +]] +{ + { + label ='static1(tt)', + kind = define.CompletionItemKind.Function, + }, + { + label ='static2(tt)', + kind = define.CompletionItemKind.Function, + }, + { + label ='method1(self)', + kind = define.CompletionItemKind.Method, + }, + { + label ='method2(self)', + kind = define.CompletionItemKind.Method, + }, +} + +TEST [[ +---@class A +local M = {} + +function M:method1() +end + +function M.static1(tt) +end + +function M:method2() +end + +function M.static2(tt) +end + +---@type A +local a + +a:<??> +]] +{ + { + label ='method1()', + kind = define.CompletionItemKind.Method, + }, + { + label ='method2()', + kind = define.CompletionItemKind.Method, + }, + { + label ='static1()', + kind = define.CompletionItemKind.Function, + }, + { + label ='static2()', + kind = define.CompletionItemKind.Function, + }, +} |