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

Commit c7e6e0e

Browse files
author
Max Brunsfeld
authored
Merge pull request #628 from atom/b3-scope-like-babel
Change scopes in comparison to language-babel
2 parents 3c1dc51 + a4f6924 commit c7e6e0e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

grammars/tree-sitter-javascript.cson

+14-5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ scopes:
6767
'variable.other.object.property'
6868
]
6969

70+
'member_expression > property_identifier': 'variable.other.object.property.unquoted'
71+
72+
'formal_parameters > identifier': 'formal-parameter.identifier'
73+
7074
'shorthand_property_identifier': [
7175
{
7276
match: '^[\$A-Z_]{2,}$',
@@ -83,14 +87,15 @@ scopes:
8387
jsx_opening_element > identifier,
8488
jsx_closing_element > identifier,
8589
jsx_self_closing_element > identifier,
86-
call_expression > identifier
8790
': [
8891
{
8992
match: '^[A-Z]',
90-
scopes: 'meta.class'
91-
},
93+
scopes: 'meta.class.component.jsx'
94+
}
9295
]
9396

97+
'call_expression > identifier': {match: '^[A-Z]', scopes: 'meta.class'}
98+
9499
'function > identifier': 'entity.name.function'
95100
'generator_function > identifier': 'entity.name.function'
96101

@@ -106,9 +111,13 @@ scopes:
106111

107112
'identifier': [
108113
{
109-
match: '^(global|module|exports|__filename|__dirname|window|document)$',
114+
match: '^(global|module|exports|__filename|__dirname)$',
110115
scopes: 'support.variable'
111116
},
117+
{
118+
match: '^(window|event|document|performance|screen|navigator|console)$'
119+
scopes: 'support.variable.dom'
120+
},
112121
{
113122
exact: 'require',
114123
scopes: 'support.function'
@@ -199,7 +208,7 @@ scopes:
199208
'"|"': 'keyword.operator.js'
200209
'"++"': 'keyword.operator.js'
201210
'"--"': 'keyword.operator.js'
202-
'"..."': 'keyword.operator.js'
211+
'"..."': 'keyword.operator.spread.js'
203212

204213
'"in"': 'keyword.operator.in'
205214
'"instanceof"': 'keyword.operator.instanceof'

0 commit comments

Comments
 (0)