Skip to content

Commit 824ab91

Browse files
committed
fix merge issue
1 parent e326dbe commit 824ab91

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/amazonq/src/app/inline/EditRendering/displayImage.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export class EditDecorationManager {
2121
private currentRemovedCodeDecorations: vscode.DecorationOptions[] = []
2222
private acceptHandler: (() => void) | undefined
2323
private rejectHandler: (() => void) | undefined
24-
private disposables: vscode.Disposable[] = []
2524

2625
constructor() {
2726
this.imageDecorationType = vscode.window.createTextEditorDecorationType({
@@ -31,6 +30,8 @@ export class EditDecorationManager {
3130
this.removedCodeDecorationType = vscode.window.createTextEditorDecorationType({
3231
backgroundColor: 'rgba(255, 0, 0, 0.2)',
3332
})
33+
34+
this.registerCommandHandlers()
3435
}
3536

3637
/**
@@ -137,7 +138,6 @@ export class EditDecorationManager {
137138
originalCodeHighlightRanges: Array<{ line: number; start: number; end: number }>
138139
): void {
139140
// Clear any existing decorations
140-
this.registerCommandHandlers()
141141
this.clearDecorations(editor)
142142

143143
// Set context to enable the Tab key handler
@@ -181,30 +181,24 @@ export class EditDecorationManager {
181181
*/
182182
public registerCommandHandlers(): void {
183183
// Register Tab key handler for accepting suggestion
184-
const acceptDisposable = vscode.commands.registerCommand('aws.amazonq.inline.acceptEdit', () => {
184+
vscode.commands.registerCommand('aws.amazonq.inline.acceptEdit', () => {
185185
if (this.acceptHandler) {
186186
this.acceptHandler()
187187
}
188188
})
189-
this.disposables.push(acceptDisposable)
190189

191190
// Register Esc key handler for rejecting suggestion
192-
const rejectDisposable = vscode.commands.registerCommand('aws.amazonq.inline.rejectEdit', () => {
191+
vscode.commands.registerCommand('aws.amazonq.inline.rejectEdit', () => {
193192
if (this.rejectHandler) {
194193
this.rejectHandler()
195194
}
196195
})
197-
this.disposables.push(rejectDisposable)
198196
}
199197

200198
/**
201199
* Disposes resources
202200
*/
203201
public dispose(): void {
204-
for (const disposable of this.disposables) {
205-
disposable.dispose()
206-
}
207-
this.disposables = []
208202
this.imageDecorationType.dispose()
209203
this.removedCodeDecorationType.dispose()
210204
}

0 commit comments

Comments
 (0)