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

refactor plugin: fix regex for extracting import suggestions #4080

Conversation

jhrcek
Copy link
Collaborator

@jhrcek jhrcek commented Feb 16, 2024

Fixes #4079

The problem was that the original regex was mistakenly using . as a regex metacharacter, whereas the GHC error contains a literal .

In cases where GHC error contains further )'s this led to 3rd match group (which is used to extract srcspan) to contain too much stuff, leading to errors described in the issue.

If the tests pass, would you still recommend adding a test case for this or is it ok like this?

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

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

LGTM

Preferably, we have a regression test proving this can't happen again.

@jhrcek
Copy link
Collaborator Author

jhrcek commented Feb 16, 2024

Ok, I'll come up with a test for this over the weekend.

@jhrcek jhrcek force-pushed the jhrcek/refactor-plugin-fix-regex-extracting-import-suggestions branch from 1098b0d to 2cbeef1 Compare February 16, 2024 17:09
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.

Refactor plugin shows "bug in srcspan parser" when trying to construct code action
2 participants