atom / language-puppet

Puppet package for Atom
Other
36 stars 31 forks source link

broken highlighting for constants and support functions #7

Closed jhaals closed 10 years ago

jhaals commented 10 years ago

Constants

false|true|running|present|absent|file|directory

Support functions

escape|gsub|alert|crit|debug|notice|defined|emerg|err|failed|file|generate|include|info|realize|search|tag|tagged|template|warning
jacobbednarz commented 10 years ago

@JHaals I can see these are defined and the regex is just the words wrapped in a word boundary so it should be applying correctly. Could you perhaps provide a little more context around this one?

I can't see any obvious stand outs but I do use a pretty minimal theme so perhaps that is a also a factor here.

jacobbednarz commented 10 years ago

Just FYI, tested with a little snippet from the Puppet Docs for a random test.

class myservice($ensure = 'running') {

  if $ensure in [ running, stopped ] {
    $_ensure = $ensure
  } else {
    fail('ensure parameter must be running or stopped')
  }

  case $::operatingsystem {
    centos: {
      $package_list = 'openssh-server'
    }
    solaris: {
      $package_list = [ SUNWsshr, SUNWsshu ]
    }
    default: {
      fail("Module ${module_name} does not support ${::operatingsystem}")
    }
  }

  $variable = 'something'

  Package { ensure => present, }

  File { owner => '0', group => '0', mode => '0644' }

  package { $package_list: }

  file { "/tmp/${variable}":
    ensure => present,
  }

  service { 'myservice':
    ensure    => $_ensure,
    hasstatus => true,
  }
}
jhaals commented 10 years ago

Just compare the Github styling above with this screenshot: https://www.dropbox.com/s/ey60dwtnple73dy/syntax.png

jacobbednarz commented 10 years ago

From my testing this one appears to be working nicely for me after applying #8.

fix-constants-and-functions

However trying on my version of Solarized Dark there are still some of them not highlighting correctly so if you don't mind @JHaals, could you please double check this?

To fix this I moved constant.language.puppet into the same block as support.function.puppet (along with adding a couple new keywords) but I am not 100% sure of all the repercussions of doing this so if @kevinsawicki has some time I might just run this by him also to be sure I am not going to accidently break everything.

Doesn't matter too much but I also found keyword.operator.assignment.php and meta.array.php were listed instead of Puppet.