Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 264d272

Browse files
committed
change syntax names to compatable with themes
close #50
1 parent 8349bd5 commit 264d272

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

grammars/angularjs.cson

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
')))\\b\\s*(=?)'
158158
'beginCaptures':
159159
'1':
160-
'name': 'entity.other.attribute-name.html.angular'
160+
'name': 'support.other.attribute-name.html.angular'
161161
'end': '(?<=\'|")|(?=\\s|>)'
162162
'name': 'meta.attribute.html.angular'
163163
'patterns': [
@@ -166,7 +166,6 @@
166166
'beginCaptures':
167167
'0':
168168
'name': 'punctuation.definition.string.begin.html.angular'
169-
'contentName': 'meta.tag.template.angular'
170169
'end': '"'
171170
'endCaptures':
172171
'0':
@@ -181,7 +180,6 @@
181180
'beginCaptures':
182181
'0':
183182
'name': 'punctuation.definition.string.begin.html.angular'
184-
'contentName': 'meta.tag.template.angular'
185183
'end': '\''
186184
'endCaptures':
187185
'0':

spec/grammar-spec.coffee

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe 'directive grammar', ->
1818
<dd ng-repeat="availability in phone.availability">{{availability}}</dd>
1919
'''
2020

21-
expect(lines[0][3]).toEqual value: 'ng-repeat', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
21+
expect(lines[0][3]).toEqual value: 'ng-repeat', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
2222

2323
it 'tokenizes ng-src and ng-click attributes inside HTML', ->
2424
lines = grammar.tokenizeLines '''
@@ -27,52 +27,52 @@ describe 'directive grammar', ->
2727
</li>
2828
'''
2929

30-
expect(lines[0][3]).toEqual value: 'ng-repeat', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
31-
expect(lines[1][4]).toEqual value: 'ng-src', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
32-
expect(lines[1][12]).toEqual value: 'ng-click', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
30+
expect(lines[0][3]).toEqual value: 'ng-repeat', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
31+
expect(lines[1][4]).toEqual value: 'ng-src', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
32+
expect(lines[1][12]).toEqual value: 'ng-click', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
3333

3434
it 'tokenizes ng-view attribute without value inside HTML', ->
3535
lines = grammar.tokenizeLines '''
3636
<div ng-view class="view-frame"></div>
3737
'''
3838

39-
expect(lines[0][3]).toEqual value: 'ng-view', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
39+
expect(lines[0][3]).toEqual value: 'ng-view', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
4040

4141
it 'tokenizes capitalized ng-repeat attribute inside HTML', ->
4242
lines = grammar.tokenizeLines '''
4343
<dd NG-REPEAT="availability in phone.availability">{{availability}}</dd>
4444
'''
4545

46-
expect(lines[0][3]).toEqual value: 'NG-REPEAT', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
46+
expect(lines[0][3]).toEqual value: 'NG-REPEAT', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
4747

4848
it 'tokenizes ng-repeat-start and ng-repeat-end attribute', ->
4949
lines = grammar.tokenizeLines '''
5050
<div ng-repeat-start></div>
5151
<div ng-repeat-end></div>
5252
'''
5353

54-
expect(lines[0][3]).toEqual value: 'ng-repeat-start', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
55-
expect(lines[1][3]).toEqual value: 'ng-repeat-end', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
54+
expect(lines[0][3]).toEqual value: 'ng-repeat-start', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
55+
expect(lines[1][3]).toEqual value: 'ng-repeat-end', scopes: ['text.html.angular', 'meta.tag.block.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
5656

5757
it 'tokenizes ng-controller attribute in body tag', ->
5858
lines = grammar.tokenizeLines '''
5959
<body ng-controller="TestCtrl">
6060
'''
6161

62-
expect(lines[0][3]).toEqual value: 'ng-controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
62+
expect(lines[0][3]).toEqual value: 'ng-controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
6363

6464
it 'tokenizes ng-s attribute', ->
6565
lines = grammar.tokenizeLines '''
6666
<select ng-options="color.name group by color.shade for color in colors">
6767
'''
6868

69-
expect(lines[0][3]).toEqual value: 'ng-options', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
69+
expect(lines[0][3]).toEqual value: 'ng-options', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
7070

7171
it 'tokenizes ng- attributes for anchor tags', ->
7272
lines = grammar.tokenizeLines '''
7373
<a href="/url" ng-click='{{setImage(img)}}'>
7474
'''
75-
expect(lines[0][9]).toEqual value: 'ng-click', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
75+
expect(lines[0][9]).toEqual value: 'ng-click', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
7676

7777
describe 'directive element', ->
7878
it 'tokenizes ng-include element inside HTML', ->
@@ -97,28 +97,28 @@ describe 'directive grammar', ->
9797
<body data-ng-controller="TestCtrl">
9898
'''
9999

100-
expect(lines[0][3]).toEqual value: 'data-ng-controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
100+
expect(lines[0][3]).toEqual value: 'data-ng-controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
101101

102102
it 'tokenizes x- prefixed angular attributes', ->
103103
lines = grammar.tokenizeLines '''
104104
<body x-ng-controller="TestCtrl">
105105
'''
106106

107-
expect(lines[0][3]).toEqual value: 'x-ng-controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
107+
expect(lines[0][3]).toEqual value: 'x-ng-controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
108108

109109
it 'tokenizes _ suffixed angular attributes', ->
110110
lines = grammar.tokenizeLines '''
111111
<body ng_controller="TestCtrl">
112112
'''
113113

114-
expect(lines[0][3]).toEqual value: 'ng_controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
114+
expect(lines[0][3]).toEqual value: 'ng_controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
115115

116116
it 'tokenizes : suffixed angular attributes', ->
117117
lines = grammar.tokenizeLines '''
118118
<body ng:controller="TestCtrl">
119119
'''
120120

121-
expect(lines[0][3]).toEqual value: 'ng:controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'entity.other.attribute-name.html.angular']
121+
expect(lines[0][3]).toEqual value: 'ng:controller', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'support.other.attribute-name.html.angular']
122122

