LuaLS / LuaLS/lua-language-server
feature: support generics in function type format
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
Currently, the only way to document generic functions is to use `@generic`. and it's not possible to use them in overloads or fields.
The following examples are invalid:
```lua
---@generic T
---@param arg1 string
---@param arg2 T
---@return T
---@overload fun(arg2: T) <- Undefined type or alias `T`.
local function foo(arg1, arg2)
return arg2 or arg1
end
```
```lua
---@class Foo
---@field bar fun(arg:T): T <- `(` expected.
local Foo = {}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Start by locating the parsing and type-resolution paths for @generic, @overload, and function types, then compare them with the two Lua examples. Done means generic type parameters resolve inside overload signatures and field function types without the reported diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- compilers, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100