atom / language-puppet

Puppet package for Atom
Other
36 stars 31 forks source link

An attempt to fix '=>' alignment issues #22

Closed bigbrozer closed 8 years ago

bigbrozer commented 8 years ago

Bonsoir,

It is an attempt to solve issues related to alignment of '=>' separator. Honestly, I'm not sure if it is the right way to do it... but it solves problem I encounter in bigbrozer/atom-aligner-puppet#2 and maybe in #15.

I did this because when writing this:

class { 'foo':
  ensure => present,
  value => 123,
}

I was not able to align the line value => 123 because the language plugin does not assign a scope (?) to the right side => 123. Doing the proposed change, assign a scope (?) to 123 which allow alignment. The Dev Tools helped me to see that.

Hope that's clear enough :-)

50Wliu commented 8 years ago

Hi @bigbrozer, thanks for the pull request! Could you please create a spec for this to make sure it doesn't break in the future? You can see https://github.com/atom/language-javascript/blob/master/spec/javascript-spec.coffee for some examples of how to write specs (this in particular might help). If you're still confused, try checking out the Specs styleguide.

bigbrozer commented 8 years ago

Hello @50Wliu, I have followed your recommendations and did something in commit f1e73c8. There are 2 tests that verify if the => operator is well recognized as a punctuation.separator.key-value.puppet token. They both pass :-)

50Wliu commented 8 years ago

Awesome, thanks for this!