Skip to content

Commit

Permalink
[Git Formats] Rename mapping separator scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Mar 13, 2022
1 parent f8a5ded commit c35a164
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 64 deletions.
12 changes: 6 additions & 6 deletions Git Formats/Git Attributes.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ contexts:
attribute-maybe-value-list:
- meta_content_scope: meta.mapping.git.attributes
- match: =(?=\S)
scope: meta.mapping.git.attributes punctuation.separator.mapping.key-value.git.attributes
scope: meta.mapping.git.attributes punctuation.separator.key-value.git.attributes
set: [attribute-value-list, attribute-value-content]
- match: =
scope: meta.mapping.git.attributes punctuation.separator.mapping.key-value.git.attributes
scope: meta.mapping.git.attributes punctuation.separator.key-value.git.attributes
set: attribute-value-expected
- include: attribute-separator
- include: immediately-pop
Expand All @@ -168,10 +168,10 @@ contexts:
- meta_content_scope: meta.mapping.value.git.attributes
- include: attribute-separator
- match: ',(?=\S)'
scope: punctuation.separator.mapping.values.git.attributes
scope: punctuation.separator.sequence.git.attributes
push: attribute-value-content
- match: ','
scope: meta.mapping.git.attributes punctuation.separator.mapping.values.git.attributes
scope: meta.mapping.git.attributes punctuation.separator.sequence.git.attributes
set: attribute-value-expected
- match: \S
scope: invalid.illegal.value.git.attributes
Expand All @@ -192,14 +192,14 @@ contexts:
# Attributes are separated by whitespace
# One whitespace after each attribute/value is captured as separator
- match: \s
scope: meta.mapping.expect-value.git.attributes punctuation.separator.mapping.pair.git.attributes
scope: meta.mapping.expect-value.git.attributes punctuation.separator.sequence.git.attributes
pop: 1

attribute-separator:
# Attributes are separated by whitespace
# One whitespace after each attribute/value is captured as separator
- match: \s
scope: meta.mapping.git.attributes punctuation.separator.mapping.pair.git.attributes
scope: meta.mapping.git.attributes punctuation.separator.sequence.git.attributes
pop: 1

##[ PROTOTYPES ]#######################################################
Expand Down
18 changes: 9 additions & 9 deletions Git Formats/Git Commit.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contexts:
- match: ^\s*(Signed-off-by)\s*(:)
captures:
1: keyword.other.signed-off-by.git.commit
2: punctuation.separator.mapping.pair.git.commit
2: punctuation.separator.key-value.git.commit

##[ COMMENTS ]#########################################################

Expand Down Expand Up @@ -112,40 +112,40 @@ contexts:
scope: meta.change-list.git.commit
captures:
1: keyword.other.change-list.git.commit
2: punctuation.separator.mapping.pair.change-list.git.commit
2: punctuation.separator.key-value.change-list.git.commit
3: string.unquoted.git.commit markup.inserted.file.git.commit
- match: \b({{copied}}|{{renamed}})\s*(:)\s*((.+)\s+(->)\s+(.+))
scope: meta.change-list.git.commit
captures:
1: keyword.other.change-list.git.commit
2: punctuation.separator.mapping.pair.change-list.git.commit
2: punctuation.separator.key-value.change-list.git.commit
3: string.unquoted.git.commit
4: markup.changed.file.name.git.commit
5: punctuation.separator.mapping.pair.path.git.commit
5: punctuation.separator.key-value.path.git.commit
6: markup.changed.file.name.git.commit
- match: \b({{typechange}})\s*(:)\s*(.*)
scope: meta.change-list.git.commit
captures:
1: keyword.other.change-list.git.commit
2: punctuation.separator.mapping.pair.change-list.git.commit
2: punctuation.separator.key-value.change-list.git.commit
3: string.unquoted.git.commit markup.changed.file.name.git.commit
- match: \b({{modified}}|{{both_modified}})\s*(:)\s*(.*)
scope: meta.change-list.git.commit
captures:
1: keyword.other.change-list.git.commit
2: punctuation.separator.mapping.pair.change-list.git.commit
2: punctuation.separator.key-value.change-list.git.commit
3: string.unquoted.git.commit markup.changed.file.content.git.commit
- match: \b({{deleted}}|{{deleted_by_them}}|{{deleted_by_us}}|{{both_deleted}})\s*(:)\s*(.*)
scope: meta.change-list.git.commit
captures:
1: keyword.other.change-list.git.commit
2: punctuation.separator.mapping.pair.change-list.git.commit
2: punctuation.separator.key-value.change-list.git.commit
3: string.unquoted.git.commit markup.deleted.file.git.commit
- match: \b({{unknown}}|{{unmerged}})\s*(:)\s*(.*)
scope: meta.change-list.git.commit
captures:
1: keyword.other.change-list.git.commit
2: punctuation.separator.mapping.pair.change-list.git.commit
2: punctuation.separator.key-value.change-list.git.commit
3: string.unquoted.git.commit markup.ignored.file.git.commit

