-
Notifications
You must be signed in to change notification settings - Fork 92
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
Wrong yaml schema for group_vars? #36
Comments
I have no idea why it gets confused as based on https://github.com/ansible-community/vscode-ansible/blob/master/package.json#L104-L115 it should pick the first pattern that matches, which is groups_vars. Do you happen to have these under a path that looks like |
The |
I can confirm the bug, in fact it seems that whatever I do vars files seems to endup using the playbook schema. Looking at the config, I see no reason for this to happen. The bug seems related to a recent merge made to redhat-developer/yaml-language-server#417 and I wonder if next release of YAML extension will adress it,... or make things even worse. Test cases:
I hope that @JPinkney or @joshuawilson may give us some insights here. Maybe the can help us by adding some extra tests that assure we can write patterns to distinguish between those cases. |
I can probably take a look as to what's causing on the yaml side later today |
I tested with vscode-ansible@master and I can confirm that now case 1 and 2 are now working (clear improvement), but 3 is not. If you look at https://github.com/ansible-community/vscode-ansible/blob/master/package.json#L117 you will see that vars pattern is listed before the playbook one, so it should be picked first, right? |
It evaluates everything equally, there is no way to prioritise one or the other. Let me try it with redhat-developer/yaml-language-server#417 and i'll see if that fixes it |
I played around with
you'll see an error with:
|
It looks like
I'm getting this error:
redhat.vscode-yaml Preview v0.18.0 Please let me know if it's not related and needs a separated issue. |
The bug is valid and the correct place to raise it is at https://github.com/ansible-community/schemas -- as this is missing from the schema. It should not be hard to add it. Update: I already made a PR to add it ansible/schemas#32 -- look at it and you will know how to add the next bit we find missing. |
We are unable to reproduce this with current version of the extension, please upgrade and report if you can see the error. |
While we had eslint configured inside the repository, there was no CI job running it. This change adds eslint as part of our existing lint job (pre-commit). Only two files were automatically reformatted by this change.
i have opened a Folder containing a playbook in vscode.
inside a subfolder named
group_vars
i haveall.yml
containing some variables.vscode-ansible complains about the format because it uses the "Ansible Playbook Schema" for some reason:
i saw you have set
yamlValidation
accordingly in your package.json so i don't know what is happening here.The text was updated successfully, but these errors were encountered: