atom / language-puppet

Puppet package for Atom
Other
36 stars 31 forks source link

resource title highlighting depends on whitespace #41

Closed alexjurkiewicz closed 5 years ago

alexjurkiewicz commented 8 years ago

These two resources are identical but get highlighted differently due to the space before colon:

notify { "Hello from ${hostname}": }
notify { "Hello from ${hostname}" : }

Screenshot: screen shot 2016-08-17 at 12 37 31 pm

The first form is probably intended, but it doesn't highlight interpolated variables.

alexjurkiewicz commented 8 years ago

screen shot 2016-08-17 at 12 56 30 pm

More tests. I also noticed an absolute variable bare resource name fails to highlight correctly.

Maybe the simplest solution is to stop trying to treat the resource name specially (eg highlighting it blue), and instead just treat it as a normal element. I would definitely prefer blue + red for variables though... Had a quick look at the grammar for this and it's pretty hairy, too complex for me to try and fix.

alexjurkiewicz commented 8 years ago

Just noticed #32 fixes part of this