Skip to content

Hide Run Python option when in Jupyter Notebook - #23732

Merged
Anthony Kim (anthonykim1) merged 2 commits into
microsoft:mainfrom
anthonykim1:disableRunPythonInJupyter
Jul 9, 2024
Merged

Hide Run Python option when in Jupyter Notebook#23732
Anthony Kim (anthonykim1) merged 2 commits into
microsoft:mainfrom
anthonykim1:disableRunPythonInJupyter

Conversation

@anthonykim1

@anthonykim1 Anthony Kim (anthonykim1) commented Jul 2, 2024

Copy link
Copy Markdown

Resolves: #22739

@anthonykim1 Anthony Kim (anthonykim1) added debt Code quality issues area-repl skip package*.json package.json and package-lock.json don't both need updating labels Jul 2, 2024
@anthonykim1
Anthony Kim (anthonykim1) marked this pull request as ready for review July 2, 2024 22:51
@vscodenpa VS Code Bot (vscodenpa) added this to the July 2024 milestone Jul 2, 2024
Comment thread package.json Outdated
"submenu": "python.run",
"group": "Python",
"when": "editorLangId == python && !virtualWorkspace && shellExecutionSupported && isWorkspaceTrusted"
"when": "editorLangId == python && !virtualWorkspace && shellExecutionSupported && isWorkspaceTrusted && !jupyter.ownsSelection && !notebookEditorFocused "

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an additional whitespace at the end. Also I wonder if !notebookEditorFocused is sufficient as we just want to filter out all notebooks.

If we only want to filter out Jupyter notebook, but not necessarily other custom notebook (including repl), then the check is notebookType != jupyter-notebook

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for input! Just made changes to 4ac4ab3 adding notebookType != jupyter-notebook to only exclude notebook and include REPL

@anthonykim1
Anthony Kim (anthonykim1) merged commit 7e434a7 into microsoft:main Jul 9, 2024
Eleanor Boyd (eleanorjboyd) pushed a commit to eleanorjboyd/vscode-python that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-repl debt Code quality issues skip package*.json package.json and package-lock.json don't both need updating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run Python command is available in Jupyter Notebook Cell

5 participants