Skip to main content

Crate perl_symbol_table

Crate perl_symbol_table 

Source
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

§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.
SymbolReference
A reference to a symbol with usage context for LSP analysis.
SymbolTable
Comprehensive symbol table for Perl code analysis and LSP features.

Enums§

ScopeKind
Classification of lexical scope types in Perl.
SymbolKind
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.