rust-lang / rust-lang/rust-analyzer
problems with associated types and code assist
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
trait Test2 {
fn test2();
}
trait Test1 {
type A: Test2;
fn test1();
}
fn test<H: Test1>(test: H) {
Test1::<Problem1>
H::<Problem1>
Test1::A::<Problem2>
H::A::<Problem2>
}
-
Problem1:
Code suggestions are different. WhileTest1::offers the expectedAandtest1(),H::adds stuff that doesn't make sense (like a clone() function). -
Problem2:
Code assist shows tons of types and methods. One of which are the proper members, but sometimes even that doesn't work (which is why I'm actually reporting this, but I haven't nailed it when that happens. So I thought maybe solve these 2 issues first ...)
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 reproducing the provided Rust snippet in rust-analyzer's code assist and compare completions for Test1::, H::, Test1::A::, and H::A::. Trace the completion entry point that produces these suggestions, then verify that associated types and methods are filtered consistently and that the relevant completions are present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100