pub struct SemanticToken {
pub location: ByteSpan,
pub token_type: SemanticTokenType,
pub modifiers: Vec<SemanticTokenModifier>,
}Expand description
A semantic token with type and modifiers for LSP syntax highlighting.
Represents a single semantic unit in Perl source code with precise location and rich type information for enhanced editor experience.
§Performance Characteristics
- Memory: ~32 bytes per token (optimized for large files)
- Serialization: Direct LSP protocol mapping
- Batch processing: Efficient delta updates for incremental parsing
§LSP Workflow Integration
Core component in Parse → Index → Navigate → Complete → Analyze pipeline for real-time syntax highlighting with ≤1ms update latency.
Fields§
§location: ByteSpanSource location of the token
token_type: SemanticTokenTypeSemantic classification of the token
modifiers: Vec<SemanticTokenModifier>Additional modifiers for enhanced highlighting
Trait Implementations§
Source§impl Clone for SemanticToken
impl Clone for SemanticToken
Source§fn clone(&self) -> SemanticToken
fn clone(&self) -> SemanticToken
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 moreAuto Trait Implementations§
impl Freeze for SemanticToken
impl RefUnwindSafe for SemanticToken
impl Send for SemanticToken
impl Sync for SemanticToken
impl Unpin for SemanticToken
impl UnsafeUnpin for SemanticToken
impl UnwindSafe for SemanticToken
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