@@ -10,7 +10,7 @@ import { equals } from 'vs/base/common/objects';
10
10
import { EventType , EventHelper , addDisposableListener , scheduleAtNextAnimationFrame , ModifierKeyEmitter } from 'vs/base/browser/dom' ;
11
11
import { Separator , WorkbenchActionExecutedClassification , WorkbenchActionExecutedEvent } from 'vs/base/common/actions' ;
12
12
import { IFileService } from 'vs/platform/files/common/files' ;
13
- import { EditorResourceAccessor , IUntitledTextResourceEditorInput , SideBySideEditor , pathsToEditors , IResourceDiffEditorInput , IUntypedEditorInput } from 'vs/workbench/common/editor' ;
13
+ import { EditorResourceAccessor , IUntitledTextResourceEditorInput , SideBySideEditor , pathsToEditors , IResourceDiffEditorInput , IUntypedEditorInput , IEditorPane } from 'vs/workbench/common/editor' ;
14
14
import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
15
15
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
16
16
import { WindowMinimumSize , IOpenFileRequest , IWindowsConfiguration , getTitleBarStyle , IAddFoldersRequest , INativeRunActionInWindowRequest , INativeRunKeybindingInWindowRequest , INativeOpenFileRequest } from 'vs/platform/window/common/window' ;
@@ -836,14 +836,23 @@ export class NativeWindow extends Disposable {
836
836
}
837
837
838
838
if ( inputs . length ) {
839
- this . openResources ( inputs , diffMode ) ;
840
- }
839
+ const openedEditorPanes = await this . openResources ( inputs , diffMode ) ;
840
+
841
+ if ( request . filesToWait ) {
842
+
843
+ // In wait mode, listen to changes to the editors and wait until the files
844
+ // are closed that the user wants to wait for. When this happens we delete
845
+ // the wait marker file to signal to the outside that editing is done.
846
+ // However, it is possible that opening of the editors failed, as such we
847
+ // check for whether editor panes got opened and otherwise delete the marker
848
+ // right away.
841
849
842
- if ( request . filesToWait && inputs . length ) {
843
- // In wait mode, listen to changes to the editors and wait until the files
844
- // are closed that the user wants to wait for. When this happens we delete
845
- // the wait marker file to signal to the outside that editing is done.
846
- this . trackClosedWaitFiles ( URI . revive ( request . filesToWait . waitMarkerFileUri ) , coalesce ( request . filesToWait . paths . map ( path => URI . revive ( path . fileUri ) ) ) ) ;
850
+ if ( openedEditorPanes . length ) {
851
+ return this . trackClosedWaitFiles ( URI . revive ( request . filesToWait . waitMarkerFileUri ) , coalesce ( request . filesToWait . paths . map ( path => URI . revive ( path . fileUri ) ) ) ) ;
852
+ } else {
853
+ return this . fileService . del ( URI . revive ( request . filesToWait . waitMarkerFileUri ) ) ;
854
+ }
855
+ }
847
856
}
848
857
}
849
858
@@ -856,7 +865,7 @@ export class NativeWindow extends Disposable {
856
865
await this . fileService . del ( waitMarkerFile ) ;
857
866
}
858
867
859
- private async openResources ( resources : Array < IResourceEditorInput | IUntitledTextResourceEditorInput > , diffMode : boolean ) : Promise < unknown > {
868
+ private async openResources ( resources : Array < IResourceEditorInput | IUntitledTextResourceEditorInput > , diffMode : boolean ) : Promise < readonly IEditorPane [ ] > {
860
869
const editors : IUntypedEditorInput [ ] = [ ] ;
861
870
862
871
// In diffMode we open 2 resources as diff
0 commit comments