Expand description
Projection layer: derives stable, reusable symbol-bearing views from the Perl AST.
This crate sits at the seam between the syntax model (perl-ast) and IDE
features (semantic analyzer, workspace index, navigation, rename, workspace
symbols, call hierarchy). It converts raw AST nodes into well-typed
projection structs that consumers can work with without re-implementing
per-node pattern matching.
§Design goals
- No
perl-parser-coredependency — depends only onperl-ast,perl-position-tracking, andperl-symbol-types. - Single extraction pass —
extract_symbol_declswalks the entire tree once and returns all declaration sites. - MVP scope — Phase 2a ships
SymbolDeclonly.SymbolRefandCallSitewill follow in later phases.
§Quick start
ⓘ
use perl_symbol_surface::extract_symbol_decls;
// `ast` is a `perl_ast::Node` produced by the parser
let decls = extract_symbol_decls(&ast, Some("MyPackage"));
for d in &decls {
println!("{} {:?} @ {:?}", d.qualified_name, d.kind, d.full_span);
}Re-exports§
pub use decl::SymbolDecl;pub use decl::extract_symbol_decls;
Modules§
- decl
SymbolDecl— a projected declaration site derived from the Perl AST.