VS Code now greys out unused variable/imports. Is there a way to change the color? As the grey conflicts with the theme I am using.
The theme I am using (Blueprint) uses the same color for object keys.
In Visual Studio Code, use Ctrl + Shift + P and type settings. json to the field that shows up. After you type it, it should give you the settings.
please use the default key combination below. CTRL + ALT + O —> to remove the unused imports in windows. However, you can also change the keymap of “Optimize Imports” in settings.
There are two options:
and you can change it via Code > Preferences > Settings > settings.json
like:
"workbench.colorCustomizations": {
"editorUnnecessaryCode.border": "#0000ff"
}
but it does not look well. If you want to achieve a satisfying solution, you can add a new css class into workbench.desktop.main.css
(that's a hack!):
.monaco-editor.showUnused .squiggly-inline-unnecessary {
opacity: 0.8;
border-bottom: 1px dotted red;
color: red;
}
It would then look like (Input
and router
are unused):
Unfortunately, you have to look for the file here: /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.css
; it is a part of the official release:
VSCode shows you a notification after your modification that your installation may be corrupt but you can ignore this message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With