@@ -21,7 +21,7 @@ import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService
21
21
import { coalesce } from '../utils/arrays' ;
22
22
import { nulToken } from '../utils/cancellation' ;
23
23
import FormattingOptionsManager from './fileConfigurationManager' ;
24
- import { CompositeCommand , EditorChatFollowUp , EditorChatFollowUp_Args } from './util/copilot' ;
24
+ import { CompositeCommand , EditorChatFollowUp } from './util/copilot' ;
25
25
import { conditionalRegistration , requireSomeCapability } from './util/dependentRegistration' ;
26
26
27
27
function toWorkspaceEdit ( client : ITypeScriptServiceClient , edits : readonly Proto . FileCodeEdits [ ] ) : vscode . WorkspaceEdit {
@@ -347,14 +347,10 @@ class InlinedCodeAction extends vscode.CodeAction {
347
347
public readonly refactor : Proto . ApplicableRefactorInfo ,
348
348
public readonly action : Proto . RefactorActionInfo ,
349
349
public readonly range : vscode . Range ,
350
- public readonly copilotRename ?: ( info : Proto . RefactorEditInfo ) => vscode . Command ,
351
350
) {
352
- const title = copilotRename ? action . description + ' and suggest a name with Copilot.' : action . description ;
351
+ const title = action . description ;
353
352
super ( title , InlinedCodeAction . getKind ( action ) ) ;
354
353
355
- if ( copilotRename ) {
356
- this . isAI = true ;
357
- }
358
354
if ( action . notApplicableReason ) {
359
355
this . disabled = { reason : action . notApplicableReason } ;
360
356
}
@@ -392,15 +388,12 @@ class InlinedCodeAction extends vscode.CodeAction {
392
388
if ( response . body . renameLocation ) {
393
389
// Disable renames in interactive playground https://github.com/microsoft/vscode/issues/75137
394
390
if ( this . document . uri . scheme !== fileSchemes . walkThroughSnippet ) {
395
- if ( this . copilotRename && this . command ) {
396
- this . command . title = 'Copilot: ' + this . command . title ;
397
- }
398
391
this . command = {
399
392
command : CompositeCommand . ID ,
400
393
title : '' ,
401
394
arguments : coalesce ( [
402
395
this . command ,
403
- this . copilotRename ? this . copilotRename ( response . body ) : {
396
+ {
404
397
command : 'editor.action.rename' ,
405
398
arguments : [ [
406
399
this . document . uri ,
@@ -635,38 +628,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
635
628
if ( action . name === 'Move to file' ) {
636
629
codeActions . push ( new MoveToFileCodeAction ( document , action , rangeOrSelection ) ) ;
637
630
} else {
638
- codeActions . push ( new InlinedCodeAction ( this . client , document , refactor , action , rangeOrSelection , undefined ) ) ;
639
- const copilot = vscode . extensions . getExtension ( 'github.copilot-chat' ) ;
640
- if ( copilot ?. isActive ) {
641
- if ( Extract_Constant . matches ( action )
642
- || Extract_Function . matches ( action )
643
- || Extract_Type . matches ( action )
644
- || Extract_Interface . matches ( action )
645
- ) {
646
- const newName = Extract_Constant . matches ( action ) ? 'newLocal'
647
- : Extract_Function . matches ( action ) ? 'newFunction'
648
- : Extract_Type . matches ( action ) ? 'NewType'
649
- : Extract_Interface . matches ( action ) ? 'NewInterface'
650
- : '' ;
651
- const copilotRename : ( ( info : Proto . RefactorEditInfo ) => vscode . Command ) = info => ( {
652
- title : '' ,
653
- command : EditorChatFollowUp . ID ,
654
- arguments : [ {
655
- message : `Rename ${ newName } to a better name based on usage.` ,
656
- expand : Extract_Constant . matches ( action ) ? {
657
- kind : 'navtree-function' ,
658
- pos : typeConverters . Position . fromLocation ( info . renameLocation ! ) ,
659
- } : {
660
- kind : 'refactor-info' ,
661
- refactor : info ,
662
- } ,
663
- action : { type : 'refactor' , refactor : action } ,
664
- document,
665
- } satisfies EditorChatFollowUp_Args ]
666
- } ) ;
667
- codeActions . push ( new InlinedCodeAction ( this . client , document , refactor , action , rangeOrSelection , copilotRename ) ) ;
668
- }
669
- }
631
+ codeActions . push ( new InlinedCodeAction ( this . client , document , refactor , action , rangeOrSelection ) ) ;
670
632
}
671
633
for ( const codeAction of codeActions ) {
672
634
codeAction . isPreferred = TypeScriptRefactorProvider . isPreferred ( action , allActions ) ;
0 commit comments