From e5a99c3cdd7d79347bb6c3d2cfc474ddda106717 Mon Sep 17 00:00:00 2001 From: jharajeev55 Date: Thu, 2 Mar 2023 10:26:33 +0530 Subject: Array of a class type does not get completion #1940 https: //github.com/LuaLS/lua-language-server/issues/1940 Co-Authored-By: esarver <4965633+esarver@users.noreply.github.com> --- test/crossfile/completion.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test/crossfile/completion.lua') diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua index d613f621..113b0327 100644 --- a/test/crossfile/completion.lua +++ b/test/crossfile/completion.lua @@ -124,6 +124,37 @@ local function WITH_CONFIG(cfg, f) end end +TEST { + { + path = 'abc.lua', + content = [[ + ---@meta + + ---@class A + ---@field f1 integer + ---@field f2 boolean + + ---@type A[] + X = {} +]], + }, + { + path = 'test.lua', + content = [[ X[1].]], + main = true, + }, + completion = { + { + label = 'f1', + kind = CompletionItemKind.Field, + }, + { + label = 'f2', + kind = CompletionItemKind.Field, + }, + } +} + TEST { { path = 'abc.lua', -- cgit v1.2.3