Reputation: 27
How would I have a type that requires a boolean or null
?
The relevant snippet that I was able to one up with:
"something": {
"type": ["boolean", null],
"default": true,
}
When I used this and tried to change that in vsc, there was only an option to copy that option into the User Settings/Workspace. But, with a boolean type by itself, it'd show true
or false
when changing the value. How can I implement this so that when attempting to edit it in the settings, it'd show true
, false
or null
in the edit popup?
EDIT: I was able to get the pop up when using "enum": [true, false, null]
. Still curious if there are any other ways.
Upvotes: 2
Views: 207
Reputation: 65453
Use the string "null"
instead of null
itself:
"something": {
"type": ["boolean", "null"],
"default": true,
}
Upvotes: 1