LuaLS / LuaLS/lua-language-server
Disable automatic insertion of "---@" on Enter
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?
Annotations, Completion, Formatting
### Expected Behaviour
When I hit Enter at the end of a class/parameter/etc. annotation, I get a new blank line.
### Actual Behaviour
When I type an annotation and hit Enter, I get `---@` automatically inserted.
### Reproduction steps
1. Type `---@class test`
2. Press Enter
### Additional Notes
I know this is an "intentional feature", but I would like a way to disable it. There is no setting that disables this (and only this) - turning "Editor: Auto Indent" to 'brackets' or lower disables this unwanted behavior, but then I lose auto-indent.
See https://github.com/LuaLS/lua-language-server/discussions/2786
### 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 behavior in the Visual Studio Code extension using the stated annotation steps, then trace the annotation, completion, and formatting handling along with existing configuration settings. Done means a setting can suppress automatic `---@` insertion on Enter while preserving normal auto-indentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100