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

Fixes space after colon highliting #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion grammars/puppet.cson
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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*:)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we matching \\s*: as entity.name.section.puppet?

'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 @@ -79,3 +79,8 @@ describe "Puppet grammar", ->

{tokens} = grammar.tokenizeLine("package {'foo':}")
expect(tokens[0]).toEqual value: 'package', scopes: ['source.puppet', 'meta.definition.resource.puppet', 'storage.type.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']