@@ -331,6 +331,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
331331 const codeAction = new VsCodeCodeAction ( action , action . description , vscode . CodeActionKind . QuickFix ) ;
332332 codeAction . edit = getEditForCodeAction ( this . client , action ) ;
333333 codeAction . diagnostics = [ diagnostic ] ;
334+ codeAction . ranges = [ diagnostic . range ] ;
334335 codeAction . command = {
335336 command : ApplyCodeActionCommand . ID ,
336337 arguments : [ { action, diagnostic, document } satisfies ApplyCodeActionCommand_args ] ,
@@ -362,6 +363,8 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
362363 const inferFromBody = new VsCodeCodeAction ( action , 'Infer types using Copilot' , vscode . CodeActionKind . QuickFix ) ;
363364 inferFromBody . edit = new vscode . WorkspaceEdit ( ) ;
364365 inferFromBody . diagnostics = [ diagnostic ] ;
366+ console . log ( diagnostic , diagnostic . range ) ;
367+ inferFromBody . ranges = [ diagnostic . range ] ;
365368 inferFromBody . isAI = true ;
366369 inferFromBody . command = {
367370 command : EditorChatFollowUp . ID ,
@@ -389,6 +392,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
389392 aiCodeAction . edit = getEditForCodeAction ( this . client , action ) ;
390393 aiCodeAction . edit ?. insert ( document . uri , diagnostic . range . start , '' ) ;
391394 aiCodeAction . diagnostics = [ diagnostic ] ;
395+ aiCodeAction . ranges = [ diagnostic . range ] ;
392396 aiCodeAction . isAI = true ;
393397 aiCodeAction . command = {
394398 command : CompositeCommand . ID ,
@@ -443,6 +447,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
443447 vscode . CodeActionKind . QuickFix ) ;
444448
445449 action . diagnostics = [ diagnostic ] ;
450+ action . ranges = [ diagnostic . range ] ;
446451 action . command = {
447452 command : ApplyFixAllCodeAction . ID ,
448453 arguments : [ { action } satisfies ApplyFixAllCodeAction_args ] ,
0 commit comments