Skip to content

Commit 54a4860

Browse files
authored
Make sure exporting a plain file also asks to open a browser (microsoft#3666)
* Add open in browser for straight file export too
1 parent 1d292d8 commit 54a4860

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/client/datascience/historycommandlistener.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ export class HistoryCommandListener implements IDataScienceCommandListener {
138138
await this.fileSystem.writeFile(uri.fsPath, JSON.stringify(notebook));
139139
}
140140
}, localize.DataScience.exportingFormat(), file);
141+
142+
// When all done, show a notice that it completed.
143+
const openQuestion = localize.DataScience.exportOpenQuestion();
144+
this.applicationShell.showInformationMessage(localize.DataScience.exportDialogComplete().format(uri.fsPath), openQuestion).then((str: string | undefined) => {
145+
if (str === openQuestion) {
146+
// If the user wants to, open the notebook they just generated.
147+
this.jupyterExecution.spawnNotebook(uri.fsPath).ignoreErrors();
148+
}
149+
});
150+
141151
}
142152
}
143153
}

0 commit comments

Comments
 (0)