Closed benjifisher closed 9 years ago
Maybe what I refer to as a "flow hash" is what #8 calls a "scalar block". If so, then we already have an open issue for a "more complete solution".
Scalar blocks, or block scalars, are not what you are referring to, see the YAML spec: http://www.yaml.org/spec/1.2/spec.html#id2793652.
Flow hashes, or flow mappings, are covered in: http://www.yaml.org/spec/1.2/spec.html#id2790832.
The issue indeed has nothing to do with Ansible loops, but entirely has to do with flow mappings not being implemented. For what it is worth, flow sequences are not implemented either.
This patch doesn't seem to change the highlighting for the example given in #16 except for allowing the highlight of the }
at the end.
Comments are still broken. The ,
delimiter and version
mapping are both still highlighted as strings.
Terminology: I was almost right, referring to { name: 'Jinja2', version: '2.7.1' }
as a flow hash. The correct term is flow mapping. Thanks for the reminder.
A complete solution to the current problem would require recognizing flow mappings. Do we have an open issue for that?
I see the problem. When I was working on this, I used :hi link yamlString WarningMsg
in order to make the difference more visible. Without that, both yamlString
and yamlScalar
are linked to String
, so there is no visible difference. Which of them do you want to change, and to what?
This quick fix improves the highlighting for the example in #16.
I do not think that
with_items
has anything to do with the problem here. The reason the strings are not highlighted is that theyamlScalar
syntax group does not allowyamlString
inside it; this patch changes that.A more complete solution to the problem would be to recognize
{ name: 'Jinja2', version: '2.7.1' }
as a flow hash (two keys, each with a value). I do not think this can be done with a quick fix.