Expand description
Symbol table and scope management for Perl LSP.
This crate provides the core data structures for tracking Perl symbols, references, and scopes for IDE features like go-to-definition, find-all-references, and semantic highlighting.
§Core Types
Symbol- A symbol definition with metadataSymbolReference- A reference to a symbolSymbolTable- Central registry of symbols and referencesScope- A lexical scope boundaryScopeKind- Classification of scope types
§Usage
use perl_symbol_table::{Symbol, SymbolTable, Scope, ScopeKind, ScopeId};
use perl_symbol_types::SymbolKind;
use perl_position_tracking::SourceLocation;
// Create a symbol table
let mut table = SymbolTable::new();
// Add a symbol
let symbol = Symbol {
name: "foo".to_string(),
qualified_name: "main::foo".to_string(),
kind: SymbolKind::Subroutine,
location: SourceLocation { start: 0, end: 10 },
scope_id: 0,
declaration: None,
documentation: Some("A function".to_string()),
attributes: vec![],
};
table.add_symbol(symbol);Structs§
- Scope
- A lexical scope in Perl code with hierarchical symbol visibility.
- Symbol
- A symbol definition in Perl code with comprehensive metadata.
- Symbol
Reference - A reference to a symbol with usage context for LSP analysis.
- Symbol
Table - Comprehensive symbol table for Perl code analysis and LSP features.
Enums§
- Scope
Kind - Classification of lexical scope types in Perl.
- Symbol
Kind - Unified Perl symbol classification for LSP tooling.
- VarKind
- Variable sigil classification for Perl’s three primary container types.
Type Aliases§
- ScopeId
- Unique identifier for a scope.