}
/// Selects the next syntactic nodes encopasing the range.
- pub fn extend_selection(&self, frange: FileRange) -> TextRange {
- extend_selection::extend_selection(&self.db, frange)
+ pub fn extend_selection(&self, frange: FileRange) -> Cancelable<TextRange> {
+ self.with_db(|db| extend_selection::extend_selection(db, frange))
}
/// Returns position of the mathcing brace (all types of braces are
WorkspaceEdit
};
use ra_ide_api::{
- FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, RunnableKind, Severity,
+ FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, RunnableKind, Severity, Cancelable,
};
use ra_syntax::{AstNode, TextUnit};
use rustc_hash::FxHashMap;
.into_iter()
.map_conv_with(&line_index)
.map(|range| FileRange { file_id, range })
- .map(|frange| world.analysis().extend_selection(frange))
- .map_conv_with(&line_index)
- .collect();
+ .map(|frange| {
+ world
+ .analysis()
+ .extend_selection(frange)
+ .map(|it| it.conv_with(&line_index))
+ })
+ .collect::<Cancelable<Vec<_>>>()?;
Ok(req::ExtendSelectionResult { selections })
}