Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Run Python option when in Jupyter Notebook #23732

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@
{
"submenu": "python.run",
"group": "Python",
"when": "editorLangId == python && !virtualWorkspace && shellExecutionSupported && isWorkspaceTrusted"
"when": "editorLangId == python && !virtualWorkspace && shellExecutionSupported && isWorkspaceTrusted && !jupyter.ownsSelection && !notebookEditorFocused "
Copy link
Member

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
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

},
{
"submenu": "python.runFileInteractive",
Expand Down
Loading