From 1794d1f8282a0af4115a1e244b0b75df96d00c01 Mon Sep 17 00:00:00 2001
From: Peter Souter
Date: Fri, 11 Mar 2016 15:59:25 +0000
Subject: [PATCH] Fixes space after colon highliting
---
grammars/puppet.cson | 4 +++-
spec/puppet-spec.coffee | 5 +++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/grammars/puppet.cson b/grammars/puppet.cson
index b67c59d..c95917b 100644
--- a/grammars/puppet.cson
+++ b/grammars/puppet.cson
@@ -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*:)'
'name': 'meta.definition.resource.puppet'
}
{
diff --git a/spec/puppet-spec.coffee b/spec/puppet-spec.coffee
index 55b4374..128c5e1 100644
--- a/spec/puppet-spec.coffee
+++ b/spec/puppet-spec.coffee
@@ -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']