mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-15 12:03:43 +00:00
[Lua] Suppress some diagnostics and also recommend suppressing certain diagnostics globally
This commit is contained in:
parent
7891a9f06f
commit
542581916f
|
@ -274,6 +274,7 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then
|
|||
---@type location
|
||||
local loc, n = wesnoth.map.read_location(x, y)
|
||||
if n == 0 then error('Missing or invalid coordinate') end
|
||||
---@diagnostic disable-next-line: return-type-mismatch
|
||||
return setmetatable({x = loc.x, y = loc.y}, hex_mt)
|
||||
end
|
||||
|
||||
|
@ -282,7 +283,7 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then
|
|||
---@param cfg WML
|
||||
---@param ref_unit? unit
|
||||
---@return terrain_hex[]
|
||||
function wesnoth.map.find(cfg, ref_unit)
|
||||
function wesnoth.map.find(cfg, ref_unit) ---@diagnostic disable-line: duplicate-set-field
|
||||
local hexes = find_locations(cfg, ref_unit)
|
||||
for i = 1, #hexes do
|
||||
hexes[i] = wesnoth.map.get(hexes[i][1], hexes[i][2])
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
--[========[Config Manipulation Functions]========]
|
||||
---@diagnostic disable: deprecated
|
||||
print("Loading WML module...")
|
||||
|
||||
local function ensure_config(cfg)
|
||||
|
|
|
@ -6,6 +6,8 @@ To enable in Visual Studio Code, install [this Lua plugin](https://marketplace.v
|
|||
|
||||
```json
|
||||
"Lua.runtime.version": "Lua 5.4",
|
||||
"Lua.type.weakNilCheck": true,
|
||||
"Lua.type.weakUnionCheck": true,
|
||||
"Lua.workspace.library": [
|
||||
"./utils/emmylua"
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue
Block a user