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

Commit

Permalink
pop up the example web view when detecting a new iot device to be con…
Browse files Browse the repository at this point in the history
…nected (#431)

* pop up the example web view when detecting a new iot device to be connected

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>

* fix review comments
  • Loading branch information
testforstephen authored Oct 25, 2017
1 parent 9c0a8e8 commit 7f8150a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ export async function activate(context: vscode.ExtensionContext) {
return vscode.commands.executeCommand("vscode.previewHtml", BOARD_CONFIG_URI, vscode.ViewColumn.Two, "Arduino Board Configuration");
});

registerArduinoCommand("arduino.showExamples", () => {
registerArduinoCommand("arduino.showExamples", (forceRefresh: boolean = false) => {
vscode.commands.executeCommand("setContext", "vscode-arduino:showExampleExplorer", true);
if (forceRefresh) {
vscode.commands.executeCommand("arduino.reloadExample");
}
return vscode.commands.executeCommand("vscode.previewHtml", EXAMPLES_URI, vscode.ViewColumn.Two, "Arduino Examples");
});

Expand Down
2 changes: 1 addition & 1 deletion src/serialmonitor/usbDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class UsbDetector {
if (!util.fileExistsSync(readmeFilePath)) {
readmeFilePath = path.join(ArduinoContext.boardManager.currentBoard.platform.rootBoardPath, "README.md");
}
vscode.commands.executeCommand("setContext", "vscode-arduino:showExampleExplorer", true);
vscode.commands.executeCommand("arduino.showExamples", true);
if (util.fileExistsSync(readmeFilePath)) {
if (readmeFilePath.endsWith(MARKDOWN_EXT)) {
vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(readmeFilePath));
Expand Down

0 comments on commit 7f8150a

Please sign in to comment.