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

Commit 7f8150a

Browse files
pop up the example web view when detecting a new iot device to be connected (#431)
* pop up the example web view when detecting a new iot device to be connected Signed-off-by: Jinbo Wang <[email protected]> * fix review comments
1 parent 9c0a8e8 commit 7f8150a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/extension.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,11 @@ export async function activate(context: vscode.ExtensionContext) {
104104
return vscode.commands.executeCommand("vscode.previewHtml", BOARD_CONFIG_URI, vscode.ViewColumn.Two, "Arduino Board Configuration");
105105
});
106106

107-
registerArduinoCommand("arduino.showExamples", () => {
107+
registerArduinoCommand("arduino.showExamples", (forceRefresh: boolean = false) => {
108108
vscode.commands.executeCommand("setContext", "vscode-arduino:showExampleExplorer", true);
109+
if (forceRefresh) {
110+
vscode.commands.executeCommand("arduino.reloadExample");
111+
}
109112
return vscode.commands.executeCommand("vscode.previewHtml", EXAMPLES_URI, vscode.ViewColumn.Two, "Arduino Examples");
110113
});
111114

src/serialmonitor/usbDetector.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class UsbDetector {
150150
if (!util.fileExistsSync(readmeFilePath)) {
151151
readmeFilePath = path.join(ArduinoContext.boardManager.currentBoard.platform.rootBoardPath, "README.md");
152152
}
153-
vscode.commands.executeCommand("setContext", "vscode-arduino:showExampleExplorer", true);
153+
vscode.commands.executeCommand("arduino.showExamples", true);
154154
if (util.fileExistsSync(readmeFilePath)) {
155155
if (readmeFilePath.endsWith(MARKDOWN_EXT)) {
156156
vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(readmeFilePath));

0 commit comments

Comments
 (0)