Skip to content

Commit

Permalink
[Common] Refactor scopes and syntax
Browse files Browse the repository at this point in the history
This commit...

1. applies more generic text.diff3 scope as those markers are not tight to git
2. renames and moves syntax definition to Packages/Text/Diff3.sublime-syntax
  • Loading branch information
deathaxe committed Oct 5, 2024
1 parent 9f93b31 commit 789f839
Show file tree
Hide file tree
Showing 93 changed files with 1,236 additions and 1,236 deletions.
2 changes: 1 addition & 1 deletion ASP/ASP.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contexts:
- include: root_asp
- match: \n
pop: true
- include: scope:text.git.merge#conflicts # merge conflict marker
- include: scope:text.diff3#conflicts # merge conflict marker

line_continuation_char:
- match: '\b_'
Expand Down
52 changes: 26 additions & 26 deletions ASP/syntax_test_asp.asp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,44 +1423,44 @@ test = "hello%>
-->
<<<<<<< HEAD
' <- markup.conflict.begin.git punctuation.section.conflict.git
' ^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
' ^ markup.conflict.begin.git - entity - punctuation
' ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
' ^ markup.conflict.begin.git - entity - punctuation
' <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
' ^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
' ^ markup.conflict.begin.diff3 - entity - punctuation
' ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
' ^ markup.conflict.begin.diff3 - entity - punctuation
=======
' <- markup.conflict.separator.git punctuation.section.conflict.git
' ^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
' ^ markup.conflict.separator.git - punctuation
' <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
' ^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
' ^ markup.conflict.separator.diff3 - punctuation
>>>>>>> master
' <- markup.conflict.end.git punctuation.section.conflict.git
' ^^^^^ markup.conflict.end.git punctuation.section.conflict.git
' ^ markup.conflict.end.git - entity - punctuation
' ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
' ^ markup.conflict.end.git - entity - punctuation
' <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
' ^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
' ^ markup.conflict.end.diff3 - entity - punctuation
' ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
' ^ markup.conflict.end.diff3 - entity - punctuation
<%
<<<<<<< HEAD
' <- markup.conflict.begin.git punctuation.section.conflict.git
' ^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
' ^ markup.conflict.begin.git - entity - punctuation
' ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
' ^ markup.conflict.begin.git - entity - punctuation
' <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
' ^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
' ^ markup.conflict.begin.diff3 - entity - punctuation
' ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
' ^ markup.conflict.begin.diff3 - entity - punctuation
=======
' <- markup.conflict.separator.git punctuation.section.conflict.git
' ^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
' ^ markup.conflict.separator.git - punctuation
' <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
' ^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
' ^ markup.conflict.separator.diff3 - punctuation
>>>>>>> master
' <- markup.conflict.end.git punctuation.section.conflict.git
' ^^^^^ markup.conflict.end.git punctuation.section.conflict.git
' ^ markup.conflict.end.git - entity - punctuation
' ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
' ^ markup.conflict.end.git - entity - punctuation
' <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
' ^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
' ^ markup.conflict.end.diff3 - entity - punctuation
' ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
' ^ markup.conflict.end.diff3 - entity - punctuation
%>
Expand Down
4 changes: 2 additions & 2 deletions AppleScript/AppleScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ contexts:
0: punctuation.definition.comment.applescript
pop: true
- include: comments.nested
- include: scope:text.git.merge#conflicts # merge conflict marker
- include: scope:text.diff3#conflicts # merge conflict marker

