You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPER_GUIDE.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1139,6 +1139,43 @@ guard that would fail before users see multi-hour indexing stalls.
1139
1139
1140
1140
Do not add mutable static caches, shared `StringBuilder` instances, reused `MatchCollection` enumerators, or singleton scanner state to extractor code. If a future extractor needs cross-call memoization, use an explicit thread-safe collection and add a targeted parallel regression test that proves deterministic output under concurrent calls.
1141
1141
1142
+
### C# top-level synthetic scope contract
1143
+
1144
+
C# extractor contract version 13 persists an actionable file-scoped symbol for
1145
+
compilation units with executable top-level statements. The symbol uses
1146
+
`kind=function`, `sub_kind=top_level_scope`, and `name=<top-level>`; public
1147
+
results derive `is_synthetic=true`, qualify the identity as
1148
+
`<indexed-path>::<top-level>`, and emit an `id:<symbol-id>@g:<generation>`
1149
+
selector. Selectors are valid only for their active index generation and are
1150
+
resolved by symbol id, so identical top-level programs in different files do
1151
+
not share callee identity.
1152
+
1153
+
Detection runs after container assignment. It excludes declaration-covered
1154
+
ranges, imports with any legal whitespace between their C# keywords, comments,
1155
+
directives, and assembly/module metadata, recognizes
1156
+
both `using var` and explicitly typed `using Type value = ...` declarations as
1157
+
executable rather than import directives, then uses the first and last uncovered
1158
+
executable lines as both source and body bounds.
1159
+
A top-level local function remains source-declared and containerless; its own
1160
+
narrower span owns references inside the function, while a synthetic range may
1161
+
cross it when executable statements occur on both sides. When a local function
1162
+
and an outside statement share one line, declaration columns retain the local
1163
+
function while the outside statement belongs to the synthetic scope. Reference extraction
1164
+
uses the synthetic symbol's persisted id for otherwise containerless calls in
1165
+
that body. The synthetic scope is not a documented declaration, so an XML-doc
1166
+
comment before a top-level statement does not attach to it. `outline`,
1167
+
coordinate `inspect`, and identity-scoped `callees` must
1168
+
therefore navigate the same row; both CLI and MCP `callees` resolve its selector
1169
+
by persisted symbol id. Unused-symbol list and count queries exclude this
1170
+
synthetic entry point because it is executable infrastructure, not removable
1171
+
dead code. Selector-scoped callee queries fail closed when a readable legacy
1172
+
schema lacks the persisted source-identity column. If a stored C# extractor version predates this
1173
+
contract or is missing, and no synthetic row is available, outline reports
1174
+
`top_level_symbol_support=reindex_required` plus a typed limitation instead of
1175
+
claiming support. A normal full index re-extracts unchanged C# files before it
1176
+
stamps this contract, so the documented reindex remediation repairs unstamped
1177
+
legacy databases without requiring `--rebuild`.
1178
+
1142
1179
### Symbol Kind Taxonomy
1143
1180
1144
1181
`symbols.kind`, `symbols.container_kind`, and `symbol_references.container_kind` use the public symbol kind taxonomy below. New extractors must register new kind values in `SymbolKindCatalog` before writing them so schema checks, writer validation, CLI filters, and downstream JSON consumers stay aligned.
Copy file name to clipboardExpand all lines: TESTING_GUIDE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -561,6 +561,7 @@ Candidate-ordered parallel-index recovery tests must prove that the fatal result
561
561
do not allocate production-sized 50k/20k inputs to test these contracts (#4620).
562
562
- Broad extractor `*CompletesWithinPracticalBudget` runaway guards run only on the primary `net8.0` test target. Keep focused functional extractor tests cross-target, but do not duplicate the large-fixture budget guards across every target framework unless the guard is specifically proving a target-framework-specific contract.
563
563
- C# reflection-name extraction coverage keeps literal, constant-concatenation, dynamic, comment, and string-decoy cases in one source fixture so those parser boundaries share one symbol/reference pass.
564
+
- C# top-level synthetic-scope coverage (#5164) keeps the 10-line entry-point, local-function ownership including an outside call on the same line, typed using declarations, bounded extraction, legal-whitespace import directives, and all import/metadata/comment/directive/type/explicit-`Main` negatives in focused extractor fixtures. CLI reader fixtures own coordinate selection, cross-file selector isolation, caller/callee round-tripping, legacy source-identity fail-closed behavior, script-scope identity parity, compact output, stale-contract guidance, and unused list/count exclusion; the MCP assertion owns selector-to-`callees` round-tripping as well as transport naming parity. Keep full plus incremental no-op/change/add/rename/delete/no-op persistence and unstamped-C# upgrade re-extraction in `IndexCommandRunnerIssue5164Tests.cs` so lifecycle coverage uses real index reconciliation instead of direct database fixtures.
564
565
- C# BOM extraction keeps a simple leading-BOM import fixture plus one mixed-newline fixture that simultaneously covers leading and mid-file BOM handling across CRLF, bare CR, and LF boundaries; do not repeat separate extraction passes for newline subsets already present in the mixed fixture.
565
566
- C# lambda-capture coverage keeps positive enclosing-local capture, parameter shadowing, and same-named-method isolation in one source fixture; a single capture assertion proves the negative regions did not leak.
566
567
- C# static-lambda declaration regression coverage keeps stateful, typed/untyped, explicit-return, both async-modifier orders, Unicode/escaped-identifier, multiline, nested, and argument-position forms in one extractor pass. Preserve real static members/local functions, including generic, constructor, explicit-interface, and verbatim-type-name forms, and an assigned-lambda range/container assertion in that fixture, plus one CLI `symbols` corpus fixture for phantom-name checks (#4830).
@@ -1685,6 +1686,7 @@ dotnet test --filter "FullyQualifiedName~GitHelperTests"
0 commit comments