clifford-github / sublime-ansible

Syntax highlighting for Ansible
MIT License
135 stars 11 forks source link

Comment at the end of string block causes scope issue #39

Closed mrmeszaros closed 1 year ago

mrmeszaros commented 1 year ago

The following code breaks the syntax highlighting:

- name: Run stuff
  shell: |
    echo Hello
    # echo World!
  changed_when: no

Here, the colon : after changed_when colors as a string (yellowish) instead of a punctuation (white):

sublime-ansible-block-comment-bug

Checking the scope, this seems to be caused by the string.unquoted.block.yaml scope not ending because the # echo World! line is interpreted as a comment instead of part of the string. Here is a YAML syntax coloring:

sublime-ansible-block-string-yaml

killua99 commented 1 year ago

Gonna double check comment rules

mrmeszaros commented 1 year ago

Thank You! In the meantime I did some more testing, and it seems it's not only end of block comments, but all lines starting with # (like shell comments).

killua99 commented 1 year ago

I manage to tweak the rules, could you test the master branch?