atom / language-puppet

Puppet package for Atom
Other
36 stars 31 forks source link

Resources are not highlighted after using puppet-lint due to chaining arrow #52

Open HanSooloo opened 7 years ago

HanSooloo commented 7 years ago

Imagine a simple class definition as below ... using puppet-lint on the file, it will move the chaining arrow to the beginning of the 'file_line' resource. But this results in language-puppet NOT doing syntax highlighting for 'file'.

puppet-lint, I believe, follows guidelines set here: https://docs.puppet.com/puppet/4.9/style_guide.html#chaining-arrow-syntax

In the first example, Atom/language-puppet will properly syntax highlight the file_line keyword in purple. However, when the chaining-arrow linting is done, -> file_line will NOT have purple highlight for file_line.

Is that a (known) issue?

Syntax highlighting WORKS, puppet-lint WARNING

# server.pp
class profiles::vault::server {
  class { '::vault':
    version  => '0.7.0',
    backend  => { 'inmem' => {}, },
    listener => { 'tcp' => {
                            'address'     => '0.0.0.0:8200',
                            'tls_disable' =>  1,
                          },
                        },
  } ->
  # Syntax highlighting for `file_line` works here; but puppet-lint throws warning
  file_line { 'vault_addr':
    ensure => present,
    path   => '/etc/environment',
    line   => 'VAULT_ADDR=http://127.0.0.1:8200',
  }
}

Syntax highlighting DOES NOT WORK, puppet-lint OK

# server.pp
class profiles::vault::server {
  class { '::vault':
    version  => '0.7.0',
    backend  => { 'inmem' => {}, },
    listener => { 'tcp' => {
                            'address'     => '0.0.0.0:8200',
                            'tls_disable' =>  1,
                          },
                        },
  } 
  # Syntax highlighting for `file_line` DOES NOT work here; and puppet-lint is happy!
  -> file_line { 'vault_addr':
    ensure => present,
    path   => '/etc/environment',
    line   => 'VAULT_ADDR=http://127.0.0.1:8200',
  }
}