-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
When building up some more complicated doc comments (for example a function that takes or returns a callback) it is much easier to use an alias for example
---@alias SourceFn fun():string|nil,string|nil
---
---@param callback SourceFn
local function some_function(callback)
endwould render with some_function(callback:SourceFn) but no link to SourceFn
This is complicated further when trying to use tables
---@alias SendFn fun(chunk:string):string|nil,string|nil
---@alias Sender { send: SendFn }
---@param sender Sender
local function some_function(sender)
endsimilarly this would render as some_function(sender: Sender) which doesn't provide enough context to be helpful. It would be nice to have these aliases rendered as part of the document's output.
note: I've started using aliases because the inline emmylua syntax for something like ---@param sender {send: fun(chunk:string):string|nil,string|nil reports the following error
ERROR:root:./path/to/source.lua: l.1: invalid @param tag: @param {send: fun(chunk:string):string|nil,string|nil
Metadata
Metadata
Assignees
Labels
No labels