Skip to content

Is it possible to hide certain properties from autocompletions based on the value of a different property? #475

Closed Answered by gregsdennis
Xterionix asked this question in Q&A
Discussion options

You must be logged in to vote

You might be able to use if/then/else.

{
  // ...
  "if": {
    "properties": {
      "type": { "not": { "const": "values:less_than" } }
    },
    "required": [ "type" ]
  },
  "then": {
    "properties": {
      "class": false
    }
  }
}

That would make validations fail when type is not values:less_than and class is present. How VSCode responds to such a schema is unknown. You'll probably need to go to them if it's not supported.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Xterionix
Comment options

Answer selected by Xterionix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants