What are the best practices to store user settings for the extension? I can think of saving them in some specific format in the text file. Is there any integrated way of doing that using vscode
API?
VSCode extensions typically contribute settings to be used in user and workspace settings.json
files.
Settings are registered via contributes.configuration
in an extension's package.json
, and the allowed values can flexibly be described with a JSON schema (which also allows for code completion in the JSON file). The value of settings can then be checked by using the workspace.getConfiguration()
API.
There is also a sample extension that showcases the Configuration API in vscode-extension-samples.
Having a separate file just for a specific extension's settings would be a bit unusual.
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