rust/crates/ra_ide_api/src/extend_selection.rs

14 lines
382 B
Rust
Raw Normal View History

2019-01-26 08:20:30 +00:00
use ra_db::SourceDatabase;
2019-03-16 16:40:41 +00:00
use ra_syntax::AstNode;
2019-01-08 19:33:36 +00:00
use crate::{
TextRange, FileRange,
db::RootDatabase,
};
2019-03-16 16:40:41 +00:00
// FIXME: restore macro support
2019-01-08 19:33:36 +00:00
pub(crate) fn extend_selection(db: &RootDatabase, frange: FileRange) -> TextRange {
2019-01-26 08:51:36 +00:00
let source_file = db.parse(frange.file_id);
2019-01-08 19:33:36 +00:00
ra_ide_api_light::extend_selection(source_file.syntax(), frange.range).unwrap_or(frange.range)
}