aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 18:04:08 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 18:04:08 +0000
commitc9e42fcf245be16958dca6571e4bccc6c29199df (patch)
treecaa02f8086ad15fb6f884e56bc6a0231b203215f /crates/ra_editor/src/lib.rs
parent1c25bf05d714680c048d250a5d39e8a4c25f0c31 (diff)
parent695294bbb974cdbac136e260029403e90a17d953 (diff)
Merge #468
468: decouple ra_editor from other stuff r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_editor/src/lib.rs')
-rw-r--r--crates/ra_editor/src/lib.rs4
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
123pub 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)]
128mod tests { 124mod tests {
129 use ra_syntax::AstNode; 125 use ra_syntax::AstNode;