fix parameterized notebook output (#15233)

This commit is contained in:
Vasu Bhog
2021-04-27 12:40:49 -07:00
committed by GitHub
parent c150f79eb4
commit c66a8ca171

View File

@@ -363,11 +363,14 @@ export class RunParametersAction extends TooltipFromLabelAction {
**/
public async openParameterizedNotebook(uri: URI): Promise<void> {
const editor = this._notebookService.findNotebookEditor(uri);
let modelContents = JSON.stringify(editor.model.toJSON());
let modelContents = editor.model.toJSON();
modelContents.cells.forEach(cell => {
cell.outputs = [];
});
let untitledUriPath = this._notebookService.getUntitledUriPath(path.basename(uri.fsPath));
let untitledUri = uri.with({ authority: '', scheme: 'untitled', path: untitledUriPath });
this._notebookService.openNotebook(untitledUri, {
initialContent: modelContents,
initialContent: JSON.stringify(modelContents),
preserveFocus: true
});
}