@@ -80,7 +80,7 @@ const getWorkspace = (context) => {
8080 if ( ! root ) {
8181 root = vscode . workspace . workspaceFolders [ 0 ]
8282 }
83-
83+
8484 workspace = root && root . uri ? root . uri . fsPath : null
8585 } else {
8686 // No file was open, so just grab the first available workspace
@@ -98,6 +98,15 @@ const getWorkspace = (context) => {
9898 }
9999 }
100100
101+ // If we did not get Workspace, let the user know
102+ if ( ! workspace ) {
103+ const message = localize ( 'debug.logger.missingWorkspace' )
104+ logger ( localize ( 'debug.logger.error' , 'getWorkspace' , message ) , 'error' )
105+
106+ vscode . commands . executeCommand ( 'setContext' , 'explorer-exclude.missingWorkspace' , true )
107+ vscode . commands . executeCommand ( 'setContext' , 'explorer-exclude.hasLoaded' , true )
108+ }
109+
101110 // Debug Cartridge Path
102111 logger ( localize ( 'debug.logger.workspace' , workspace ) )
103112
@@ -293,13 +302,13 @@ function exclude(uri, callback) {
293302 case 'path' :
294303 break
295304 case 'ext' :
296- regex = _meta [ key ] ? `**${ path . sep } *${ _meta [ key ] } ` : undefined
305+ regex = _meta [ key ] ? `**/ *${ _meta [ key ] } ` : undefined
297306 break
298307 case 'base' :
299308 regex = _meta [ key ]
300309 break
301310 case 'dir' :
302- if ( _showPicker ) regex = _meta [ key ] ? `${ _meta [ key ] + path . sep } *.*` : undefined
311+ if ( _showPicker ) regex = _meta [ key ] ? `${ _meta [ key ] } / *.*` : undefined
303312 break
304313 }
305314 if ( regex ) {
@@ -308,15 +317,15 @@ function exclude(uri, callback) {
308317 } )
309318
310319 if ( _meta [ 'dir' ] && _meta [ 'ext' ] ) {
311- options . push ( `${ _meta [ 'dir' ] } ${ path . sep } *${ _meta [ 'ext' ] } ` )
320+ options . push ( `${ _meta [ 'dir' ] } / *${ _meta [ 'ext' ] } ` )
312321 } else if ( _meta [ 'ext' ] ) {
313322 options . push ( `*${ _meta [ 'ext' ] } ` )
314323 }
315324
316325 if ( _meta [ 'base' ] ) {
317- options . push ( `**${ path . sep } ${ _meta [ 'base' ] } ` )
326+ options . push ( `**/ ${ _meta [ 'base' ] } ` )
318327 if ( _meta [ 'dir' ] ) {
319- options . push ( `${ _meta [ 'dir' ] } ${ path . sep } ${ _meta [ 'base' ] } ` )
328+ options . push ( `${ _meta [ 'dir' ] } / ${ _meta [ 'base' ] } ` )
320329 }
321330 }
322331
0 commit comments