Improve the output of the debugger#4365
Draft
jkyang92 wants to merge 14 commits into
Draft
Conversation
…bugger, changed the input line indicates we are in the debugger from iine to <M2 Debugger>, and we added carets below the specific characters causing an error.
…function code'', adds carets for single line errors, and adds carets on first and last characters for multiple line outputs.
…Currently, this is not changeable by the user. We, also cleaned up the code.
…hich are available to the function code.
d-torrance
requested changes
May 24, 2026
| code Function := opt -> f -> codeFunction(null, f, 0) | ||
| code Command := opt -> C -> code C#0 | ||
| code List := opt -> L -> DIV between_(HR{}) dedupMethods apply(L, code) | ||
| code ZZ := opt -> i -> code previousMethodsFound#i |
Member
There was a problem hiding this comment.
Suggested change
| code ZZ := opt -> i -> code previousMethodsFound#i | |
| code ZZ := opt -> i -> code(previousMethodsFound#i, opt) |
code(TestInput) in testing.m2 also needs updated to use options
|
|
||
|
|
||
| protect PrintCaret | ||
| protect PrintLineNum |
Member
There was a problem hiding this comment.
I'm wondering if we should export these, too, so users can pass them to code? If so, then I'd considering using PrintCarets and PrintLineNumbers to match the corresponding debug-prefixed global variables.
We'd also need to update the code docs accordingly.
d-torrance
requested changes
May 24, 2026
| @@ -0,0 +1,29 @@ | |||
|
|
|||
Member
There was a problem hiding this comment.
Was adding this file just a git oopsie?
d-torrance
requested changes
May 24, 2026
| file = lines file; | ||
| if #file < stop then error("line number ",toString stop, " not found in file ", filename); | ||
| DIV splice { codeAddress(x), codeContent(start, stop, file) } | ||
| DIV splice { codeAddress(x), codeContent(PrintCaret => debugPrintCarets, PrintLineNum => debugPrintLineNumbers, x, start, stop, file) } |
Member
There was a problem hiding this comment.
It seems like we should use opt here. Maybe the default values should be null, and if so, use the global variables?
Either that or just drop options entirely and use the global variables inside codeContent?
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 is a draft pull request improving the output of the current line of code in the debugger.
This pull request contains work with @adamlaclair @BrysonKagy @OlaPeteru from the Building the Future of Macaualy2 workshop. Comments welcome, I will still read through this to make sure that nothing is missing and no obvious issues remain.
These commits do not include any AI generated code.
@adamlaclair @BrysonKagy, Can you respond verifying that that the code from your commits can be distributed under GPL2+? (or the public domain or other compatible license if that is not acceptable)