vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

`allOf` with condition breaks completion

Open EmilyGraceSeville7cf opened this issue 1 year ago • 0 comments

Describe the bug

While choosing suggested property value, Tab inserts <property-value>: <property-value> instead of just <property-value>:

image

Expected Behavior

<property-value> to be inserted instead of <property-value>: <property-value>.

Current Behavior

<property-value>: <property-value> being inserted.

Steps to Reproduce

Setup:

{
    "$schema": "http://json-schema.org/draft-07/schema",
    "definitions": {
        "version-property": {
            "description": "A syntax version\nhttps://taskfile.dev/usage/#getting-started",
            "type": "string",
            "enum": [
                "2"
            ]
        },
        "v2-properties": {
            "properties": {
                "version": {
                    "$ref": "#/definitions/version-property"
                }
            },
            "additionalProperties": false
        }
    },
    "title": "tasks",
    "description": "Tasks",
    "type": "object",
    "required": [
        "version"
    ],
    "properties": {
        "version": {
            "$ref": "#/definitions/version-property"
        }
    },
    "allOf": [
        {
            "if": {
                "properties": {
                    "version": {
                        "const": "2"
                    }
                }
            },
            "then": {
                "$ref": "#/definitions/v2-properties"
            }
        }
    ]
}

schema for some local YAML file via .vscode/settings.json

Try to complete version value and obtain this bug.

Environment

  • [ ] Windows
  • [ ] Mac
  • [x] Linux
  • [ ] other (please specify)

Original issue

EmilyGraceSeville7cf avatar Apr 11 '23 06:04 EmilyGraceSeville7cf