@@ -9,8 +9,6 @@ import { AutoDebugController, AutoDebugConfig } from './autoDebugController'
99import { ContextMenuProvider } from './ide/contextMenuProvider'
1010import { AutoDebugCodeActionsProvider } from './ide/codeActionsProvider'
1111import { Commands } from '../../shared/vscode/commands2'
12- import { focusAmazonQPanel } from '../../codewhispererChat/commands/registerCommands'
13- import { placeholder } from '../../shared/vscode/commands2'
1412
1513/**
1614 * Main entry point for Amazon Q Auto Debug feature.
@@ -126,33 +124,6 @@ export class AutoDebugFeature implements vscode.Disposable {
126124 }
127125 }
128126
129- /**
130- * Triggers Fix with Amazon Q - opens panel and starts the automated fixing process
131- */
132- private async triggerFixWithAmazonQ ( ) : Promise < void > {
133- this . logger . debug ( 'AutoDebugFeature: Triggering Fix with Amazon Q' )
134-
135- if ( ! this . autoDebugController ) {
136- this . logger . warn ( 'AutoDebugFeature: Auto debug controller not initialized' )
137- return
138- }
139-
140- try {
141- // Focus Amazon Q panel first
142- await focusAmazonQPanel . execute ( placeholder , 'autoDebug' )
143-
144- // Then trigger the automated fix process
145- await this . autoDebugController . fixAllProblemsInFile ( 10 )
146-
147- this . logger . debug ( 'AutoDebugFeature: Fix with Amazon Q process started' )
148- } catch ( error ) {
149- this . logger . error ( 'AutoDebugFeature: Error triggering Fix with Amazon Q: %s' , error )
150- void vscode . window . showErrorMessage (
151- `Failed to start Fix with Amazon Q: ${ error instanceof Error ? error . message : 'Unknown error' } `
152- )
153- }
154- }
155-
156127 /**
157128 * Sets the language client and encryption key for LSP communication
158129 */
@@ -213,98 +184,13 @@ export class AutoDebugFeature implements vscode.Disposable {
213184 return
214185 }
215186
216- // Listen for problems detected
187+ // Listen for problems detected (logging only, no notifications)
217188 this . disposables . push (
218189 this . autoDebugController . onProblemsDetected . event ( ( problems ) => {
219190 this . logger . debug ( 'AutoDebugFeature: Problems detected event received: %d problems' , problems . length )
220191
221- // **DEBUG**: Log problem severities to identify filtering issue
222- const severities = problems . map ( ( p ) => p . severity )
223- this . logger . debug ( 'AutoDebugFeature: Problem severities: %s' , severities . join ( ', ' ) )
224-
225- // Show notification for critical problems
226192 const criticalProblems = problems . filter ( ( p ) => p . severity === 'error' )
227- this . logger . debug ( 'AutoDebugFeature: Critical problems after filtering: %d' , criticalProblems . length )
228-
229- if ( criticalProblems . length > 0 ) {
230- const message = `Amazon Q detected ${ criticalProblems . length } error${ criticalProblems . length !== 1 ? 's' : '' } in your code`
231- this . logger . debug ( 'AutoDebugFeature: About to show notification: %s' , message )
232-
233- // **FIX**: Try multiple notification methods with error handling
234- try {
235- // Method 1: showWarningMessage with error handling
236- Promise . resolve ( vscode . window . showWarningMessage ( message , 'Fix with Amazon Q' , 'Dismiss' ) )
237- . then ( ( selection ) => {
238- this . logger . debug (
239- 'AutoDebugFeature: Notification selection: %s' ,
240- selection || 'dismissed'
241- )
242- if ( selection === 'Fix with Amazon Q' ) {
243- void this . triggerFixWithAmazonQ ( )
244- }
245- } )
246- . catch ( ( error ) => {
247- this . logger . error ( 'AutoDebugFeature: showWarningMessage failed: %s' , error )
248- // Fallback: Try showInformationMessage with proper button handling
249- Promise . resolve (
250- vscode . window . showInformationMessage ( message , 'Fix with Amazon Q' , 'Dismiss' )
251- )
252- . then ( ( selection ) => {
253- this . logger . debug (
254- 'AutoDebugFeature: Fallback notification selection: %s' ,
255- selection || 'dismissed'
256- )
257- if ( selection === 'Fix with Amazon Q' ) {
258- void this . triggerFixWithAmazonQ ( )
259- }
260- } )
261- . catch ( ( fallbackError ) => {
262- this . logger . error (
263- 'AutoDebugFeature: Fallback showInformationMessage failed: %s' ,
264- fallbackError
265- )
266- } )
267- } )
268-
269- // Method 2: Alternative - showErrorMessage (should be more visible)
270- setTimeout ( ( ) => {
271- this . logger . debug ( 'AutoDebugFeature: Trying showErrorMessage as backup' )
272- Promise . resolve (
273- vscode . window . showErrorMessage ( `🔧 ${ message } ` , 'Fix with Amazon Q' , 'Dismiss' )
274- )
275- . then ( ( selection ) => {
276- this . logger . debug (
277- 'AutoDebugFeature: Backup notification selection: %s' ,
278- selection || 'dismissed'
279- )
280- if ( selection === 'Fix with Amazon Q' ) {
281- void this . triggerFixWithAmazonQ ( )
282- }
283- } )
284- . catch ( ( backupError ) => {
285- this . logger . error (
286- 'AutoDebugFeature: Backup showErrorMessage failed: %s' ,
287- backupError
288- )
289- } )
290- } , 500 )
291- } catch ( error ) {
292- this . logger . error ( 'AutoDebugFeature: All notification methods failed: %s' , error )
293- // Last resort: Status bar message
294- void vscode . window . setStatusBarMessage (
295- `Amazon Q: ${ criticalProblems . length } errors detected` ,
296- 5000
297- )
298- }
299- } else {
300- this . logger . debug ( 'AutoDebugFeature: No critical problems found - likely severity mismatch!' )
301- // **TEMPORARY DEBUG**: Show notification for all problems to test VS Code API
302- if ( problems . length > 0 ) {
303- const message = `Amazon Q detected ${ problems . length } issue${ problems . length !== 1 ? 's' : '' } in your code (debug mode)`
304- this . logger . debug ( 'AutoDebugFeature: Showing debug notification: %s' , message )
305- void vscode . window . showWarningMessage ( message , 'Fix with Amazon Q' , 'Dismiss' )
306- }
307- }
193+ this . logger . debug ( 'AutoDebugFeature: Critical problems detected: %d' , criticalProblems . length )
308194 } )
309195 )
310196
0 commit comments