From 4ed119766282b2e758a88ac29daf488d718f730c Mon Sep 17 00:00:00 2001 From: Ali Bektas Date: Sat, 17 Jun 2023 21:27:52 +0200 Subject: [PATCH] Version 3 Remove scope_for_def calls as the definition have been removed entirely. As a result of this change the problem with false path resolutions has been solved. --- crates/ide-assists/src/handlers/generate_delegate_trait.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ide-assists/src/handlers/generate_delegate_trait.rs b/crates/ide-assists/src/handlers/generate_delegate_trait.rs index 4d05dbfcf5f..185f47184d4 100644 --- a/crates/ide-assists/src/handlers/generate_delegate_trait.rs +++ b/crates/ide-assists/src/handlers/generate_delegate_trait.rs @@ -294,7 +294,7 @@ fn generate_impl( }; let target = ctx.sema.scope(strukt.strukt.syntax()).unwrap(); - let source = ctx.sema.scope_for_def(delegee.0); + let source = ctx.sema.scope(source.syntax()).unwrap(); let transform = PathTransform::trait_impl(&target, &source, delegee.0, delegate.clone()); @@ -342,7 +342,7 @@ fn generate_impl( }); let target = ctx.sema.scope(strukt.strukt.syntax()).unwrap(); - let source = ctx.sema.scope_for_def(delegee.0); + let source = ctx.sema.scope(source.syntax()).unwrap(); let transform = PathTransform::trait_impl(&target, &source, delegee.0, delegate.clone());