Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,17 @@ The CLI normalizes exact-mode aliases and then rejects raw `--fts` combined with
`--exact`, `--exact-substring`, or `--token-boundary` before database dispatch.
This keeps query context and replay output on one matching model.

Search-result symbol attribution uses the primary match line and column when
the index provides declaration coordinates. C# positional-record properties
store the span from the component's first attribute or type token through its
identifier, so record keywords, record type names, base arguments, and body
members remain attributed to their actual enclosing symbols even when they
share a physical line with a positional component. Legacy rows without column
metadata retain the line-based fallback. Primary-match selection mirrors the
displayed focus line. Exact-source names are normalized with each result's
language when the query does not specify one, and raw source-column maps are
created only for lines whose escaped names actually change during normalization.

When you run:
```sql
SELECT f.path, c.start_line, c.content
Expand Down Expand Up @@ -5790,6 +5801,14 @@ CLI は exact-mode alias を正規化してから、raw `--fts` と `--exact`、
拒否します。これにより query context と replay output は 1 つの一致モデルだけを
保持します。

検索結果の囲みシンボルは、index が宣言座標を持つ場合、主要一致の行と列を使って
判定します。C# の位置 record property は、component の最初の attribute または型 token から
識別子までの範囲を保持します。これにより、同じ物理行に位置 component があっても、
record keyword、record 型名、base 引数、body member は実際の囲みシンボルに帰属します。
列 metadata がない旧 row では行ベースの fallback を維持します。主要一致の選択は表示される
focus 行と一致します。query が言語を指定しない場合、exact-source 名は各結果の言語で正規化し、
raw source の列 map は escaped name が正規化で実際に変わる行にだけ作成します。

以下のクエリを実行すると:
```sql
SELECT f.path, c.start_line, c.content
Expand Down
2 changes: 2 additions & 0 deletions TESTING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ Candidate-ordered parallel-index recovery tests must prove that the fatal result
- Argument-bearing parameter attributes share one method fixture for inline and line-broken declaration layouts.
- C# parameter and argument-list modifier coverage keeps multiline declaration and call sites for `out` / `ref` / `in` / `params` / `this` / `scoped`, multiple modifier fragments on one continuation line, final `)`-closing fragments, nested lambda arguments, `out var`, following generic types, ref returns, and ref structs in one extractor fixture. The indexed reader fixture separately proves raw `type_reference` queries exclude modifiers while resolved following-type edges remain graph-queryable.
- C# generic outline display coverage stays in one `DbReaderTests` fixture that shares extraction and reader setup across generic/non-generic overloads, extension/local/explicit-interface methods, nested generic tuple/nullable/array parameter types, constraints, overload-significant modifiers, qualified/concrete-name collisions, escaped and Unicode identifiers, and delimiters inside attribute/default literals. Keep the paired moved-line fixture byte-identical except for leading newlines, assert canonical names/paths remain unchanged, and retain one manually persisted incomplete-signature row for the old-index `Name@line` fallback (#4916).
- C# positional-record search attribution coverage pairs extractor coordinate assertions with one indexed reader fixture and one CLI fixture. Keep record keywords and type names, attributes and component types, base arguments, body members, same-line ordinary properties, multiline `record struct` components, normalized verbatim-identifier columns, language-unspecified exact grouping, multi-hit focus selection, focus line/column output, and symbol grouping in the shared contract; legacy symbols without component columns must retain line-based fallback behavior. When C# comment padding changes to preserve offsets, assert that Java/Kotlin record-component comments retain their established signatures (#5095).
- Direct and `global::` static type qualifiers share one C# fixture while retaining per-container reference assertions.
- Static qualifiers in using statements and field access share one consumer fixture and extraction pass.
- Namespace-qualified and Pascal-cased instance-member chains share one qualifier fixture with a rightmost static type reference, so positive and negative qualifier outcomes are checked after one parse.
Expand Down Expand Up @@ -1193,6 +1194,7 @@ dotnet test --filter "FullyQualifiedName~GitHelperTests"
C# の declaration boundary に関する regression では、extractor を直接呼ぶ fixture と、実 index に対する `symbols --exact-name` query を組み合わせてください。呼び出し・parameter の continuation と、正当な複数行 method、constructor、delegate、local function を同居させ、false positive の拒否と宣言 range の両方を観測可能にします。
C# の明示的 interface identity coverage では、method、property、event、indexer の extractor assertion と、永続化後の修飾 / 非修飾の完全一致 query、fold rewrite 検証、inspect / outline、LSP の definition / reference scope を組み合わせます。複数および継承 interface、generic arity、同名 public member に加え、明示的 interface qualifier と誤認してはならない修飾 return type を含めてください。
C# generic outline 表示の coverage は、generic / 非 generic overload、extension / local / explicit-interface method、nested generic の tuple / nullable / array parameter type、constraint、overload を区別する modifier、修飾型 / 具体型名との衝突、escaped / Unicode identifier、attribute / 既定値 literal 内の区切り文字を、抽出と reader setup を共有する1つの `DbReaderTests` fixture に維持します。line 移動を検証する対の fixture は先頭改行以外を同一にし、canonical name / path が不変であることを assertion に含め、旧 index の `Name@line` fallback 用に不完全 signature を手動永続化した row も1件残してください(#4916)。
C# の位置 record に対する検索帰属 coverage は、extractor の座標 assertion、1つの indexed reader fixture、1つの CLI fixture を組み合わせます。record keyword と型名、attribute と component 型、base 引数、body member、同一行の通常 property、複数行 `record struct` component、正規化された verbatim identifier の列、言語未指定の exact grouping、multi-hit の focus 選択、focus の行・列出力、symbol grouping を共通契約に維持します。component 列を持たない旧 symbol では行ベースの fallback を維持してください。C# の座標維持のために comment padding を変更する場合、Java/Kotlin の record component comment が既存 signature を維持することも assertion してください(#5095)。
C# の callable containment fixture では、block body の test method、local / nested local function、named lambda、expression-bodied member、nested type を同居させ、symbol の親と call reference の container の両方を検証してください。
C# switch expression が返す lambda の coverage では、`ReferenceExtractorCSharpTests` の直接 regression と `IndexCommandRunnerFullScanTests` の `--rebuild` graph fixture を組み合わせます。expression / block、parenthesized、multiline、nested switch、async、qualified / unqualified、non-lambda の各 arm を同居させ、raw call row、enclosing container、正確な location、callers / callees、完全な graph readiness、次行に arrow がある guarded / nested / contextual-keyword-designation pattern を含む positional pattern / enum の負例を検証してください(#5085)。
repository metadata の coverage は `SymbolExtractorRepositoryMetadataTests.cs` と `ReferenceExtractorRepositoryMetadataTests.cs` に置きます。TOML、JSON Lines、ignore / attributes、EditorConfig、`.rules`、application manifest の capability assertion を、保守的な local-path 抽出と malformed-record control に同期させてください。
Expand Down
25 changes: 25 additions & 0 deletions changelog.d/unreleased/5095.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
category: fixed
issues:
- 5095
affected:
- src/CodeIndex/Database/DbSearchReader.cs
- src/CodeIndex/Indexer/Symbols/SymbolExtractor.Contracts.cs
- src/CodeIndex/Indexer/Symbols/SymbolExtractor.RecordComponents.cs
- src/CodeIndex/Indexer/Symbols/SymbolExtractor.RecordComponents.Types.cs
- tests/CodeIndex.Tests/DbReaderSearchTests.cs
- tests/CodeIndex.Tests/IndexCommandRunnerFullScanTests.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSearchTests.cs
- tests/CodeIndex.Tests/SymbolExtractorCSharpTests.cs
- tests/CodeIndex.Tests/SymbolExtractorTests.cs
- DEVELOPER_GUIDE.md
- TESTING_GUIDE.md
---

## English

- **Search results now attribute C# positional records by line and column (#5095)** — record keywords and type names stay attached to the record type, positional components attach to their generated properties, and base arguments, body members, multiline `record struct` components, language-inferred normalized identifiers, multi-hit focus coordinates, ordinary same-line properties, and symbol grouping retain their precise owners.

## 日本語

- **C# の位置 record 検索が行と列に基づいて帰属するようになりました (#5095)** — record keyword と型名は record 型に帰属し続け、位置 component は対応する合成 property に帰属します。base 引数、body member、複数行 `record struct` component、結果の言語から推定して正規化した identifier、multi-hit の focus 座標、同一行の通常 property、symbol grouping も正確な所有者を維持します。
Loading
Loading