Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Fixes space after colon highliting
Browse files Browse the repository at this point in the history
  • Loading branch information
petems committed Mar 15, 2016
1 parent c2cf946 commit cefc69d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion grammars/puppet.cson
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@
'name': 'storage.type.puppet'
'2':
'name': 'entity.name.section.puppet'
'match': '^\\s*(\\w+)\\s*{\\s*([\'"].+[\'"]):'
'3':
'name': 'entity.name.section.puppet'
'match': '^\\s*(\\w+)\\s*{\\s*([\'"].+[\'"]*)(\\s*:)'
'name': 'meta.definition.resource.puppet'
}
{
Expand Down
5 changes: 5 additions & 0 deletions spec/puppet-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,8 @@ describe "Puppet grammar", ->
{tokens} = grammar.tokenizeLine('$::foo')
expect(tokens[0]).toEqual value: '$', scopes: ['source.puppet', 'variable.other.readwrite.global.puppet', 'punctuation.definition.variable.puppet']
expect(tokens[1]).toEqual value: '::foo', scopes: ['source.puppet', 'variable.other.readwrite.global.puppet']

it "tokenizes resource with space after title", ->
{tokens} = grammar.tokenizeLine("package {'foo' :")
expect(tokens[0]).toEqual value: 'package', scopes: ['source.puppet', 'meta.definition.resource.puppet', 'storage.type.puppet']
expect(tokens[3]).toEqual value: ':', scopes: ['source.puppet', 'meta.definition.resource.puppet', 'entity.name.section.puppet']

0 comments on commit cefc69d

Please sign in to comment.