Expand description
Symbol identity: the one place that knows how a SymbolId is spelled.
Every adapter mints ids for the symbols it finds and, during resolution,
rewrites placeholder ids into real ones. Both halves of that contract used to
be duplicated per adapter, which let the spellings drift apart — the
TypeScript adapter separated placeholder fields with | while the newer
adapters used ::, a separator that also occurs inside Rust and C++ paths
and therefore could not be parsed back out unambiguously.
§Resolved ids
relative/file/path.rs::SymbolName::kind — stable, persisted to the store,
and the only form that may appear in a graph node.
§Placeholder ids
Emitted by extractors, consumed by resolvers, and never persisted. They use
| as a field separator because | cannot occur in an identifier or a
module path in any language we parse:
unresolved_import|<module>|<symbol>— an import awaiting module resolutionunresolved_local_type|<type>— a type reference awaiting local lookup
external_package_id is the exception: it survives resolution as a real
graph node, because an edge to a third-party package is a fact worth keeping.
Constants§
- IMPORT_
ALL - The
symbolvalue denoting “the module itself”, not a member of it.
Functions§
- external_
package_ id - The id of the shared node representing a third-party package.
- is_
external_ package - True if
idnames an external package node. - is_
placeholder - True if
idis any placeholder, i.e. resolution did not finish for it. - kind_
suffix - The trailing component of a symbol id, identifying what kind of thing it is.
- make_
symbol_ id - Mint the canonical id for a symbol defined at
file. - module_
symbol - Build the synthetic per-file module symbol.
- module_
symbol_ id - The id of the synthetic per-file module symbol.
- parse_
external_ package_ id - Recover the package name from an external package id.
- parse_
symbol_ id - Split a resolved symbol id back into
(file, name, kind_suffix). - parse_
unresolved_ import_ id - Recover
(module, symbol)from an unresolved-import placeholder. - parse_
unresolved_ local_ type_ id - Recover the type name from a local-type placeholder.
- symbol_
name_ of - The symbol name component of a resolved id, if it is one.
- unresolved_
import_ id - Placeholder for an import of
symbolfrommodule, pending resolution. - unresolved_
local_ type_ id - Placeholder for a reference to a type that must be looked up in file scope.