File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ local files = require 'files'
22local guide = require ' parser.guide'
33local define = require ' proto.define'
44local lang = require ' language'
5+ local vm = require ' vm.vm'
56
67local function hasGet (loc )
78 if not loc .ref then
@@ -96,7 +97,7 @@ return function (uri, callback)
9697 if isDocClass (source ) then
9798 return
9899 end
99- if isDocParam (source ) then
100+ if vm . isMetaFile ( uri ) and isDocParam (source ) then
100101 return
101102 end
102103 local data = hasGet (source )
Original file line number Diff line number Diff line change 974974]]
975975
976976TEST [[
977+ ---@param a number
978+ return function (<!a!>)
979+ end
980+ ]]
981+
982+ TEST [[
983+ ---@meta
984+
977985---@param a number
978986return function (a)
979987end
@@ -1154,6 +1162,7 @@ TEST [[
11541162local emit = {}
11551163]]
11561164
1165+ config .get ' Lua.diagnostics.neededFileStatus' [' unused-local' ] = ' None'
11571166TEST [[
11581167---@param table table
11591168---@param metatable table
@@ -1292,6 +1301,8 @@ trim('str', 'left')
12921301trim('str', nil)
12931302]]
12941303
1304+ config .get ' Lua.diagnostics.neededFileStatus' [' unused-local' ] = ' Any'
1305+
12951306--- 不完整的函数参数定义,会跳过检查
12961307TEST [[
12971308---@param mode string
You can’t perform that action at this time.
0 commit comments