@@ -14,7 +14,7 @@ export interface ISimpleWindow {
1414 openedWorkspace ?: IWorkspaceIdentifier ;
1515 openedFolderUri ?: URI ;
1616
17- extensionDevelopmentPath ?: string ;
17+ extensionDevelopmentPath ?: string | string [ ] ;
1818 lastFocusTime : number ;
1919}
2020
@@ -95,13 +95,33 @@ export function findWindowOnWorkspace<W extends ISimpleWindow>(windows: W[], wor
9595 return null ;
9696}
9797
98- export function findWindowOnExtensionDevelopmentPath < W extends ISimpleWindow > ( windows : W [ ] , extensionDevelopmentPath : string ) : W | null {
98+ export function findWindowOnExtensionDevelopmentPath < W extends ISimpleWindow > ( windows : W [ ] , extensionDevelopmentPath : string | string [ ] ) : W | null {
99+
100+ const matches = ( uriString : string ) : boolean => {
101+ if ( Array . isArray ( extensionDevelopmentPath ) ) {
102+ return extensionDevelopmentPath . some ( p => extpath . isEqual ( p , uriString , ! platform . isLinux /* ignorecase */ ) ) ;
103+ } else if ( extensionDevelopmentPath ) {
104+ return extpath . isEqual ( extensionDevelopmentPath , uriString , ! platform . isLinux /* ignorecase */ ) ;
105+ }
106+ return false ;
107+ } ;
108+
99109 for ( const window of windows ) {
100- // match on extension development path. The path can be a path or uri string, using paths.isEqual is not 100% correct but good enough
101- if ( window . extensionDevelopmentPath && extpath . isEqual ( window . extensionDevelopmentPath , extensionDevelopmentPath , ! platform . isLinux /* ignorecase */ ) ) {
102- return window ;
110+ // match on extension development path. The path can be one or more paths or uri strings, using paths.isEqual is not 100% correct but good enough
111+
112+ if ( window . extensionDevelopmentPath ) {
113+ if ( Array . isArray ( window . extensionDevelopmentPath ) ) {
114+ if ( window . extensionDevelopmentPath . some ( p => matches ( p ) ) ) {
115+ return window ;
116+ }
117+ } else if ( window . extensionDevelopmentPath ) {
118+ if ( matches ( window . extensionDevelopmentPath ) ) {
119+ return window ;
120+ }
121+ }
103122 }
104123 }
124+
105125 return null ;
106126}
107127
0 commit comments