In VS code how can I see the current value of a specify setting variable?
For example: I have the Code Runner extension installed. In the Feature contribution page I saw that it has a setting variable
code-runner.executorMap (Set the executor of each language.)
How can see the current value of this setting? Is there a way to display this value? Or do I need to trawl through the different JSON setting files (Default/User/Workspace) to then determine its current value?
(1) You can view the value of many specific setting variables via the settings editor in VS Code. There's a web page describing all aspects of that, including settings for extensions.
To modify user settings, you'll use the Settings editor to review and change VS Code settings.
To open the Settings editor, use the following VS Code menu command:
On Windows/Linux - File > Preferences > Settings
On macOS - Code > Preferences > Settings
You can also open the Settings editor from the Command Palette (⇧⌘P) with Preferences: Open Settings or use the keyboard shortcut (⌘,).
(2) However some settings - like the one you mention (code-runner.executorMap) - cannot directly be viewed in the settings editor. They just show up with a "Edit in settings.json" link.
When you click that link VS Code will possibly add the default value for that variable to your user or workspace settings file. Be aware of this.
Maybe you can use this https://code.visualstudio.com/api/references/vscode-api#WorkspaceConfiguration.
const myWorkbench = vscode.workspace.getConfiguration('myWorkbench')
const yourConfigValue = myWorkbench.get('yourConfigValue')
Related
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)
Where I can find good documentation for every available settings.json configuration option so I can configure VS code however I like to?
There isn't an official maintained list of everything, but you can find some guides in the VS Code Documentation.
For theme color reference, you can see the list at Theme Color documentation.
The closest to what you want may be pressing Ctrl+, (or by using the gear menu in the bottom left), you can open a GUI that will show all configurable settings and allow you to search them. For some things, it will tell you to edit it in the settings.json instead, though. In which case, you may need to to look at the documentation for usage instructions.
Using the quick open shortcut (CTRL/CMD + P) to navigate files always put the recently opened files first, then the file results.
I would like it to show me only the file results, or at least put them first, but I can't find any options that would do this. Does it exists? Or do I just lack the right term to search ?
Use this in your VS Code settings (Code -> Preferences -> Settings in macOS, File > Preferences > Settings on Windows/Linux). Open the Settings in JSON format (document icon on the top right of the tab bar), and add:
"search.quickOpen.includeHistory": false
I am adding this answer just to give a description of that property. All credits to #Hejazzman.
"search.quickOpen.includeHistory": false, // by default is true
This setting was released of VS code version 1.28 in September 2018. According to the official release documentation,
A new setting allows you to control if files that were recently opened should be part of the Quick Open file picker. By default, files that were recently opened will appear to the top of the search and other files from the workspace below. If you would prefer to not see recently opened files on top, you can change this setting to false.
When I'm opening settings using Preferences: Open Settings (JSON) I'm getting screen like this:
But in VSCode videos/tutorials I see people somehow have splitted window, with default settings on the left and user/workspace setting on the right:
How I can enable it?
===========================
EDIT:
I found "workbench.settings.openDefaultSettings" option and set it to true, but still my UI is different from desired on screenshot above ( I don't see search box for searching settings, also I don't see the message Place your settings in the right ... to override):
As mentioned #Juraj Kocan in comments, it happens after last VS Code updates.
This is Github issue related to this new "feature"
This one helped me:
"workbench.settings.useSplitJSON": true,
"workbench.settings.editor": "json",
How to Get to the JSON settings in Newer Versions of VS Code
In the latest versions of VS Code, you can convert back to the split JSON settings editor by changing the following settings in the (now standard) UI settings editor:
Workbench > Settings: Editor
Change from UI to json
Workbench > Settings: Use Split JSON
Checkmark to enable the option
after making this change, VS Code will open its settings as a JSON file, like in older versions of the application, rather than in the new UI. This allows you to make the changes that other answers provide, directly in the JSON (if you can find the right place and file to make them in..)
NOTE: Whether or not you actually want to use the JSON settings is a different question. Most of the time, the settings search function allows finding the same settings in the new UI. Sometimes it is difficult to get search to work though, especially if the settings are worded differently in the new UI style. There may also be cases where extensions haven't been updated to accommodate the new UI setting style, and so there is no option but to enter the JSON directly.
Not sure what do you mean by "Default".
steps to open setting by keyboard are:
press Ctrl+p (an input command line would appear at the top.)
press >
A List will appear like that in image. (search preference for all vs code settings)
I updated my VS Code at the morning and now at night it shows a badge on setting icon for install updates. As it seems VS Code update files arrives every second to second and it makes me to install updates (it makes you to close editor and when you want to open it, take a long time to install the new updates and then opens the updated version).
I know that being up to date is cool but forcing you to update twice a day is not cool for me, so is there any way to disable vs code from updating?
Have you tried updating JSON User settings to "update.mode": "none"
Navigation steps:
File > Preferences > Settings or [ Ctrl + Shift + , ]
References:
https://code.visualstudio.com/docs/supporting/FAQ
Following block of text is from the FAQ VS Code
How do I opt out of VS Code auto-updates?
By default, VS Code is set up to auto-update for macOS and Windows
users when we release new updates. If you do not want to get automatic
updates, you can set the update.channel setting from default to none.
To modify the update channel, go to File > Preferences > Settings and
add the update.channel setting with the value "none".
"update.mode": "none"
I had this problem for a long time and solved as in the steps in the screenshot. I set it to manual and it works:
The none option works so no clear difference between the two options.
go to File > Preferences > Settings (macOS: Code > Preferences > Settings), search for update mode and change the setting to none