rust-lang / rust-lang/rust-analyzer
Emit diagnostics for unresolved methond calls where fix (import trait) is available
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Quite often methods on a particular type can not be found since the trait was not bought into scope with a use statement. Would it be possible to index the traits from the crates listed as dependencies in Cargo.toml and to improve the lint from:
no method named XXX found for struct
to:
method XXX is only available when you bring trait YYY into scope
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
Inspect rust-analyzer's unresolved-method diagnostics and how it indexes traits from dependency crates listed in Cargo.toml. Compare the current no-method-found output with the requested trait-import suggestion, and define completion as emitting the suggested trait and import guidance when that information is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100