aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_go.lua
diff options
context:
space:
mode:
authorMerlin Volkmer <49447733+Meerschwein@users.noreply.github.com>2022-12-29 20:06:50 +0100
committerGitHub <noreply@github.com>2022-12-29 15:06:50 -0400
commit28e28f235798f012c4a7b8f8d2e282e96f2193cf (patch)
tree54ad2b86170d6ef659138789b054c19c6e1fa1d3 /plugins/language_go.lua
parent25b0ebd36838188fa5c1568e16afd79bb0dcb67d (diff)
downloadlite-xl-plugins-28e28f235798f012c4a7b8f8d2e282e96f2193cf.tar.gz
lite-xl-plugins-28e28f235798f012c4a7b8f8d2e282e96f2193cf.zip
Add highlighting for go.mod and go.sum files (#182)
Diffstat (limited to 'plugins/language_go.lua')
-rw-r--r--plugins/language_go.lua37
1 files changed, 37 insertions, 0 deletions
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 = {}
+}
+