rust-lang / rust-lang/rust-analyzer
`dbg` postfix completion should take adjustments into account
Open
Nobody has claimed this yet.
A-completion
C-bug
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
struct S;
impl S {
fn borrow(&self) {}
}
fn main() {
S$0.borrow();
}
doing a .dbg completion at $0 results in dbg!(S).borrow() which is a compile error. We should instead emit a dbg!(&S).borrow() here
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 .dbg postfix completion with the provided S::borrow example, then locate the implementation and its completion tests. Check how expression adjustments are represented and add a regression case showing that the generated completion preserves the required borrow; run the relevant completion test suite and verify the output is dbg!(&S).borrow().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100