From 28e28f235798f012c4a7b8f8d2e282e96f2193cf Mon Sep 17 00:00:00 2001 From: Merlin Volkmer <49447733+Meerschwein@users.noreply.github.com> Date: Thu, 29 Dec 2022 20:06:50 +0100 Subject: Add highlighting for go.mod and go.sum files (#182) --- plugins/language_go.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'plugins') diff --git a/plugins/language_go.lua b/plugins/language_go.lua index 93db0e4..e262af0 100644 --- a/plugins/language_go.lua +++ b/plugins/language_go.lua @@ -193,3 +193,40 @@ syntax.add { }, } +syntax.add { + name = "Go", + files = { "go%.mod" }, + comment = "//", + patterns = { + { pattern = "//.-\n", type = "comment"}, + { pattern = "module() %S+()", + type = { "keyword", "string", "normal"} + }, + { pattern = "go() %S+()", + type = { "keyword", "string", "normal" } + }, + { pattern = "%S+() v%S+()", + type = { "string", "keyword", "normal" } + }, + }, + symbols = { + ["require"] = "keyword", + ["module"] = "keyword", + ["go"] = "keyword", + } +} + +syntax.add { + name = "Go", + files = { "go%.sum" }, + patterns = { + { pattern = "%S+() v[^/]-() h1:()%S+()=", + type = { "string", "keyword", "normal", "string", "normal" } + }, + { pattern = "%S+() v[^/]-()/%S+() h1:()%S+()=", + type = { "string", "keyword", "string", "normal", "string", "normal" } + }, + }, + symbols = {} +} + -- cgit v1.2.3