File tree 2 files changed +5
-8
lines changed 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -165,8 +165,7 @@ export class NativeRepl implements Disposable {
165
165
166
166
const notebookEditor = await openInteractiveREPL (
167
167
this . replController ,
168
- this . notebookDocument ,
169
- wsMementoUri ,
168
+ this . notebookDocument ?? wsMementoUri ,
170
169
preserveFocus ,
171
170
) ;
172
171
if ( notebookEditor ) {
Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ import { PVSC_EXTENSION_ID } from '../common/constants';
20
20
*/
21
21
export async function openInteractiveREPL (
22
22
notebookController : NotebookController ,
23
- notebookDocument : NotebookDocument | undefined ,
24
- mementoValue : Uri | undefined ,
23
+ notebookDocument : NotebookDocument | Uri | undefined ,
25
24
preserveFocus : boolean = true ,
26
25
) : Promise < NotebookEditor | undefined > {
27
26
let viewColumn = ViewColumn . Beside ;
28
- if ( mementoValue ) {
29
- if ( ! notebookDocument ) {
30
- notebookDocument = await workspace . openNotebookDocument ( mementoValue as Uri ) ;
31
- }
27
+ if ( notebookDocument instanceof Uri ) {
28
+ // Case where NotebookDocument is undefined, but workspace mementoURI exists.
29
+ notebookDocument = await workspace . openNotebookDocument ( notebookDocument ) ;
32
30
} else if ( notebookDocument ) {
33
31
// Case where NotebookDocument (REPL document already exists in the tab)
34
32
const existingReplViewColumn = getExistingReplViewColumn ( notebookDocument ) ;
You can’t perform that action at this time.
0 commit comments