LuaLS / LuaLS/lua-language-server

When a parameter for a function is defined as `fun(param:type)`, the auto-complete when you're using that function stops working beyond typing "fun"

Open
#857 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

as designed
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

For example, having a function defined as:

---@param callback fun(text:string)
local function my_fun(callback)
    callback()
end

When you go to call it using my_fun(), the auto-completer suggests "fun(text:string), but if you start typing func the auto-completer loses the suggestion.

Screenshot 2021-12-11 101408
Screenshot 2021-12-11 101422

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the autocomplete behavior with the Lua annotation and function call shown in the issue, then trace the language server's completion handling for function-type annotations. Done means the fun(text:string) suggestion remains available as the call is typed beyond fun; the payload does not name a file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.