mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Don't qualify self as crate in add_missing_impl_members assist
This commit is contained in:
parent
d571ca814e
commit
456f5c6d09
2 changed files with 39 additions and 1 deletions
|
@ -101,8 +101,11 @@ impl<'a> Ctx<'a> {
|
|||
if path.qualifier().is_some() {
|
||||
return None;
|
||||
}
|
||||
if path.segment().and_then(|s| s.param_list()).is_some() {
|
||||
if path.segment().map_or(false, |s| {
|
||||
s.param_list().is_some() || (s.self_token().is_some() && path.parent_path().is_none())
|
||||
}) {
|
||||
// don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
|
||||
// don't try to qualify sole `self` either, they are usually locals, but are returned as modules due to namespace classing
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue