extension/src/goInstallTools: run updateImportantToolsStatus always

I noticed that the language bar status shows only "Analysis tools"
and nothing more when my environment is already setup and there is
no missing tool.

Even when all tools are installed, we need to run
updateImportantToolsStatus to set up the update command
and update the presentation. Add tests too.

Change-Id: I18a0a9b35f7651473fc7a7717303d5bd6f75901e
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/562400
Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
diff --git a/extension/src/goInstallTools.ts b/extension/src/goInstallTools.ts
index 356cb6c..8d570c7 100644
--- a/extension/src/goInstallTools.ts
+++ b/extension/src/goInstallTools.ts
@@ -556,6 +556,9 @@
 			}
 			await installTools(missing, goVersion, { toolsManager: tm, skipRestartGopls: true });
 			// installTools will update ImportantToolsStatus.
+		} else {
+			// no essential tools to be installed.
+			await updateImportantToolsStatus(tm);
 		}
 	} catch (e) {
 		outputChannel.appendLine('install missing tools failed - ' + JSON.stringify(e));
diff --git a/extension/test/integration/install.test.ts b/extension/test/integration/install.test.ts
index f3b7c17..ce435cf 100644
--- a/extension/test/integration/install.test.ts
+++ b/extension/test/integration/install.test.ts
@@ -412,8 +412,14 @@
 					: vscode.LanguageStatusSeverity.Information,
 				statusBarItem.text
 			);
-			for (const tool of wantMissingTools) {
-				assert(statusBarItem.detail!.includes(tool), statusBarItem.detail + ' does not contain ' + tool);
+			if (wantMissingTools && wantMissingTools.length > 0) {
+				assert.strictEqual(statusBarItem.command?.title, 'Install missing tools');
+				for (const tool of wantMissingTools) {
+					assert(statusBarItem.detail!.includes(tool), statusBarItem.detail + ' does not contain ' + tool);
+				}
+			} else {
+				assert.strictEqual(statusBarItem.command?.title, 'Update');
+				assert.strictEqual(statusBarItem.detail, 'no missing tools');
 			}
 		} catch (e) {
 			assert.fail(`maybeInstallImportantTools failed: ${e}`);