Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
manifestinteractive committed Aug 21, 2022
2 parents 5a38f21 + 8f32214 commit 152a769
Show file tree
Hide file tree
Showing 19 changed files with 155 additions and 94 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
20 changes: 14 additions & 6 deletions extension/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ const getWorkspace = (context) => {
const relative = path.relative(wsFolder.uri.fsPath, vscode.window.activeTextEditor.document.uri.path)
return relative && !relative.startsWith('..') && !path.isAbsolute(relative)
})

// The file that is active does not belong to any of the workspace folders, so let's use the first workspace
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 @@ -96,7 +102,9 @@ const getWorkspace = (context) => {
if (!workspace) {
const message = localize('debug.logger.missingWorkspace')
logger(localize('debug.logger.error', 'getWorkspace', message), 'error')
vscode.window.showErrorMessage(`${localize('extension.title')}: ${message}`)

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

// Debug Cartridge Path
Expand Down Expand Up @@ -294,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 @@ -309,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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 29 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "explorer-exclude",
"displayName": "Explorer Exclude",
"version": "1.3.1",
"version": "1.3.2",
"description": "Explorer Exclude lets you easily Hide Files & Folders with Dynamic Filter Options. Add a New 'Hidden Items' Explorer Pane for you to Manage and Quickly Toggle Visibility of Hidden Items.",
"license": "MIT",
"publisher": "PeterSchmalfeldt",
Expand Down Expand Up @@ -47,17 +47,19 @@
}
],
"activationEvents": [
"onStartupFinished",
"onView:extension",
"onCommand:explorer-exclude.disableAll",
"onCommand:explorer-exclude.enableAll",
"onCommand:explorer-exclude.enabled",
"onCommand:explorer-exclude.exclude",
"onCommand:explorer-exclude.hasLoaded",
"onCommand:explorer-exclude.missingWorkspace",
"onCommand:explorer-exclude.remove",
"onCommand:explorer-exclude.reset",
"onCommand:explorer-exclude.toggle",
"onCommand:explorer-exclude.toggleAllOn",
"onCommand:explorer-exclude.toggleAllOff",
"onCommand:explorer-exclude.disableAll",
"onCommand:explorer-exclude.enableAll",
"onCommand:explorer-exclude.reset"
"onCommand:explorer-exclude.toggleAllOn",
"onStartupFinished",
"onView:extension"
],
"contributes": {
"configuration": [
Expand Down Expand Up @@ -92,6 +94,18 @@
}
]
},
"viewsWelcome": [
{
"view": "explorerExclude.pane.items",
"contents": "%package.loading%",
"when": "!explorer-exclude.missingWorkspace && !explorer-exclude.hasLoaded"
},
{
"view": "explorerExclude.pane.items",
"contents": "%debug.logger.missingWorkspace%",
"when": "explorer-exclude.missingWorkspace"
}
],
"commands": [
{
"command": "explorer-exclude.exclude",
Expand Down Expand Up @@ -165,46 +179,46 @@
{
"command": "explorer-exclude.exclude",
"group": "explorer-exclude@1",
"when": "activeViewlet == 'workbench.view.explorer'"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && activeViewlet == 'workbench.view.explorer'"
}
],
"view/item/context": [
{
"command": "explorer-exclude.remove",
"group": "explorer-exclude@1",
"when": "view == explorerExclude.pane.items && viewItem && viewItem != '**/.git' && viewItem != '**/.svn'&& viewItem != '**/.hg'&& viewItem != '**/CVS'&& viewItem != '**/.DS_Store' && viewItem != '**/Thumbs.db' && viewItem != '**/*.git'"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && view == explorerExclude.pane.items && viewItem && viewItem != '**/.git' && viewItem != '**/.svn'&& viewItem != '**/.hg'&& viewItem != '**/CVS'&& viewItem != '**/.DS_Store' && viewItem != '**/Thumbs.db' && viewItem != '**/*.git'"
}
],
"view/title": [
{
"command": "explorer-exclude.disableAll",
"group": "navigation@10",
"when": "view == explorerExclude.pane.items"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && view == explorerExclude.pane.items"
},
{
"command": "explorer-exclude.enableAll",
"group": "navigation@11",
"when": "view == explorerExclude.pane.items"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && view == explorerExclude.pane.items"
},
{
"command": "explorer-exclude.toggleAllOn",
"group": "navigation@12",
"when": "view == explorerExclude.pane.items && !explorer-exclude.enabled"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && view == explorerExclude.pane.items && !explorer-exclude.enabled"
},
{
"command": "explorer-exclude.toggleAllOff",
"group": "navigation@12",
"when": "view == explorerExclude.pane.items && explorer-exclude.enabled"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && view == explorerExclude.pane.items && explorer-exclude.enabled"
},
{
"command": "explorer-exclude.reset",
"group": "navigation@13",
"when": "view == explorerExclude.pane.items"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && view == explorerExclude.pane.items"
},
{
"command": "explorer-exclude.openSettings",
"group": "navigation@14",
"when": "view == explorerExclude.pane.items"
"when": "explorer-exclude.hasLoaded && !explorer-exclude.missingWorkspace && view == explorerExclude.pane.items"
}
]
}
Expand Down
12 changes: 7 additions & 5 deletions package.nls.bg.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_language": "Bulgarian",
"command.openSettings.title": "Актуализиране на настройките на разширението",
"config.properties.backup": "Конфигурация на ресурси: Конфигурирайте файловете, като използвате глобални модели, за да имате винаги празен последен ред.",
"config.properties.showPicker": "Показване на инструмента за избор на шаблон на файл, когато е активиран, или Изключване на точното съвпадение, когато е деактивиран.",
Expand All @@ -9,15 +10,16 @@
"error.ifExists": "{0} не съществува",
"error.parseFilePath": "{0} не е налице",
"extension.title": "Explorer Exclude",
"package.disableAll": "Деактивиране на всички",
"package.enableAll": "Активиране на всички",
"package.exclude": "Добавяне към скрити елементи ...",
"package.loading": "Зареждане на скрити елементи...",
"package.pane": "Скрити елементи",
"package.remove": "Премахване от скритите елементи",
"package.toggle": "Превключване на видимостта",
"package.disableAll": "Деактивиране на всички",
"package.enableAll": "Активиране на всички",
"package.reset": "Нулирайте скритите елементи",
"package.toggle": "Превключване на видимостта",
"picker.placeholder": "Какво бихте искали да скриете? Изберете всички приложими.",
"reset.prompt": "Нулиране на скритите елементи? Това не може да бъде отменено.",
"tooltip.hide": "Скриване на {0}",
"tooltip.show": "Показване на {0}",
"reset.prompt": "Нулиране на скритите елементи? Това не може да бъде отменено."
"tooltip.show": "Показване на {0}"
}
12 changes: 7 additions & 5 deletions package.nls.de.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_language": "German",
"command.openSettings.title": "Erweiterungseinstellungen aktualisieren",
"config.properties.backup": "Ressourcenkonfiguration: Konfigurieren Sie Dateien mit Glob-Mustern so, dass sie immer eine leere letzte Zeile haben.",
"config.properties.showPicker": "Dateimusterauswahl anzeigen, wenn aktiviert, oder Exakte Übereinstimmung ausschließen, wenn deaktiviert.",
Expand All @@ -9,15 +10,16 @@
"error.ifExists": "{0} existiert nicht",
"error.parseFilePath": "{0} ist nicht verfügbar",
"extension.title": "Explorer Exclude",
"package.disableAll": "Alle deaktivieren",
"package.enableAll": "Alles aktivieren",
"package.exclude": "Zu ausgeblendeten Objekten hinzufügen ...",
"package.loading": "Versteckte Elemente werden geladen ...",
"package.pane": "Versteckte Gegenstände",
"package.remove": "Aus ausgeblendeten Objekten entfernen",
"package.toggle": "Sichtbarkeit umschalten",
"package.disableAll": "Alle deaktivieren",
"package.enableAll": "Alles aktivieren",
"package.reset": "Versteckte Objekte zurücksetzen",
"package.toggle": "Sichtbarkeit umschalten",
"picker.placeholder": "Was möchtest du verstecken? Wählen Sie alle zutreffenden.",
"reset.prompt": "Versteckte Objekte zurücksetzen? Das kann nicht rückgängig gemacht werden.",
"tooltip.hide": "{0} ausblenden",
"tooltip.show": "{0} anzeigen",
"reset.prompt": "Versteckte Objekte zurücksetzen? Das kann nicht rückgängig gemacht werden."
"tooltip.show": "{0} anzeigen"
}
12 changes: 7 additions & 5 deletions package.nls.es.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_language": "Spanish",
"command.openSettings.title": "Actualizar la configuración de la extensión",
"config.properties.backup": "Configuración de recursos: configure archivos usando patrones globales para tener siempre una última línea vacía.",
"config.properties.showPicker": "Mostrar selector de patrón de archivo cuando está habilitado o excluir coincidencia exacta cuando está deshabilitado.",
Expand All @@ -9,15 +10,16 @@
"error.ifExists": "{0} no existe",
"error.parseFilePath": "{0} no está disponible",
"extension.title": "Explorer Exclude",
"package.disableAll": "Desactivar todo",
"package.enableAll": "Activar todo",
"package.exclude": "Añadir a objetos ocultos ...",
"package.loading": "Cargando elementos ocultos...",
"package.pane": "Objetos ocultos",
"package.remove": "Eliminar de los elementos ocultos",
"package.toggle": "Alternar la visibilidad",
"package.disableAll": "Desactivar todo",
"package.enableAll": "Activar todo",
"package.reset": "Restablecer elementos ocultos",
"package.toggle": "Alternar la visibilidad",
"picker.placeholder": "¿Qué te gustaría esconder? Seleccione todas las que correspondan.",
"reset.prompt": "¿Desea restablecer los elementos ocultos? Esto no se puede deshacer.",
"tooltip.hide": "Ocultar {0}",
"tooltip.show": "Show {0}",
"reset.prompt": "¿Desea restablecer los elementos ocultos? Esto no se puede deshacer."
"tooltip.show": "Show {0}"
}
12 changes: 7 additions & 5 deletions package.nls.fr.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_language": "French",
"command.openSettings.title": "Mettre à jour les paramètres d'extension",
"config.properties.backup": "Configuration des ressources : configurez les fichiers à l'aide de modèles glob pour qu'ils aient toujours une dernière ligne vide.",
"config.properties.showPicker": "Afficher le sélecteur de modèle de fichier lorsqu'il est activé ou exclure la correspondance exacte lorsqu'il est désactivé.",
Expand All @@ -9,15 +10,16 @@
"error.ifExists": "{0} n'existe pas",
"error.parseFilePath": "{0} n'est pas disponible",
"extension.title": "Explorer Exclude",
"package.disableAll": "Désactiver tous les",
"package.enableAll": "Activer tout",
"package.exclude": "Ajouter aux éléments cachés ...",
"package.loading": "Chargement des éléments masqués...",
"package.pane": "Objets Cachés",
"package.remove": "Supprimer des éléments cachés",
"package.toggle": "Basculer la visibilité",
"package.disableAll": "Désactiver tous les",
"package.enableAll": "Activer tout",
"package.reset": "Réinitialiser les éléments cachés",
"package.toggle": "Basculer la visibilité",
"picker.placeholder": "Que voudriez-vous cacher? Sélectionnez tout ce qui s'y rapporte.",
"reset.prompt": "Réinitialiser les éléments cachés? Ça ne peut pas être annulé.",
"tooltip.hide": "Masquer {0}",
"tooltip.show": "Montrer {0}",
"reset.prompt": "Réinitialiser les éléments cachés? Ça ne peut pas être annulé."
"tooltip.show": "Montrer {0}"
}
12 changes: 7 additions & 5 deletions package.nls.hu.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_language": "Hungarian",
"command.openSettings.title": "Frissítse a bővítmény beállításait",
"config.properties.backup": "Erőforrás-konfiguráció: Állítsa be a fájlokat glob-mintákkal úgy, hogy az utolsó sor mindig üres legyen.",
"config.properties.showPicker": "Fájlmintaválasztó megjelenítése, ha engedélyezve van, vagy Pontos egyezés kizárása, ha le van tiltva.",
Expand All @@ -9,15 +10,16 @@
"error.ifExists": "{0} nem létezik",
"error.parseFilePath": "{0} nem érhető el",
"extension.title": "Explorer Exclude",
"package.disableAll": "Összes letiltása",
"package.enableAll": "Az összes engedélyezése",
"package.exclude": "Hozzáadás a rejtett elemekhez ...",
"package.loading": "Rejtett elemek betöltése...",
"package.pane": "Rejtett elemek",
"package.remove": "Eltávolítás a rejtett elemekből",
"package.toggle": "A láthatóság váltása",
"package.disableAll": "Összes letiltása",
"package.enableAll": "Az összes engedélyezése",
"package.reset": "A rejtett elemek visszaállítása",
"package.toggle": "A láthatóság váltása",
"picker.placeholder": "Mit szeretne elrejteni? Válassza ki az összes alkalmazást.",
"reset.prompt": "A rejtett elemek visszaállítása? Ezt nem lehet visszacsinálni.",
"tooltip.hide": "{0} elrejtése",
"tooltip.show": "{0} megjelenítése",
"reset.prompt": "A rejtett elemek visszaállítása? Ezt nem lehet visszacsinálni."
"tooltip.show": "{0} megjelenítése"
}
12 changes: 7 additions & 5 deletions package.nls.it.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_language": "Italian",
"command.openSettings.title": "Aggiorna le impostazioni dell'estensione",
"config.properties.backup": "Configurazione delle risorse: configura i file utilizzando i modelli glob per avere sempre un'ultima riga vuota.",
"config.properties.showPicker": "Mostra Selettore modello file quando abilitato o Escludi corrispondenza esatta quando disabilitato.",
Expand All @@ -9,15 +10,16 @@
"error.ifExists": "{0} non esiste",
"error.parseFilePath": "{0} non è disponibile",
"extension.title": "Explorer Exclude",
"package.disableAll": "Disabilitare tutto",
"package.enableAll": "Attiva tutto",
"package.exclude": "Aggiungi a oggetti nascosti ...",
"package.loading": "Caricamento di elementi nascosti...",
"package.pane": "Oggetti nascosti",
"package.remove": "Rimuovi da oggetti nascosti",
"package.toggle": "Attiva / disattiva visibilità",
"package.disableAll": "Disabilitare tutto",
"package.enableAll": "Attiva tutto",
"package.reset": "Reimposta elementi nascosti",
"package.toggle": "Attiva / disattiva visibilità",
"picker.placeholder": "Cosa ti piacerebbe nascondere? Seleziona tutto ciò che si applica.",
"reset.prompt": "Reimposta elementi nascosti? Questo non può essere annullato.",
"tooltip.hide": "Nascondi {0}",
"tooltip.show": "Mostra {0}",
"reset.prompt": "Reimposta elementi nascosti? Questo non può essere annullato."
"tooltip.show": "Mostra {0}"
}
Loading

0 comments on commit 152a769

Please sign in to comment.