LuaLS / LuaLS/lua-language-server
[Feature Request] Support capturing generic type for @overload
Open
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
```lua
---@class base
---@class builder
---@generic T: base
---@overload fun(name: `T`): T
local builder = {}
local function __call(self, name)
....
end
setmetatable(builder, { __call = __call })
```
Thats will be helpfull for table have an metatable.__call
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
Start with the Lua example and trace how the language server processes the @generic and @overload annotations for a table with a metatable.__call. The work is done when the generic type T is captured from the overload argument and the returned value is inferred as T for this pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100