From 56464aed262f423a264d6166e3a4bdbdae9f858b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 27 Jan 2018 12:36:12 -0200 Subject: [PATCH] [JSX] Clean up meta scope --- syntaxes/jsx1/shared.sublime-syntax | 31 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/syntaxes/jsx1/shared.sublime-syntax b/syntaxes/jsx1/shared.sublime-syntax index 78f36686..971b658b 100644 --- a/syntaxes/jsx1/shared.sublime-syntax +++ b/syntaxes/jsx1/shared.sublime-syntax @@ -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: @@ -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: /> @@ -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: .