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

Commit

Permalink
Change scopes in comparison to language-babel
Browse files Browse the repository at this point in the history
Refs #625
  • Loading branch information
Ben3eeE committed Nov 14, 2018
1 parent c0553a3 commit a4f6924
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions grammars/tree-sitter-javascript.cson
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ scopes:
'variable.other.object.property'
]

'member_expression > property_identifier': 'variable.other.object.property.unquoted'

'formal_parameters > identifier': 'formal-parameter.identifier'

'shorthand_property_identifier': [
{
match: '^[\$A-Z_]{2,}$',
Expand All @@ -83,14 +87,15 @@ scopes:
jsx_opening_element > identifier,
jsx_closing_element > identifier,
jsx_self_closing_element > identifier,
call_expression > identifier
': [
{
match: '^[A-Z]',
scopes: 'meta.class'
},
scopes: 'meta.class.component.jsx'
}
]

'call_expression > identifier': {match: '^[A-Z]', scopes: 'meta.class'}

'function > identifier': 'entity.name.function'
'generator_function > identifier': 'entity.name.function'

Expand All @@ -106,9 +111,13 @@ scopes:

'identifier': [
{
match: '^(global|module|exports|__filename|__dirname|window|document)$',
match: '^(global|module|exports|__filename|__dirname)$',
scopes: 'support.variable'
},
{
match: '^(window|event|document|performance|screen|navigator|console)$'
scopes: 'support.variable.dom'
},
{
exact: 'require',
scopes: 'support.function'
Expand Down Expand Up @@ -199,7 +208,7 @@ scopes:
'"|"': 'keyword.operator.js'
'"++"': 'keyword.operator.js'
'"--"': 'keyword.operator.js'
'"..."': 'keyword.operator.js'
'"..."': 'keyword.operator.spread.js'

'"in"': 'keyword.operator.in'
'"instanceof"': 'keyword.operator.instanceof'
Expand Down

0 comments on commit a4f6924

Please sign in to comment.