minor, move type
This commit is contained in:
parent
c9cfd57eea
commit
62be91b82d
@ -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.
|
||||
///
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user