diff options
Diffstat (limited to 'crates/ra_syntax/src/algo.rs')
-rw-r--r-- | crates/ra_syntax/src/algo.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/algo.rs b/crates/ra_syntax/src/algo.rs index 6bb46b021..ecd42c133 100644 --- a/crates/ra_syntax/src/algo.rs +++ b/crates/ra_syntax/src/algo.rs | |||
@@ -5,8 +5,8 @@ use std::ops::RangeInclusive; | |||
5 | use itertools::Itertools; | 5 | use itertools::Itertools; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | AstNode, Direction, InsertPosition, NodeOrToken, SourceFile, SyntaxElement, SyntaxNode, | 8 | AstNode, Direction, NodeOrToken, SourceFile, SyntaxElement, SyntaxNode, SyntaxNodePtr, |
9 | SyntaxNodePtr, SyntaxToken, TextRange, TextUnit, | 9 | SyntaxToken, TextRange, TextUnit, |
10 | }; | 10 | }; |
11 | 11 | ||
12 | pub use rowan::TokenAtOffset; | 12 | pub use rowan::TokenAtOffset; |
@@ -61,6 +61,14 @@ pub fn find_covering_element(root: &SyntaxNode, range: TextRange) -> SyntaxEleme | |||
61 | root.covering_element(range) | 61 | root.covering_element(range) |
62 | } | 62 | } |
63 | 63 | ||
64 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] | ||
65 | pub enum InsertPosition<T> { | ||
66 | First, | ||
67 | Last, | ||
68 | Before(T), | ||
69 | After(T), | ||
70 | } | ||
71 | |||
64 | /// Adds specified children (tokens or nodes) to the current node at the | 72 | /// Adds specified children (tokens or nodes) to the current node at the |
65 | /// specific position. | 73 | /// specific position. |
66 | /// | 74 | /// |