{{ message }}
Repository navigation
Commit 30e230b
Hide "Run Python File" button on .pyi stub files (microsoft#26026)
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`:
```jsonc
"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.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Eleanor Boyd <26030610+eleanorjboyd@users.noreply.github.com>1 parent 9189164 commit 30e230b
1 file changed
Lines changed: 2 additions & 2 deletions

0 commit comments