Skip to content

Commit

Permalink
[JSX] Clean up meta scope
Browse files Browse the repository at this point in the history
  • Loading branch information
borela committed Jan 30, 2018
1 parent 78c6c1f commit 56464ae
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions syntaxes/jsx1/shared.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,20 @@ contexts:
push: content

content:
# Sub element.
- include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax
- include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax
# Embedded JS.
- include: Packages/Naomi/syntaxes/jsx1/embedded-js.sublime-syntax
# Text.
- match: .|\n
pop: true

meta-content:
- clear_scopes: true
- meta_scope: text.html.jsx.jsx1
# 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: .
- match: ""
pop: true

namespaced-closing-tag:
Expand All @@ -99,8 +102,9 @@ contexts:
6: entity.name.tag.jsx.jsx1
7: punctuation.definition.tag.end.html.jsx.jsx1
pop: true
- match: (?=.)
push: content
# Content.
- match: (?=.|\n)
push: [ meta-content, content ]

self-closing-tag:
- match: />
Expand All @@ -116,8 +120,9 @@ contexts:
3: entity.name.tag.html.jsx.jsx1
4: punctuation.definition.tag.end.html.jsx.jsx1
pop: true
- match: (?=.)
push: content
# Content.
- match: (?=.|\n)
push: [ meta-content, content ]

trap:
- match: .
Expand Down

0 comments on commit 56464ae

Please sign in to comment.