mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 07:37:30 +00:00
minor, move type
This commit is contained in:
parent
c9cfd57eea
commit
62be91b82d
3 changed files with 13 additions and 12 deletions
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue