switch to FileRange

This commit is contained in:
Aleksey Kladov 2018-12-28 18:15:19 +03:00
parent 02924174bb
commit fd33c89207
4 changed files with 37 additions and 15 deletions

View 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)
}