Skip to content

Hide "Run Python File" button on .pyi stub files#26026

Merged
eleanorjboyd merged 3 commits into
mainfrom
copilot/make-run-python-button-configurable
Jul 24, 2026
Merged

Hide "Run Python File" button on .pyi stub files#26026
eleanorjboyd merged 3 commits into
mainfrom
copilot/make-run-python-button-configurable

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown

The editor-title "Run Python File" buttons appear on .pyi stub files, which cannot meaningfully be executed, because .pyi and .py share resourceLangId == python.

Change

  • In package.json, tighten the when clauses of both editor/title/run contributions (python.execInTerminal-icon, python.execInDedicatedTerminal) to exclude .pyi:
"when": "resourceLangId == python && resourceExtname != .pyi && !isInDiffEditor && !virtualWorkspace && shellExecutionSupported"

Notes

  • Applied as a sensible default rather than a new setting: stub files are type-hint-only and not runnable, so no user-facing configuration is warranted.
  • Scoped strictly to the two editor-title run buttons; other Python command contributions (command palette, explorer context, REPL, etc.) are unchanged.

Copilot AI changed the title [WIP] Add option to configure visibility of 'Run Python File' button for .pyi files Hide "Run Python File" button on .pyi stub files Jul 2, 2026
Copilot AI requested a review from eleanorjboyd July 2, 2026 21:59
@eleanorjboyd
eleanorjboyd marked this pull request as ready for review July 2, 2026 22:05
@eleanorjboyd eleanorjboyd added the bug Issue identified by VS Code Team member as probable bug label Jul 2, 2026
@eleanorjboyd eleanorjboyd added skip-issue-check skip package*.json package.json and package-lock.json don't both need updating labels Jul 24, 2026
@eleanorjboyd
eleanorjboyd merged commit 30e230b into main Jul 24, 2026
131 of 132 checks passed
@eleanorjboyd
eleanorjboyd deleted the copilot/make-run-python-button-configurable branch July 24, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug skip package*.json package.json and package-lock.json don't both need updating skip-issue-check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to configure visibility of the "Run Python File" button for .pyi files only

4 participants