pub struct Symbol {
pub name: String,
pub qualified_name: String,
pub kind: SymbolKind,
pub location: ByteSpan,
pub scope_id: usize,
pub declaration: Option<String>,
pub documentation: Option<String>,
pub attributes: Vec<String>,
}Expand description
Symbol extraction, table, and reference types for navigation. A symbol definition in Perl code with comprehensive metadata for Index/Navigate workflows.
Represents a symbol definition with full context including scope, package qualification, and documentation for LSP features like go-to-definition, hover, and workspace symbols.
§Performance Characteristics
- Memory: ~128 bytes per symbol (optimized for large codebases)
- Lookup time: O(1) via hash table indexing
- Scope resolution: O(log n) with scope hierarchy
§Perl Language Semantics
- Package qualification:
Package::symbolvs baresymbol - Scope rules: Lexical (
my), package (our), dynamic (local), persistent (state) - Symbol types: Variables (
$,@,%), subroutines, packages, constants - Attribute parsing:
:shared,:method,:lvalueand custom attributes
Fields§
§name: StringSymbol name (without sigil for variables)
qualified_name: StringFully qualified name with package prefix
kind: SymbolKindClassification of symbol type
location: ByteSpanSource location of symbol definition
scope_id: usizeLexical scope identifier for visibility rules
declaration: Option<String>Variable declaration type (my, our, local, state)
documentation: Option<String>Extracted POD or comment documentation
attributes: Vec<String>Perl attributes applied to the symbol
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnsafeUnpin for Symbol
impl UnwindSafe for Symbol
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