1 | initial version |
To add an array configuration to a VSCode extension, follow these steps:
Create a new file in your extension's root directory named package.json
.
In package.json
, add a new section called configuration
that lists all of the configuration options in an array format.
"configuration": {
"arrayConfig": {
"type": "array",
"description": "An example array configuration",
"default": ["Option 1", "Option 2", "Option 3"]
}
}
workspace
object and the getConfiguration
method.const config = vscode.workspace.getConfiguration();
const arrayConfig = config.get('extensionName.arrayConfig');
arrayConfig
variable in your extension to retrieve the selected options from the user.Note: Make sure to update extensionName
with the name of your extension.