Skip to content

Commit 8f32214

Browse files
Version v1.3.2
--- * Add additional fallback for Workspace Detection ( Thanks @bjrmatos ) * Move Missing Workspace Message to Panel rather than show alert ( Thanks @colas31 ) * Revert Glob Pattern Change that used OS Path Separator
1 parent cc0dec5 commit 8f32214

19 files changed

+155
-2556
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Change Log
33

44
> Here's our record of all notable changes made to to this project
55
6+
v1.3.2
7+
---
8+
9+
* Add additional fallback for Workspace Detection ( Thanks @bjrmatos )
10+
* Move Missing Workspace Message to Panel rather than show alert ( Thanks @colas31 )
11+
* Revert Glob Pattern Change that used OS Path Separator
12+
613
v1.3.1
714
---
815

extension/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ function activate(context) {
6767
})
6868

6969
const remove = vscode.commands.registerCommand('explorer-exclude.remove', (uri) => {
70-
util.logger(`Remove: ${uri}`, 'debug')
7170
if (uri && uri.value) {
7271
const value = uri.value
7372
const key = value.substring(0, value.length - 2)
7473

74+
util.logger(`Remove: ${key}`, 'debug')
75+
7576
util.deleteExclude(key, function () {
7677
setTimeout(function () {
7778
pane.update(util.getExcludes())
@@ -124,6 +125,7 @@ function activate(context) {
124125

125126
// Set Initial State of Extension
126127
vscode.commands.executeCommand('setContext', 'explorer-exclude.enabled', true)
128+
vscode.commands.executeCommand('setContext', 'explorer-exclude.hasLoaded', true)
127129

128130
// Save Extension Context for later use
129131
util.saveContext(context)
@@ -146,7 +148,9 @@ function activate(context) {
146148
/**
147149
* Handle Deactivating Extension
148150
*/
149-
function deactivate() {}
151+
function deactivate() {
152+
vscode.commands.executeCommand('setContext', 'explorer-exclude.enabled', false)
153+
}
150154

151155
module.exports = {
152156
activate,

extension/util.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)