Add unit test for BufferView::select_{larger,smaller}_syntax_node

This commit is contained in:
Antonio Scandurra
2021-05-28 14:59:29 +02:00
parent 0ed9e74785
commit 36c1d21025
2 changed files with 148 additions and 8 deletions
+1 -4
View File
@@ -709,10 +709,7 @@ impl Buffer {
})
}
pub fn range_for_containing_syntax_node<T: ToOffset>(
&self,
range: Range<T>,
) -> Option<Range<usize>> {
pub fn range_for_syntax_ancestor<T: ToOffset>(&self, range: Range<T>) -> Option<Range<usize>> {
if let Some(tree) = self.syntax_tree() {
let root = tree.root_node();
let range = range.start.to_offset(self)..range.end.to_offset(self);