redhat-developer / vscode-yaml

YAML support for VS Code with built-in kubernetes syntax support
MIT License
652 stars 221 forks source link

Completion for "const" doesn't work inside "items" #1011

Open EmilyGraceSeville7cf opened 7 months ago

EmilyGraceSeville7cf commented 7 months ago

Describe the bug

When I try to complete an array item which value is restricted by const nothing is suggested. But if I use enum instead of const, then completion brings up.

Expected Behavior

Completion should work in both cases.

Current Behavior

Already explained above.

Steps to Reproduce

Create JSON schema with the following content:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "items": {
    "type": "string",
    "const": "pop"
  }
}

Create a test YAML file and link a JSON schema to it like this:

{
    "yaml.schemas": {
        "schema.json": "test.yaml"
    }
}

Try to type -<space> inside this test file and press Ctrl+Space to get no completion.

Environment