LuaLS / LuaLS/lua-language-server
Suggestion: Make `@param;@return` available as code action
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
One really nice feature of the lua-lsp is that by typing `---` above a function, we get the `@param;@return` suggestions which auto-inserts function annotation.
Would it be possible to make this feature available via code action as well? Right now, it takes a bit of repetitive work to get the annotations inserted. When at the function head: `up`, `-`. `-`, `-`, `enter`. By using a code action, this could be reduced to one hotkey (and depending on your editor, maybe one extra `enter`).
Another benefit would be that making this available as code action would increase the discoverability of this feature. For a while, I didn't know that this very useful feature even existed. By being a code action, it would be far easier to discover for new users.
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 the existing `---`-triggered suggestions that insert `@param` and `@return` annotations, then inspect where code actions are exposed by the language server. Done means the same annotation insertion is available through a code action and remains discoverable at a function head.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100