LuaLS / LuaLS/lua-language-server
Enhancement - Allow ability to specify a default value for --- @param
Open
Nobody has claimed this yet.
enhancement
feat/LuaCats Annotations
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
Allow the ability to specify a default value for optional params.
Example:
--- @param a number
--- @param b=[32] number
--- @param c=[' '] string
--- @param d=[] any
--- @param e=[MyClass.subclass] MyClass
--- @return boolean
local function test(a, b, c. d, e
end
hovering over test could show
function test(a: number, b=32: number, c=' ': string, d=nil: any, e=MyClass.subclass: MyClass)
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 tracing how @param annotations are parsed and how function hover text is assembled. Clarify the proposed default-value syntax and its behavior for numeric, string, nil, and class-valued defaults; done means optional parameters display the specified defaults consistently in hover information.
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
- Needs clarification
- Newbie friendliness
- 25/100