diff --git a/extensions/go/syntaxes/go.json b/extensions/go/syntaxes/go.json index b4983d40002..21be4436592 100644 --- a/extensions/go/syntaxes/go.json +++ b/extensions/go/syntaxes/go.json @@ -9,26 +9,7 @@ "foldingStopMarker": "(}|\\))\\s*$", "patterns": [ { - "comment": "Block comments", - "begin": "/\\*", - "end": "\\*/", - "captures": { - "0": { - "name": "punctuation.definition.comment.go" - } - }, - "name": "comment.block.go" - }, - { - "comment": "Line comments", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.go" - } - }, - "end": "$", - "name": "comment.line.double-slash.go" + "include": "#comments" }, { "comment": "Interpreted string literals", @@ -219,6 +200,9 @@ "name": "punctuation.definition.string.end.go" } } + }, + { + "include": "#comments" } ], "end": "\\)", @@ -351,6 +335,30 @@ } ] }, + "comments": { + "patterns": [ + { + "begin": "/\\*", + "end": "\\*/", + "captures": { + "0": { + "name": "punctuation.definition.comment.go" + } + }, + "name": "comment.block.go" + }, + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.go" + } + }, + "end": "$", + "name": "comment.line.double-slash.go" + } + ] + }, "delimiters": { "patterns": [ {