@@ -9,27 +9,7 @@ import * as path from 'path';
99import * as fs from 'original-fs' ;
1010import * as platform from 'vs/base/common/platform' ;
1111import * as paths from 'vs/base/common/paths' ;
12-
13- export enum OpenContext {
14-
15- // opening when running from the command line
16- CLI ,
17-
18- // macOS only: opening from the dock (also when opening files to a running instance from desktop)
19- DOCK ,
20-
21- // opening from the main application window
22- MENU ,
23-
24- // opening from a file or folder dialog
25- DIALOG ,
26-
27- // opening from the OS's UI
28- DESKTOP ,
29-
30- // opening through the API
31- API
32- }
12+ import { OpenContext } from 'vs/code/common/windows' ;
3313
3414/**
3515 * Exported subset of VSCodeWindow for testing.
@@ -42,8 +22,8 @@ export interface ISimpleWindow {
4222/**
4323 * Exported for testing.
4424 */
45- export interface IBestWindowOrFolderOptions < WINDOW > {
46- windows : WINDOW [ ] ;
25+ export interface IBestWindowOrFolderOptions < SimpleWindow extends ISimpleWindow > {
26+ windows : SimpleWindow [ ] ;
4727 newWindow : boolean ;
4828 reuseWindow : boolean ;
4929 context : OpenContext ;
@@ -52,7 +32,7 @@ export interface IBestWindowOrFolderOptions<WINDOW> {
5232 vscodeFolder ?: string ;
5333}
5434
55- export function findBestWindowOrFolder < WINDOW extends ISimpleWindow > ( { windows, newWindow, reuseWindow, context, filePath, userHome, vscodeFolder } : IBestWindowOrFolderOptions < WINDOW > ) : WINDOW | string {
35+ export function findBestWindowOrFolder < SimpleWindow extends ISimpleWindow > ( { windows, newWindow, reuseWindow, context, filePath, userHome, vscodeFolder } : IBestWindowOrFolderOptions < SimpleWindow > ) : SimpleWindow | string {
5636 // OpenContext.DOCK implies newWindow unless overwritten by settings.
5737 const findBest = filePath && ( context === OpenContext . DESKTOP || context === OpenContext . CLI || context === OpenContext . DOCK ) ;
5838 const bestWindow = ! newWindow && findBest && findBestWindow ( windows , filePath ) ;
0 commit comments