Skip to content

Allow setting yaml.customTags as prefixes, so any suffix like !u!28 is accepted without errors #1156

@geekley

Description

@geekley

Is your enhancement related to a problem? Please describe.

Same problem as this, but the proposed solution is terrible:

Errors in Unity's asset files are impossible to disable without either:

Describe the solution you would like

Please allow a way for yaml.customTags to set the tag as a prefix. For example, you can simply allow a <*> at the end so that all tags with the prefix are matched. If you want to go even further, you could even allow any JS regex within <...> for a simple but flexible implementation. For example:

"yaml.customTags": [
    "tag:unity3d.com,2011:<*> mapping", // allow any suffix, e.g. `tag:unity3d.com,2011:28`
    "<tag:unity3d[.]com,2011:\\d+> mapping", // allow any custom regex
]

Describe alternatives you have considered

I've tried setting an empty json schema https://www.schemastore.org/any.json, but it doesn't suppress the "Unresolved tag" errors.

I've tried disabling validation to stop the errors, but it seems it can only be done globally, not per file extension/glob, see:

Additional context

I don't know if I'm supposed to use some other workaround here, like referencing custom tags from an external URL somehow, or using some Unity YAML schema, but I didn't find anything of the sort.

I chose "enhancement", but I might as well call it a bug, since I get errors with no workaround, and tag suffixes are a part of YAML spec as far as I understand. You shouldn't force people to have to add every possible suffix, as the list can be giant and change with time, as in Unity's case.

If there's already a way to do this currently, then it's not properly documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions