summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-11-14 22:32:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-11-14 22:32:31 +0800
commitbfeea5916effde22eae483a2f3b3077cbd7f6e52 (patch)
tree6b3728d7d92b1b474aeabf43808ef73624dc16cf /test/crossfile
parent21ee5e8a7393e936f2c36d5628e2a307750f4ff5 (diff)
downloadlua-language-server-bfeea5916effde22eae483a2f3b3077cbd7f6e52.zip
`duplicate-set-field` supports cross files
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/diagnostic.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/crossfile/diagnostic.lua b/test/crossfile/diagnostic.lua
index 58c89805..126a2ab8 100644
--- a/test/crossfile/diagnostic.lua
+++ b/test/crossfile/diagnostic.lua
@@ -8,6 +8,7 @@ local catch = require 'catch'
config.get(nil, 'Lua.diagnostics.neededFileStatus')['deprecated'] = 'Any'
config.get(nil, 'Lua.diagnostics.neededFileStatus')['type-check'] = 'Any'
+config.get(nil, 'Lua.diagnostics.neededFileStatus')['duplicate-set-field'] = 'Any'
config.get(nil, 'Lua.diagnostics.neededFileStatus')['codestyle-check'] = 'None'
rawset(_G, 'TEST', true)
@@ -176,3 +177,37 @@ TEST {
---@field <!x!> number
]]}
}
+
+TEST {
+ { path = 'a.lua', content = [[
+ ---@class A
+ local mt
+
+ function <!mt:init!>()
+ end
+ ]]},
+ { path = 'b.lua', content = [[
+ ---@class A
+ local mt
+
+ function <!mt:init!>()
+ end
+ ]]}
+}
+
+TEST {
+ { path = 'a.lua', content = [[
+ ---@class A
+ local mt
+
+ function mt:init()
+ end
+ ]]},
+ { path = 'b.lua', content = [[
+ ---@class B: A
+ local mt
+
+ function mt:init()
+ end
+ ]]}
+}