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

Commit f5706d5

Browse files
author
Max Brunsfeld
authored
Merge pull request #620 from atom/b3-more-scopes
Add more scopes to the tree-sitter grammar
2 parents 0acec37 + cab77b6 commit f5706d5

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

grammars/tree-sitter-javascript.cson

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ scopes:
9999
'entity.name.function'
100100
]
101101

102-
'call_expression > super': 'support.function'
102+
'call_expression > super': 'support.function.super'
103103

104104
'method_definition > property_identifier': 'entity.name.function'
105105
'call_expression > member_expression > property_identifier': 'entity.name.function'
@@ -110,8 +110,9 @@ scopes:
110110
scopes: 'support.variable'
111111
},
112112
{
113-
exact: 'require', scopes: 'support.function'
114-
}
113+
exact: 'require',
114+
scopes: 'support.function'
115+
},
115116
{
116117
match: '^[\$A-Z_]{2,}$',
117118
scopes: 'constant.other'
@@ -146,6 +147,9 @@ scopes:
146147
'")"': 'punctuation.definition.parameters.end.bracket.round'
147148
'"{"': 'punctuation.definition.function.body.begin.bracket.curly'
148149
'"}"': 'punctuation.definition.function.body.end.bracket.curly'
150+
'";"': 'punctuation.terminator.statement.semicolon'
151+
'"["': 'punctuation.definition.array.begin.bracket.square'
152+
'"]"': 'punctuation.definition.array.end.bracket.square'
149153

150154
'"var"': 'storage.type'
151155
'"let"': 'storage.type'
@@ -154,7 +158,7 @@ scopes:
154158
'"const"': 'storage.modifier'
155159
'"static"': 'storage.modifier'
156160
'"function"': 'storage.type.function'
157-
'"=>"': 'storage.type.function'
161+
'"=>"': 'storage.type.function.arrow'
158162

159163
'"="': 'keyword.operator.js'
160164
'"+="': 'keyword.operator.js'
@@ -209,6 +213,7 @@ scopes:
209213
'"."': 'meta.delimiter.period'
210214
'","': 'meta.delimiter.comma'
211215

216+
'"as"': 'keyword.control'
212217
'"if"': 'keyword.control'
213218
'"do"': 'keyword.control'
214219
'"else"': 'keyword.control'

0 commit comments

Comments
 (0)