src/goVulncheck: add the feedback link, polish govulncheck output

This change also makes 'gopls.tidy' trigger file save, since
gopls requires all files to be on disk, and results in an error
otherwise. That makes the module upgrade UX bumpy.

Also, change the textmate tokens for severity - most VS Code theme
extensions offer severity-based color and formatting. Utilize them.

Change-Id: I741c063517b9a1ccf15c968c33d1b36d2eca7abf
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/456755
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/src/goVulncheck.ts b/src/goVulncheck.ts
index c835864..2fe4fd7 100644
--- a/src/goVulncheck.ts
+++ b/src/goVulncheck.ts
@@ -68,7 +68,7 @@
 			outputChannel.appendLine(`Found Version: ${moduleVersion(mod.Path, mod.FoundVersion)}`);
 			outputChannel.appendLine(`Fixed Version: ${moduleVersion(mod.Path, mod.FixedVersion)}`);
 			mod.Packages?.forEach((pkg) => {
-				outputChannel.appendLine('');
+				outputChannel.appendLine('\nCall stacks in your code:');
 				pkg.CallStacks?.forEach((cs, index) => {
 					// TODO: the position info embedded in the cs.Summary is relative to
 					// the directory gopls ran the vulnchek.
@@ -347,9 +347,6 @@
 
 export const toggleVulncheckCommandFactory = () => () => {
 	const editor = vscode.window.activeTextEditor;
-	if (!editor) {
-		return;
-	}
 	const documentUri = editor?.document.uri;
 	toggleVulncheckCommand(documentUri);
 };
diff --git a/src/language/goLanguageServer.ts b/src/language/goLanguageServer.ts
index fda9374..30fee57 100644
--- a/src/language/goLanguageServer.ts
+++ b/src/language/goLanguageServer.ts
@@ -499,9 +499,17 @@
 					try {
 						if (command === 'gopls.run_govulncheck' && args.length) {
 							await vscode.workspace.saveAll(false);
+							// TODO: move this output printing to goVulncheck.ts.
 							govulncheckOutputChannel?.replace(`govulncheck ./... for ${args[0].URI}\n`);
+							govulncheckOutputChannel?.appendLine('govulncheck is an experimental tool.');
+							govulncheckOutputChannel?.appendLine(
+								'Share feedback at https://go.dev/s/vsc-vulncheck-feedback.\n'
+							);
 							govulncheckOutputChannel?.show();
 						}
+						if (command === 'gopls.tidy') {
+							await vscode.workspace.saveAll(false);
+						}
 						const res = await next(command, args);
 						if (command === 'gopls.run_govulncheck') {
 							const progressToken = res.Token;
diff --git a/syntaxes/govulncheck.tmGrammar.json b/syntaxes/govulncheck.tmGrammar.json
index 52f411b..b557c59 100644
--- a/syntaxes/govulncheck.tmGrammar.json
+++ b/syntaxes/govulncheck.tmGrammar.json
@@ -40,32 +40,31 @@
 		"affecting": {
 			"comment": "vulnerability heading",
 			"match": "^(⚠) (\\S+) \\((https://[^)]+)\\)",
-			"name": "markup.heading.2.govulncheck",
+			"name": "markup.heading.1.govulncheck",
 			"captures": {
 				"1": {
-					"name": "markup.bold.severity.govulncheck"
+					"name": "token.error-token.severity.govulncheck"
 				},
 				"2": {
-					"name": "markup.bold.vulnid.govulncheck"
+					"name": "token.error-token.vulnid.govulncheck"
 				},
 				"3": {
-					"name": "entity.bold.link.govulncheck"
+					"name": "entity.link.govulncheck"
 				}
 			}
 		},
 		"unaffecting": {
 			"comment": "vulnerability heading",
 			"match": "^(ⓘ) (\\S+) \\((https://[^)]+)\\)",
-			"name": "markup.heading.2.govulncheck",
 			"captures": {
 				"1": {
-					"name": "markup.severity.govulncheck"
+					"name": "token.info-token.severity.govulncheck"
 				},
 				"2": {
-					"name": "markup.vulnid.govulncheck"
+					"name": "token.info-token.vulnid.govulncheck"
 				},
 				"3": {
-					"name": "markup.link.govulncheck"
+					"name": "entity.link.govulncheck"
 				}
 			}
 		},