microsoft / microsoft/vscode-python-debugger

Feature Request: Conditional Breakpoints

Offen
#883 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

triage-needed
Vorherrschende Sprache
TypeScript
Sterne
180
Forks
126
Ø Merge
2 T. 3 Std.
Gemergte PRs (30 T.)
3

Beschreibung

Motivation

For efficient debugging, I very often need to have a break-point trigger only under certain circumstances.

Consider the following setup

Image

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:

Image

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:

Image

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

In der Issue werden keine Dateien, Tests oder Einstiegspunkte genannt. Beginne damit, nachzuverfolgen, wie Breakpoint-Zustand und -Auswertung im Python-Debugger behandelt werden; done sollte die aufgeführten UI- und Verhaltensfälle für leere, ungültige, true- und false-Bedingungen abdecken.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, typescript, vscode
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.