commands-line:
Expand All @@ -162,7 +162,7 @@ contexts:
- match: \b({{date}})\s*(:)\s*(.*)
captures:
1: markup.heading.git.commit
2: punctuation.separator.mapping.pair.date.git.commit
2: punctuation.separator.key-value.date.git.commit
3: constant.language.timestamp.git.commit

heading:
Expand Down
2 changes: 1 addition & 1 deletion Git Formats/Git Common.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ contexts:
scope: meta.reference.issue.git
captures:
1: keyword.other.resolved-issue.git
2: punctuation.separator.mapping.pair.resolved-issue.git
2: punctuation.separator.key-value.resolved-issue.git
3: constant.other.reference.issue.git
4: punctuation.separator.reference.issue.git # (inside repository_ref)
5: punctuation.definition.reference.issue.git
Expand Down
2 changes: 1 addition & 1 deletion Git Formats/Git Link.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contexts:
separator:
- meta_scope: meta.mapping.git.link
- match: ':'
scope: punctuation.separator.mapping.key-value.git.link
scope: punctuation.separator.key-value.git.link
set: [mapping-value-meta, expect-path]
- match: \n
pop: 1
Expand Down
2 changes: 1 addition & 1 deletion Git Formats/Git Log.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contexts:
- match: ^(\w+)\s*(:)\s*
captures:
1: keyword.other.header.git.log
2: punctuation.separator.mapping.pair.git.log
2: punctuation.separator.key-value.git.log
push:
- meta_scope: meta.header.git.commit markup.raw.block.git.log
- meta_content_scope: string.unquoted.log
Expand Down
2 changes: 1 addition & 1 deletion Git Formats/Git Rebase.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ contexts:
help-cmd-descriptions:
- match: (=)\s*(\S.+)
captures:
1: punctuation.separator.mapping.pair.git.rebase
1: punctuation.separator.key-value.git.rebase
2: string.unquoted.git.rebase

help-cmd-parameters:
Expand Down
30 changes: 15 additions & 15 deletions Git Formats/tests/syntax_test_git_attributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# ^ keyword.operator.logical.git.attributes
# ^^^^^ variable.language.attribute.git.attributes
# ^^^^^^ variable.language.attribute.git.attributes
# ^ punctuation.separator.mapping.key-value.git.attributes
# ^ punctuation.separator.key-value.git.attributes
# ^^^^ string.unquoted.git.attributes
[macro\tws]attr
# <- meta.brackets.git.attributes punctuation.definition.brackets.begin.git.attributes
Expand Down Expand Up @@ -64,13 +64,13 @@
# ^ punctuation.definition.string.end.git.attributes - entity.name.pattern.git
# ^^^^^^ meta.attributes-list.git.attributes
# ^^^^ variable.language.attribute.git.attributes
# ^ punctuation.separator.mapping.key-value.git.attributes
# ^ punctuation.separator.key-value.git.attributes
# ^ punctuation.definition.string.begin.git.attributes
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.git.attributes
# ^^^^^^^^^^ constant.character.escape.git.attributes
# ^ punctuation.definition.string.end.git.attributes
# ^^^^^ variable.language.attribute.git.attributes
# ^ punctuation.separator.mapping.key-value.git.attributes
# ^ punctuation.separator.key-value.git.attributes
# ^^^^^^^^ string.quoted.double.git.attributes
# ^^^^^^^^^ invalid.illegal.value.git.attributes

