wesnoth/utils/emmylua
2024-09-15 15:27:39 -04:00
..
wesnoth Some updates to Lua map location operations 2024-09-15 15:27:39 -04:00
ai.lua
builtin.lua
config.lua
filesystem.lua
gui.lua
mathx.lua
README.md
stringx.lua
wesnoth.lua Lua API: Add mathx.lerp_index and wesnoth.game_config.palettes 2024-09-15 15:27:39 -04:00
wml.lua

These files can be used to allow Lua linting tools to understand Wesnoth types and functions that are defined in C++. Documentation of the annotations format can be found here.

To enable in Visual Studio Code, install this Lua plugin and add the following settings to your settings.json:

"Lua.runtime.version": "Lua 5.4",
"Lua.type.weakNilCheck": true,
"Lua.type.weakUnionCheck": true,
"Lua.workspace.library": [
  "./utils/emmylua"
],
"Lua.runtime.special": {
  "wesnoth.require": "require",
  "wesnoth.dofile": "dofile"
},
"Lua.runtime.builtin": {
  "io": "disable",
  "debug": "disable",
  "os": "disable",
  "package": "disable"
},
"Lua.diagnostics.globals": [
  "wesnoth",
  "wml",
  "gui",
  "filesystem",
  "unit_test",
  "stringx",
  "mathx",
  "ai"
]