-
|
Hi, my project confer is configured in lua, with most APIs defined in the host language (Haskell) and injected in the Lua runtime. Considering that the Lua runtime used by LuaLS is not going to be the one embedded in my program, there's bound to be a mismatch between what they can see at runtime. How may I inform LuaLS that such and such identifiers are of a certain type, or a table with certain expected fields? I can also accept that LuaLS is best used for self-contained Lua codebases where modules refer their explicit dependencies on the file-system. I'll just move to a different mean of producing documentation statically. Thanks a lot for the project by the way, it was really useful to me when I was using Neovim, and now I'm finding myself in a position where I am the one providing a Lua API. ❤️ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
You can make the LSP recognize these definitions by creating a meta file. like: --xxx.d.lua
---@meta
---@class Test
local Test = {}
--- Markdown description
---@param aaa string
---@return string
function Test:example(aaa)
return "example"
end |
Beta Was this translation helpful? Give feedback.
You can make the LSP recognize these definitions by creating a meta file. like: