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.
///

View File

@ -37,13 +37,14 @@ use ra_text_edit::AtomTextEdit;
use crate::syntax_node::GreenNode;
pub use crate::{
algo::InsertPosition,
ast::{AstNode, AstToken},
parsing::{classify_literal, tokenize, Token},
ptr::{AstPtr, SyntaxNodePtr},
syntax_error::{Location, SyntaxError, SyntaxErrorKind},
syntax_node::{
Direction, InsertPosition, NodeOrToken, SyntaxElement, SyntaxNode, SyntaxToken,
SyntaxTreeBuilder, WalkEvent,
Direction, NodeOrToken, SyntaxElement, SyntaxNode, SyntaxToken, SyntaxTreeBuilder,
WalkEvent,
},
};
pub use ra_parser::SyntaxKind;

View File

@ -17,14 +17,6 @@ use crate::{
pub use rowan::WalkEvent;
pub(crate) use rowan::{GreenNode, GreenToken};
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum InsertPosition<T> {
First,
Last,
Before(T),
After(T),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum RustLanguage {}
impl Language for RustLanguage {