Expand description
C# and TypeScript declaration and reference extraction.
Structs§
- DefRecord
- Represents
DefRecord. - Extension
Method - One
extensionMethodsentry. Field order (name,thisType,arityMin,arityMax,thisArgs) is significant: it fixes the serialized field order. - Extraction
- Represents
Extraction. - Fact
- One receiver fact: the declared type NAME plus that type’s top-level
type-argument descriptors when it carried any. Two facts agree only when
BOTH halves do, so
Box<int> aandBox<string> ain sibling blocks conflict exactly like two different type names would. - Name
Record - One declared name and the line its own NAME TOKEN sits on. Deliberately
not the declaration node’s start row: a member’s span begins
at its attribute list, so an attributed member would point a reader at the
[line instead of the line carrying the name they searched for. - RefRecord
- Represents
RefRecord. - TsBinding
- One local name an import statement binds, and the export it names in the
source module.
importedis"default"for a default clause and"*"for a namespace clause (or a whole-modulerequire). - TsFile
Extraction - One TS/JS file’s whole contribution, off ONE parse: its purpose (when the
file exports anything) and its reference fragment (always), from the same
tree. A parse failure yields
None, leaving the file out of BOTH outputs. - TsFragment
- The whole per-file fragment, in serialization order:
defs,imports,reexports,refs, thendefaultwhen the file has one. Thets: 1tag itself lives on the serde type (graph::TsFragment), which this converts into – exactly asextract::Extractionconverts intograph::Fragment. - TsFragment
Def - One exported top-level declaration, in the shape the fragment serializes:
name,kind,line, in that order. - TsImport
- Represents
TsImport. - TsReexport
- Represents
TsReexport. - TsReexport
Name export { A as B } from 'm're-exports A under the name B:exportedis what a consumer of THIS file imports,importedis what the source module declares.- TsRef
- One recorded reference. Field order (
kind,name, optionalmember,line) is significant.
Enums§
- Using
Record - Represents
UsingRecord.
Functions§
- compose_
hybrid_ ts_ purpose - Compose a leading-comment hybrid purpose prefix.
comment_textiswalk::default_purpose_detailed’s output (already ≤100 chars); the SAME globaltruncate()every other purpose bucket uses applies to the combined string over the RAW (pre-truncation) segment join, so the AST tail fills the remainder under the 200-char cap instead of compounding two independent truncations. - extract
- Extract both outputs from one parse of C#
source: the file’s purpose signature and its graph fragment (defs, usings, refs, names). - extract_
ts_ file - Parses TypeScript-family source into its optional purpose and graph fragment.
- extract_
ts_ fragment - Extract the reference fragment (imports, exports, refs) from a parsed TS/JS program node.
- extract_
ts_ purpose - Extract a one-line purpose signature from TS/JS source, or
Nonewhen the file exports nothing or fails to parse (in which case the caller falls back to the heuristic purpose).grammarcomes fromparse::ts_grammar_for. PURE – no heuristic or disk access; seeextract_ts_purpose_with_heuristicbelow for the hybrid-aware entry point thatmapcmd.rsandrun_extract_dumpactually use. - extract_
ts_ purpose_ with_ heuristic - Hybrid-aware entry point used by
mapcmd.rs’s per-file dispatch. ReturnsNoneexactly whenextract_ts_purposewould (zero-export or parse failure) – a zero-export file has no purpose to prefix. When there IS a purpose,root/relare used ONLY to askwalk::default_purpose_detailedwhether the heuristic’s match for this file came from the comment-marker branch; if so, the comment text is prefixed viacompose_hybrid_ts_purposebefore the final truncate, else the plain (unprefixed) purpose is returned exactly asextract_ts_purposewould produce it. - extraction_
to_ json - Serializes a C# extraction as JSON.
- run_
extract_ dump - Extracts the C# file at
pathand prints the extraction as JSON. - ts_
extraction_ to_ json - Render a TS/JS file’s dump-extract JSON. The reader expects
{purpose, defs, usings, refs, names}, and a TS fragment carries nousingsand nonames, so both keys are dropped – the dump is a three-key object.