rust-lang / rust-lang/rust-analyzer
Option to disable semicolon insertion
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
When completing certain keywords, rust-analyzer appends a semicolon which is not visible in the preview text. For example:
With return, it is sensible-enough to account for return type, but I still find it intrusive:
- this is actually inconsistent behavior
- it messes with my expectations and muscle memory, since the semicolon is not in the preview text and I am used to typing it manually
- with
breakandcontinue, it doesn't consider context; I may want to specify a label, but the semicolon is inserted even when inside of labeled loops, so I have to delete the semicolon in those cases
https://rust-analyzer.github.io/book/configuration.html#completion.addSemicolonToUnit exists, but from a cursory reading of the source code, this only seems to apply to function call snippets which I also have disabled.
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 with the configuration documentation for completion.addSemicolonToUnit, then trace how semicolons are added to return, break, and continue completions. Done means users can disable these keyword insertions independently, including when labels are valid, with tests covering the affected completion cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100