mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 07:44:33 +01:00
0035fb2e7e
PR #322438 allowed splitting one model-sent diff-patch into multiple LineReplacements, breaking the invariant that the Nth shown edit corresponded to the Nth model patch (progressive ghost-text reveal already broke it too). As a result, telemetry could no longer attribute a served edit back to the model patch it came from. Stamp a 0-based `patchIndex` on each Patch in extractEdits, thread it through the streamed-edit -> cache -> telemetry pipeline, and emit a new `sourcePatchIndex` telemetry measurement. All fragments produced from the same patch (diff splitting or ghost-text early + continuation) share the index. The field is optional since the edit-window and INSERT response formats have no patch structure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>