Hide "Run Python File" button on .pyi stub files (#26026) · love-be/vscode-python@30e230b · GitHub
Skip to content

Commit 30e230b

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

File tree

‎package.json‎

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)