Skip to content

Commit

Permalink
add state transition
Browse files Browse the repository at this point in the history
  • Loading branch information
hitesh-1997 committed Jan 10, 2025
1 parent cd86320 commit 4f6c6aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vscode/src/autoedits/analytics-logger/analytics-logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const validRequestTransitions = {
started: ['contextLoaded', 'discarded'],
contextLoaded: ['loaded', 'discarded'],
loaded: ['postProcessed', 'discarded'],
postProcessed: ['suggested'],
postProcessed: ['suggested', 'discarded'],
suggested: ['read', 'accepted', 'rejected'],
read: ['accepted', 'rejected'],
accepted: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ export class DefaultDecorator implements AutoEditsDecorator {
if (addedLinesInfo.length === 0) {
return { removedRangesInfo: removedRanges }
}
const oldLines = addedLinesInfo.map(info => this.editor.document.lineAt(info.afterLine))
const oldLines = addedLinesInfo
.filter(info => info.afterLine < this.editor.document.lineCount)
.map(info => this.editor.document.lineAt(info.afterLine))
const replacerCol = Math.max(...oldLines.map(line => line.range.end.character))
const startLine = Math.min(...oldLines.map(line => line.lineNumber))

Expand Down

0 comments on commit 4f6c6aa

Please sign in to comment.