@@ -21,7 +21,7 @@ import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService
2121import { coalesce } from '../utils/arrays' ;
2222import { nulToken } from '../utils/cancellation' ;
2323import FormattingOptionsManager from './fileConfigurationManager' ;
24- import { CompositeCommand , EditorChatFollowUp , EditorChatFollowUp_Args } from './util/copilot' ;
24+ import { CompositeCommand , EditorChatFollowUp } from './util/copilot' ;
2525import { conditionalRegistration , requireSomeCapability } from './util/dependentRegistration' ;
2626
2727function toWorkspaceEdit ( client : ITypeScriptServiceClient , edits : readonly Proto . FileCodeEdits [ ] ) : vscode . WorkspaceEdit {
@@ -347,14 +347,10 @@ class InlinedCodeAction extends vscode.CodeAction {
347347 public readonly refactor : Proto . ApplicableRefactorInfo ,
348348 public readonly action : Proto . RefactorActionInfo ,
349349 public readonly range : vscode . Range ,
350- public readonly copilotRename ?: ( info : Proto . RefactorEditInfo ) => vscode . Command ,
351350 ) {
352- const title = copilotRename ? action . description + ' and suggest a name with Copilot.' : action . description ;
351+ const title = action . description ;
353352 super ( title , InlinedCodeAction . getKind ( action ) ) ;
354353
355- if ( copilotRename ) {
356- this . isAI = true ;
357- }
358354 if ( action . notApplicableReason ) {
359355 this . disabled = { reason : action . notApplicableReason } ;
360356 }
@@ -392,15 +388,12 @@ class InlinedCodeAction extends vscode.CodeAction {
392388 if ( response . body . renameLocation ) {
393389 // Disable renames in interactive playground https://github.com/microsoft/vscode/issues/75137
394390 if ( this . document . uri . scheme !== fileSchemes . walkThroughSnippet ) {
395- if ( this . copilotRename && this . command ) {
396- this . command . title = 'Copilot: ' + this . command . title ;
397- }
398391 this . command = {
399392 command : CompositeCommand . ID ,
400393 title : '' ,
401394 arguments : coalesce ( [
402395 this . command ,
403- this . copilotRename ? this . copilotRename ( response . body ) : {
396+ {
404397 command : 'editor.action.rename' ,
405398 arguments : [ [
406399 this . document . uri ,
@@ -635,38 +628,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
635628 if ( action . name === 'Move to file' ) {
636629 codeActions . push ( new MoveToFileCodeAction ( document , action , rangeOrSelection ) ) ;
637630 } 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 ) ) ;
670632 }
671633 for ( const codeAction of codeActions ) {
672634 codeAction . isPreferred = TypeScriptRefactorProvider . isPreferred ( action , allActions ) ;
0 commit comments