pub enum EdgeBinder {
DefaultLeft,
DefaultRight,
PrecedingComments,
PrecedingDocComments,
TrailingComments,
PrecedingAllComments,
TrailingAllComments,
DoNotBindAnything,
BindFirstShebangWithWhitespaceOnly,
PrecedingAll,
TrailingAll,
}Expand description
Decides where an element edge lands inside a run of whitespace/comment tokens:
the result is an index into tokens (0 = before all of them, tokens.len() = after all).
Variants§
DefaultLeft
WhitespacesBinders.DEFAULT_LEFT_BINDER (= GREEDY_RIGHT_BINDER).
DefaultRight
WhitespacesBinders.DEFAULT_RIGHT_BINDER (= GREEDY_LEFT_BINDER).
PrecedingComments
PrecedingDocComments
TrailingComments
PrecedingAllComments
PRECEDING_ALL_COMMENTS_BINDER (AllCommentsBinder(isTrailing = false)).
TrailingAllComments
TRAILING_ALL_COMMENTS_BINDER (AllCommentsBinder(isTrailing = true)).
DoNotBindAnything
BindFirstShebangWithWhitespaceOnly
PrecedingAll
PRECEDING_ALL_BINDER (BindAll(isTrailing = false)).
TrailingAll
TRAILING_ALL_BINDER (BindAll(isTrailing = true)).
Implementations§
Source§impl EdgeBinder
impl EdgeBinder
pub fn get_edge_position<'t>( self, tokens: &[SyntaxKind], _at_stream_edge: bool, getter: &dyn Fn(usize) -> &'t str, ) -> usize
Trait Implementations§
Source§impl Clone for EdgeBinder
impl Clone for EdgeBinder
impl Copy for EdgeBinder
Source§impl Debug for EdgeBinder
impl Debug for EdgeBinder
impl Eq for EdgeBinder
Source§impl PartialEq for EdgeBinder
impl PartialEq for EdgeBinder
impl StructuralPartialEq for EdgeBinder
Auto Trait Implementations§
impl Freeze for EdgeBinder
impl RefUnwindSafe for EdgeBinder
impl Send for EdgeBinder
impl Sync for EdgeBinder
impl Unpin for EdgeBinder
impl UnsafeUnpin for EdgeBinder
impl UnwindSafe for EdgeBinder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more