Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/references.rs')
-rw-r--r--crates/ide/src/references.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index 516cc7fe60..0738b7fadc 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -28,7 +28,6 @@ use ide_db::{
use itertools::Itertools;
use macros::UpmapFromRaFixture;
use nohash_hasher::IntMap;
-use span::Edition;
use syntax::AstToken;
use syntax::{
AstNode,
@@ -419,10 +418,7 @@ fn handle_control_flow_keywords(
FilePosition { file_id, offset }: FilePosition,
) -> Option<ReferenceSearchResult> {
let file = sema.parse_guess_edition(file_id);
- let edition = sema
- .attach_first_edition(file_id)
- .map(|it| it.edition(sema.db))
- .unwrap_or(Edition::CURRENT);
+ let edition = sema.attach_first_edition(file_id).edition(sema.db);
let token = pick_best_token(file.syntax().token_at_offset(offset), |kind| match kind {
_ if kind.is_keyword(edition) => 4,
T![=>] => 3,
@@ -1124,7 +1120,10 @@ pub(super) struct Foo$0 {
check_with_scope(
code,
Some(&mut |db| {
- SearchScope::single_file(EditionedFileId::current_edition(db, FileId::from_raw(2)))
+ SearchScope::single_file(EditionedFileId::current_edition_guess_origin(
+ db,
+ FileId::from_raw(2),
+ ))
}),
expect![[r#"
quux Function FileId(0) 19..35 26..30