-
Notifications
You must be signed in to change notification settings - Fork 77
Add Jinja highlighting for special Ansible functions #2
Comments
In this example
are you saying that you want the second and third "when" to be in the same highlight group? I assume you do not want anything special for the first "when". Currently, the three "when"s are
|
You are correct, I want the second and third "when" to be highlighted the same. |
I am still not sure what you want. If you want the third "when" in the example to be highlighted the same way that the second is now, then all it takes is
and I guess you would do the same for It looks as though |
That's not quite the case. Notice that ansibleRepeat and ansibleConditional are both essentially just keywords. I do not want to change
So making the value use For Ansible |
I was right about one thing:
Please keep the terminology straight: syntax groups and highlight groups are closely related, but they are not the same.
No, this is how they are highlighted:
(BTW, is there an easy way to generate those links, or do you type in things like I am pretty sure that my previous comment is completely correct as stated. What may be wrong is the hypothesis:
If that is the problem, then please be clear about which word you want highlighted differently. Or supply your own example. Here is a screenshot of the example I proposed: |
Sorry, I did interchange terminology incorrectly. I edited my previous comment in hopes that it is more clear. Regarding those links with the lines highlighted, when viewing a code file you can click a line number to highlight it. This changes the URL of the current page to correspond to the change. To select a line range, click the first line you want then shift-click the last line you want. |
Essentially it is not a single word's highlighting to be changed, otherwise I would have implemented this a long time ago. I want the value of the key-value mapping to be highlighted as I described above. |
Thanks for the tip on using GitHub. Referring to the example, I now think that you want to leave the "when"'s as they are, but change "some_condition" to have the same highlighting as the second "when". In other words, "some_condition" should be part of the |
Sounds like I finally got my thoughts across properly, haha. Sorry about all the communication issues. Yes, "some_condition" should be part of a syntax group that behaves just like |
Add this cluster, then replace a bunch of containedin=jinjaVarBlock,jinjaNested clauses with contains=@jinjaNestedElement on the jinjaVarBlock and jinjaNested syntax groups.
These replace the jinja variants for mappings where the key is one of the Ansible keywords when, changed_when, or with_*. The ansibleVarBlock item can contain exactly the same things as the jinjaVarBlock element, namely the @jinjaNestedElement syntax cluster.
Add this cluster, then replace a bunch of containedin=jinjaVarBlock,jinjaNested clauses with contains=@jinjaNestedElement on the jinjaVarBlock and jinjaNested syntax groups.
These replace the jinja variants for mappings where the key is one of the Ansible keywords when, changed_when, or with_*. The ansibleVarBlock item can contain exactly the same things as the jinjaVarBlock element, namely the @jinjaNestedElement syntax cluster.
Strings, encased or otherwise, should be highlighted as if they were between Jinja variable blocks for the following keys:
There are probably more, but they can be added later.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1446702-add-jinja-highlighting-for-special-ansible-functions?utm_campaign=plugin&utm_content=tracker%2F509109&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F509109&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: