Skip to content

Commit 09f8b6f

Browse files
committed
feat(missing-fields): ignore methods when determining missing fields
1 parent 759e8fb commit 09f8b6f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/core/diagnostics/missing-fields.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ return function (uri, callback)
3131
local class = vm.getGlobal('type', className)
3232
---@cast class -nil
3333
for _, set in ipairs(class:getSets(uri)) do
34-
if set.type == 'doc.class'
34+
if set.type == 'doc.class'
3535
and vm.docHasAttr(set, 'partial')
3636
then
3737
sortedDefs[className].isPartial = true
@@ -70,7 +70,8 @@ return function (uri, callback)
7070

7171
for _, field in ipairs(fields) do
7272
if not field.optional
73-
and not vm.compileNode(field):isNullable() then
73+
and not vm.compileNode(field):isNullable()
74+
and field.type == "doc.field" then
7475
local key = vm.getKeyName(field)
7576
if not key then
7677
local fieldnode = vm.compileNode(field.field)[1]

0 commit comments

Comments
 (0)