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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1441 | 1441 | | |
1442 | 1442 | | |
1443 | 1443 | | |
1444 | | - | |
| 1444 | + | |
1445 | 1445 | | |
1446 | 1446 | | |
1447 | 1447 | | |
1448 | 1448 | | |
1449 | 1449 | | |
1450 | | - | |
| 1450 | + | |
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
| |||
0 commit comments