Skip to content

Commit 5ae1861

Browse files
authored
Enable cell related commands when a Python file is already open (#11188)
1 parent 342eacc commit 5ae1861

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

news/2 Fixes/10884.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable cell related commands when a Python file is already open.

src/client/datascience/context/activeEditorContext.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export class ActiveEditorContextService implements IExtensionSingleActivationSer
6262
this,
6363
this.disposables
6464
);
65+
66+
// Do we already have python file opened.
67+
if (this.docManager.activeTextEditor?.document.languageId === PYTHON_LANGUAGE) {
68+
this.onDidChangeActiveTextEditor(this.docManager.activeTextEditor);
69+
}
6570
}
6671

6772
private onDidChangeActiveInteractiveWindow(e?: IInteractiveWindow) {

0 commit comments

Comments
 (0)