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

Commit

Permalink
Merge pull request #620 from atom/b3-more-scopes
Browse files Browse the repository at this point in the history
Add more scopes to the tree-sitter grammar
  • Loading branch information
Max Brunsfeld authored Nov 8, 2018
2 parents 0acec37 + cab77b6 commit f5706d5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions grammars/tree-sitter-javascript.cson
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ scopes:
'entity.name.function'
]

'call_expression > super': 'support.function'
'call_expression > super': 'support.function.super'

'method_definition > property_identifier': 'entity.name.function'
'call_expression > member_expression > property_identifier': 'entity.name.function'
Expand All @@ -110,8 +110,9 @@ scopes:
scopes: 'support.variable'
},
{
exact: 'require', scopes: 'support.function'
}
exact: 'require',
scopes: 'support.function'
},
{
match: '^[\$A-Z_]{2,}$',
scopes: 'constant.other'
Expand Down Expand Up @@ -146,6 +147,9 @@ scopes:
'")"': 'punctuation.definition.parameters.end.bracket.round'
'"{"': 'punctuation.definition.function.body.begin.bracket.curly'
'"}"': 'punctuation.definition.function.body.end.bracket.curly'
'";"': 'punctuation.terminator.statement.semicolon'
'"["': 'punctuation.definition.array.begin.bracket.square'
'"]"': 'punctuation.definition.array.end.bracket.square'

'"var"': 'storage.type'
'"let"': 'storage.type'
Expand All @@ -154,7 +158,7 @@ scopes:
'"const"': 'storage.modifier'
'"static"': 'storage.modifier'
'"function"': 'storage.type.function'
'"=>"': 'storage.type.function'
'"=>"': 'storage.type.function.arrow'

'"="': 'keyword.operator.js'
'"+="': 'keyword.operator.js'
Expand Down Expand Up @@ -209,6 +213,7 @@ scopes:
'"."': 'meta.delimiter.period'
'","': 'meta.delimiter.comma'

'"as"': 'keyword.control'
'"if"': 'keyword.control'
'"do"': 'keyword.control'
'"else"': 'keyword.control'
Expand Down

0 comments on commit f5706d5

Please sign in to comment.