Skip to content

Commit

Permalink
[JSX] Clean up meta scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
borela committed Jan 30, 2018
1 parent 9a3d1bd commit 78c6c1f
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions syntaxes/jsx1/shared.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ hidden: true

scope: ...

variables:
elementIdentifier: |
[$_[:alpha:]]
[$_.[:alnum:]\-]*
contexts:
main:
- match: ""
Expand Down Expand Up @@ -57,16 +62,20 @@ contexts:
6: entity.name.tag.component.jsx.jsx1
7: punctuation.definition.tag.end.html.jsx.jsx1
pop: true
- match: (?=\S)
- match: (?=.)
push: content

content:
- clear_scopes: true
- meta_scope: text.html.jsx.jsx1
- include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/embedded-js.sublime-syntax
# Elements.
- match: (?xi)(?=<(?>\s*>|{{elementIdentifier}}))
push:
- include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/embedded-js.sublime-syntax
# Text.
- match: .
pop: true

Expand All @@ -90,7 +99,7 @@ contexts:
6: entity.name.tag.jsx.jsx1
7: punctuation.definition.tag.end.html.jsx.jsx1
pop: true
- match: (?=\S)
- match: (?=.)
push: content

self-closing-tag:
Expand All @@ -107,7 +116,7 @@ contexts:
3: entity.name.tag.html.jsx.jsx1
4: punctuation.definition.tag.end.html.jsx.jsx1
pop: true
- match: (?=\S)
- match: (?=.)
push: content

trap:
Expand Down

0 comments on commit 78c6c1f

Please sign in to comment.