Skip to content

Commit d7a44e3

Browse files
frankli0324gopherbot
authored andcommitted
extension: fix go.mod retract block syntax highlight
retract block in go.mod can contain ranges in the form of "[vStart, vEnd]", which is not currently well-highlighted Change-Id: I8f2a41b6fc9a268c939e0e65fa82b9d2146ea360 GitHub-Last-Rev: 979739c GitHub-Pull-Request: #3604 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/628335 Auto-Submit: Hyang-Ah Hana Kim <[email protected]> Commit-Queue: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> kokoro-CI: kokoro <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 9eedcfc commit d7a44e3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

extension/syntaxes/go.mod.tmGrammar.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
{
6565
"include": "#semver"
6666
},
67+
{
68+
"include": "#semver_range"
69+
},
6770
{
6871
"include": "#unquoted_string"
6972
}
@@ -142,6 +145,15 @@
142145
"match": "v(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\da-z-]+(?:\\.[\\da-z-]+)*)?(?:\\+[\\da-z-]+(?:\\.[\\da-z-]+)*)?",
143146
"name": "constant.language.go.mod"
144147
},
148+
"semver_range": {
149+
"begin": "\\[",
150+
"patterns": [
151+
{
152+
"include": "#semver"
153+
}
154+
],
155+
"end": "\\]"
156+
},
145157
"string_escaped_char": {
146158
"patterns": [
147159
{

0 commit comments

Comments
 (0)