rust-lang / rust-lang/rust-analyzer
VSCode Cursor Auto Indent
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
The one feature that is missing is cursor auto-indentation. It is configured via "editor.autoIndent" setting that is set to "full" by default.
For example, cursor | is placed here:
App::new()|
.insert_resource(...);
After pressing Enter inside incomplete statement, cursor is placed here:
App::new()
|
.insert_resource(...);
But I expected it here:
App::new()
|
.insert_resource(...);
From the API documentation:
full: The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.
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 locating rust-analyzer's VSCode/LSP integration for the editor.autoIndent setting and tracing how Enter handling and indentation are exposed. Compare the current behavior with VSCode's documented "full" mode using the Rust example in the issue; done means Enter places the cursor at the continuation indentation for incomplete statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100