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

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

Merged
merged 2 commits into from
Oct 25, 2017
Merged
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
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