-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom tags not working #137
Comments
What errors are you getting? |
|
I think in this case you would technically need to do: "yaml.customTags": [ However it looks like there are quite a few bugs in custom tags right now anyways so that won't work currently. I'm working on a fix |
That gets me only halfway: With When I try Do you plan to include 'any' type as well? Or will you make sure that the same tag can be applied to multiple types? Thanks. |
Currently, there are no plans to include (the code that has the issue doesn't live here it lives in http://github.com/mulesoft-labs/yaml-ast-parser/issues iirc).
I hope to do this/someone adds this in the future, it would be very useful. |
I'm was getting a similar problem (Cloudformation yaml tags were causing unknown tag errors), I managed to 'fix' it by:
For reference my versions are: VSCode: 1.30.2 Here's my yaml.customTags:
|
In more news - as soon as I re-enable the Ansible 0.5.2 extension and reload it breaks the yaml custom tags |
Same problem here. Looks like Ansible extension breaks YAML custom tags functionality. |
The ansible extension uses a fork of this one for some reason 🤷♂️ and because of that we can't actually stop it from showing the error see: #178 but it looks like the actual issue was fixed so I'm going to close the issue |
I'm not able to get it working even after disabling the Ansible extension unfortunately. |
@smiller171 Can you open a new issue with your custom tags and also a picture whats in the text document (similar to what was posted in the issue) and other extensions installed. |
I have also tried @AndyJPhillips method above and am not able to get custom tags to work after disabling all extensions and re-enabling just the YAML extension. I have tried removing all custom tags and just trying one at a time. None are working. I am trying to get the Cloudformation (!Ref, !Sub, etc) custom tags to work. I've tried with just !Ref, !Sub. I've tried !Sub scalar, !Sub sequence, !Sub mapping. Nothing. EDIT: If you copy your "yaml.customTags" in settings and add the same to "cloudcode.yaml.customTags", this fixes it. Also with the Ansible extension enabled, if you set "ansible.validation": false the customTags will still work as well. |
I posted another workaround at VSChina/vscode-ansible#230 (comment). |
Or to rephrase this bug is caused by adamvoss/vscode-yaml#16 extension which hijacks yaml customTagsconfig and overrides it for all YAML files, not only for Ansible ones, breaking a huge number of YAML tools. |
FWIW, on MacOS 11.6.1, latest VSCode 1.62.3, extension v1.2.2, I was annoyed by supposed syntax errors in yml files ( AFAICT, the GitLab Workflow extension still can't properly validate yml files with custom tags like "!reference", but thanks to the comments here, I could at least get rid of the syntax errors:
|
See redhat-developer/vscode-yaml#137 for reference Co-authored-by: Kevin DeJong <kddejong@amazon.com>
I have trouble getting the custom tags working. This are my user settings:
cat ~/.config/Code/User/settings.json
and this is the yaml that fails to be parsed:
VSCode version: 1.28.2
YAML Support by Red Hat version: 0.1.0
possibly conflicting plugin? Ansible 0.5.2 (extension association is to YAML, not ansible, though).
I'll be grateful for any hints. I've tried restarting VSCode couple of times, or placing the
yaml.customTags
to workspace settings instead but it did not help. Removing exclamation marks didn't help either. Thank you.The text was updated successfully, but these errors were encountered: