Skip to content

Enable custom validation of Settings through ConfigurationChangeEvent #133604

@robole

Description

@robole

Currently, it is not possible to do custom validation of Settings programmatically. There are some options in the Extension Manifest (package.json) e.g use a regex to validate a string. However, if you have a group of options (like a checkbox group), and you want to have at least one to be selected, this is not possible to validate. I have this scenario for my extension Marky Stats, I always want at least one stat to be selected. I can do this validation with the QuickPick, but I cannot do the equivalent with the configuration.

example

Currently, you can use the workspace.onDidConfigurationChange event to respond to config options being changed, but you can only tell if something has changed or not. This is done through ConfigurationChangeEvent.affectsConfiguration(). It would be great if you could update the API of ConfigurationChangeEvent to enable a change to be validated.

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions