@@ -247,7 +247,7 @@ export abstract class BaseApplyService extends WithEventBus {
247
247
originalCode : originalModelRef . instance . getText ( ) ,
248
248
} ;
249
249
if ( uriCodeBlocks ?. length ) {
250
- newBlock . version = uriCodeBlocks . length ;
250
+ newBlock . version = uriCodeBlocks . length + 1 ;
251
251
for ( const block of uriCodeBlocks ) {
252
252
// 如果连续的上一个同文件apply结果存在LintError,则iterationCount++
253
253
if ( block . relativePath === relativePath && block . applyResult ?. diagnosticInfos ?. length ) {
@@ -480,7 +480,7 @@ export abstract class BaseApplyService extends WithEventBus {
480
480
}
481
481
}
482
482
483
- processAll ( type : 'accept' | 'reject' , uri ?: URI ) : void {
483
+ async processAll ( type : 'accept' | 'reject' , uri ?: URI ) : Promise < void > {
484
484
const codeBlocks = uri
485
485
? this . getUriCodeBlocks ( uri ) ?. filter ( ( block ) => block . status === 'pending' )
486
486
: this . getSessionCodeBlocks ( ) . filter ( ( block ) => block . status === 'pending' ) ;
@@ -498,6 +498,13 @@ export abstract class BaseApplyService extends WithEventBus {
498
498
acc . push ( cur ) ;
499
499
return acc ;
500
500
} , [ ] as string [ ] ) ;
501
+ const openedEditor = this . editorService . getAllOpenedUris ( ) ;
502
+ const unopenedUris = relativePaths
503
+ . filter ( ( relativePath ) => ! openedEditor . some ( ( editor ) => editor . codeUri . fsPath . endsWith ( relativePath ) ) )
504
+ . map ( ( relativePath ) => URI . file ( path . join ( this . appConfig . workspaceDir , relativePath ) ) ) ;
505
+ if ( unopenedUris . length ) {
506
+ await this . editorService . openUris ( unopenedUris ) ;
507
+ }
501
508
relativePaths . forEach ( ( relativePath ) => {
502
509
this . doProcess ( type , relativePath ) ;
503
510
} ) ;
0 commit comments