@@ -131,8 +131,8 @@ export class InteractiveEditorController implements IEditorContribution {
131
131
}
132
132
133
133
dispose ( ) : void {
134
+ this . _finishExistingSession ( ) ;
134
135
this . _store . dispose ( ) ;
135
- this . cancelSession ( ) ;
136
136
}
137
137
138
138
getId ( ) : string {
@@ -156,19 +156,19 @@ export class InteractiveEditorController implements IEditorContribution {
156
156
157
157
async run ( options : InteractiveEditorRunOptions | undefined ) : Promise < void > {
158
158
this . _logService . trace ( '[IE] session starting' ) ;
159
- await this . _finishOrCancel ( ) ;
159
+ await this . _finishExistingSession ( ) ;
160
160
161
161
await this . _nextState ( State . CREATE_SESSION , { ...options } ) ;
162
162
this . _logService . trace ( '[IE] session done or paused' ) ;
163
163
}
164
164
165
- private async _finishOrCancel ( ) : Promise < void > {
165
+ private async _finishExistingSession ( ) : Promise < void > {
166
166
if ( this . _activeSession ) {
167
167
if ( this . _activeSession . editMode === EditMode . Preview ) {
168
- this . _logService . trace ( '[IE] an EXISTING session is active, cancelling first' ) ;
168
+ this . _logService . trace ( '[IE] finishing existing session, using CANCEL' , this . _activeSession . editMode ) ;
169
169
await this . cancelSession ( ) ;
170
170
} else {
171
- this . _logService . trace ( '[IE] an EXISTING session is active, finishing first' ) ;
171
+ this . _logService . trace ( '[IE] finishing existing session, using APPLY' , this . _activeSession . editMode ) ;
172
172
await this . applyChanges ( ) ;
173
173
}
174
174
}
@@ -292,7 +292,7 @@ export class InteractiveEditorController implements IEditorContribution {
292
292
// cancel all sibling sessions
293
293
for ( const editor of editors ) {
294
294
if ( editor !== this . _editor ) {
295
- InteractiveEditorController . get ( editor ) ?. _finishOrCancel ( ) ;
295
+ InteractiveEditorController . get ( editor ) ?. _finishExistingSession ( ) ;
296
296
}
297
297
}
298
298
break ;
0 commit comments