Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 8,
},
env: {
es6: true,
node: true,
browser: true,
jest: true,
},
plugins: ['prettier'],
extends: ['eslint:recommended', 'prettier'],
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
bracketSpacing: true,
semi: false,
printWidth: 500,
},
],
'no-empty': [
'error',
{
allowEmptyCatch: true,
},
],
'no-console': 0,
'no-control-regex': 0,
'no-useless-escape': 0,
},
globals: {},
}
root: true,
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 8,
},
env: {
es6: true,
node: true,
browser: true,
jest: true,
},
plugins: ['prettier'],
extends: ['eslint:recommended', 'prettier'],
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
bracketSpacing: true,
semi: false,
printWidth: 500,
},
],
'no-empty': [
'error',
{
allowEmptyCatch: true,
},
],
'no-console': 0,
'no-control-regex': 0,
'no-useless-escape': 0,
},
globals: {},
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Change Log

> Here's our record of all notable changes made to to this project

V1.3.3
---

* Add explorer-exclude.showSelected command that opens up a QuickPick window with all the excluded items and allows you to quickly filter and select which item you want to be visible in the explorer.

v1.3.2
---

Expand Down
3 changes: 2 additions & 1 deletion extension.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"srggrs",
"viewpane",
"vsix"
]
],
"nuxt.isNuxtApp": false
}
}
28 changes: 28 additions & 0 deletions extension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,32 @@ function activate(context) {
})
})

/*
This command will show a quick pick of all the excluded items
and allow the user to select which ones they want to show.
*/
const showSelected = vscode.commands.registerCommand('explorer-exclude.showSelected', async () => {
util.logger('Toggle All Selected Excludes: Visible', 'debug')
const excludedItems = util.getExcludes()
const selectedExcluded = await vscode.window.showQuickPick(excludedItems, {
placeHolder: 'Select Excluded Files/Folders to Show',
canPickMany: true,
})
/*
First we need to enable all the excludes (Make everything hidden)
*/
util.enableAll(function () {
/*
Then we need to set the selected excludes to visible
*/
util.setExcludeVisible(selectedExcluded, function () {})

setTimeout(function () {
pane.update(util.getExcludes())
}, timeout * 10)
})
})

// Set Initial State of Extension
vscode.commands.executeCommand('setContext', 'explorer-exclude.enabled', true)
vscode.commands.executeCommand('setContext', 'explorer-exclude.hasLoaded', true)
Expand All @@ -143,6 +169,8 @@ function activate(context) {
context.subscriptions.push(toggle)
context.subscriptions.push(toggleAllOff)
context.subscriptions.push(toggleAllOn)

context.subscriptions.push(showSelected)
}

/**
Expand Down
25 changes: 25 additions & 0 deletions extension/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,30 @@ function toggleExclude(key, callback) {
}
}

/**
* Set Visibility of Excluded Pattern
* This function get the exclude items keys and make only them visible
* @param {string} keysToShow
* @param {function} callback
*/
function setExcludeVisible(keysToShow, callback) {
if (!keysToShow) {
return false
}

const excludes = vscode.workspace.getConfiguration().get('files.exclude', vscode.ConfigurationTarget.Workspace) || {}

for (let key in keysToShow) {
key = keysToShow[key].split('|')[0]
// Set visability status
if (key && Object.prototype.hasOwnProperty.call(excludes, key)) {
logger(`Set: OFF | ${key}`, 'debug')
excludes[key] = false
updateConfig(excludes, callback)
}
}
}

module.exports = {
deleteExclude,
disableAll,
Expand All @@ -535,4 +559,5 @@ module.exports = {
saveContext,
toggleAll,
toggleExclude,
setExcludeVisible,
}
Loading