rodjek / vim-puppet

Puppet niceties for your Vim setup
Apache License 2.0
500 stars 137 forks source link

Detect and highlight epp syntax #115

Closed lelutin closed 4 years ago

lelutin commented 4 years ago

This is a replacement for #63. I've started by merging @rothsa 's work and seeing that it did somewhat work, it then motivated me to continue on that direction and actually get full syntax hilghlighting for .epp files.

I've base my work by heavily re-using what Tim Pope did for eruby, but with lots of complexity removed.

I've taken a shortcut here by assuming that the underlying syntax (e.g. what's used for the template's litteral content) is colored using "sh" filetype. That choice was made so that I could implement this faster, but also both because the sh filetype should cover a good majority of content in templates somewhat correctly and that it's actually quite hard to detect what type of content a puppet template is supposed to represent (e.g. no consistently available information from the file name, from a header or from a comment somewhere)

I've also added a test that should check most colouring cases to make sure that epp syntax highlighting is unbroken with future changes.