123123
it 'tokenizes data- prefixed angular element', ->
124124
lines = grammar.tokenizeLines '''
@@ -168,7 +168,7 @@ describe 'directive grammar', ->
168168
'''
169169

170170
expect(lines[0][5]).toEqual value: '"', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'punctuation.definition.string.begin.html.angular']
171-
expect(lines[0][6]).toEqual value: 'phone in phones | filter:query | orderBy:orderProp', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular']
171+
expect(lines[0][6]).toEqual value: 'phone in phones | filter:query | orderBy:orderProp', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular']
172172
expect(lines[0][7]).toEqual value: '"', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'punctuation.definition.string.end.html.angular']
173173

174174
it 'tokenizes angular expressions in value of attributes with single quoted', ->
@@ -177,7 +177,7 @@ describe 'directive grammar', ->
177177
'''
178178

179179
expect(lines[0][5]).toEqual value: '\'', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.single.html.angular', 'punctuation.definition.string.begin.html.angular']
180-
expect(lines[0][6]).toEqual value: 'img in phone.images', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.single.html.angular', 'meta.tag.template.angular']
180+
expect(lines[0][6]).toEqual value: 'img in phone.images', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.single.html.angular']
181181
expect(lines[0][7]).toEqual value: '\'', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.single.html.angular', 'punctuation.definition.string.end.html.angular']
182182

183183
it 'tokenizes angular expressions in value of attributes with {{}}', ->
@@ -186,14 +186,14 @@ describe 'directive grammar', ->
186186
'''
187187

188188
expect(lines[0][5]).toEqual value: '"', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'punctuation.definition.string.begin.html.angular']
189-
expect(lines[0][6]).toEqual value: '{{', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'meta.tag.template.angular', 'punctuation.definition.block.begin.angular']
190-
expect(lines[0][7]).toEqual value: 'img', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'meta.tag.template.angular']
191-
expect(lines[0][8]).toEqual value: '}}', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'meta.tag.template.angular', 'punctuation.definition.block.end.angular']
189+
expect(lines[0][6]).toEqual value: '{{', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'punctuation.definition.block.begin.angular']
190+
expect(lines[0][7]).toEqual value: 'img', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular']
191+
expect(lines[0][8]).toEqual value: '}}', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'punctuation.definition.block.end.angular']
192192
expect(lines[0][9]).toEqual value: '"', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'punctuation.definition.string.end.html.angular']
193193
expect(lines[0][13]).toEqual value: '"', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'punctuation.definition.string.begin.html.angular']
194-
expect(lines[0][14]).toEqual value: '{{', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'meta.tag.template.angular', 'punctuation.definition.block.begin.angular']
195-
expect(lines[0][15]).toEqual value: 'setImage(img)', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'meta.tag.template.angular']
196-
expect(lines[0][16]).toEqual value: '}}', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'meta.tag.template.angular', 'punctuation.definition.block.end.angular']
194+
expect(lines[0][14]).toEqual value: '{{', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'punctuation.definition.block.begin.angular']
195+
expect(lines[0][15]).toEqual value: 'setImage(img)', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular']
196+
expect(lines[0][16]).toEqual value: '}}', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'meta.tag.template.angular', 'punctuation.definition.block.end.angular']
197197
expect(lines[0][17]).toEqual value: '"', scopes: ['text.html.angular', 'meta.tag.inline.any.html', 'meta.attribute.html.angular', 'string.quoted.double.html.angular', 'punctuation.definition.string.end.html.angular']
198198

199199
describe 'angular ng-template', ->

0 commit comments

Comments
 (0)