Closed briantist closed 3 years ago
The extension is configured to recognize all .yml
and .yaml
files as Ansible, because Ansible's directory layout and naming conventions (particularly in case of playbook files) isn't any more restrictive than that.
But you can always override that behavior using the files.associations
setting. Using that setting, you could for instance create a glob pattern and map it to ansible
- this will effectively override the configuration that comes with this plugin, so that .yml
/.yaml
files that do not match the glob would no longer be mistaken for Ansible files.
The log output is from the ansible-lint
execution and it does not affect selection of the language for the file.
I definitely understand that Ansible doesn't have restrictive directory layouts that make it easy to know for sure. I feel like a sensible default for your plugin would be to exclude directories with a leading dot .
by default, and instead having those be opt-in, via files.associations
.
You can't easily blanket exclude any .directory
via that setting, so you have to list each type with an affirmative association (so knowing what they all are in advance). At least that's my understanding of it.
@tomaciazek I think .directories
are rare to use in an Ansible layout; would you consider excluding those?
That's not possible in the extension manifest. Essentially, I have the same toolset to work with as you. You can also try to associate all .*/**/*.yml
to yaml
language ID.
Summary
For example, the YAML files in my
.github
directory uses to have proper code completion for GitHub Actions, and my other Ansible extensions did not interfere, but now I can't as this extension has taken over those files as being "Ansible" files.If there's a way to ignore certain paths, that might be good? I can change the dropdown back to YAML for these, but I'd like to not have to mess with file associations in vscode to do this reliably. However the other extensions worked, they were smart enough not to mess with these, so I'd really like that functionality back.
Extension version
1.0.2
VS Code version
1.57.1
Ansible Version
OS / Environment
Ubuntu 18.04 (WSL2)
Relevant log output