comments.nested:
- match: \(\*
Expand All @@ -556,7 +556,7 @@ contexts:
0: punctuation.definition.comment.applescript
pop: true
- include: comments.nested
- include: scope:text.git.merge#conflicts # merge conflict marker
- include: scope:text.diff3#conflicts # merge conflict marker

data-structures:
- match: '(\{)'
Expand Down
104 changes: 52 additions & 52 deletions AppleScript/tests/syntax_test.applescript
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
-- SYNTAX TEST "Packages/AppleScript/AppleScript.sublime-syntax"

<<<<<<< HEAD
-- <- markup.conflict.begin.git punctuation.section.conflict.git
--^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation
-- ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation

=======
-- <- markup.conflict.separator.git punctuation.section.conflict.git
--^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
-- ^ markup.conflict.separator.git - punctuation
-- <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.separator.diff3 - punctuation

>>>>>>> foo/bar
-- <- markup.conflict.end.git punctuation.section.conflict.git
--^^^^^ markup.conflict.end.git punctuation.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- ^^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation
-- ^^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation

(* Conflict in block comment
<<<<<<< HEAD
-- <- markup.conflict.begin.git punctuation.section.conflict.git
--^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation
-- ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation
=======
-- <- markup.conflict.separator.git punctuation.section.conflict.git
--^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
-- ^ markup.conflict.separator.git - punctuation
-- <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.separator.diff3 - punctuation
>>>>>>> master
-- <- markup.conflict.end.git punctuation.section.conflict.git
--^^^^^ markup.conflict.end.git punctuation.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation
-- ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation
*)

{ (* conflict in block *)
<<<<<<< HEAD
-- <- markup.conflict.begin.git punctuation.section.conflict.git
--^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation
-- ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation

=======
-- <- markup.conflict.separator.git punctuation.section.conflict.git
--^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
-- ^ markup.conflict.separator.git - punctuation
-- <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.separator.diff3 - punctuation

>>>>>>> master
-- <- markup.conflict.end.git punctuation.section.conflict.git
--^^^^^ markup.conflict.end.git punctuation.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation
-- ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation
}

( (* conflict in group *)
<<<<<<< HEAD
-- <- markup.conflict.begin.git punctuation.section.conflict.git
--^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
-- ^ markup.conflict.begin.git - entity - punctuation
-- <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation
-- ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.begin.diff3 - entity - punctuation

=======
-- <- markup.conflict.separator.git punctuation.section.conflict.git
--^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
-- ^ markup.conflict.separator.git - punctuation
-- <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.separator.diff3 - punctuation

>>>>>>> master
-- <- markup.conflict.end.git punctuation.section.conflict.git
--^^^^^ markup.conflict.end.git punctuation.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
-- ^ markup.conflict.end.git - entity - punctuation
-- <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
--^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation
-- ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
-- ^ markup.conflict.end.diff3 - entity - punctuation
)
2 changes: 1 addition & 1 deletion Batch File/Batch File.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ contexts:
- match: '{{label_comment}}'
scope: punctuation.definition.comment.dosbatch
push: comment-body
- include: scope:text.git.merge#conflicts # merge conflict marker
- include: scope:text.diff3#conflicts # merge conflict marker

comment-body:
- meta_scope: comment.line.colon.dosbatch
Expand Down
26 changes: 13 additions & 13 deletions Batch File/tests/syntax_test_batch_file.bat
Original file line number Diff line number Diff line change
Expand Up @@ -265,23 +265,23 @@ ECHO : Not a comment ^
:::: [ Git Conflict Marker Tests ]:::::::::::::::::::::::::::::::::::::::::::::

<<<<<<< HEAD
:: <- markup.conflict.begin.git punctuation.section.conflict.git
::^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
:: ^ markup.conflict.begin.git - entity - punctuation
:: ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
:: ^ markup.conflict.begin.git - entity - punctuation
:: <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
::^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
:: ^ markup.conflict.begin.diff3 - entity - punctuation
:: ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
:: ^ markup.conflict.begin.diff3 - entity - punctuation

=======
:: <- markup.conflict.separator.git punctuation.section.conflict.git
::^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
:: ^ markup.conflict.separator.git - punctuation
:: <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
::^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
:: ^ markup.conflict.separator.diff3 - punctuation

>>>>>>> master
:: <- markup.conflict.end.git punctuation.section.conflict.git
::^^^^^ markup.conflict.end.git punctuation.section.conflict.git
:: ^ markup.conflict.end.git - entity - punctuation
:: ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
:: ^ markup.conflict.end.git - entity - punctuation
:: <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
::^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
:: ^ markup.conflict.end.diff3 - entity - punctuation
:: ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
:: ^ markup.conflict.end.diff3 - entity - punctuation

:::: [ @ Operator ] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down
2 changes: 1 addition & 1 deletion C#/C#.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ contexts:
captures:
1: punctuation.definition.comment.cs
- include: comments_in
- include: scope:text.git.merge#conflicts # merge conflict marker
- include: scope:text.diff3#conflicts # merge conflict marker

comments_in:
- match: \b(?i:todo|hack|xxx)\b
Expand Down
26 changes: 13 additions & 13 deletions C#/tests/syntax_test_Comments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ void dcscmm(Transpose TransA, int m, int n, int k,

class MergeConflict {
<<<<<<< HEAD
// <- markup.conflict.begin.git punctuation.section.conflict.git
//^^^^^ markup.conflict.begin.git punctuation.section.conflict.git
// ^ markup.conflict.begin.git - entity - punctuation
// ^^^^ markup.conflict.begin.git entity.name.section.conflict.git
// ^ markup.conflict.begin.git - entity - punctuation
// <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3
//^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3
// ^ markup.conflict.begin.diff3 - entity - punctuation
// ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3
// ^ markup.conflict.begin.diff3 - entity - punctuation
void main(int foo) {
=======
// <- markup.conflict.separator.git punctuation.section.conflict.git
//^^^^^ markup.conflict.separator.git punctuation.section.conflict.git
// ^ markup.conflict.separator.git - punctuation
// <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3
//^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3
// ^ markup.conflict.separator.diff3 - punctuation
void main(bool bar) {
>>>>>>> master
// <- markup.conflict.end.git punctuation.section.conflict.git
//^^^^^ markup.conflict.end.git punctuation.section.conflict.git
// ^ markup.conflict.end.git - entity - punctuation
// ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git
// ^ markup.conflict.end.git - entity - punctuation
// <- markup.conflict.end.diff3 punctuation.section.conflict.diff3
//^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3
// ^ markup.conflict.end.diff3 - entity - punctuation
// ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3
// ^ markup.conflict.end.diff3 - entity - punctuation
}
}
2 changes: 1 addition & 1 deletion C++/C.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contexts:
comments:
- include: block-comments
- include: line-comments
- include: scope:text.git.merge#conflicts # merge conflict marker
- include: scope:text.diff3#conflicts # merge conflict marker

block-comments:
- match: ^(/\*) =\s*(.*?)\s*= (\*/)$\n?
Expand Down
26 changes: 13 additions & 13 deletions C++/syntax_test_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@
*/

<<<<<<< HEAD
/* <- markup.conflict.begin.git punctuation.section.conflict.git */
/*^^^^^ markup.conflict.begin.git punctuation.section.conflict.git */
/* ^ markup.conflict.begin.git - entity - punctuation */
/* ^^^^ markup.conflict.begin.git entity.name.section.conflict.git */
/* ^ markup.conflict.begin.git - entity - punctuation */
/* <- markup.conflict.begin.diff3 punctuation.section.conflict.diff3 */
/*^^^^^ markup.conflict.begin.diff3 punctuation.section.conflict.diff3 */
/* ^ markup.conflict.begin.diff3 - entity - punctuation */
/* ^^^^ markup.conflict.begin.diff3 entity.name.section.conflict.diff3 */
/* ^ markup.conflict.begin.diff3 - entity - punctuation */

=======
/* <- markup.conflict.separator.git punctuation.section.conflict.git */
/*^^^^^ markup.conflict.separator.git punctuation.section.conflict.git */
/* ^ markup.conflict.separator.git - punctuation */
/* <- markup.conflict.separator.diff3 punctuation.section.conflict.diff3 */
/*^^^^^ markup.conflict.separator.diff3 punctuation.section.conflict.diff3 */
/* ^ markup.conflict.separator.diff3 - punctuation */

>>>>>>> master
/* <- markup.conflict.end.git punctuation.section.conflict.git */
/*^^^^^ markup.conflict.end.git punctuation.section.conflict.git */
/* ^ markup.conflict.end.git - entity - punctuation */
/* ^^^^^^ markup.conflict.end.git entity.name.section.conflict.git */
/* ^ markup.conflict.end.git - entity - punctuation */
/* <- markup.conflict.end.diff3 punctuation.section.conflict.diff3 */
/*^^^^^ markup.conflict.end.diff3 punctuation.section.conflict.diff3 */
/* ^ markup.conflict.end.diff3 - entity - punctuation */
/* ^^^^^^ markup.conflict.end.diff3 entity.name.section.conflict.diff3 */
/* ^ markup.conflict.end.diff3 - entity - punctuation */

int main(){
int a=5,b=0;
Expand Down
Loading

0 comments on commit 789f839

Please sign in to comment.