mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
re-introduce always!
This commit is contained in:
parent
28c73f8374
commit
df9fb9b159
1 changed files with 7 additions and 8 deletions
|
@ -12,7 +12,7 @@ use ide_db::{
|
||||||
RootDatabase,
|
RootDatabase,
|
||||||
};
|
};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use stdx::never;
|
use stdx::{always, never};
|
||||||
use syntax::{ast, AstNode, SyntaxNode};
|
use syntax::{ast, AstNode, SyntaxNode};
|
||||||
|
|
||||||
use text_edit::TextEdit;
|
use text_edit::TextEdit;
|
||||||
|
@ -41,13 +41,12 @@ pub(crate) fn prepare_rename(
|
||||||
bail!("No references found at position")
|
bail!("No references found at position")
|
||||||
}
|
}
|
||||||
let frange = sema.original_range(name_like.syntax());
|
let frange = sema.original_range(name_like.syntax());
|
||||||
if frange.range.contains_inclusive(position.offset)
|
|
||||||
&& frange.file_id == position.file_id
|
always!(
|
||||||
{
|
frange.range.contains_inclusive(position.offset)
|
||||||
Ok(frange.range)
|
&& frange.file_id == position.file_id
|
||||||
} else {
|
);
|
||||||
bail!("invalid text range")
|
Ok(frange.range)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.reduce(|acc, cur| match (acc, cur) {
|
.reduce(|acc, cur| match (acc, cur) {
|
||||||
// ensure all ranges are the same
|
// ensure all ranges are the same
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue