@@ -331,6 +331,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
331
331
const codeAction = new VsCodeCodeAction ( action , action . description , vscode . CodeActionKind . QuickFix ) ;
332
332
codeAction . edit = getEditForCodeAction ( this . client , action ) ;
333
333
codeAction . diagnostics = [ diagnostic ] ;
334
+ codeAction . ranges = [ diagnostic . range ] ;
334
335
codeAction . command = {
335
336
command : ApplyCodeActionCommand . ID ,
336
337
arguments : [ { action, diagnostic, document } satisfies ApplyCodeActionCommand_args ] ,
@@ -362,6 +363,8 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
362
363
const inferFromBody = new VsCodeCodeAction ( action , 'Infer types using Copilot' , vscode . CodeActionKind . QuickFix ) ;
363
364
inferFromBody . edit = new vscode . WorkspaceEdit ( ) ;
364
365
inferFromBody . diagnostics = [ diagnostic ] ;
366
+ console . log ( diagnostic , diagnostic . range ) ;
367
+ inferFromBody . ranges = [ diagnostic . range ] ;
365
368
inferFromBody . isAI = true ;
366
369
inferFromBody . command = {
367
370
command : EditorChatFollowUp . ID ,
@@ -389,6 +392,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
389
392
aiCodeAction . edit = getEditForCodeAction ( this . client , action ) ;
390
393
aiCodeAction . edit ?. insert ( document . uri , diagnostic . range . start , '' ) ;
391
394
aiCodeAction . diagnostics = [ diagnostic ] ;
395
+ aiCodeAction . ranges = [ diagnostic . range ] ;
392
396
aiCodeAction . isAI = true ;
393
397
aiCodeAction . command = {
394
398
command : CompositeCommand . ID ,
@@ -443,6 +447,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
443
447
vscode . CodeActionKind . QuickFix ) ;
444
448
445
449
action . diagnostics = [ diagnostic ] ;
450
+ action . ranges = [ diagnostic . range ] ;
446
451
action . command = {
447
452
command : ApplyFixAllCodeAction . ID ,
448
453
arguments : [ { action } satisfies ApplyFixAllCodeAction_args ] ,
0 commit comments