minor, move type

This commit is contained in:
Aleksey Kladov 2019-07-21 13:08:32 +03:00
parent c9cfd57eea
commit 62be91b82d
3 changed files with 13 additions and 12 deletions

View file

@ -5,8 +5,8 @@ use std::ops::RangeInclusive;
use itertools::Itertools;
use crate::{
AstNode, Direction, InsertPosition, NodeOrToken, SourceFile, SyntaxElement, SyntaxNode,
SyntaxNodePtr, SyntaxToken, TextRange, TextUnit,
AstNode, Direction, NodeOrToken, SourceFile, SyntaxElement, SyntaxNode, SyntaxNodePtr,
SyntaxToken, TextRange, TextUnit,
};
pub use rowan::TokenAtOffset;
@ -61,6 +61,14 @@ pub fn find_covering_element(root: &SyntaxNode, range: TextRange) -> SyntaxEleme
root.covering_element(range)
}
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum InsertPosition<T> {
First,
Last,
Before(T),
After(T),
}
/// Adds specified children (tokens or nodes) to the current node at the
/// specific position.
///