@@ -337,15 +337,14 @@ async function moveFile(languageClient: LanguageClient, fileUris: Uri[]) {
337337 fileUris = moveUris ;
338338 }
339339
340- const refactorEdit : RefactorWorkspaceEdit = await languageClient . sendRequest ( MoveRequest . type , {
340+ const refactorEdit = await requestMoveWithConfirmation ( languageClient , {
341341 moveKind : 'moveResource' ,
342342 sourceUris : fileUris . map ( uri => uri . toString ( ) ) ,
343343 params : null ,
344344 destination : selectPackageNodeItem . packageNode ,
345345 updateReferences : true ,
346346 } ) ;
347347
348- await applyRefactorEdit ( languageClient , refactorEdit ) ;
349348 if ( refactorEdit && refactorEdit . edit ) {
350349 await saveEdit ( refactorEdit . edit ) ;
351350 }
@@ -466,13 +465,12 @@ async function moveStaticMember(languageClient: LanguageClient, params: CodeActi
466465 const projectName = commandInfo ? commandInfo . projectName : null ;
467466 const picked = await selectTargetClass ( languageClient , `Select the new class for the static member ${ memberName } .` , projectName , exclude ) ;
468467 if ( picked ) {
469- const refactorEdit : RefactorWorkspaceEdit = await languageClient . sendRequest ( MoveRequest . type , {
468+ await requestMoveWithConfirmation ( languageClient , {
470469 moveKind : 'moveStaticMember' ,
471470 sourceUris : [ params . textDocument . uri ] ,
472471 params,
473472 destination : picked ,
474473 } ) ;
475- await applyRefactorEdit ( languageClient , refactorEdit ) ;
476474 }
477475}
478476
@@ -546,9 +544,8 @@ async function moveType(languageClient: LanguageClient, params: CodeActionParams
546544 return ;
547545 }
548546
549- let refactorEdit : RefactorWorkspaceEdit ;
550547 if ( picked . kind === 'newFile' ) {
551- refactorEdit = await languageClient . sendRequest ( MoveRequest . type , {
548+ await requestMoveWithConfirmation ( languageClient , {
552549 moveKind : 'moveTypeToNewFile' ,
553550 sourceUris : [ params . textDocument . uri ] ,
554551 params,
@@ -562,14 +559,12 @@ async function moveType(languageClient: LanguageClient, params: CodeActionParams
562559
563560 const picked = await selectTargetClass ( languageClient , `Select the new class for the type ${ commandInfo . displayName } .` , commandInfo . projectName , exclude ) ;
564561 if ( picked ) {
565- refactorEdit = await languageClient . sendRequest ( MoveRequest . type , {
562+ await requestMoveWithConfirmation ( languageClient , {
566563 moveKind : 'moveTypeToClass' ,
567564 sourceUris : [ params . textDocument . uri ] ,
568565 params,
569566 destination : picked ,
570567 } ) ;
571568 }
572569 }
573-
574- await applyRefactorEdit ( languageClient , refactorEdit ) ;
575570}
0 commit comments