From 246711c5919aff9c471939285685827831b8fd08 Mon Sep 17 00:00:00 2001 From: sumneko Date: Tue, 23 Apr 2019 15:32:35 +0800 Subject: =?UTF-8?q?=E4=B8=80=E5=AE=9A=E4=B8=8D=E4=BC=9Arequire=E5=88=B0?= =?UTF-8?q?=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test/crossfile/completion.lua | 22 ++++++++++++++++++++++ server/test/crossfile/definition.lua | 16 ++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'server/test') diff --git a/server/test/crossfile/completion.lua b/server/test/crossfile/completion.lua index cc31ed5d..2c781e9e 100644 --- a/server/test/crossfile/completion.lua +++ b/server/test/crossfile/completion.lua @@ -510,3 +510,25 @@ TEST { main = true, }, } + +TEST { + { + path = 'xxx.lua', + content = '' + }, + { + path = 'xxxx.lua', + content = [[ + require 'xx$' + ]], + main = true, + }, + completion = { + { + label = 'xxx', + kind = CompletionItemKind.Reference, + documentation = 'xxx.lua', + textEdit = EXISTS, + }, + } +} diff --git a/server/test/crossfile/definition.lua b/server/test/crossfile/definition.lua index e49308a1..06512f9b 100644 --- a/server/test/crossfile/definition.lua +++ b/server/test/crossfile/definition.lua @@ -359,6 +359,22 @@ TEST { } } +TEST { + { + path = 'a/xxx.lua', + content = [[ + return + ]] + }, + { + path = 'b/xxx.lua', + content = [[ + local = require 'xxx' + return function () end + ]] + } +} + TEST { { path = 'a.lua', -- cgit v1.2.3