Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing errorIDs #3299

Merged
merged 265 commits into from
Feb 6, 2023
Merged

Implementing errorIDs #3299

merged 265 commits into from
Feb 6, 2023

Conversation

davidcok
Copy link
Collaborator

Fixes #3182

Implementing an error ID in order to enable showing the user more detailed error explanations and quick fixes.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

davidcok added 30 commits July 20, 2022 15:42
Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor requests, overall, looks good to merge next time ! This is the start of the next great IDE feature for Dafny I believe.

@@ -242,7 +236,7 @@ public class ConsoleErrorReporter : BatchErrorReporter {
errorLine += $" {msg} {TokenToString(tok)}";
}

if (DafnyOptions.O.CompileVerbose) {
if (DafnyOptions.O.CompileVerbose && false) { // Need to control tests better before we enable this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to keep this in production? looks like a leftover 🍕

Copy link
Collaborator Author

@davidcok davidcok Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to put out error detail when --verbose was true. But many tests have --verbose (equivalently /compileVerbose) true. But you are correct that I forgot about this. But I'd like to deal with it in a subsequent PR, as it may require lots of test changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took out the block for now.

Test/git-issues/git-issue-3187a.dfy.expect Show resolved Hide resolved
@@ -118,7 +118,7 @@ do
## For header lines, extract the error message from
## the header text (everything but the initial ##[ ]* )
( echo "$line" | grep -E -e '[#][#] ' > /dev/null ) \
&& msg=`echo "$line" | sed -E -e 's/^##[ ]*[*]*//' -e 's/[*]*$//' -e 's/\\*/\\\\*/' -e 's/_[a-z]+_/.*/g'`
&& msg=`echo "$line" | sed -E -e 's/ {#.*}//' | sed -E -e 's/^##[ ]*[*]*//' -e 's/[*]*$//' -e 's/\\*/\\\\*/' -e 's/_[a-z]+_/.*/g'`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain me what this change does? At least I would love if there was a change in the comment that reflects what the change on this obscure regex is ^^

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment in the script. It converts the error message in the header into a regex to match against the eror message produced by running dafny against the example, to be sure the example does what I say.

@davidcok davidcok enabled auto-merge (squash) February 3, 2023 21:31
Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final approval, great job, let's have it !

@davidcok davidcok merged commit d949078 into dafny-lang:master Feb 6, 2023
@davidcok davidcok deleted the cok-3182-error-id branch February 6, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-deep-tests Tells CI to run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider associating unique IDs with errors
5 participants