Skip to content

Commit

Permalink
[XML] Change scopes to make debugging easier.
Browse files Browse the repository at this point in the history
  • Loading branch information
borela committed Oct 8, 2016
1 parent 7824678 commit cef4eb7
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion completition/xml/instruction.sublime-completions
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// License for the specific language governing permissions and limitations under
// the License.

"scope": "text.xml.1.0 - comment",
"scope": "text.xml - comment",
"completions": [
{
"trigger": "cdata",
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/naomi.xml.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file_extensions:

first_line_match: <\?xml

scope: text.xml.1.0
scope: text.xml

contexts:
main:
Expand Down
4 changes: 2 additions & 2 deletions syntaxes/xml/attribute.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ contexts:
- match: |
(?xi)
{{commonIdentifier}}
scope: entity.name.attribute.xml.1.0
scope: entity.name.attribute.xml
set: optional-value
optional-value:
- match: \=
scope: operator.assignment.xml.1.0
scope: operator.assignment.xml
set: value
- match: (?=\S)
pop: true
Expand Down
12 changes: 6 additions & 6 deletions syntaxes/xml/element/cdata.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ contexts:
main:
- match: (<!\[)(CDATA)(\[)
captures:
0: tag.cdata.xml.1.0
1: punctuation.delimiter.tag.begin.xml.1.0
2: entity.name.tag.cdata.xml.1.0
3: punctuation.delimiter.tag.begin.xml.1.0
0: tag.cdata.xml
1: punctuation.delimiter.tag.begin.xml
2: entity.name.tag.cdata.xml
3: punctuation.delimiter.tag.begin.xml
set: content

content:
- match: \]\]\>
scope: >-
tag.cdata.xml.1.0
punctuation.delimiter.tag.end.xml.1.0
tag.cdata.xml
punctuation.delimiter.tag.end.xml
pop: true
8 changes: 4 additions & 4 deletions syntaxes/xml/element/comment.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ scope: ...
contexts:
main:
- match: <!--
scope: punctuation.comment.begin.xml.1.0
scope: punctuation.comment.begin.xml
set: comment

comment:
- meta_scope: comment.block.xml.1.0
- meta_content_scope: comment.content.xml.1.0
- meta_scope: comment.block.xml
- meta_content_scope: comment.content.xml
- match: -->
scope: punctuation.comment.end.xml.1.0
scope: punctuation.comment.end.xml
pop: true
8 changes: 4 additions & 4 deletions syntaxes/xml/element/doctype.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ contexts:
main:
- match: (<!)(DOCTYPE).*?(>)
captures:
0: tag.doctype.xml.1.0
1: punctuation.delimiter.tag.begin.xml.1.0
2: entity.name.tag.doctype.xml.1.0
3: punctuation.delimiter.tag.end.xml.1.0
0: tag.doctype.xml
1: punctuation.delimiter.tag.begin.xml
2: entity.name.tag.doctype.xml
3: punctuation.delimiter.tag.end.xml
pop: true
30 changes: 15 additions & 15 deletions syntaxes/xml/element/normal.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ contexts:
{{commonIdentifier}}
)
scope: >-
element.xml.1.0
tag.open.xml.1.0
punctuation.delimiter.tag.begin.xml.1.0
element.xml
tag.open.xml
punctuation.delimiter.tag.begin.xml
set: tag-name
tag-name:
- match: |
(?xi)
({{commonIdentifier}})
scope: >-
tag.open.xml.1.0
entity.name.tag.xml.1.0
tag.open.xml
entity.name.tag.xml
set: [
content,
attributes
Expand All @@ -53,26 +53,26 @@ contexts:
pop: true
- match: \>
scope: >-
tag.open.xml.1.0
punctuation.delimiter.tag.end.xml.1.0
tag.open.xml
punctuation.delimiter.tag.end.xml
pop: true
- include: Packages/Naomi/syntaxes/xml/attribute.no-pop.sublime-syntax

content:
- meta_scope: element.xml.1.0
- meta_content_scope: element.content.xml.1.0
- meta_scope: element.xml
- meta_content_scope: element.content.xml
- match: />
scope: >-
tag.open.void.xml.1.0
punctuation.delimiter.tag.end.xml.1.0aaaaaaaaaaaa
tag.open.void.xml
punctuation.delimiter.tag.end.xmlaaaaaaaaaaaa
pop: true
- match: |
(?x)
(</)(\1)(>)
captures:
0: tag.close.xml.1.0
1: punctuation.delimiter.tag.begin.xml.1.0
2: entity.name.tag.xml.1.0
3: punctuation.delimiter.tag.end.xml.1.0
0: tag.close.xml
1: punctuation.delimiter.tag.begin.xml
2: entity.name.tag.xml
3: punctuation.delimiter.tag.end.xml
pop: true
- include: Packages/Naomi/syntaxes/xml/element.no-pop.sublime-syntax
60 changes: 30 additions & 30 deletions syntaxes/xml/element/prolog.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@ contexts:
main:
- match: (<\?)(xml)
captures:
0: tag.prolog.xml.1.0
1: punctuation.tag.instruction.begin.xml.1.0
2: entity.name.tag.instruction.prolog.xml.1.0
0: tag.prolog.xml
1: punctuation.tag.instruction.begin.xml
2: entity.name.tag.instruction.prolog.xml
set: version

terminator:
- match: \s*\?>
scope: >-
tag.prolog.xml.1.0
punctuation.tag.instruction.end.xml.1.0
tag.prolog.xml
punctuation.tag.instruction.end.xml
pop: true

assignment-operator:
- match: \s*(=)
captures:
1: operator.assignment.xml.1.0
1: operator.assignment.xml
pop: true

version:
- include: terminator
- match: version
scope: >-
support.attribute.xml.1.0
entity.name.attribute.xml.1.0
support.attribute.xml
entity.name.attribute.xml
set: [
optional-attributes,
version-value,
Expand All @@ -54,15 +54,15 @@ contexts:
version-value:
- match: (\")1.[0-9]+(\")
captures:
0: string.quoted.double.xml.1.0
1: punctuation.delimiter.string.begin.xml.1.0
2: punctuation.delimiter.string.end.xml.1.0
0: string.quoted.double.xml
1: punctuation.delimiter.string.begin.xml
2: punctuation.delimiter.string.end.xml
pop: true
- match: (\')1.[0-9]+(\')
captures:
0: string.quoted.single.xml.1.0
1: punctuation.delimiter.string.begin.xml.1.0
2: punctuation.delimiter.string.end.xml.1.0
0: string.quoted.single.xml
1: punctuation.delimiter.string.begin.xml
2: punctuation.delimiter.string.end.xml
pop: true

optional-attributes:
Expand All @@ -73,8 +73,8 @@ contexts:
- include: terminator
- match: encoding
scope: >-
support.attribute.xml.1.0
entity.name.attribute.xml.1.0
support.attribute.xml
entity.name.attribute.xml
set: [
standalone,
encoding-value,
Expand All @@ -86,25 +86,25 @@ contexts:
(?xi)
(\")[a-z][a-z0-9-._]+(\")
captures:
0: string.quoted.double.xml.1.0
1: punctuation.delimiter.string.begin.xml.1.0
2: punctuation.delimiter.string.end.xml.1.0
0: string.quoted.double.xml
1: punctuation.delimiter.string.begin.xml
2: punctuation.delimiter.string.end.xml
pop: true
- match: |
(?xi)
(\')[a-z][a-z0-9-._]+(\')
captures:
0: string.quoted.single.xml.1.0
1: punctuation.delimiter.string.begin.xml.1.0
2: punctuation.delimiter.string.end.xml.1.0
0: string.quoted.single.xml
1: punctuation.delimiter.string.begin.xml
2: punctuation.delimiter.string.end.xml
pop: true
standalone:
- include: terminator
- match: standalone
scope: >-
support.attribute.xml.1.0
entity.name.attribute.xml.1.0
support.attribute.xml
entity.name.attribute.xml
set: [
terminator,
standalone-value,
Expand All @@ -117,15 +117,15 @@ contexts:
(?xi)
(\")(?>yes|no)(\")
captures:
0: string.quoted.double.xml.1.0
1: punctuation.delimiter.string.begin.xml.1.0
2: punctuation.delimiter.string.end.xml.1.0
0: string.quoted.double.xml
1: punctuation.delimiter.string.begin.xml
2: punctuation.delimiter.string.end.xml
pop: true
- match: |
(?xi)
(\')(?>yes|no)(\')
captures:
0: string.quoted.single.xml.1.0
1: punctuation.delimiter.string.begin.xml.1.0
2: punctuation.delimiter.string.end.xml.1.0
0: string.quoted.single.xml
1: punctuation.delimiter.string.begin.xml
2: punctuation.delimiter.string.end.xml
pop: true
6 changes: 3 additions & 3 deletions syntaxes/xml/literal/string/double-quoted.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ scope: ...
contexts:
main:
- match: \"
scope: punctuation.delimiter.string.begin.xml.1.0
scope: punctuation.delimiter.string.begin.xml
set: string

string:
- meta_scope: string.quoted.double.xml.1.0
- meta_scope: string.quoted.double.xml
- match: \"
scope: punctuation.delimiter.string.end.xml.1.0
scope: punctuation.delimiter.string.end.xml
pop: true
6 changes: 3 additions & 3 deletions syntaxes/xml/literal/string/single-quoted.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ scope: ...
contexts:
main:
- match: \'
scope: punctuation.delimiter.string.begin.xml.1.0
scope: punctuation.delimiter.string.begin.xml
set: string

string:
- meta_scope: string.quoted.single.xml.1.0
- meta_scope: string.quoted.single.xml
- match: \'
scope: punctuation.delimiter.string.end.xml.1.0
scope: punctuation.delimiter.string.end.xml
pop: true

0 comments on commit cef4eb7

Please sign in to comment.