Skip to content

Commit 14499a2

Browse files
authored
Defer building code when vendor instructions shown (#799)
Fixes #746 Loading the instructions leaves the dependency view visible, so code will still be built the next time the dependency view loses visibility
1 parent 76464bc commit 14499a2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vscode-wpilib/src/dependencyView.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export class DependencyViewProvider implements vscode.WebviewViewProvider {
4747
private vendordepMarketplaceURL = `https://frcmaven.wpi.edu/artifactory/vendordeps/vendordep-marketplace/`;
4848
private wp: vscode.WorkspaceFolder | undefined;
4949
private changed = 0;
50+
private showingInstructions = false;
5051

5152
private _view?: vscode.WebviewView;
5253

@@ -92,7 +93,9 @@ export class DependencyViewProvider implements vscode.WebviewViewProvider {
9293
if (webviewView.visible) {
9394
void this._refresh(this.wp);
9495
} else {
95-
if (this.changed > this.vendorLibraries.getLastBuild()) {
96+
if (this.showingInstructions) {
97+
this.showingInstructions = false;
98+
} else if (this.changed > this.vendorLibraries.getLastBuild()) {
9699
this.externalApi.getBuildTestAPI().buildCode(this.wp, undefined);
97100
this.changed = 0;
98101
}
@@ -127,7 +130,9 @@ export class DependencyViewProvider implements vscode.WebviewViewProvider {
127130
}
128131
case 'blur': {
129132
if (this.wp) {
130-
if (this.changed > this.vendorLibraries.getLastBuild()) {
133+
if (this.showingInstructions) {
134+
this.showingInstructions = false;
135+
} else if (this.changed > this.vendorLibraries.getLastBuild()) {
131136
this.externalApi.getBuildTestAPI().buildCode(this.wp, undefined);
132137
this.changed = 0;
133138
}
@@ -234,6 +239,7 @@ export class DependencyViewProvider implements vscode.WebviewViewProvider {
234239

235240
if (success) {
236241
if (avail.instructions) {
242+
this.showingInstructions = true;
237243
await vscode.commands.executeCommand(
238244
'extension.showWebsite',
239245
avail.instructions,

0 commit comments

Comments
 (0)