From c3fb86cbaa5c6973fe014a4401c4e0d6f663384d Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 24 Dec 2021 16:49:27 -0600 Subject: tree-sitter-gitcommit->tree-sitter-git-commit --- .gitmodules | 6 +++--- book/src/generated/lang-support.md | 2 +- helix-syntax/languages/tree-sitter-git-commit | 1 + helix-syntax/languages/tree-sitter-gitcommit | 1 - languages.toml | 2 +- runtime/queries/git-commit/highlights.scm | 18 ++++++++++++++++++ runtime/queries/git-commit/injections.scm | 15 +++++++++++++++ runtime/queries/gitcommit/highlights.scm | 18 ------------------ runtime/queries/gitcommit/injections.scm | 15 --------------- 9 files changed, 39 insertions(+), 39 deletions(-) create mode 160000 helix-syntax/languages/tree-sitter-git-commit delete mode 160000 helix-syntax/languages/tree-sitter-gitcommit create mode 100644 runtime/queries/git-commit/highlights.scm create mode 100644 runtime/queries/git-commit/injections.scm delete mode 100644 runtime/queries/gitcommit/highlights.scm delete mode 100644 runtime/queries/gitcommit/injections.scm diff --git a/.gitmodules b/.gitmodules index ad100a00..d5bd61c9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -170,7 +170,7 @@ path = helix-syntax/languages/tree-sitter-fish url = https://github.com/ram02z/tree-sitter-fish shallow = true -[submodule "helix-syntax/languages/tree-sitter-gitcommit"] - path = helix-syntax/languages/tree-sitter-gitcommit - url = https://github.com/the-mikedavis/tree-sitter-gitcommit.git +[submodule "helix-syntax/languages/tree-sitter-git-commit"] + path = helix-syntax/languages/tree-sitter-git-commit + url = https://github.com/the-mikedavis/tree-sitter-git-commit.git shallow = true diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index d6e0d9af..9c42005b 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -11,7 +11,7 @@ | dockerfile | ✓ | | | `docker-langserver` | | elixir | ✓ | | | `elixir-ls` | | fish | ✓ | ✓ | ✓ | | -| gitcommit | ✓ | | | | +| git-commit | ✓ | | | | | glsl | ✓ | | ✓ | | | go | ✓ | ✓ | ✓ | `gopls` | | html | ✓ | | | | diff --git a/helix-syntax/languages/tree-sitter-git-commit b/helix-syntax/languages/tree-sitter-git-commit new file mode 160000 index 00000000..5cd4776c --- /dev/null +++ b/helix-syntax/languages/tree-sitter-git-commit @@ -0,0 +1 @@ +Subproject commit 5cd4776c86c82d9d6afdc8c73a47a08057aef618 diff --git a/helix-syntax/languages/tree-sitter-gitcommit b/helix-syntax/languages/tree-sitter-gitcommit deleted file mode 160000 index 6a2ddbec..00000000 --- a/helix-syntax/languages/tree-sitter-gitcommit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6a2ddbecd49fa8e7e1fda24d43e363cfd9171ca0 diff --git a/languages.toml b/languages.toml index f73011c8..616ef234 100644 --- a/languages.toml +++ b/languages.toml @@ -475,7 +475,7 @@ indent = { tab-width = 2, unit = " " } language-server = { command = "docker-langserver", args = ["--stdio"] } [[language]] -name = "gitcommit" +name = "git-commit" scope = "git.commitmsg" roots = [] file-types = ["COMMIT_EDITMSG"] diff --git a/runtime/queries/git-commit/highlights.scm b/runtime/queries/git-commit/highlights.scm new file mode 100644 index 00000000..04d70416 --- /dev/null +++ b/runtime/queries/git-commit/highlights.scm @@ -0,0 +1,18 @@ +(subject) @markup.heading +(path) @string.special.path +(branch) @string.special.symbol +(commit) @constant +(item) @markup.link.url +(header) @tag + +(change kind: "new file" @diff.plus) +(change kind: "deleted" @diff.minus) +(change kind: "modified" @diff.delta) +(change kind: "renamed" @diff.delta.moved) + +[":" "->"] @punctuation.delimeter +(comment) @comment + +; once we have diff injections, @comment should become @none +((comment (scissors)) + (message)+ @comment) diff --git a/runtime/queries/git-commit/injections.scm b/runtime/queries/git-commit/injections.scm new file mode 100644 index 00000000..2837a586 --- /dev/null +++ b/runtime/queries/git-commit/injections.scm @@ -0,0 +1,15 @@ +; once a diff grammar is available, we can inject diff highlighting into the +; trailer after scissors (git commit --verbose) +; see https://github.com/helix-editor/helix/pull/1338#issuecomment-1000013539 +; +; ((comment (scissors)) +; (message) @injection.content +; (#set! injection.language "diff")) + +; --- + +; once a rebase grammar is available, we can inject rebase highlighting into +; interactive rebase summary sections like so: +; +; ((rebase_command) @injection.content +; (#set! injection.language "git-rebase")) diff --git a/runtime/queries/gitcommit/highlights.scm b/runtime/queries/gitcommit/highlights.scm deleted file mode 100644 index 04d70416..00000000 --- a/runtime/queries/gitcommit/highlights.scm +++ /dev/null @@ -1,18 +0,0 @@ -(subject) @markup.heading -(path) @string.special.path -(branch) @string.special.symbol -(commit) @constant -(item) @markup.link.url -(header) @tag - -(change kind: "new file" @diff.plus) -(change kind: "deleted" @diff.minus) -(change kind: "modified" @diff.delta) -(change kind: "renamed" @diff.delta.moved) - -[":" "->"] @punctuation.delimeter -(comment) @comment - -; once we have diff injections, @comment should become @none -((comment (scissors)) - (message)+ @comment) diff --git a/runtime/queries/gitcommit/injections.scm b/runtime/queries/gitcommit/injections.scm deleted file mode 100644 index 2837a586..00000000 --- a/runtime/queries/gitcommit/injections.scm +++ /dev/null @@ -1,15 +0,0 @@ -; once a diff grammar is available, we can inject diff highlighting into the -; trailer after scissors (git commit --verbose) -; see https://github.com/helix-editor/helix/pull/1338#issuecomment-1000013539 -; -; ((comment (scissors)) -; (message) @injection.content -; (#set! injection.language "diff")) - -; --- - -; once a rebase grammar is available, we can inject rebase highlighting into -; interactive rebase summary sections like so: -; -; ((rebase_command) @injection.content -; (#set! injection.language "git-rebase")) -- cgit v1.2.3-70-g09d2