M.DIRECTION values are all strings, Lua LSP detected the type error while the values in function calls were correct. Example:
In
local next_row = stages_util.available_slot(state.open_windows, next_height, stages_util.DIRECTION.BOTTOM_UP)
stages_util.DIRECTION.BOTTOM_UP is a string, and is the correct value that should be used here. But since the available_slot method was expecting an integer, LSP complained (even though the code still works since lua is dynamically typed).
Minor documentation corrections:
M.DIRECTION
values are all strings, Lua LSP detected the type error while the values in function calls were correct. Example:In
stages_util.DIRECTION.BOTTOM_UP
is a string, and is the correct value that should be used here. But since theavailable_slot
method was expecting an integer, LSP complained (even though the code still works since lua is dynamically typed).Same with
window_intervals
method.