pub struct SexpOptions {
pub include_trivia: bool,
pub kind_to_name: Option<fn(u16) -> Option<&'static str>>,
pub max_token_len: Option<usize>,
}Expand description
Options for S-expression output.
Fields§
§include_trivia: boolInclude trivia tokens in the output.
kind_to_name: Option<fn(u16) -> Option<&'static str>>If set, use this to map SyntaxKind to a readable name (e.g. “ROOT”, “EXPR”).
Otherwise numeric kind is used.
max_token_len: Option<usize>Truncate token text to this length (with “…”); None = no truncation.
Implementations§
Source§impl SexpOptions
impl SexpOptions
Sourcepub fn semantic_only() -> SexpOptions
pub fn semantic_only() -> SexpOptions
Structure and semantic tokens only; no trivia.
Sourcepub fn full() -> SexpOptions
pub fn full() -> SexpOptions
Full tree including trivia.
Trait Implementations§
Source§impl Clone for SexpOptions
impl Clone for SexpOptions
Source§fn clone(&self) -> SexpOptions
fn clone(&self) -> SexpOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SexpOptions
impl Debug for SexpOptions
Source§impl Default for SexpOptions
impl Default for SexpOptions
Source§fn default() -> SexpOptions
fn default() -> SexpOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SexpOptions
impl RefUnwindSafe for SexpOptions
impl Send for SexpOptions
impl Sync for SexpOptions
impl Unpin for SexpOptions
impl UnsafeUnpin for SexpOptions
impl UnwindSafe for SexpOptions
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