Reputation: 27
I would like to know if I can make an extension that enables "Render Whitespace" to all. I know that you can change it in "File->Preferences->Settings->Render Witespace:all" but my question is that I want that when a user installs my extension this property changes.
It is posible? Thank you
Upvotes: 0
Views: 1238
Reputation: 1528
Your extension code may and can change any settings in the user, workspace or machine scope.
Notice there is a gear icon next to every setting, which lets you copy the setting ID:
Copy the ID and use it in this code:
await vscode.workspace.getConfiguration()
.update('editor.renderWhitespace', 'selection', vscode.ConfigurationTarget.Global);
Here is a full example of how to work with configuration settings: https://github.com/microsoft/vscode-extension-samples/tree/master/configuration-sample
Upvotes: 2