Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .vscode/tasks.json
Comment thread
NeOzay marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"options": {
"cwd": "${workspaceFolder}/3rd/luamake"
},
}
},
{
"type": "shell",
Expand All @@ -42,7 +42,12 @@
},
"osx": {
"command": "${workspaceFolder}/3rd/luamake/luamake rebuild"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
}
]
}
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* `NEW` Add support for lambda style functions, `|paramList| expr` is syntactic sugar for `function(paramList) return expr end`
* `FIX` Respect `completion.showParams` config for local function completion
* `CHG` Improve performance of multithreaded `--check` and `undefined-field` diagnostic
* `FIX` Bad triggering of the `inject-field` diagnostic, when the fields are declared at the creation of the object [#2746](https://github.com/LuaLS/lua-language-server/issues/2746)

## 3.9.3
`2024-6-11`
Expand Down
3 changes: 3 additions & 0 deletions script/core/diagnostics/inject-field.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ return function (uri, callback)
if def.type == 'doc.field' then
return
end
if def.type == 'tablefield' and not isExact then
return
end
end

local howToFix = ''
Expand Down
13 changes: 13 additions & 0 deletions test/diagnostics/inject-field.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,16 @@ function m:init() -- OK
end
end
]]

TEST [[
---@class Class
local m = {
xx = 1, -- OK
}

---@type Class
local m

m.xx = 1 -- OK
m.<!yy!> = 1 -- Warning
]]