You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to ensure that vscode-ansible extension can co-exist with vscode-yaml extension and that file using recommended naming and repository layout are automatically detected as ansible while the rest are detected a just yaml.
This can be achieve by using some smart file.associations inside settings.json, like below:
I tested and these settings take precedence over the file extension advertised by both extensions, which are quite general.
The tricky part is that extension cannot expose these inside its manifest and the only way to enable them is to modify user settings when it starts first time. Likely we would not want to override user settings with our own patterns, so it needs to a prompt: "Do you want to configure file.associations with ansible file patterns?"
The solutions above won't work with roles, because playbooks exist at the root level too. That means the only globs that will actually work in all cases are *.yml and *.yaml, which is why I'd argue that the real solution is for Ansible to have its own file extension. I doubt anyone here can do anything about that though.
We need to ensure that
vscode-ansible
extension can co-exist withvscode-yaml
extension and that file using recommended naming and repository layout are automatically detected asansible
while the rest are detected a justyaml
.This can be achieve by using some smart
file.associations
inside settings.json, like below:I tested and these settings take precedence over the file extension advertised by both extensions, which are quite general.
The tricky part is that extension cannot expose these inside its manifest and the only way to enable them is to modify user settings when it starts first time. Likely we would not want to override user settings with our own patterns, so it needs to a prompt: "Do you want to configure
file.associations
with ansible file patterns?"We can extract a relatively complete list of file patterns from https://github.com/ansible-community/ansible-lint/blob/f2fae710c7ccf99e2db2056569d964564403066d/src/ansiblelint/config.py#L14-L58 as the linter already have logic for distinguishing between random yaml files and files owned by ansible.
The text was updated successfully, but these errors were encountered: