@wrongstack/tools 0.299.0 → 0.300.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,25 @@
1
+ /**
2
+ * Rust source symbol extraction.
3
+ *
4
+ * Extracts fn, struct, enum, trait, impl, type, const, static and mod with
5
+ * line-anchored regexes. Dependency edges do not come from here — `use` and
6
+ * `mod` declarations are read by `import-extractor.ts` and resolved against the
7
+ * crate's `Cargo.toml` by `module-resolver.ts`.
8
+ *
9
+ * ### Why there is no native `syn` parser
10
+ *
11
+ * There used to be a path that shelled out to a cargo subproject for real AST
12
+ * parsing. It resolved that subproject relative to `process.cwd()` — the
13
+ * *indexed project*, not the wstack installation — and the crate has never
14
+ * existed in this repository. So the branch was unreachable except in the one
15
+ * case where it must never fire: an indexed repository that happens to contain
16
+ * `tools/Cargo.toml`, where indexing would have run `cargo run` inside the
17
+ * user's checkout and written to `tools/syn-parser/src/input.rs`.
18
+ *
19
+ * Indexing reads a repository; it does not execute its build or write to its
20
+ * working tree. Reinstating native parsing means shipping the crate inside the
21
+ * wstack installation and resolving it from there — never from the scan target.
22
+ */
1
23
  import type { FileSymbols, SymbolLang } from './schema.js';
2
24
  export declare function parseSymbols(opts: {
3
25
  file: string;
@@ -95,6 +95,29 @@ export interface Ref {
95
95
  toId?: number | undefined;
96
96
  callType: CallType;
97
97
  line: number;
98
+ /**
99
+ * Language of the *referencing* file. Name resolution (`toName` → `toId`) is
100
+ * scoped to the referencing language's family, because a global name match
101
+ * links unrelated declarations across languages: `New`/`Get`/`String` in Go,
102
+ * `main`/`__init__` in Python and TS all collide otherwise.
103
+ */
104
+ lang?: SymbolLang | undefined;
105
+ /**
106
+ * Module specifier for `import` refs, verbatim as written in the source
107
+ * (`./foo.js`, `github.com/org/repo/pkg`, `os.path`, `crate::parser`,
108
+ * `com.example.Thing`). `undefined` for every other ref kind.
109
+ *
110
+ * This is deliberately separate from {@link toName}: TS/JS import refs put
111
+ * the imported *symbol* name in `toName` so the dead-code BFS can traverse
112
+ * module boundaries, which means `toName` cannot also carry the module path.
113
+ */
114
+ module?: string | undefined;
115
+ /**
116
+ * Target file an `import` ref resolves to, filled by the post-index module
117
+ * resolution pass. Absolute path, or `undefined` for external/unresolvable
118
+ * modules (stdlib, third-party dependencies).
119
+ */
120
+ toFile?: string | undefined;
98
121
  }
99
122
  /**
100
123
  * A call site — the enriched result of an incoming/outgoing calls query.
@@ -161,5 +184,5 @@ export interface CodeMapGraph {
161
184
  nodes: GraphNode[];
162
185
  edges: GraphEdge[];
163
186
  }
164
- export declare const SCHEMA_VERSION = 3;
187
+ export declare const SCHEMA_VERSION = 4;
165
188
  //# sourceMappingURL=schema.d.ts.map