The format LLS expects to export documentation and handle autocompletion & hover should be the same. I'd like to export documentation from the same set of definition files I'm shipping as an Addon, and keeping them synced to the same source of truth seems the sensible way to go.
Actual Behaviour
This example is valid as far as documentation export, in that the JSON file generated as output contains references to the functions defined. However, this breaks tooltips/popovers/autocompletion, which require testLib to be defined and returned from this module to function:
---@meta cradle.basic.text
---This is test function 1.
---@param a number This is a number.
---@param b number This is another number.
---@return number This is the sum of a and b.
function testLib.add(a, b) end
---This is test function 2.
---@param a number This is a number.
---@param b number This is another number.
---@return number This is the difference of a and b.
function testLib.sub(a, b) end
Conversely, this other example allows tooltips/popovers/autocompletion to function properly, documentation generated via CLI seems to succeed with no errors, however the actual JSON containing the references is missing any reference to testLib entirely:
---@meta cradle.basic.text
local testLib = {}
---This is test function 1.
---@param a number This is a number.
---@param b number This is another number.
---@return number This is the sum of a and b.
function testLib.add(a, b) end
---This is test function 2.
---@param a number This is a number.
---@param b number This is another number.
---@return number This is the difference of a and b.
function testLib.sub(a, b) end
return testLib
Reproduction steps
Save each of the two examples above as a Lua file somewhere
Modify LLS config to include them
Export documentation via CLI and try to require the library in the workspace
Observe that depending on the example tested, either documentation exporting silently fails, or popovers don't work anymore
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
MacOS
What is the issue affecting?
Annotations, Completion, Hover, Other
Expected Behaviour
The format LLS expects to export documentation and handle autocompletion & hover should be the same. I'd like to export documentation from the same set of definition files I'm shipping as an Addon, and keeping them synced to the same source of truth seems the sensible way to go.
Actual Behaviour
This example is valid as far as documentation export, in that the JSON file generated as output contains references to the functions defined. However, this breaks tooltips/popovers/autocompletion, which require
testLib
to be defined and returned from this module to function:Conversely, this other example allows tooltips/popovers/autocompletion to function properly, documentation generated via CLI seems to succeed with no errors, however the actual JSON containing the references is missing any reference to
testLib
entirely:Reproduction steps
Additional Notes
No response
Log File
No response