mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Add config for preferring / ignoring prelude modules in find_path
This commit is contained in:
parent
801a887954
commit
ba61766217
36 changed files with 260 additions and 54 deletions
|
@ -277,6 +277,7 @@ impl Ctx<'_> {
|
|||
self.source_scope.db.upcast(),
|
||||
hir::ModuleDef::Trait(trait_ref),
|
||||
false,
|
||||
true,
|
||||
)?;
|
||||
match make::ty_path(mod_path_to_ast(&found_path)) {
|
||||
ast::Type::PathType(path_ty) => Some(path_ty),
|
||||
|
@ -311,8 +312,12 @@ impl Ctx<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
let found_path =
|
||||
self.target_module.find_use_path(self.source_scope.db.upcast(), def, false)?;
|
||||
let found_path = self.target_module.find_use_path(
|
||||
self.source_scope.db.upcast(),
|
||||
def,
|
||||
false,
|
||||
true,
|
||||
)?;
|
||||
let res = mod_path_to_ast(&found_path).clone_for_update();
|
||||
if let Some(args) = path.segment().and_then(|it| it.generic_arg_list()) {
|
||||
if let Some(segment) = res.segment() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue