Skip to content

Commit 6bb2321

Browse files
committed
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 <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Suzy Mueller <[email protected]>
1 parent 5382d03 commit 6bb2321

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

extension/src/goInstallTools.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ export async function maybeInstallImportantTools(
556556
}
557557
await installTools(missing, goVersion, { toolsManager: tm, skipRestartGopls: true });
558558
// installTools will update ImportantToolsStatus.
559+
} else {
560+
// no essential tools to be installed.
561+
await updateImportantToolsStatus(tm);
559562
}
560563
} catch (e) {
561564
outputChannel.appendLine('install missing tools failed - ' + JSON.stringify(e));

extension/test/integration/install.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,14 @@ suite('maybeInstallImportantTools tests', () => {
412412
: vscode.LanguageStatusSeverity.Information,
413413
statusBarItem.text
414414
);
415-
for (const tool of wantMissingTools) {
416-
assert(statusBarItem.detail!.includes(tool), statusBarItem.detail + ' does not contain ' + tool);
415+
if (wantMissingTools && wantMissingTools.length > 0) {
416+
assert.strictEqual(statusBarItem.command?.title, 'Install missing tools');
417+
for (const tool of wantMissingTools) {
418+
assert(statusBarItem.detail!.includes(tool), statusBarItem.detail + ' does not contain ' + tool);
419+
}
420+
} else {
421+
assert.strictEqual(statusBarItem.command?.title, 'Update');
422+
assert.strictEqual(statusBarItem.detail, 'no missing tools');
417423
}
418424
} catch (e) {
419425
assert.fail(`maybeInstallImportantTools failed: ${e}`);

0 commit comments

Comments
 (0)