From d392cea3487149c1ef028a8f60367d20f7acb536 Mon Sep 17 00:00:00 2001 From: DarkMatter-999 Date: Fri, 3 Oct 2025 12:40:59 +0530 Subject: [PATCH 1/4] feat: Add Gomod submodule for go.mod / go.sum syntax support --- .gitmodules | 3 +++ assets/syntaxes/02_Extra/Gomod | 1 + 2 files changed, 4 insertions(+) create mode 160000 assets/syntaxes/02_Extra/Gomod diff --git a/.gitmodules b/.gitmodules index 860bcbb0..1d1b8429 100644 --- a/.gitmodules +++ b/.gitmodules @@ -278,3 +278,6 @@ [submodule "assets/syntaxes/02_Extra/hosts"] path = assets/syntaxes/02_Extra/hosts url = https://github.com/tijn/hosts.tmLanguage +[submodule "assets/syntaxes/02_Extra/Gomod"] + path = assets/syntaxes/02_Extra/Gomod + url = https://github.com/mitranim/sublime-gomod diff --git a/assets/syntaxes/02_Extra/Gomod b/assets/syntaxes/02_Extra/Gomod new file mode 160000 index 00000000..e0200f02 --- /dev/null +++ b/assets/syntaxes/02_Extra/Gomod @@ -0,0 +1 @@ +Subproject commit e0200f024a394d6e7d6b7b37a070bb8ef324b19b From 28ab873a3fc973d3fec36cf9954b75f5f75387e4 Mon Sep 17 00:00:00 2001 From: DarkMatter-999 Date: Fri, 3 Oct 2025 13:00:09 +0530 Subject: [PATCH 2/4] tests: add syntax tests for go.mod and go.sum --- tests/syntax-tests/highlighted/Go/go.mod | 5 +++++ tests/syntax-tests/highlighted/Go/go.sum | 6 ++++++ tests/syntax-tests/source/Go/go.mod | 5 +++++ tests/syntax-tests/source/Go/go.sum | 6 ++++++ 4 files changed, 22 insertions(+) create mode 100644 tests/syntax-tests/highlighted/Go/go.mod create mode 100644 tests/syntax-tests/highlighted/Go/go.sum create mode 100644 tests/syntax-tests/source/Go/go.mod create mode 100644 tests/syntax-tests/source/Go/go.sum diff --git a/tests/syntax-tests/highlighted/Go/go.mod b/tests/syntax-tests/highlighted/Go/go.mod new file mode 100644 index 00000000..0af0c671 --- /dev/null +++ b/tests/syntax-tests/highlighted/Go/go.mod @@ -0,0 +1,5 @@ +module hugeparam + +go 1.25.1 + +require golang.org/x/tools v0.37.0 diff --git a/tests/syntax-tests/highlighted/Go/go.sum b/tests/syntax-tests/highlighted/Go/go.sum new file mode 100644 index 00000000..c64fd034 --- /dev/null +++ b/tests/syntax-tests/highlighted/Go/go.sum @@ -0,0 +1,6 @@ +golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= diff --git a/tests/syntax-tests/source/Go/go.mod b/tests/syntax-tests/source/Go/go.mod new file mode 100644 index 00000000..9f229ef3 --- /dev/null +++ b/tests/syntax-tests/source/Go/go.mod @@ -0,0 +1,5 @@ +module hugeparam + +go 1.25.1 + +require golang.org/x/tools v0.37.0 diff --git a/tests/syntax-tests/source/Go/go.sum b/tests/syntax-tests/source/Go/go.sum new file mode 100644 index 00000000..f04bc1a7 --- /dev/null +++ b/tests/syntax-tests/source/Go/go.sum @@ -0,0 +1,6 @@ +golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= From 7ee6ee385efd75242aa96950608492671f620345 Mon Sep 17 00:00:00 2001 From: DarkMatter-999 Date: Fri, 3 Oct 2025 13:09:57 +0530 Subject: [PATCH 3/4] docs: update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc2169e9..53b0955e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ - Map `.flatpakref` and `.flatpakrepo` files to INI syntax #3353 (@Ferenc-) - Update hosts syntax #3368 (@keith-hall) - Map `.kshrc` files to Bash syntax #3364 (@ritoban23) +- Add syntax definition and test file for Go modules(`go.mod` and `go.sum`) highlighting, see #3424 (@DarkMatter-999) ## Themes From 7b67981fb9b6743aab8b4e96eff10c6f880e5c75 Mon Sep 17 00:00:00 2001 From: DarkMatter-999 Date: Fri, 3 Oct 2025 13:26:59 +0530 Subject: [PATCH 4/4] tests: fix highlights for Go module syntax --- tests/syntax-tests/highlighted/Go/go.mod | 6 +++--- tests/syntax-tests/highlighted/Go/go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/syntax-tests/highlighted/Go/go.mod b/tests/syntax-tests/highlighted/Go/go.mod index 0af0c671..26d11781 100644 --- a/tests/syntax-tests/highlighted/Go/go.mod +++ b/tests/syntax-tests/highlighted/Go/go.mod @@ -1,5 +1,5 @@ -module hugeparam +module hugeparam -go 1.25.1 +go 1.25.1 -require golang.org/x/tools v0.37.0 +require golang.org/x/tools v0.37.0 diff --git a/tests/syntax-tests/highlighted/Go/go.sum b/tests/syntax-tests/highlighted/Go/go.sum index c64fd034..54394747 100644 --- a/tests/syntax-tests/highlighted/Go/go.sum +++ b/tests/syntax-tests/highlighted/Go/go.sum @@ -1,6 +1,6 @@ -golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= -golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= -golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= -golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= -golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= -golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= +golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=