[git] add grammar update script
This commit is contained in:
parent
f1abf5ad11
commit
fb84773f76
5 changed files with 183 additions and 280 deletions
|
@ -10,6 +10,9 @@
|
|||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"scripts": {
|
||||
"update-grammar": "node ../../build/npm/update-grammar.js textmate/git.tmbundle Syntaxes/Git%20Commit%20Message.tmLanguage ./syntaxes/git-commit.tmLanguage.json Syntaxes/Git%20Rebase%20Message.tmLanguage ./syntaxes/git-rebase.tmLanguage.json"
|
||||
},
|
||||
"contributes": {
|
||||
"languages": [
|
||||
{
|
||||
|
@ -40,12 +43,12 @@
|
|||
{
|
||||
"language": "git-commit",
|
||||
"scopeName": "text.git-commit",
|
||||
"path": "./syntaxes/git-commit.tmLanguage"
|
||||
"path": "./syntaxes/git-commit.tmLanguage.json"
|
||||
},
|
||||
{
|
||||
"language": "git-rebase",
|
||||
"scopeName": "text.git-rebase",
|
||||
"path": "./syntaxes/git-rebase.tmLanguage"
|
||||
"path": "./syntaxes/git-rebase.tmLanguage.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,221 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>COMMIT_EDITMSG</string>
|
||||
<string>MERGE_MSG</string>
|
||||
</array>
|
||||
<key>foldingStartMarker</key>
|
||||
<string>^\+\+\+</string>
|
||||
<key>foldingStopMarker</key>
|
||||
<string>^---</string>
|
||||
<key>name</key>
|
||||
<string>Git Commit Message</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\A(?!# Please enter the commit message)</string>
|
||||
<key>end</key>
|
||||
<string>^(?=# Please enter the commit message)</string>
|
||||
<key>name</key>
|
||||
<string>meta.scope.message.git-commit</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\A(?=#)</string>
|
||||
<key>end</key>
|
||||
<string>^(?!#)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#comment</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>^(?!# Please enter the commit message)</string>
|
||||
<key>end</key>
|
||||
<string>^(?=# Please enter the commit message)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\G</string>
|
||||
<key>end</key>
|
||||
<string>^(?!\G)</string>
|
||||
<key>name</key>
|
||||
<string>meta.scope.subject.git-commit</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.$2.git-commit</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>\G((fixup|squash)!)\s*</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>.{66,}$</string>
|
||||
<key>name</key>
|
||||
<string>invalid.illegal.line-too-long.git-commit</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>.{51,}$</string>
|
||||
<key>name</key>
|
||||
<string>invalid.deprecated.line-too-long.git-commit</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>^(?!# Please enter the commit message)</string>
|
||||
<key>end</key>
|
||||
<string>^(?=# Please enter the commit message)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#comment</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>^(?=# Please enter the commit message)</string>
|
||||
<key>end</key>
|
||||
<string>\z</string>
|
||||
<key>name</key>
|
||||
<string>meta.scope.metadata.git-commit</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#metadata</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>^(#)</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.git-commit</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\n</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.number-sign.git-commit</string>
|
||||
</dict>
|
||||
<key>metadata</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?=^# Changes to be committed:)</string>
|
||||
<key>end</key>
|
||||
<string>(?!\G)((?=^# \w)|(?!^#))</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(^[ \t]+)?(?=#)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.whitespace.comment.leading.git-commit</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>contentName</key>
|
||||
<string>comment.line.number-sign.git-commit</string>
|
||||
<key>end</key>
|
||||
<string>(?!\G)^</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\G#</string>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.git-commit</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>((modified|renamed):.*)$\n?</string>
|
||||
<key>name</key>
|
||||
<string>markup.changed.git-commit</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(new file:.*)$\n?</string>
|
||||
<key>name</key>
|
||||
<string>markup.inserted.git-commit</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(deleted:.*)$\n?</string>
|
||||
<key>name</key>
|
||||
<string>markup.deleted.git-commit</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#comment</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?=diff\ \-\-git)</string>
|
||||
<key>comment</key>
|
||||
<string>diff presented at the end of the commit message when using commit -v.</string>
|
||||
<key>contentName</key>
|
||||
<string>source.diff</string>
|
||||
<key>end</key>
|
||||
<string>\z</string>
|
||||
<key>name</key>
|
||||
<string>meta.embedded.diff.git-commit</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>source.diff</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>scopeName</key>
|
||||
<string>text.git-commit</string>
|
||||
<key>uuid</key>
|
||||
<string>BFE83C06-8508-44BE-A975-95A57BF619A7</string>
|
||||
</dict>
|
||||
</plist>
|
143
extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json
Normal file
143
extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json
Normal file
|
@ -0,0 +1,143 @@
|
|||
{
|
||||
"fileTypes": [
|
||||
"COMMIT_EDITMSG",
|
||||
"MERGE_MSG"
|
||||
],
|
||||
"foldingStartMarker": "^\\+\\+\\+",
|
||||
"foldingStopMarker": "^---",
|
||||
"name": "Git Commit Message",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\A(?!# Please enter the commit message)",
|
||||
"end": "^(?=# Please enter the commit message)",
|
||||
"name": "meta.scope.message.git-commit",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\A(?=#)",
|
||||
"end": "^(?!#)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(?!# Please enter the commit message)",
|
||||
"end": "^(?=# Please enter the commit message)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G",
|
||||
"end": "^(?!\\G)",
|
||||
"name": "meta.scope.subject.git-commit",
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.$2.git-commit"
|
||||
}
|
||||
},
|
||||
"match": "\\G((fixup|squash)!)\\s*"
|
||||
},
|
||||
{
|
||||
"match": ".{73,}$",
|
||||
"name": "invalid.illegal.line-too-long.git-commit"
|
||||
},
|
||||
{
|
||||
"match": ".{51,}$",
|
||||
"name": "invalid.deprecated.line-too-long.git-commit"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(?!# Please enter the commit message)",
|
||||
"end": "^(?=# Please enter the commit message)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(?=# Please enter the commit message)",
|
||||
"end": "\\z",
|
||||
"name": "meta.scope.metadata.git-commit",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#metadata"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"comment": {
|
||||
"begin": "^(#)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.comment.git-commit"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"name": "comment.line.number-sign.git-commit"
|
||||
},
|
||||
"metadata": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(?=^# Changes to be committed:)",
|
||||
"end": "(?!\\G)((?=^# \\w)|(?!^#))",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(^[ \\t]+)?(?=#)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.git-commit"
|
||||
}
|
||||
},
|
||||
"contentName": "comment.line.number-sign.git-commit",
|
||||
"end": "(?!\\G)^",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\G#",
|
||||
"name": "punctuation.definition.comment.git-commit"
|
||||
},
|
||||
{
|
||||
"match": "((modified|renamed):.*)$\\n?",
|
||||
"name": "markup.changed.git-commit"
|
||||
},
|
||||
{
|
||||
"match": "(new file:.*)$\\n?",
|
||||
"name": "markup.inserted.git-commit"
|
||||
},
|
||||
{
|
||||
"match": "(deleted:.*)$\\n?",
|
||||
"name": "markup.deleted.git-commit"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"begin": "(?=diff\\ \\-\\-git)",
|
||||
"comment": "diff presented at the end of the commit message when using commit -v.",
|
||||
"contentName": "source.diff",
|
||||
"end": "\\z",
|
||||
"name": "meta.embedded.diff.git-commit",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.diff"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "text.git-commit",
|
||||
"uuid": "BFE83C06-8508-44BE-A975-95A57BF619A7",
|
||||
"version": "https://github.com/textmate/git.tmbundle/commit/93897a78c6e52bef13dadc0d4091d203c5facb40"
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>git-rebase-todo</string>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Git Rebase Message</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.git-rebase</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^\s*(#).*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.number-sign.git-rebase</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>support.function.git-rebase</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>constant.sha.git-rebase</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.commit-message.git-rebase</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^\s*(pick|p|reword|r|edit|e|squash|s|fixup|f|d|drop|x|exec)\s+([0-9a-f]+)\s+(.*)$</string>
|
||||
<key>name</key>
|
||||
<string>meta.commit-command.git-rebase</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>scopeName</key>
|
||||
<string>text.git-rebase</string>
|
||||
<key>uuid</key>
|
||||
<string>7F1CC209-5F6D-486A-8180-09FA282381A1</string>
|
||||
</dict>
|
||||
</plist>
|
35
extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json
Normal file
35
extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"fileTypes": [
|
||||
"git-rebase-todo"
|
||||
],
|
||||
"name": "Git Rebase Message",
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.comment.git-rebase"
|
||||
}
|
||||
},
|
||||
"match": "^\\s*(#).*$\\n?",
|
||||
"name": "comment.line.number-sign.git-rebase"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.function.git-rebase"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.sha.git-rebase"
|
||||
},
|
||||
"3": {
|
||||
"name": "meta.commit-message.git-rebase"
|
||||
}
|
||||
},
|
||||
"match": "^\\s*(pick|p|reword|r|edit|e|squash|s|fixup|f|exec|x|drop|d)\\s+([0-9a-f]+)\\s+(.*)$",
|
||||
"name": "meta.commit-command.git-rebase"
|
||||
}
|
||||
],
|
||||
"scopeName": "text.git-rebase",
|
||||
"uuid": "7F1CC209-5F6D-486A-8180-09FA282381A1",
|
||||
"version": "https://github.com/textmate/git.tmbundle/commit/d1db42c2d71948662098183a6df519fb53a7a15b"
|
||||
}
|
Loading…
Reference in a new issue