mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
switch to FileRange
This commit is contained in:
parent
02924174bb
commit
fd33c89207
4 changed files with 37 additions and 15 deletions
11
crates/ra_analysis/src/extend_selection.rs
Normal file
11
crates/ra_analysis/src/extend_selection.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
use ra_db::SyntaxDatabase;
|
||||
|
||||
use crate::{
|
||||
TextRange, FileRange,
|
||||
db::RootDatabase,
|
||||
};
|
||||
|
||||
pub(crate) fn extend_selection(db: &RootDatabase, frange: FileRange) -> TextRange {
|
||||
let file = db.source_file(frange.file_id);
|
||||
ra_editor::extend_selection(&file, frange.range).unwrap_or(frange.range)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue