diff --git a/src/deviceContext.ts b/src/deviceContext.ts index 2e7f18e3..119a3fce 100644 --- a/src/deviceContext.ts +++ b/src/deviceContext.ts @@ -359,6 +359,9 @@ export class DeviceContext implements IDeviceContext, vscode.Disposable { this.sketch = chosen.label; } } + }) + .then(() => { + this.showStatusBar(); }); } } diff --git a/src/extension.ts b/src/extension.ts index 57eae256..9e555f07 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -153,24 +153,7 @@ export async function activate(context: vscode.ExtensionContext) { }); registerArduinoCommand("arduino.setSketchFile", async () => { - const sketchFileName = deviceContext.sketch; - const newSketchFileName = await vscode.window.showInputBox({ - placeHolder: sketchFileName, - validateInput: (value) => { - if (value && /\.((ino)|(cpp)|c)$/.test(value.trim())) { - return null; - } else { - return "Invalid sketch file name. Should be *.ino/*.cpp/*.c"; - } - }, - }); - - if (!newSketchFileName) { - return; - } - - deviceContext.sketch = newSketchFileName; - deviceContext.showStatusBar(); + await deviceContext.resolveMainSketch(); }); registerArduinoCommand("arduino.uploadUsingProgrammer", async () => {