Skip to main content

Module signatures

Module signatures 

Source
Expand description

Loading of signature files (.sig) for stdlib and API definitions.

Use load_signatures_from_dir or default_signature_roots to obtain parsed signature roots for DocumentAnalysis and [analyze_with_signatures].

Constants§

DEFAULT_SIGNATURES_DIR
Default directory for .sig files when no explicit path is given. Override with env var LEEKSCRIPT_SIGNATURES_DIR.

Functions§

build_sig_definition_locations
Build a map from function/global name to (path, 0-based line) for one parsed .sig file.
default_signature_roots
If no signature path was given, use default locations: LEEKSCRIPT_SIGNATURES_DIR env var if set, else examples/signatures, else leekscript-rs/examples/signatures (when run from workspace root). Returns empty vec if no directory is found.
default_signature_roots_with_locations
Like default_signature_roots but also returns a map from function/global name to (path, 0-based line) for hover/definition links into .sig files.
load_signatures_from_dir
Load signature AST roots from a directory (all *.sig files).
load_signatures_from_dir_with_locations
Load signature roots and a map from function/global name to (path, 0-based line) for link resolution.