rust-lang / rust-lang/rust-analyzer
Struct field complete suggestion should follow declaration order instead of alphabetical
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
This is one of the subtle things that I've always hated: I expected the suggestions to follow the declaration order, but it has been alphabetical instead. It causes all kinds of headaches when later I'm changing the fields and can't find the field easily in the new method, because I filled the fields with the suggestion order instead of declaration order and now it's all messed up.
Notice how the declaration goes "source, start, index, line" and the suggestion goes "index, line, source, start".
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 struct field completion shown in the issue and trace the rust-analyzer completion entry point responsible for ordering suggestions. Determine how declaration order can be observed there, then verify that fields appear as source, start, index, line rather than alphabetically, with coverage for the reported example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100