diff options
Diffstat (limited to 'crates/ra_editor/src/lib.rs')
-rw-r--r-- | crates/ra_editor/src/lib.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/crates/ra_editor/src/lib.rs b/crates/ra_editor/src/lib.rs index 6731260a3..5a6af19b7 100644 --- a/crates/ra_editor/src/lib.rs +++ b/crates/ra_editor/src/lib.rs | |||
@@ -120,10 +120,6 @@ pub fn syntax_tree(file: &SourceFile) -> String { | |||
120 | ::ra_syntax::utils::dump_tree(file.syntax()) | 120 | ::ra_syntax::utils::dump_tree(file.syntax()) |
121 | } | 121 | } |
122 | 122 | ||
123 | pub fn find_node_at_offset<N: AstNode>(syntax: &SyntaxNode, offset: TextUnit) -> Option<&N> { | ||
124 | find_leaf_at_offset(syntax, offset).find_map(|leaf| leaf.ancestors().find_map(N::cast)) | ||
125 | } | ||
126 | |||
127 | #[cfg(test)] | 123 | #[cfg(test)] |
128 | mod tests { | 124 | mod tests { |
129 | use ra_syntax::AstNode; | 125 | use ra_syntax::AstNode; |