feat(editor): add syntax highlighting for go.mod and go.work files (#1695)

go.mod and go.work opened as plain text: their language definitions had no ui-mode, so no CodeMirror language loaded. Add a GoMod mode (a small stream parser): directives as keywords, module paths as strings, versions as numbers, // comments; shared by go.mod and go.work.

Co-authored-by: elfadl <[email protected]>
Цей коміт міститься в:
Kamal ElFadlтаelfadl authored and GitHub committed 2026-11-07 11:12:41 +08:00
1 джерело 1af1744290
коміт 14a31fe8a1
7 files changed
+196 -1

No files matched your search

+1
Переглянути файл
@@ -3,6 +3,7 @@ name = "Go Module"
filenames = ["go.mod"]
line-comment = "//"
indent = { tab-size = 4, insert-spaces = false }
ui-mode = "GoMod"
[[language-servers]]
name = "gopls"
+1
Переглянути файл
@@ -3,6 +3,7 @@ name = "Go Workspace"
filenames = ["go.work"]
line-comment = "//"
indent = { tab-size = 4, insert-spaces = false }
ui-mode = "GoMod"
[[language-servers]]
name = "gopls"