@@ -101,22 +101,49 @@ export class PickCommand {
101101 private getOutput ( file : string , root : string ) : string | undefined {
102102 return this . getProperty ( file , root , this . _args . output ) ;
103103 }
104- public async Invoke ( ) : Promise < string | undefined > {
104+
105+ private async getAbsoluteMap ( mask : string ) : Promise < Map < vscode . QuickPickItem , string > > {
105106 const map = new Map < vscode . QuickPickItem , string > ( ) ;
106- const masks = this . getMasks ( ) ;
107+ var files = await this . getFilesAsync ( mask ) ;
108+ for ( const file of files ) {
109+ const key = this . getDisplay ( file , "/" ) ;
110+ const value = this . getOutput ( file , "/" ) ;
111+ if ( key != undefined && value != undefined ) {
112+ map . set ( key , value ) ;
113+ }
114+ }
115+ return map ;
116+ }
117+
118+ private async getWorkspaceMap ( mask : string ) : Promise < Map < vscode . QuickPickItem , string > > {
119+ const map = new Map < vscode . QuickPickItem , string > ( ) ;
120+
107121 for ( const folder of vscode . workspace . workspaceFolders ) {
108122 const root = folder . uri . fsPath ;
109- for ( const mask of masks ) {
110- var files = await this . getFilesAsync ( path . join ( root , mask ) ) ;
111- for ( const file of files ) {
112- const key = this . getDisplay ( file , root ) ;
113- const value = this . getOutput ( file , root ) ;
114- if ( key != undefined && value != undefined ) {
115- map . set ( key , value ) ;
116- }
123+ var files = await this . getFilesAsync ( path . join ( root , mask ) ) ;
124+ for ( const file of files ) {
125+ const key = this . getDisplay ( file , root ) ;
126+ const value = this . getOutput ( file , root ) ;
127+ if ( key != undefined && value != undefined ) {
128+ map . set ( key , value ) ;
117129 }
118130 }
119131 }
132+
133+ return map ;
134+ }
135+
136+ public async Invoke ( ) : Promise < string | undefined > {
137+ var map : Map < vscode . QuickPickItem , string > ;
138+ const masks = this . getMasks ( ) ;
139+
140+ for ( const mask of masks ) {
141+ if ( mask . startsWith ( "/" ) ) {
142+ map = await this . getAbsoluteMap ( mask ) ;
143+ } else {
144+ map = await this . getWorkspaceMap ( mask ) ;
145+ }
146+ }
120147 const names = Array . from ( map . keys ( ) ) ;
121148 if ( names . length == 0 ) {
122149 await vscode . window . showInformationMessage ( "No files found" ) ;
0 commit comments