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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Code Review: Fixed a bug where applying a fix did not update the positions of other issues in the same file."
}
1 change: 0 additions & 1 deletion packages/core/src/codewhisperer/commands/basicCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ export const applySecurityFix = Commands.declare(
new vscode.Range(document.lineAt(0).range.start, document.lineAt(document.lineCount - 1).range.end),
updatedContent
)
SecurityIssueProvider.instance.disableEventHandler()
const isApplied = await vscode.workspace.applyEdit(edit)
if (isApplied) {
void document.save().then((didSave) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export class SecurityIssueProvider {
}

private _issues: AggregatedCodeScanIssue[] = []
private _disableEventHandler: boolean = false
public get issues() {
return this._issues
}
Expand All @@ -21,19 +20,11 @@ export class SecurityIssueProvider {
this._issues = issues
}

public disableEventHandler() {
this._disableEventHandler = true
}

public handleDocumentChange(event: vscode.TextDocumentChangeEvent) {
// handleDocumentChange function may be triggered while testing by our own code generation.
if (!event.contentChanges || event.contentChanges.length === 0) {
return
}
if (this._disableEventHandler) {
this._disableEventHandler = false
return
}
const { changedRange, lineOffset } = event.contentChanges.reduce(
(acc, change) => ({
changedRange: acc.changedRange.union(change.range),
Expand Down
Loading