halloleo
halloleo

Reputation: 10354

How to see the current value of a setting in VS Code

In VS Code how can I see the current value of a specific 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?

Upvotes: 2

Views: 1281

Answers (2)

Mike Lischke
Mike Lischke

Reputation: 53307

Settings editor

You can view the value of many specific setting variables via the Settings editor in VS Code (however, not the one you mention; see below). There's a web page describing all aspects of that, including settings for extensions.

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 (⌘,).

Other settings

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.

Upvotes: 2

QuidalTHF
QuidalTHF

Reputation: 11

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')

Upvotes: 1

Related Questions