rust-lang / rust-lang/rust-analyzer
No "import trait" assist nor trait method completion on associated types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
When writing a custom Deserialize impl, typing something like D::Error::inval does not show any relevant completions, despite D::Error implementing serde's Error trait (this happens even when the trait is already in scope). Even when a full method name is typed out (eg invalid_type), there is no "import serde::de::Error" assist like there is in other cases.
While mostly rare, this is an easy papercut to run into when writing a custom Deserialize impl for a type, so it would be good to support it better.
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 case in a custom Deserialize impl by trying completion on D::Error::inval and typing invalid_type with serde:🇩🇪:Error in scope. Trace the completion and import-assist entry points for associated types, then verify that trait methods are suggested and the serde:🇩🇪:Error import assist appears.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100