diff --git a/.github/workflows/update-grammars.yml b/.github/workflows/update-grammars.yml index a026168d3..ae873523f 100644 --- a/.github/workflows/update-grammars.yml +++ b/.github/workflows/update-grammars.yml @@ -54,6 +54,7 @@ jobs: - gleam - glsl - go + - go-mod - gpr - groovy - haskell diff --git a/.gitmodules b/.gitmodules index 1fb4eb84c..cd0676eb4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -624,3 +624,9 @@ update = none ignore = dirty branch = main +[submodule "repos/go-mod"] + path = repos/go-mod + url = https://github.com/camdencheek/tree-sitter-go-mod + update = none + ignore = dirty + branch = main diff --git a/CHANGELOG.md b/CHANGELOG.md index 02a134c60..f0eb339d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Unreleased +- Add `Go Mod` support ## 0.12.266 - 2025-03-23 diff --git a/queries/go-mod/highlights.scm b/queries/go-mod/highlights.scm new file mode 100644 index 000000000..0d3e0ca55 --- /dev/null +++ b/queries/go-mod/highlights.scm @@ -0,0 +1,18 @@ +[ + "require" + "replace" + "go" + "toolchain" + "exclude" + "retract" + "module" +] @keyword + +"=>" @operator + +(comment) @comment + +[ +(version) +(go_version) +] @string diff --git a/repos/go-mod b/repos/go-mod new file mode 160000 index 000000000..6efb59652 --- /dev/null +++ b/repos/go-mod @@ -0,0 +1 @@ +Subproject commit 6efb59652d30e0e9cd5f3b3a669afd6f1a926d3c diff --git a/tree-sitter-langs.el b/tree-sitter-langs.el index 5650c10f7..ab2d36ebb 100644 --- a/tree-sitter-langs.el +++ b/tree-sitter-langs.el @@ -142,6 +142,7 @@ See `tree-sitter-langs-repos'." (gleam-mode . gleam) (glsl-mode . glsl) (go-mode . go) + (go-dot-mod-mode . go-mod) (gpr-mode . gpr) (groovy-mode . groovy) (jenkinsfile-mode . groovy)