Skip to content

Add compilation regexp to match ‘dbg!’ output #569

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

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

hron
Copy link
Contributor

@hron hron commented Jun 8, 2025

While debugging tests it’s annoying when ‘compilation-mode’ matches ‘dbg!’ output incorrectly. Currently, rust-mode’s regexps assign it as an error and incorrectly include ‘[’. The proposed change adds a regexp to match such things and assign them info level.

image

Copy link
Member

@psibi psibi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Is it possible to add tests for it as regex code in general makes me nervous ? There are some tests for the regexp currently that you might be able to adapt for this:

(ert-deftest compilation-regexp-dashes ()

While debugging tests it’s annoying when ‘compilation-mode’ matches
‘dbg!’ output incorrectly. Currently, rust-mode’s regexps assign it as
an error and incorrectly include ‘[’. The proposed change adds a
regexp to match such things and assign them info level.
@hron hron force-pushed the rust-compilation-dbg! branch from bf1b2d4 to 684f679 Compare June 9, 2025 12:43
@hron
Copy link
Contributor Author

hron commented Jun 9, 2025

@psibi sure thing! I have added the test for the regexps and did a bit of renaming to match the current variable names. Let me know if you spot anything else. Thanks!

@psibi psibi merged commit 0d5d54a into rust-lang:master Jun 9, 2025
16 checks passed
@psibi
Copy link
Member

psibi commented Jun 9, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants