lua-language-server
lua-language-server copied to clipboard
doc param support generic pattern
---@class namespace.A
---@overload fun(x: {id: string})
---@generic T
---@param t namespace.`T`
---@return T
local function new(t) end
new 'A'{
id
}
感觉这个写法怪怪的,可能用形如 `namespace.<T>` 更好。 `T` 则作为 `<T>` 的语法糖。
可以啊,我也没决定怎么写比较好。
不急,过2天看看有没有其他想法
感觉这个写法怪怪的,可能用形如
`namespace.<T>`更好。`T`则作为`<T>`的语法糖。
In my opinion, the current way feels more intuitive. With the current capture being `T` it seems clearer that namespace.`T` is the same as just capturing the original generic class name with some static prefix. Also I just really want to see this get merged lol.
参考了一下TS,确实最初的写法更好