Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Use QuickPick to select sketch and set it to arduino.json file #963

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/deviceContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ export class DeviceContext implements IDeviceContext, vscode.Disposable {
this.sketch = chosen.label;
}
}
})
.then(() => {
this.showStatusBar();
});
}
}
19 changes: 1 addition & 18 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down