Skip to content

Commit bd4f4a9

Browse files
authored
Merge pull request #2 from glektarssza/feature/setting-use-files-exclude
[Feature] Add a setting to control whether to use `files.exclude` when filtering
2 parents 672afaa + 76d6011 commit bd4f4a9

File tree

5 files changed

+22
-28
lines changed

5 files changed

+22
-28
lines changed

.vscodeignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@ types/
88
.gitignore
99
tsconfig.json
1010
vsc-extension-quickstart.md
11-
Dockerfile
12-
docker-compose.yml
1311
.nvmrc
14-
tslint.json

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 1.5.0
2+
3+
## What's New
4+
* Added `advancedNewFile.useFilesExclude` configuration option to select whether
5+
to use the contents of the `files.exclude` setting or not when deciding which
6+
folders to show or not.
7+
18
# 1.4.0
29

310
## What's New

Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

docker-compose.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/extension.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,24 @@ function gitignoreGlobs(root: string): string[] {
6464
}
6565

6666
function configIgnoredGlobs(root: string): string[] {
67-
const configFilesExclude = Object.assign(
68-
[],
67+
const configFilesExcluded: {
68+
[key: string]: boolean;
69+
} = Object.assign(
70+
{},
6971
vscode.workspace.getConfiguration('advancedNewFile').get('exclude'),
70-
vscode.workspace.getConfiguration(
71-
'files.exclude',
72-
vscode.Uri.file(root)
73-
)
72+
(
73+
vscode.workspace
74+
.getConfiguration('advancedNewFile')
75+
.get('useFilesExclude', true)
76+
) ?
77+
vscode.workspace
78+
.getConfiguration('files', vscode.Uri.file(root))
79+
.get('exclude', {})
80+
: {}
7481
);
75-
const configIgnored = Object.keys(configFilesExclude).filter(
76-
(key) => configFilesExclude[key] === true
82+
const configIgnored = Object.keys(configFilesExcluded).filter(
83+
(key) => configFilesExcluded[key] === true
7784
);
78-
7985
return gitignoreToGlob(configIgnored.join('\n'), {string: true});
8086
}
8187

0 commit comments

Comments
 (0)