[SOLVED] Lua Language Server type annotations for rxi/classic classes
[SOLVED] Lua Language Server type annotations for rxi/classic classes
Hello, everyone! I've been having a lot of success with the tiny rxi/classic class library. I understand the Lua Language Server has class and type annotations, but I can't seem to make them work with the classic classes. Has anyone had success using a class library with type annotations?
Last edited by keharriso on Fri Jul 12, 2024 12:01 am, edited 1 time in total.
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
Re: Lua Language Server type annotations for rxi/classic classes
I've been having the same issue, have you found a solution yet?
Re: Lua Language Server type annotations for rxi/classic classes
Solution found!
Example:
Example:
Code: Select all
---@class Map
---@overload fun(cols: integer, rows: integer): Map
local Map = Object:extend()
function Map:new(cols, rows)
-- initialize map
end
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
Re: [SOLVED] Lua Language Server type annotations for rxi/classic classes
I did never heard of Lua Language Server (LLS), very interesting.
At the moment I'm using Ldoc , to generate documentation for my code
https://github.com/lunarmodules/ldoc
I see that they use different annotations for example this is Ldoc
I'm wondering if LLS can generate written code into html like Ldoc?
For example like this https://stevedonovan.github.io/winapi/api.html
At the moment I'm using Ldoc , to generate documentation for my code
https://github.com/lunarmodules/ldoc
I see that they use different annotations for example this is Ldoc
Code: Select all
---
-- @tparam triggerData triggerData
-- @tparam actionData actionData
-- @tparam table actionList
-- @tparam number actionListIndex
-- @tparam number actionId
-- @tparam function afterProcessActionListCallback
function ActionCamera:execute(
triggerData,
actionData,
actionList,
actionListIndex,
actionId,
afterProcessActionListCallback)
For example like this https://stevedonovan.github.io/winapi/api.html
Re: [SOLVED] Lua Language Server type annotations for rxi/classic classes
Answer my own question: https://luals.github.io/wiki/export-docs/ it is possible to export to json and markdown.
I know that there are many tools to convert markdown into html, so I'm going give it a try thanks for sharing this !
I know that there are many tools to convert markdown into html, so I'm going give it a try thanks for sharing this !
Re: [SOLVED] Lua Language Server type annotations for rxi/classic classes
How did you include love ?keharriso wrote: ↑Sun Jun 09, 2024 12:45 am Hello, everyone! I've been having a lot of success with the tiny rxi/classic class library. I understand the Lua Language Server has class and type annotations, but I can't seem to make them work with the classic classes. Has anyone had success using a class library with type annotations?
Re: [SOLVED] Lua Language Server type annotations for rxi/classic classes
I think if you are using the LLS plugin by sumneko, you need to add this to your settings.json:
Code: Select all
"Lua.workspace.library": [
"${3rd}/love2d/library"
],
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
Re: [SOLVED] Lua Language Server type annotations for rxi/classic classes
Yes that works with
Code: Select all
"Lua.workspace.checkThirdParty": "Apply",
Who is online
Users browsing this forum: Ahrefs [Bot] and 9 guests