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

Commit

Permalink
Merge branch 'master' into yaohai_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
yaohaizh authored Oct 25, 2017
2 parents 1987bdc + 7f8150a commit 50334c8
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 @@ -105,8 +105,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 50334c8

Please sign in to comment.