From ebd08fb3dbc17d25b5b37cb9ea51c88c785f2109 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Tue, 24 Aug 2021 21:26:30 +0300 Subject: [PATCH 1/9] [Git Formats] highlight diffs in Git Log syntax for `git show` --- Git Formats/Git Log.sublime-syntax | 8 ++++- Git Formats/tests/syntax_test_git_log | 42 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Git Formats/Git Log.sublime-syntax b/Git Formats/Git Log.sublime-syntax index 5cd70052d6..204c2f6e5f 100644 --- a/Git Formats/Git Log.sublime-syntax +++ b/Git Formats/Git Log.sublime-syntax @@ -23,7 +23,7 @@ contexts: scope: meta.header.git.commit markup.raw.block.git.log pop: true embed: commit-header - escape: (?=^commit\s) + escape: (?=^(?:commit|diff)\s) - match: (\()(HEAD)\s*(->) captures: 1: punctuation.section.parens.begin.git.log @@ -39,6 +39,12 @@ contexts: scope: entity.other.branch-name.git.log - match: ',' scope: punctuation.separator.sequence.git.log + - match: (?=^diff\s--git) + embed: scope:source.shell.bash + escape: $ + - match: (?=^index\s) + embed: scope:source.diff + escape: (?=^diff\s--git) commit-header: # All header attributes are mappings of `key: value` format. diff --git a/Git Formats/tests/syntax_test_git_log b/Git Formats/tests/syntax_test_git_log index 6e5d06035a..50bf14c8b4 100644 --- a/Git Formats/tests/syntax_test_git_log +++ b/Git Formats/tests/syntax_test_git_log @@ -74,3 +74,45 @@ Date: Thu Sep 21 22:53:04 2017 +0200 #^^^ keyword.other.header.git.log # ^ punctuation.separator.mapping.pair.git.log - keyword.other.header.git.log # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.log + +commit 344d003a330e244cc507d17c2f224bb295013511 (HEAD -> git_show, sublimehq/master, master) +Author: Thomas Smith +Date: Tue Aug 24 13:44:17 2021 -0400 + + [TypeScript] [TSX] Fix arrow function type parameter tests for TSX. (#2987) + +diff --git a/JavaScript/TypeScript.sublime-syntax b/JavaScript/TypeScript.sublime-syntax +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.shell +# ^ - source.shell +#^^^ source.shell meta.function-call.identifier variable.function +# ^^ punctuation.definition.parameter +# ^^^ variable.parameter.option +index ae1b1061..c1a585d0 100644 +--- a/JavaScript/TypeScript.sublime-syntax +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.diff meta.diff.header meta.header.from-file ++++ b/JavaScript/TypeScript.sublime-syntax +@@ -551,26 +551,6 @@ contexts: + scope: keyword.operator.comparison.js + set: expression-begin + +- # expression-begin: +- # - meta_prepend: true +- # - match: (?=\<(?!<)) +- # pop: true +- # branch_point: ts-old-type-assertion +- # branch: +- # - ts-old-type-assertion +diff --git a/JavaScript/tests/syntax_test_typescript_not_tsx.ts b/JavaScript/tests/syntax_test_typescript_not_tsx.ts +#^^^ source.shell meta.function-call.identifier variable.function +index c90bfab4..e9338c70 100644 +--- a/JavaScript/tests/syntax_test_typescript_not_tsx.ts ++++ b/JavaScript/tests/syntax_test_typescript_not_tsx.ts +#^^ source.diff meta.diff.header meta.header.to-file punctuation.definition.to-file +@@ -25,3 +25,12 @@ + let strLength: number = (someValue).length; // + // ^^^^^^^^ meta.assertion - meta.tag + // ^^^^^^^^^ comment - meta.tag ++ ++ () => {}; ++// ^^^^^^^^^^^ meta.function +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.diff markup.inserted \ No newline at end of file From 7e74f6a05c5f08ae7521c2482ba5d7868728199a Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Tue, 24 Aug 2021 21:40:02 +0300 Subject: [PATCH 2/9] [Git Formats] Improvements to Git Log from PR review --- Git Formats/Git Log.sublime-syntax | 2 +- Git Formats/tests/syntax_test_git_log | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Git Formats/Git Log.sublime-syntax b/Git Formats/Git Log.sublime-syntax index 204c2f6e5f..8f12a83fa4 100644 --- a/Git Formats/Git Log.sublime-syntax +++ b/Git Formats/Git Log.sublime-syntax @@ -44,7 +44,7 @@ contexts: escape: $ - match: (?=^index\s) embed: scope:source.diff - escape: (?=^diff\s--git) + escape: (?=^(?:commit\s+\h{7,}|diff\s+--git\s)) commit-header: # All header attributes are mappings of `key: value` format. diff --git a/Git Formats/tests/syntax_test_git_log b/Git Formats/tests/syntax_test_git_log index 50bf14c8b4..17f75f7bbc 100644 --- a/Git Formats/tests/syntax_test_git_log +++ b/Git Formats/tests/syntax_test_git_log @@ -115,4 +115,7 @@ index c90bfab4..e9338c70 100644 + + () => {}; +// ^^^^^^^^^^^ meta.function -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.diff markup.inserted \ No newline at end of file +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.diff markup.inserted + +commit e2077c6e006acfd2f060aef03c4ef8f89c4db362 (HEAD -> branch_name, origin/branch_name) +#^^^^^ meta.header.git markup.raw.block.git keyword.other.commit.git - source.diff From 2886c3e2162bda5bdd4cb993a2161b9ddd28ce1a Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Tue, 24 Aug 2021 22:28:39 +0300 Subject: [PATCH 3/9] [Git Formats] Scope the extended patch headers in Git Log syntax --- Git Formats/Git Log.sublime-syntax | 51 ++++++++++++++++++++++++--- Git Formats/tests/syntax_test_git_log | 41 +++++++++++++++++++-- 2 files changed, 85 insertions(+), 7 deletions(-) diff --git a/Git Formats/Git Log.sublime-syntax b/Git Formats/Git Log.sublime-syntax index 8f12a83fa4..2966e52c93 100644 --- a/Git Formats/Git Log.sublime-syntax +++ b/Git Formats/Git Log.sublime-syntax @@ -33,18 +33,17 @@ contexts: - match: \) scope: punctuation.section.parens.end.git.log pop: true - - match: \bmaster\b + - match: \b(?:master|main)\b scope: entity.other.branch-name.master.git.log - match: (\w+)(?:(/)(\w+))? scope: entity.other.branch-name.git.log - match: ',' scope: punctuation.separator.sequence.git.log - - match: (?=^diff\s--git) + - match: (?=^diff\s+--git) embed: scope:source.shell.bash escape: $ - match: (?=^index\s) - embed: scope:source.diff - escape: (?=^(?:commit\s+\h{7,}|diff\s+--git\s)) + push: extended-patch-headers commit-header: # All header attributes are mappings of `key: value` format. @@ -65,3 +64,47 @@ contexts: # https://github.com/SublimeTextIssues/Core/issues/2395 - match: ^ push: Git Commit.sublime-syntax + + extended-patch-headers: + # https://git-scm.com/docs/git-show#_generating_patch_text_with_p + - match: ^(index)\s+ + captures: + 1: keyword.context.git.log + push: index + - match: ^((?:new|deleted)\s+file\s+)?(mode)\s+ + captures: + 1: keyword.context.git.log + 2: keyword.context.git.log + push: mode + - match: ^((?:dis)?similarity\s+index)\s+ + captures: + 1: keyword.context.git.log + push: similarity-index + - match: ^((?:copy|move)\s+(?:from|to))\s+ + captures: + 1: keyword.context.git.log + push: copy-or-move + - match: ^ + pop: true + embed: scope:source.diff + escape: (?=^(?:commit\s+\h{7,}|diff\s+--git\s)) + + index: + - include: Git Common.sublime-syntax#commit + - include: mode + + mode: + - include: Git Common.sublime-syntax#eol-pop + - match: ',|\.\.' + scope: punctuation.separator.sequence.git.log + - match: '[0-7]{6}' + scope: meta.number.integer.octal.git.log constant.numeric.value.git.log + + similarity-index: + - include: Git Common.sublime-syntax#eol-pop + - match: \d+ + scope: meta.number.integer.decimal.git.log constant.numeric.value.git.log + + copy-or-move: + - include: Git Common.sublime-syntax#eol-pop + - include: Git Link.sublime-syntax#expect-path diff --git a/Git Formats/tests/syntax_test_git_log b/Git Formats/tests/syntax_test_git_log index 17f75f7bbc..a5d53ea9a7 100644 --- a/Git Formats/tests/syntax_test_git_log +++ b/Git Formats/tests/syntax_test_git_log @@ -104,7 +104,41 @@ index ae1b1061..c1a585d0 100644 - # - ts-old-type-assertion diff --git a/JavaScript/tests/syntax_test_typescript_not_tsx.ts b/JavaScript/tests/syntax_test_typescript_not_tsx.ts #^^^ source.shell meta.function-call.identifier variable.function -index c90bfab4..e9338c70 100644 +index c90bfab4,c90bfab4..e9338c70 100644 +#^^^^ keyword.context.git.log +# ^^^^^^^^ constant.other.hash +# ^ punctuation.separator.sequence.git.log +# ^^^^^^^^ constant.other.hash +# ^^ punctuation.separator.sequence.git.log +# ^^^^^^^^ constant.other.hash +# ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +mode 012345,676543..701532 +#^^^ keyword.context.git.log +# ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +# ^ punctuation.separator.sequence.git.log +# ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +# ^^ punctuation.separator.sequence.git.log +# ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +new file mode 012345 +#^^^^^^^^^^^^ keyword.context.git.log +# ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +deleted file mode 012345,676543 +#^^^^^^^^^^^^^^^^ keyword.context.git.log +# ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +# ^ punctuation.separator.sequence.git.log +# ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +similarity index 983489374 +#^^^^^^^^^^^^^^^ keyword.context.git.log +# ^^^^^^^^^ meta.number.integer.decimal.git constant.numeric.value.git.log +dissimilarity index 72637263 +#^^^^^^^^^^^^^^^^^^ keyword.context.git.log +# ^^^^^^^^ meta.number.integer.decimal.git constant.numeric.value.git.log +copy from JavaScript/tests/syntax_test_typescript_not_tsx.ts +#^^^^^^^^ keyword.context.git.log +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git meta.path.git string.unquoted.git +move to JavaScript/tests/syntax_test_typescript_not_tsx.ts +#^^^^^^ keyword.context.git.log +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git meta.path.git string.unquoted.git --- a/JavaScript/tests/syntax_test_typescript_not_tsx.ts +++ b/JavaScript/tests/syntax_test_typescript_not_tsx.ts #^^ source.diff meta.diff.header meta.header.to-file punctuation.definition.to-file @@ -117,5 +151,6 @@ index c90bfab4..e9338c70 100644 +// ^^^^^^^^^^^ meta.function #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.diff markup.inserted -commit e2077c6e006acfd2f060aef03c4ef8f89c4db362 (HEAD -> branch_name, origin/branch_name) -#^^^^^ meta.header.git markup.raw.block.git keyword.other.commit.git - source.diff +commit e2077c6e006acfd2f060aef03c4ef8f89c4db362 (HEAD -> main, origin/main) +#^^^^^ meta.header.git.commit markup.raw.block.git keyword.other.commit.git - source.diff +# ^^^^ entity.other.branch-name.master.git.log \ No newline at end of file From d1742200aa0d1c10461a401f53b76239652c6a65 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Wed, 25 Aug 2021 21:21:16 +0300 Subject: [PATCH 4/9] [Git Formats] use variables for escape patterns in Git Log syntax --- Git Formats/Git Log.sublime-syntax | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Git Formats/Git Log.sublime-syntax b/Git Formats/Git Log.sublime-syntax index 2966e52c93..44d3c4ddd9 100644 --- a/Git Formats/Git Log.sublime-syntax +++ b/Git Formats/Git Log.sublime-syntax @@ -2,9 +2,13 @@ --- name: Git Log file_extensions: - - gitlog # no real extention but why not? + - gitlog # no real extension but why not? first_line_match: ^commit\s+\h{7,} scope: text.git.log +variables: + diff_begin: ^diff\s+--git\s + commit_begin: ^(commit)\s+(\h{7,}) + commit_or_diff_begin: (?={{diff_begin}}|{{commit_begin}}) contexts: prototype: @@ -13,7 +17,7 @@ contexts: main: # 1st header line # commit d9d9fb804f5d61c13ba2f8746af33a9f3c609075 - - match: ^(commit)\s+(\h{7,}) + - match: '{{commit_begin}}' captures: 1: keyword.other.commit.git.log 2: constant.other.hash.git.log @@ -23,7 +27,7 @@ contexts: scope: meta.header.git.commit markup.raw.block.git.log pop: true embed: commit-header - escape: (?=^(?:commit|diff)\s) + escape: '{{commit_or_diff_begin}}' - match: (\()(HEAD)\s*(->) captures: 1: punctuation.section.parens.begin.git.log @@ -39,7 +43,7 @@ contexts: scope: entity.other.branch-name.git.log - match: ',' scope: punctuation.separator.sequence.git.log - - match: (?=^diff\s+--git) + - match: (?={{diff_begin}}) embed: scope:source.shell.bash escape: $ - match: (?=^index\s) @@ -87,7 +91,7 @@ contexts: - match: ^ pop: true embed: scope:source.diff - escape: (?=^(?:commit\s+\h{7,}|diff\s+--git\s)) + escape: '{{commit_or_diff_begin}}' index: - include: Git Common.sublime-syntax#commit From 9368cafd63040ca3a6923acfa0db0ac821e1f2d8 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Wed, 25 Aug 2021 21:21:40 +0300 Subject: [PATCH 5/9] [Git Formats] apply a meta scope to the extended diff headers in Git Log --- Git Formats/Git Log.sublime-syntax | 1 + Git Formats/tests/syntax_test_git_log | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Git Formats/Git Log.sublime-syntax b/Git Formats/Git Log.sublime-syntax index 44d3c4ddd9..52c893f042 100644 --- a/Git Formats/Git Log.sublime-syntax +++ b/Git Formats/Git Log.sublime-syntax @@ -71,6 +71,7 @@ contexts: extended-patch-headers: # https://git-scm.com/docs/git-show#_generating_patch_text_with_p + - meta_scope: meta.diff.header.extended.git.log - match: ^(index)\s+ captures: 1: keyword.context.git.log diff --git a/Git Formats/tests/syntax_test_git_log b/Git Formats/tests/syntax_test_git_log index a5d53ea9a7..2b5e3b0e11 100644 --- a/Git Formats/tests/syntax_test_git_log +++ b/Git Formats/tests/syntax_test_git_log @@ -112,6 +112,7 @@ index c90bfab4,c90bfab4..e9338c70 100644 # ^^ punctuation.separator.sequence.git.log # ^^^^^^^^ constant.other.hash # ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.extended.git.log mode 012345,676543..701532 #^^^ keyword.context.git.log # ^^^^^^ meta.number.integer.octal.git constant.numeric.value.git.log @@ -139,7 +140,9 @@ copy from JavaScript/tests/syntax_test_typescript_not_tsx.ts move to JavaScript/tests/syntax_test_typescript_not_tsx.ts #^^^^^^ keyword.context.git.log # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git meta.path.git string.unquoted.git +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.extended.git.log --- a/JavaScript/tests/syntax_test_typescript_not_tsx.ts +#<- - meta.diff.header.extended +++ b/JavaScript/tests/syntax_test_typescript_not_tsx.ts #^^ source.diff meta.diff.header meta.header.to-file punctuation.definition.to-file @@ -25,3 +25,12 @@ From d2eba7d55bbf223b1c968a4d2050083bfc932465 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Wed, 25 Aug 2021 21:26:47 +0300 Subject: [PATCH 6/9] [Git Formats] Rework Git Link syntax to avoid meta.mapping.value scope when referencing the path context from another syntax --- Git Formats/Git Link.sublime-syntax | 14 +++++++++----- Git Formats/tests/syntax_test_git_log | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Git Formats/Git Link.sublime-syntax b/Git Formats/Git Link.sublime-syntax index b26919ac14..669649d25e 100644 --- a/Git Formats/Git Link.sublime-syntax +++ b/Git Formats/Git Link.sublime-syntax @@ -32,21 +32,25 @@ contexts: - meta_scope: meta.mapping.git.link - match: ':' scope: punctuation.separator.mapping.key-value.git.link - set: expect-path + set: [mapping-value-meta, expect-path] - match: \n pop: true expect-path: - - meta_content_scope: meta.mapping.value.git.link - - match: (?=\S) # path starts with the first none space character + - match: (?=\S) # path starts with the first non-space character set: [path, path-start] - match: \n pop: true + mapping-value-meta: + - meta_content_scope: meta.mapping.value.git.link + - match: '' + pop: true + path: - - meta_content_scope: meta.mapping.value.git.link meta.path.git.link string.unquoted.git.link + - meta_content_scope: meta.path.git.link string.unquoted.git.link - match: \.?\n - scope: meta.mapping.value.git.link punctuation.terminator.path.git.link + scope: punctuation.terminator.path.git.link pop: true - match: '[\\/]' scope: punctuation.separator.path.git.link diff --git a/Git Formats/tests/syntax_test_git_log b/Git Formats/tests/syntax_test_git_log index 2b5e3b0e11..2e2a9d5793 100644 --- a/Git Formats/tests/syntax_test_git_log +++ b/Git Formats/tests/syntax_test_git_log @@ -136,10 +136,10 @@ dissimilarity index 72637263 # ^^^^^^^^ meta.number.integer.decimal.git constant.numeric.value.git.log copy from JavaScript/tests/syntax_test_typescript_not_tsx.ts #^^^^^^^^ keyword.context.git.log -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git meta.path.git string.unquoted.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.path.git string.unquoted.git move to JavaScript/tests/syntax_test_typescript_not_tsx.ts #^^^^^^ keyword.context.git.log -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git meta.path.git string.unquoted.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.path.git string.unquoted.git #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.extended.git.log --- a/JavaScript/tests/syntax_test_typescript_not_tsx.ts #<- - meta.diff.header.extended From 54fa8f8b29454b9cf0fcbddbdadef84968f1089a Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Wed, 25 Aug 2021 22:39:26 +0300 Subject: [PATCH 7/9] [Git Formats] Remove .link scope suffix from generic path scopes in Git Link syntax --- Git Formats/Git Link.sublime-syntax | 14 +++--- Git Formats/tests/syntax_test_git_link | 66 +++++++++++++------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Git Formats/Git Link.sublime-syntax b/Git Formats/Git Link.sublime-syntax index 669649d25e..fae05260a8 100644 --- a/Git Formats/Git Link.sublime-syntax +++ b/Git Formats/Git Link.sublime-syntax @@ -48,35 +48,35 @@ contexts: pop: true path: - - meta_content_scope: meta.path.git.link string.unquoted.git.link + - meta_content_scope: meta.path.git string.unquoted.git - match: \.?\n scope: punctuation.terminator.path.git.link pop: true - match: '[\\/]' - scope: punctuation.separator.path.git.link + scope: punctuation.separator.path.git push: path-dir-pattern - match: '[*?]' - scope: invalid.illegal.path.git.link + scope: invalid.illegal.path.git path-start: # windows drive letter and separator - match: '[A-Za-z](:)(?=[\\/])' captures: - 1: punctuation.separator.drive.git.link + 1: punctuation.separator.drive.git pop: true # homedir tilde operator - match: ~(?=/) - scope: variable.language.environment.home.git.link + scope: variable.language.environment.home.git pop: true # any other directory pattern - include: path-dir-pattern path-dir-pattern: - match: \.\.(?=[\\/]) - scope: constant.language.path.parent.git.link + scope: constant.language.path.parent.git pop: true - match: \.(?=[\\/]) - scope: constant.language.path.self.git.link + scope: constant.language.path.self.git pop: true - match: '' pop: true diff --git a/Git Formats/tests/syntax_test_git_link b/Git Formats/tests/syntax_test_git_link index 6302ea4aa5..378ec4c913 100644 --- a/Git Formats/tests/syntax_test_git_link +++ b/Git Formats/tests/syntax_test_git_link @@ -4,24 +4,24 @@ gitdir: c:/data/sublime/packages/.git. #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link -# ^ - string.unquoted.git.link -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.link -# ^ punctuation.separator.drive.git.link -# ^ punctuation.separator.path.git.link -# ^ punctuation.separator.path.git.link -# ^ punctuation.separator.path.git.link -# ^ - string.unquoted.git.link +# ^ - string.unquoted.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git +# ^ punctuation.separator.drive.git +# ^ punctuation.separator.path.git +# ^ punctuation.separator.path.git +# ^ punctuation.separator.path.git +# ^ - string.unquoted.git # ^ punctuation.terminator.path.git.link gitdir: c:\data\sublime\packages\.git. #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link -# ^ - string.unquoted.git.link -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.link -# ^ punctuation.separator.drive.git.link -# ^ punctuation.separator.path.git.link -# ^ punctuation.separator.path.git.link -# ^ - string.unquoted.git.link +# ^ - string.unquoted.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git +# ^ punctuation.separator.drive.git +# ^ punctuation.separator.path.git +# ^ punctuation.separator.path.git +# ^ - string.unquoted.git # ^ punctuation.terminator.path.git.link gitdir: ~/../sub..li~me/./packages/.git #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link @@ -30,19 +30,19 @@ gitdir: ~/../sub..li~me/./packages/.git # <- keyword.other.gitdir.git.link #^^^^^ keyword.other.gitdir.git.link # ^ punctuation.separator.mapping.key-value.git.link -# ^ - string.unquoted.git.link -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git.link -# ^ - string.unquoted.git.link -# ^ variable.language.environment.home.git.link -# ^ punctuation.separator.path.git.link -# ^^ constant.language.path.parent.git.link -# ^ punctuation.separator.path.git.link -# ^^ - constant.language.path.parent.git.link -# ^ - variable.language.environment.home.git.link -# ^ punctuation.separator.path.git.link -# ^ constant.language.path.self.git.link -# ^ punctuation.separator.path.git.link -# ^ - constant.language.path.self.git.link +# ^ - string.unquoted.git +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git +# ^ - string.unquoted.git +# ^ variable.language.environment.home.git +# ^ punctuation.separator.path.git +# ^^ constant.language.path.parent.git +# ^ punctuation.separator.path.git +# ^^ - constant.language.path.parent.git +# ^ - variable.language.environment.home.git +# ^ punctuation.separator.path.git +# ^ constant.language.path.self.git +# ^ punctuation.separator.path.git +# ^ - constant.language.path.self.git gitdir invalid : ../data/s?bl*me/packages/.git. #^^^^^^^^^^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link @@ -51,11 +51,11 @@ gitdir invalid : ../data/s?bl*me/packages/.git. #^^^^^ keyword.other.gitdir.git.link # ^^^^^^^ invalid.illegal.separator-expected.git.link # ^ punctuation.separator.mapping.key-value.git.link -# ^^ constant.language.path.parent.git.link -# ^ punctuation.separator.path.git.link -# ^ punctuation.separator.path.git.link -# ^ invalid.illegal.path.git.link -# ^ invalid.illegal.path.git.link -# ^ punctuation.separator.path.git.link -# ^ punctuation.separator.path.git.link +# ^^ constant.language.path.parent.git +# ^ punctuation.separator.path.git +# ^ punctuation.separator.path.git +# ^ invalid.illegal.path.git +# ^ invalid.illegal.path.git +# ^ punctuation.separator.path.git +# ^ punctuation.separator.path.git # ^ punctuation.terminator.path.git.link From ba65fe7bcce53808765972b0eedb662d9876c5a7 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Thu, 26 Aug 2021 07:50:47 +0300 Subject: [PATCH 8/9] [Git Formats] Remove erroneous dot from Git Link path terminator punctuation --- Git Formats/Git Link.sublime-syntax | 4 ++-- Git Formats/tests/syntax_test_git_link | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Git Formats/Git Link.sublime-syntax b/Git Formats/Git Link.sublime-syntax index fae05260a8..4f1108416b 100644 --- a/Git Formats/Git Link.sublime-syntax +++ b/Git Formats/Git Link.sublime-syntax @@ -49,8 +49,8 @@ contexts: path: - meta_content_scope: meta.path.git string.unquoted.git - - match: \.?\n - scope: punctuation.terminator.path.git.link + - match: $\n + scope: punctuation.terminator.path.git pop: true - match: '[\\/]' scope: punctuation.separator.path.git diff --git a/Git Formats/tests/syntax_test_git_link b/Git Formats/tests/syntax_test_git_link index 378ec4c913..298c34190e 100644 --- a/Git Formats/tests/syntax_test_git_link +++ b/Git Formats/tests/syntax_test_git_link @@ -1,6 +1,6 @@ # SYNTAX TEST "Git Link.sublime-syntax" # <- text.git.link comment.line punctuation.definition.comment -gitdir: c:/data/sublime/packages/.git. +gitdir: c:/data/sublime/packages/.git #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link @@ -11,8 +11,8 @@ gitdir: c:/data/sublime/packages/.git. # ^ punctuation.separator.path.git # ^ punctuation.separator.path.git # ^ - string.unquoted.git -# ^ punctuation.terminator.path.git.link -gitdir: c:\data\sublime\packages\.git. +# ^ punctuation.terminator.path.git +gitdir: c:\data\sublime\packages\.git #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link @@ -22,7 +22,7 @@ gitdir: c:\data\sublime\packages\.git. # ^ punctuation.separator.path.git # ^ punctuation.separator.path.git # ^ - string.unquoted.git -# ^ punctuation.terminator.path.git.link +# ^ punctuation.terminator.path.git gitdir: ~/../sub..li~me/./packages/.git #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link @@ -43,7 +43,7 @@ gitdir: ~/../sub..li~me/./packages/.git # ^ constant.language.path.self.git # ^ punctuation.separator.path.git # ^ - constant.language.path.self.git -gitdir invalid : ../data/s?bl*me/packages/.git. +gitdir invalid : ../data/s?bl*me/packages/.git #^^^^^^^^^^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link @@ -58,4 +58,4 @@ gitdir invalid : ../data/s?bl*me/packages/.git. # ^ invalid.illegal.path.git # ^ punctuation.separator.path.git # ^ punctuation.separator.path.git -# ^ punctuation.terminator.path.git.link +# ^ punctuation.terminator.path.git From 28f7041f7d520b9d7c9d976011a1e0b30692de74 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Thu, 26 Aug 2021 21:00:22 +0300 Subject: [PATCH 9/9] [Git Formats] remove unnecessary punctuation.terminator scope at EOL --- Git Formats/Git Link.sublime-syntax | 3 +-- Git Formats/tests/syntax_test_git_link | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Git Formats/Git Link.sublime-syntax b/Git Formats/Git Link.sublime-syntax index 4f1108416b..1b5cbfd8ce 100644 --- a/Git Formats/Git Link.sublime-syntax +++ b/Git Formats/Git Link.sublime-syntax @@ -49,8 +49,7 @@ contexts: path: - meta_content_scope: meta.path.git string.unquoted.git - - match: $\n - scope: punctuation.terminator.path.git + - match: $ pop: true - match: '[\\/]' scope: punctuation.separator.path.git diff --git a/Git Formats/tests/syntax_test_git_link b/Git Formats/tests/syntax_test_git_link index 298c34190e..a442c22715 100644 --- a/Git Formats/tests/syntax_test_git_link +++ b/Git Formats/tests/syntax_test_git_link @@ -3,7 +3,7 @@ gitdir: c:/data/sublime/packages/.git #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link # ^ - string.unquoted.git # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git # ^ punctuation.separator.drive.git @@ -11,22 +11,20 @@ gitdir: c:/data/sublime/packages/.git # ^ punctuation.separator.path.git # ^ punctuation.separator.path.git # ^ - string.unquoted.git -# ^ punctuation.terminator.path.git gitdir: c:\data\sublime\packages\.git #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link # ^ - string.unquoted.git # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.unquoted.git # ^ punctuation.separator.drive.git # ^ punctuation.separator.path.git # ^ punctuation.separator.path.git # ^ - string.unquoted.git -# ^ punctuation.terminator.path.git gitdir: ~/../sub..li~me/./packages/.git #^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link # <- keyword.other.gitdir.git.link #^^^^^ keyword.other.gitdir.git.link # ^ punctuation.separator.mapping.key-value.git.link @@ -46,7 +44,7 @@ gitdir: ~/../sub..li~me/./packages/.git gitdir invalid : ../data/s?bl*me/packages/.git #^^^^^^^^^^^^^^ meta.mapping.key.git.link - meta.mapping.value.git.link # ^ meta.mapping.git.link - meta.mapping.key.git.link - meta.mapping.value.git.link -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.git.link - meta.mapping.key.git.link # <- keyword.other.gitdir.git.link #^^^^^ keyword.other.gitdir.git.link # ^^^^^^^ invalid.illegal.separator-expected.git.link @@ -58,4 +56,3 @@ gitdir invalid : ../data/s?bl*me/packages/.git # ^ invalid.illegal.path.git # ^ punctuation.separator.path.git # ^ punctuation.separator.path.git -# ^ punctuation.terminator.path.git