How do you reset an extension's settings in vscode? - visual-studio-code

I was trying to do some custom settings for the C++ and CMakeTools extensions. But now I want to reset/revert everything to defaults. How do I do that?
I tried uninstalling the extensions and re-installing, and they got re-installed with my custom settings wtf.
I see no reset buttons in the UI
I don't know where the per-extension settings are stored on my computer.
What am I not understanding? Why is this so unobvious?

As described in this feature request, you cannot do this directly. However, you can open your settings.json file and find the extension settings, then manually remove them.
Keep in mind, removing the extension won't remove its settings. So reinstalling the extension will not reset it at all, but keep your previous configuration.

There's a Settings tab (and apparently extension settings can be both in the User subtab and the Workspace subtab).
There's User, Workspace, and Default settings.json's which you can open from Ctrl+Shift+P, start typing "settings.j", and see the 3 suggestions (the user settings file is located at C:\Users\{USER_NAME}\AppData\Roaming\Code\User\settings.json (see docs for all OS paths).
Compiler settings are in c_cpp_properties.json, Compiling settings are in tasks.json, Debugging settings in launch.json. These are in your project folder under the .vscode folder, and you can search them in Ctrl+Shift+P (but don't write .json at the end or it won't show up).
Also check your system environment variables for "CXX" and "CC" env variables which can also overwrite the compiler (and the ui says nothing about this).
Apparently there's no way to reset all settings (the "permanence" is a giant source of ux confusion, a meme decision in my professional opinion).
Luckily you can just go to Settings and write #modified to see all the settings you've changed!
Ok, so to finally answer: HOW do you RESET an individual setting?
This cannot be "googled": There's an invisible hover hitbox on the left side leading to a hidden settings gear (red dotted line):
This ux is the source of the problem.
In VSCode, "removing"/"deleting" a setting means "resetting" it. Your settings are just "overwritings". So all auto-defaults should pop back into the UI after a VSCode restart, I hope. (also the aforementioned .vscode settings / env vars / build folder might still override)

Related

How to avoid VSCode from overwriting workspace settings while have settings sync on

I have (builtin) settings sync on in VSCode. For various workspaces I use the the workspace settings to give titleBar of each workspace a different color for easy recognition. However everytime I re-open a workspace (for which I set workspace settings for titleBar colorCustomizations) VSCode tries to overwrite the values in workspace settings.json into the ones used in user settings.json.
Example the workspace settings.json I set for the workspace:
{
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#f558be",
"titleBar.activeForeground": "#ffffff",
"titleBar.inactiveBackground": "#f424ac",
"titleBar.inactiveForeground": "#cccccc",
"editorGhostText.border": "#d94e4e",
"editorGhostText.foreground": "#b95454",
},
}
Which at re-opening are overwritten and thus changed into:
{
"workbench.colorCustomizations": {
"editorGhostText.border": "#d94e4e",
"editorGhostText.foreground": "#b95454"
},
}
I tried setting:
"settingsSync.ignoredSettings": [
"workbench.colorCustomizations"
],
in User settings, but that seems only works on user settings, as it does not solve my issue. The settingsSync.ignoredSettings, which might solve my issue, can not be set on Workspace settings.
I tried adding vscode/ or vscode/settings.json to the .gitignore file of my project, but issue remains.
How can I avoid VSCode trying to overwrite my workspace settings?
According to the documentation Settings precedence "later scopes override earlier scopes", and Workspace comes after User.
Values with Object type are merged – like workbench.colorCustomizations then:
If there are conflicting values, such as editor.selectionBackground in the example above, the usual override behavior occurs, with workspace values taking precedence over user values, and language-specific values taking precedence over non-language-specific values.
Does the problem go away if you disable Sync?
Are you using the latest version of VS Code?
Turns out I have installed an extension which already deals with UI colors called Peacock. It overrides the workspace settings. When I disable it the issue is gone. It looks nice actually, so better just start using it.

vscode settings pane is blank

