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