vermut / intellij-ansible

YAML/Ansible support with Jinja2 tags / IntelliJ IDEA
https://plugins.jetbrains.com/plugin/7792
Other
205 stars 29 forks source link

False-positive in source code when using nested dicts access #92

Open vfrans opened 6 years ago

vfrans commented 6 years ago

Hello,

Syntax highlighting detects an error and is getting confused for the rest of the source file when that king of source is used:

- name: Check that db_pass is the same everywhere
      fail:
        msg: "db_pass is not the same on every host"
      when: hostvars[item]['db_pass'].stdout != hostvars[groups['camundahosts'][0]]['db_pass'].stdout
      with_items: "{{ groups['camundahosts'] }}"
      run_once: true

The error in this example appears right between the first hostvars[item] and ['db_pass'] (line 4 in the example) and it states:

Expected key-val pair or array item

After that, nearly everywhere in the file the following error is detected:

unexpected token at end of file

That source thought is exectuted without any error by ansible.

Thanks a lot for your help!

rfvermut commented 4 years ago

this plugin does not feature a fully compatible yaml parser, it will hiccup on any complicated