Skip to content

Commit

Permalink
syntaxes: color govulncheck output in the output channel
Browse files Browse the repository at this point in the history
Change-Id: I00ff7a0cf0f016748f4da3278055f720e6cc480a
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/455555
Reviewed-by: Jamal Carvalho <[email protected]>
TryBot-Result: kokoro <[email protected]>
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
  • Loading branch information
hyangah committed Dec 7, 2022
1 parent 3bcbaaf commit 8ffb271
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@
"aliases": [
"Go Template File"
]
},
{
"id": "govulncheck",
"aliases": [
"Govulncheck Output"
]
}
],
"grammars": [
Expand All @@ -189,6 +195,11 @@
"language": "go.sum",
"scopeName": "go.sum",
"path": "./syntaxes/go.sum.tmGrammar.json"
},
{
"language": "govulncheck",
"scopeName": "govulncheck",
"path": "./syntaxes/govulncheck.tmGrammar.json"
}
],
"snippets": [
Expand Down
124 changes: 124 additions & 0 deletions syntaxes/govulncheck.tmGrammar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"scopeName": "govulncheck",
"patterns": [
{
"include": "#log"
},
{
"include": "#info"
},
{
"include": "#affecting"
},
{
"include": "#unaffecting"
},
{
"include": "#callstack"
},
{
"include": "#callstacklong"
},
{
"include": "#frame"
},
{
"include": "#framePosition"
}
],
"repository": {
"log": {
"comment": "log",
"match": "^\\d{2}:\\d{2}:\\d{2} \\S.*$",
"name": "comment.govulncheck"
},
"info": {
"comment": "info",
"match": "^# .*",
"name": "comment.govulncheck"
},
"affecting": {
"comment": "vulnerability heading",
"match": "^(⚠) (\\S+) \\((https://[^)]+)\\)",
"name": "markup.heading.2.govulncheck",
"captures": {
"1": {
"name": "markup.bold.severity.govulncheck"
},
"2": {
"name": "markup.bold.vulnid.govulncheck"
},
"3": {
"name": "entity.bold.link.govulncheck"
}
}
},
"unaffecting": {
"comment": "vulnerability heading",
"match": "^(ⓘ) (\\S+) \\((https://[^)]+)\\)",
"name": "markup.heading.2.govulncheck",
"captures": {
"1": {
"name": "markup.severity.govulncheck"
},
"2": {
"name": "markup.vulnid.govulncheck"
},
"3": {
"name": "markup.link.govulncheck"
}
}
},
"callstacklong": {
"comment": "callstack",
"match": "^\\- (\\S+) (\\S+) calls ([^,]+), which eventually calls (\\S+)",
"name": "markup.list.unnumbered.callstack.summary.govulncheck",
"captures": {
"1": {
"name": "markup.link.callstack.position.govulncheck"
},
"2": {
"name": "markup.italic.raw.callstack.symbol.govulncheck"
},
"3": {
"name": "markup.italic.callstack.symbol.govulncheck"
},
"4": {
"name": "markup.italic.callstack.symbol.govulncheck"
}
}
},
"callstack": {
"comment": "callstack",
"match": "^\\- (\\S+) (\\S+) calls ([^,]+)$",
"name": "markup.list.unnumbered.callstack.summary.govulncheck",
"captures": {
"1": {
"name": "markup.link.callstack.position.govulncheck"
},
"2": {
"name": "markup.italic.raw.callstack.symbol.govulncheck"
},
"3": {
"name": "markup.italic.callstack.symbol.govulncheck"
}
}
},
"frame": {
"comment": "frame",
"match": "^\\t(\\S+)",
"name": "markup.list.unnumbered.fram.govulncheck",
"captures": {
"1": { "name": "markup.italic.raw.callstack.symbol.govulncheck"}
}
},
"framePosition": {
"comment": "frame position info",
"match": "^\\t\\t(\\([^)]+\\))",
"name": "markup.list.unnumbered.frame.govulncheck",
"captures": {
"1": { "name": "comment.govulncheck"}
}
}
}
}

0 comments on commit 8ffb271

Please sign in to comment.