For some reason, my vscode is no longer showing any settings in the UI settings pane. I can still open my settings.json, but even with my settings editor set to "workbench.settings.editor": "ui", I still get this:
I'm on macOS Catalina version 10.15.7 and vscode version 1.52.1
Any ideas on what might be causing this? Should I make a backup of my settings files and then reset the settings to default?
I was having this exact same issue recently, so I was a little disappointed when there were no solutions. I did not have my settings editor set to "workbench.settings.editor": "ui",as you had, so I tried doing that, but after restarting vscode it didn't appear to do anything.
I've been working in the same folder for a while now, so I tried toggling to a different folder to see if somehow that would kickstart vscode into displaying the settings pane. That did not work, but when I toggled back to the folder that I was originally in, the settings pane was now populating with the normal settings for User and Workspace.
A little bit more troubleshooting and it seems like if I have the settings pane already open in the workspace when the workspace loads (either by toggling to a new folder or by restarting vscode), I can see the settings, but if the settings pane is not already open in a workspace and I try to open it, I get a blank page. I also noticed that the settings pane that appears when you load a fresh workspace is stuck on one tab (ie the settings don't change if you toggle between User and Workspace), but if I close and reopen the tab (not the whole workspace), it works as expected. Here's a gif to prove I'm not crazy:
This is me just clicking around to show the behavior I'm describing
I can't embed the picture because of my reputation, but hopefully that shows the behavior I am seeing. I wouldn't be surprised if at the end of the day this is still somehow my fault because of my settings or something, but hopefully this helps someone else.
Small Edit
Just wanted to point out that I acknowledge that this is not an actual solution to the underlying problem, but it's certainly worked well enough for me for now, maybe some one else can chime in with the true solution.

why there is no selection when I click F5 to run program in vscode

In the begin, for example, I'd like to run program by click F5, and there is a selection box on the top of vscode. However, maybe I click some errorly, it debug directly, and no selection here, and the terminal shows (base) in the front of result, why and how to correct to original setting?
One way to reset VS settings as follows:
Note: Please use save as to backup settings.json in case you have something that you may need to restore later.
DO NOT DELETE ANYTHING FROM YOUR "defaultSettings.json"
These instructions are only for clearing out everything except {
} within your user settings.json:
The easiest way to reset VS Code
back to the default settings is to clear your user settings.json file
contents in the Settings editor. Delete everything between the two
curly braces, save the file, and VS Code will go back to using the
default values.How can I reset my user settings?
If following above does not resolve your issue, please consider adding a screenshot of the issue along with your posted question and/or add default settings.json, so it can be compared with a working default settings.json file for your assistance.

VSCode Settings.json is empty

I just install the latest version of the VS Code on my Win 10 x64, before that I install Python as well, but nothing else.
When I open the VS Code, it seems my Settings.json is empty (just my theme and zoom level are there).
I opened the Settings.json from settings with clicking on the icon that you can see in the bellow image (noted with a red circle in the top right side) or with searching the JSON keyword in the setting (result is the same)
But in this file I just have two lines of code which you can see in the below image:
But I think it has to bee a big file with lots of settings and so on, even I check this file in this path: %APPDATA%\Code\User\settings.json and it was empty and just have this two lines of code.
I install the python extension, Dracula theme and so on in my VS Code.
.
Can you help in these questions:
Do you know what is the problem?
How I can restore the default value of the setting? (in case they are missed)
I want to change the color of the comments in the python language because in this theme it is not easy for me to read them in files, I found I can change it from the Settings.json but mine is empty,
settings.json only contains those settings which override the default behaviors.
In order to restore the default settings (from .json) you have to delete the line. (You can also do it from the GUI)
I think the setting "workbench.colorCustomizations" is what you are searching for; try to Google it.

IntelliJ Macro menu

I've just started playing with macros in IntelliJ. I recorded several then played back until I decided to add keymap shortcuts to my macros. I went to Settings and pressed Alt+C to add a new child map because I couldn't edit the parent. Since then the macros are no longer accessible from the Tools menu, not to mention that the shortcuts don't work. I tried removing the shortcuts from the keymap but even though I press Alt+R or Alt+L, it still does not revert them back. And TAB has stopped working .. when writing sout +TAB ..nothing happens anymore... HELP
Sorted! sout+TAB is part of live templates..
If you open the IDE Settings window, you will see Live Templates.. Under output you should find sout(Prints a string to System.out).. if not, click Add and then type sout for the Abbreviation section, type in a description and then for the template text put System.out.println("$END$");
I use the Default keymap in IntelliJ now...
Thought this might help someone...
You can try to use the default keymap. When you modify the default keymap, a copy is created with your settings.
If that is not working, you can try to quit IntelliJ and to delete this file:
/.IntelliJIdea90/config/options/macros.xml
and check also for the folder
/.IntelliJIdea90/config/keymaps
To find the location of the config folder you should look for the file : idea.properties in the folder where the main executable for idea is.
Look for the line:
# path to IDEA config folder. Make sure you're using forward slashes
idea.config.path=${idea.home}/.IntelliJIdea90/config
And this is the location of the config. folder.
Restart IntelliJ.
Take a copy of any file you are going to delete!