Skip to content

Commit

Permalink
Version 3
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alibektas committed Jun 17, 2023
1 parent 19a9de7 commit 4ed1197
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/ide-assists/src/handlers/generate_delegate_trait.rs
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 4ed1197

Please sign in to comment.