Skip to content

Commit

Permalink
Version v1.3.2
Browse files Browse the repository at this point in the history
---

* 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
  • Loading branch information
manifestinteractive committed Aug 21, 2022
1 parent cc0dec5 commit 8f32214
Show file tree
Hide file tree
Showing 19 changed files with 155 additions and 2,556 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ Change Log

> Here's our record of all notable changes made to to this project
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

v1.3.1
---

Expand Down
8 changes: 6 additions & 2 deletions extension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ function activate(context) {
})

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

util.logger(`Remove: ${key}`, 'debug')

util.deleteExclude(key, function () {
setTimeout(function () {
pane.update(util.getExcludes())
Expand Down Expand Up @@ -124,6 +125,7 @@ function activate(context) {

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

// Save Extension Context for later use
util.saveContext(context)
Expand All @@ -146,7 +148,9 @@ function activate(context) {
/**
* Handle Deactivating Extension
*/
function deactivate() {}
function deactivate() {
vscode.commands.executeCommand('setContext', 'explorer-exclude.enabled', false)
}

module.exports = {
activate,
Expand Down
21 changes: 15 additions & 6 deletions extension/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const getWorkspace = (context) => {
if (!root) {
root = vscode.workspace.workspaceFolders[0]
}

workspace = root && root.uri ? root.uri.fsPath : null
} else {
// No file was open, so just grab the first available workspace
Expand All @@ -98,6 +98,15 @@ const getWorkspace = (context) => {
}
}

// If we did not get Workspace, let the user know
if (!workspace) {
const message = localize('debug.logger.missingWorkspace')
logger(localize('debug.logger.error', 'getWorkspace', message), 'error')

vscode.commands.executeCommand('setContext', 'explorer-exclude.missingWorkspace', true)
vscode.commands.executeCommand('setContext', 'explorer-exclude.hasLoaded', true)
}

// Debug Cartridge Path
logger(localize('debug.logger.workspace', workspace))

Expand Down Expand Up @@ -293,13 +302,13 @@ function exclude(uri, callback) {
case 'path':
break
case 'ext':
regex = _meta[key] ? `**${path.sep}*${_meta[key]}` : undefined
regex = _meta[key] ? `**/*${_meta[key]}` : undefined
break
case 'base':
regex = _meta[key]
break
case 'dir':
if (_showPicker) regex = _meta[key] ? `${_meta[key] + path.sep}*.*` : undefined
if (_showPicker) regex = _meta[key] ? `${_meta[key]}/*.*` : undefined
break
}
if (regex) {
Expand All @@ -308,15 +317,15 @@ function exclude(uri, callback) {
})

if (_meta['dir'] && _meta['ext']) {
options.push(`${_meta['dir']}${path.sep}*${_meta['ext']}`)
options.push(`${_meta['dir']}/*${_meta['ext']}`)
} else if (_meta['ext']) {
options.push(`*${_meta['ext']}`)
}

if (_meta['base']) {
options.push(`**${path.sep}${_meta['base']}`)
options.push(`**/${_meta['base']}`)
if (_meta['dir']) {
options.push(`${_meta['dir']}${path.sep}${_meta['base']}`)
options.push(`${_meta['dir']}/${_meta['base']}`)
}
}

Expand Down
Loading

0 comments on commit 8f32214

Please sign in to comment.