-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Track strings to calculate codeSurvivalRate #2430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,13 @@ export interface EditSurvivalResult { | |
| * See ArcTracker. | ||
| */ | ||
| readonly arc?: number; | ||
|
|
||
| /** | ||
| * Text states for each edit region | ||
| */ | ||
| readonly textBeforeAiEdits?: string[]; | ||
| readonly textAfterAiEdits?: string[]; | ||
| readonly textAfterUserEdits?: string[]; | ||
|
Comment on lines
+31
to
+36
|
||
| } | ||
|
|
||
| export class EditSurvivalReporter { | ||
|
|
@@ -74,6 +81,8 @@ export class EditSurvivalReporter { | |
| this._initialBranchName = this._gitService.activeRepository.get()?.headBranchName; | ||
|
|
||
| // This aligns with github inline completions | ||
| this._reportAfter(0); | ||
| this._reportAfter(5 * 1000); | ||
| this._reportAfter(30 * 1000); | ||
| this._reportAfter(120 * 1000); | ||
| this._reportAfter(300 * 1000); | ||
|
|
@@ -104,7 +113,6 @@ export class EditSurvivalReporter { | |
|
|
||
| const currentBranch = this._getCurrentBranchName(); | ||
| const didBranchChange = currentBranch !== this._initialBranchName; | ||
|
|
||
| this._sendTelemetryEvent({ | ||
| telemetryService: this._telemetryService, | ||
| fourGram: survivalRate.fourGram, | ||
|
|
@@ -113,6 +121,9 @@ export class EditSurvivalReporter { | |
| didBranchChange, | ||
| currentFileContent: this._document.getText(), | ||
| arc: this._arcTracker?.getAcceptedRestrainedCharactersCount(), | ||
| textBeforeAiEdits: survivalRate.textBeforeAiEdits, | ||
| textAfterAiEdits: survivalRate.textAfterAiEdits, | ||
| textAfterUserEdits: survivalRate.textAfterUserEdits, | ||
| }); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,13 +36,17 @@ export class EditSurvivalTracker { | |||||||||||||||||||||
| * fourGram: Number between 0 (no edits survived) and 1 (all edits survived). | ||||||||||||||||||||||
| * noRevert: Number between 0 (the text after user edits equals the text before the AI edits) and 1 (the text after user edits does not revert any text to the initial state) | ||||||||||||||||||||||
|
Comment on lines
36
to
37
|
||||||||||||||||||||||
| * fourGram: Number between 0 (no edits survived) and 1 (all edits survived). | |
| * noRevert: Number between 0 (the text after user edits equals the text before the AI edits) and 1 (the text after user edits does not revert any text to the initial state) | |
| * Computes survival scores and text snapshots for tracked edits. | |
| * | |
| * @returns An object containing: | |
| * - fourGram: Number between 0 (no edits survived) and 1 (all edits survived). | |
| * - noRevert: Number between 0 (the text after user edits equals the text before the AI edits) and 1 (the text after user edits does not revert any text to the initial state) | |
| * - textBeforeAiEdits: Array of text strings before AI edits were applied for each edit region. | |
| * - textAfterAiEdits: Array of text strings after AI edits were applied for each edit region. | |
| * - textAfterUserEdits: Array of text strings after user edits were applied for each edit region. |
Uh oh!
There was an error while loading. Please reload this page.