microsoft / microsoft/vscode-python-debugger
Feature Request: Conditional Breakpoints
還沒有人認領這個 Issue。
- 主要語言
- TypeScript
- 星號
- 180
- 分支
- 126
- 平均合併
- 2 天 3 小時
- 30 天內合併 PR
- 3
描述
Motivation
For efficient debugging, I very often need to have a break-point trigger only under certain circumstances.
Consider the following setup
here I may for example only wish for the break point to trigger if
"advanced" in case.tags
holds.
Current workaround
Currently, I can achieve this, but only by rewriting the code as a workaround:
Proposal
The workaround is clearly clumsy, esp. as it means injecting code into ones codebase, which is en par with adding print statements everywhere.
What would be much more ideal would be one could simply add dynamic trigger-conditions to the break points.[^trigger]
For example in the UI would could add a right-click menu to the individual break points > add conditions > user entry of boolean expression:
Here one could consider the cases
| checkbox | trigger condition | behaviour |
|---|---|---|
| ☐ | * | never triggers |
| ✅ | (empty) | always triggers |
| ✅ | cannot be evaluated | never triggers |
| ✅ | can be evaluated and evaluates to true |
triggers in the given instance |
| ✅ | can be evaluated and evaluates to false |
does not trigger in the given instance |
[^trigger]: currently they can only statically be toggled.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
issue 中沒有指定檔案、測試或進入點。首先追蹤 Python 偵錯器如何處理中斷點狀態和評估;done 應涵蓋針對空白、無效、true 和 false 條件所列出的 UI 和行為案例。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python, typescript, vscode
- 領域
- devtools
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100