In the explorer of VS Code I want to have the gitignored files grey.
I managed to add "gitDecoration.ignoredResourceForeground":"#CCCCCC"
, however I now have various files and folders where there are other decorations and it looks like explorer.decorations.colors
takes precedence over this. This mechanism now destroys the coloring of the ignored resources again as it looks like this rule is checked later.
How can I fix this and have the gitignored rule applied no matter what happens otherwise?
This is for:
VSCode: Version: 1.73.1
Release: 22314
Commit: 14f2d26367b7e8f03ff2352516ba27d6302dd7b1
Date: 2022-11-10T18:37:51.314Z (2 wks ago)
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 19.6.0
Sandboxed: No
MacOS: Catalina 10.15.7
Git: 2.38.1
The screenshot shows a situation where chamaeleon/
is part of .gitignore
. All files nicely are greyed out with the exception of ChameleonTemplate.php
which contains a PHP error, as well as src
which contains a file containing an error and Components
which contains another file with an editor decoration due to a type problem in PHP.
Clarification: My question is not about files which are only gitignored (they show uo correctly) but about files which are gitognored and have a further editor decoration (such as a syntax error). If these two decorations apply both then the question is which one takes precedence. That is the problem here.
My question is rather not a bug (as in "does not work as expected") but a conceptual one. If we have two different reasons for setting foreground color, and both reasons apply, which color is chosen?
A workaround would be if we were able to set other attributes such as underline, strike-through, background-color or font type and not only foreground-color, because such attributes could be combined. Foreground-color and foreground-color cannot be combined but needs a precedence rule.
4
Answers
For me this happened automatically… I think you just need the high-contrast dark color theme in vscoode. You could also choose another color theme but this changes. You could also look into making you own color theme for vscode like I did, and edit the colors to your liking.
As you can see,
fort-bishop.exe
is grayed out. I have ignored it in my.gitignore
.Probably you should provide more information, like VS Code and git version. I am running VS Code 1.73.1 and git 2.37.1 in macOS and it works automatically.
Possible solutions:
Probably, you missed
workbench.colorCustomizations
.In your
settings.json
:Seems like a known issue. Yet, please add VSCode version details. Below are the possible workarounds which might help: