sadesyllas / explorer-excluded-files Goto Github PK
View Code? Open in Web Editor NEWExclude files from the Visual Studio Code explorer
License: GNU General Public License v2.0
Exclude files from the Visual Studio Code explorer
License: GNU General Public License v2.0
The default setting of
"explorerExcludedFiles.patterns" : [
"file://.gitignore"
]
should be changed to something like:
"explorerExcludedFiles.patterns" : [
"file://${XDG_CONFIG_HOME}/git/ignore",
"file://${HOME}/.config/git/ignore",
"file://${USERPROFILE}/.config/git/ignore",
"file://.git/info/exclude",
"file://**/.gitignore"
]
This is ordered so that the highest-priority file appears last.
${XDG_CONFIG_HOME}
and ${HOME}
should be done only on Linux and macOS, while the entry with ${USERPROFILE}
should be done only on Windows. (These are expressed in terms of environment variables; I'm not sure if these are currently supported.).gitignore
files in subdirectories. The current implementation doesn't support wildcards, so that will need to be implemented.git config --get core.excludesFile
should also be considered before all others.Got next error from runtime status
ENOENT: no such file or directory, open '/home/[username]/.config/Code/User/settings.json'
After creating empty settings.json file with only {} structure got error related to json
Basically bug #1 is back: the extension is checking its state every few seconds. While doing so it would first clean out the ignore list, then add its own items. Both actions would write the file, resulting in at least two writes per workspace folder.
Another issue seems to be that with no configuration given for a folder, it would compare workspaceConfigurationText
and workspaceConfiguration
. While the former would be initialized, the latter is not. Which means that the former would become {files.exclude:{}}
by default, but workspaceConfigurationText
would stay {}
- causing the re-build of the file when no exclusion is defined in a project.
The fix probably would be to only modify the data during cleanWorkspaceConfiguration
and patch*Configuration
in memory, then run the configurationsAreIdentical
check on that value. Otherwise that check would always fail.
If settings.json has something like /* I'm a C-style comment */
and you try to run command Hide Explorer Excluded Files
, then you will get the following...
error: command 'extension.hideExplorerExcludedFiles' not found
and in the console:
mainThreadExtensionService.ts:110
Activating extension `sadesyllas.explorer-excluded-files` failed:
Unexpected token / in JSON at position 131.
I regularly open subfolders in vscode to cut out a lot of the noise when working. This causes this extension to write { "files.exclude": {} }
in a .vscode folder there, which I then have to remove again later.
Could this extension not write when there are no ignored files? Cheers!
The .gitignore
format supports negations with the !
prefix. For example, to ignore wp-*.php
but not wp-config.php
:
node_modules/
!wp-config.php
wp-*.php
Right now, explorer-excluded-files
doesn't recognise the negation, and includes the whole line in files.exclude
:
"files.exclude": {
"node_modules/": "explorerExcludedFiles",
"wp-*.php": "explorerExcludedFiles",
"!wp-config.php": "explorerExcludedFiles"
}
Since the only entries in that file are generated by explorer-excluded-file I presume that this extension is regenerating that file periodically, but way too often.
According to the .gitignore
documentation:
.gitignore
: *.o
, then Git ignores .o
files in both the top-level directory and any subdirectories. (Git also behaves the same way if I specified it like: **/*.o
. A non-trailing **
means "match zero or more directories", while a trailing /**
means "match all files and directories inside this directory".).gitignore
file in which the pattern occurs, but not upwards. So if I have *.o
in my a/.gitignore
file in my repo, then Git will ignore a/hello.o
and a/c/foo.o
, but not b/bar.o
.Neither of these behaviors are replicated in VSCode by this plugin.
files.exclude
seems to always need patterns to start with **/
in order for them to match files in subdirectories. (The plugin should cater for this by prepending each pattern with **/
if it does not already begin with it.).gitignore
file are directly enlisted in files.exclude
without regard to the location of the .gitignore
file the pattern is from. The plugin should cater for this by prepending each pattern with the directory of the contributory .gitignore
file, and a /
(and then **/
as above).Finally, the README.md
says:
If you specify a pattern beginning with
file://
, e.g.,"file://.gitignore"
, the pattern is interpreted as a file...
This led me to believe that I can get the plugin to pick up all my subdirectory-level .gitignore
files by having something like "file://**/.gitignore"
. I was wrong; perhaps it would be good to rephrase it to avoid confusion:
If you specify an entry beginning with
file://
, e.g.,"file://.gitignore"
, the entry is interpreted as a file...
I tried adding enlisting some subdirectory-level .gitignore
files in my User Settings, but they were not considered at all. It only works if I enlist them in my Workspace Settings.
For consistency with other settings of VS Code configuration, the plugin should respect both User Settings and Workspace Settings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.