LuaLS / LuaLS/lua-language-server
Anonymous function whitespace
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
### How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
### Which OS are you using?
Windows
### What is the issue affecting?
Completion
### Expected Behaviour
Not adding a whitespace character if a function is anonymous and therefore can't have a name.
### Actual Behaviour
Adds a whitespace character like if I were create a regular function, which I can name.
### Reproduction steps
1. Type `table.sort({}, `.

2. Once it suggests to autocomplete the template function, press Enter.

### Additional Notes
I think it's a bug because I've never seen anyone code like that. I couldn't find anything related to this in the settings nor in the documentation.
### Log File
_No response_
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
Reproduce the completion behavior in the Visual Studio Code extension on Windows using `table.sort({}, ` and accept the suggested anonymous function template. Trace the completion handling for anonymous versus regular functions, then verify that accepting the anonymous template does not insert the extra whitespace character.
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