Expand All @@ -92,9 +92,9 @@
# ^^^^^^^^^^^^^^^ meta.attributes-list.git.attributes
# ^^^^^^^^^^^^^^^ meta.attribute
# ^^^^^^^^ meta.mapping.key.git.attributes variable.language.attribute.git.attributes
# ^ punctuation.separator.mapping.key-value.git.attributes
# ^ punctuation.separator.key-value.git.attributes
# ^^^^^ meta.mapping.value.git.attributes string.unquoted.git.attributes
# ^ meta.attribute meta.mapping.git.attributes punctuation.separator.mapping.pair.git.attributes
# ^ meta.attribute meta.mapping.git.attributes punctuation.separator.sequence.git.attributes

# set binary content
/path/*.pb?proj binary -text !indent eol=crlf attr=val1,-val2,!val3 !attr2 # no-comment
Expand All @@ -116,15 +116,15 @@
# ^^^^^^ variable.language.attribute.git.attributes
# ^ - variable.language.attribute - keyword.operator.logical
# ^^^ variable.language.attribute.git.attributes
# ^ punctuation.separator.mapping.key-value.git.attributes
# ^ punctuation.separator.key-value.git.attributes
# ^^^^ string.unquoted.git.attributes
# ^ - variable.language.attribute - keyword.operator.logical
# ^^^^ variable.language.attribute.git.attributes
# ^ punctuation.separator.mapping.key-value.git.attributes
# ^ punctuation.separator.key-value.git.attributes
# ^^^^ string.unquoted.git.attributes
# ^ punctuation.separator.mapping.values.git.attributes
# ^ punctuation.separator.sequence.git.attributes
# ^^^^^ string.unquoted.git.attributes
# ^ punctuation.separator.mapping.values.git.attributes
# ^ punctuation.separator.sequence.git.attributes
# ^^^^^ string.unquoted.git.attributes
# ^ - variable.language.attribute - keyword.operator.logical
# ^ keyword.operator.logical.git.attributes
Expand Down Expand Up @@ -177,7 +177,7 @@ pattern attr=
# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git
# ^^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git
# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git
# ^ punctuation.separator.mapping.key-value.git
# ^ punctuation.separator.key-value.git
# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git

# TEST: `meta.mapping.expect-value` at end of line
Expand All @@ -188,21 +188,21 @@ pattern attr= no_value attr=value, eol=lf,
# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git
# ^^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git
# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git
# ^ punctuation.separator.mapping.key-value.git
# ^ punctuation.separator.key-value.git
# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git
# ^^^^^^^^ meta.attribute.other.git meta.mapping.key.git variable.language.attribute.git - meta.mapping.expect-value.git
# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git
# ^^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git
# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git
# ^ punctuation.separator.mapping.key-value.git
# ^ punctuation.separator.key-value.git
# ^^^^^ string.unquoted.git.attributes
# ^^^^^ meta.mapping.value.git - meta.mapping.key.git - meta.mapping.git - meta.mapping.expect-value.git
# ^ meta.mapping.git.attributes punctuation.separator.mapping.values.git.attributes
# ^ meta.mapping.git.attributes punctuation.separator.sequence.git.attributes
# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git
# ^^^ meta.mapping.key.git - meta.mapping.git - meta.mapping.value.git
# ^ meta.mapping.git - meta.mapping.key.git - meta.mapping.value.git - meta.mapping.expect-value.git
# ^ punctuation.separator.mapping.key-value.git
# ^ punctuation.separator.key-value.git
# ^^ string.unquoted.git.attributes
# ^^ meta.mapping.value.git - meta.mapping.key.git - meta.mapping.git - meta.mapping.expect-value.git
# ^ meta.mapping.git.attributes punctuation.separator.mapping.values.git.attributes
# ^ meta.mapping.git.attributes punctuation.separator.sequence.git.attributes
# ^ meta.mapping.expect-value.git - meta.mapping.key.git - meta.mapping.git
Loading

0 comments on commit c35a164

Please sign in to comment.