Skip to content

Commit 083168f

Browse files
committed
fix merge issue
1 parent 30c0f09 commit 083168f

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
@@ -20,7 +20,6 @@ export class EditDecorationManager {
2020
private currentRemovedCodeDecorations: vscode.DecorationOptions[] = []
2121
private acceptHandler: (() => void) | undefined
2222
private rejectHandler: (() => void) | undefined
23-
private disposables: vscode.Disposable[] = []
2423

2524
constructor() {
2625
this.imageDecorationType = vscode.window.createTextEditorDecorationType({
@@ -30,6 +29,8 @@ export class EditDecorationManager {
3029
this.removedCodeDecorationType = vscode.window.createTextEditorDecorationType({
3130
backgroundColor: 'rgba(255, 0, 0, 0.2)',
3231
})
32+
33+
this.registerCommandHandlers()
3334
}
3435

3536
/**
@@ -136,7 +137,6 @@ export class EditDecorationManager {
136137
originalCodeHighlightRanges: Array<{ line: number; start: number; end: number }>
137138
): void {
138139
// Clear any existing decorations
139-
this.registerCommandHandlers()
140140
this.clearDecorations(editor)
141141

142142
// Set context to enable the Tab key handler
@@ -180,30 +180,24 @@ export class EditDecorationManager {
180180
*/
181181
public registerCommandHandlers(): void {
182182
// Register Tab key handler for accepting suggestion
183-
const acceptDisposable = vscode.commands.registerCommand('aws.amazonq.inline.acceptEdit', () => {
183+
vscode.commands.registerCommand('aws.amazonq.inline.acceptEdit', () => {
184184
if (this.acceptHandler) {
185185
this.acceptHandler()
186186
}
187187
})
188-
this.disposables.push(acceptDisposable)
189188

190189
// Register Esc key handler for rejecting suggestion
191-
const rejectDisposable = vscode.commands.registerCommand('aws.amazonq.inline.rejectEdit', () => {
190+
vscode.commands.registerCommand('aws.amazonq.inline.rejectEdit', () => {
192191
if (this.rejectHandler) {
193192
this.rejectHandler()
194193
}
195194
})
196-
this.disposables.push(rejectDisposable)
197195
}
198196

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

0 commit comments

Comments
 (0)