LuaLS / LuaLS/lua-language-server
Overriding methods
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
It would be great if I can override fields, not just shadow them, to retain their signature and doc.
```lua
---@class (exact) A
local a = {}
---Test Comment
---@param test string Some argument
function a:Method(test) end
---@class (exact) B : A
local b = {}
function b:Method(test) end
---@type B
local test
test:Method("") -- Annotations are gone
```
The signature wont change for overridden methods, and thus I would like to avoid copy pasting the whole doc for each method. How would I resolve this efficiently?
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 by reproducing the Lua example in the issue and inspect how class inheritance currently handles shadowed fields and overridden methods. The work is done when an overridden method retains the inherited signature and documentation without requiring duplicated annotations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100