From 8b681399d4a5098fd1ec35e053f775df7cd67a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 19 Jul 2023 18:03:20 +0800 Subject: sort results of completion --- test/completion/common.lua | 80 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'test/completion') 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, + }, +} -- cgit v1.2.3