redhat-developer / vscode-yaml

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

"Unknown tag" error when validating sets #191

Closed bfelbo closed 2 years ago

bfelbo commented 5 years ago

This works just fine as YAML:

1:
  not_allowed_match_user_ids: !!set {}
2:
  not_allowed_match_user_ids: !!set {}

However, this extension redlines it and gives the following errors:

unknown tag <tag:yaml.org,2002:set>
unknown tag <tag:yaml.org,2002:set>

According to https://github.com/adamvoss/vscode-yaml/issues/16, it's possible to add these tags to your own settings, but I can't find the right name to add them with.

bfelbo commented 4 years ago

I can add this to settings.json to resolve the error:

    "yaml.customTags": [
        "tag:yaml.org,2002:set"
    ]

However, then I get the following errors:

bad indentation of a mapping entry
unacceptable node kind for !<tag:yaml.org,2002:set> tag; it should be "scalar", not "mapping"
end of the stream or a document separator is expected

Is there anything I can add to settings.json to fix this?

bfelbo commented 4 years ago

Alternatively, is it possible to make this plugin ignore certain (custom) types altogether?

LucasIcarus commented 3 years ago

any updates?

key: !!bool true

will cause similar error.

unknown tag <tag:yaml.org,2002:bool>
gorkem commented 2 years ago

The new parser recognizes YAML 1.2 core schema of which all these tags are part. Closing as I can see them working now.