rust-lang / rust-lang/rust-analyzer
Unable to quick fix import when function name conflicts with builtin type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: 0.3.1583-standalone (ff1563483 2023-07-09)
rustc version:rustc 1.73.0-nightly (ad963232d 2023-07-14)
The nom parsing library contains various functions that have the same name as rust's builtin types, for example:
nom::character::complete::charnom::character::complete::u8nom::character::complete::u32
It seems rust-analyzer is unable to suggest a quick fix action to import these functions.
While it may be questionable to import a function with the same name as a type, I feel there should be some kind of quick-fix option here.
cargo clippy correctly suggests a fix:
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 missing quick fix with the nom functions char, u8, or u32, using the versions and example described in the issue. Compare the behavior with cargo clippy's suggested fix; done means rust-analyzer offers a working import quick fix for functions whose names conflict with builtin types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100