When suggesting to import an item, also suggest changing the path if appropriate
When we don't find an item we search all of them for an appropriate import and suggest `use`ing it. This is sometimes done for expressions that have paths with more than one segment. We now also suggest changing that path to work with the `use`. Fix #95413
This commit is contained in:
committed by
Esteban Kuber
parent
3d0ac7ea23
commit
57967269e9
@@ -2682,6 +2682,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
def_id,
|
||||
instead,
|
||||
suggestion,
|
||||
path: path.into(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2745,6 +2746,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
def_id,
|
||||
instead: false,
|
||||
suggestion: None,
|
||||
path: path.into(),
|
||||
});
|
||||
} else {
|
||||
err.cancel();
|
||||
|
||||
Reference in New Issue
Block a user