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

Broken completion for allof inside ref

Open marcelldls opened this issue 8 months ago • 0 comments

Describe the bug

Expected Behavior

Completion returns key:\n\t

Current Behavior

Completion returns key

Steps to Reproduce

  1. Insert # yaml-language-server: $schema=example.schema.json as file header
  2. Try a working example and observe expected behavior:
{
  "title": "Values",
  "type": "object",
  "$schema": "http://json-schema.org/schema#",
  "$ref": "#/$defs/instance",
  "required": [
    "thisinstance"
  ],
  "$defs": {
    "union": {
      "type": "object",
      "properties": {
        "config0": {
          "type": "string"
        }
      }
    },
    "instance": {
      "type": "object",
      "properties": {
        "thisinstance": {
          "$ref": "#/$defs/union"
        }
      }
    }
  }
}
  1. Try a broken example and observe undesired behavior
{
  "title": "Values",
  "type": "object",
  "$schema": "http://json-schema.org/schema#",
  "$ref": "#/$defs/instance",
  "required": [
    "thisinstance"
  ],
  "$defs": {
    "union": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "config0": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "properties": {
            "config1": {
              "type": "string"
            }
          }
        }
      ]
    },
    "instance": {
      "type": "object",
      "properties": {
        "thisinstance": {
          "$ref": "#/$defs/union"
        }
      }
    }
  }
}

Environment

  • [ ] Linux

marcelldls avatar Jan 29 '25 10:01 marcelldls