feat: idbg interactive debug expression evaluator#12648
Merged
Kha merged 8 commits intoleanprover:masterfrom Feb 23, 2026
Merged
feat: idbg interactive debug expression evaluator#12648Kha merged 8 commits intoleanprover:masterfrom
idbg interactive debug expression evaluator#12648Kha merged 8 commits intoleanprover:masterfrom
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the experimental
idbg e, a new do-element (and term) syntax for live debugging between the language server and a running compiled Lean program.When placed in a
doblock,idbgcaptures all local variables in scope and expressione, then:connect; the editor will mark this part of the program as "in progress" during this wait but that
will not block
lake buildof the project.idbgcall site, connects to the server,receives the expression, compiles and evaluates it using the program's actual runtime values, and
sends the
reprresult back.The result is displayed as an info diagnostic on the
idbgkeyword. The expressionecan beedited while the program is running - each edit triggers re-elaboration of
e, a new TCP exchange,and an updated result. This makes
idbga live REPL for inspecting and experimenting withprogram state at a specific point in execution. Only when
idbgis inserted, moved, or removed doesthe program need to be recompiled and restarted.
Known Limitations
otherwise.
idbgat once untested, likely too much overhead from overlapping imports withoutfurther changes.
LEAN_PATHmust be properly set up so compiled program can import its origin module.