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

Use -fno-show-error-context #4281

Open
michaelpj opened this issue Jun 6, 2024 · 3 comments · May be fixed by #4295
Open

Use -fno-show-error-context #4281

michaelpj opened this issue Jun 6, 2024 · 3 comments · May be fixed by #4295
Labels
Hackathon This issue is suitable for hackathon sessions level: easy The issue is suited for beginners type: enhancement New feature or request

Comments

@michaelpj
Copy link
Collaborator

Since 9.8 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8563) GHC has had the -fno-show-error-context flag, which makes GHC omit a bunch of contextual information that isn't really useful if you are directly showing the user the location of the error. That's exactly the situation we are in, we should use it!

@michaelpj michaelpj added type: enhancement New feature or request status: needs triage Hackathon This issue is suitable for hackathon sessions level: easy The issue is suited for beginners and removed status: needs triage labels Jun 6, 2024
@michaelpj
Copy link
Collaborator Author

I guess once we move to the full structured diagnostic infrastructure we'll be able to use the more sophisticated printing options, but for now just using the user-facing flag will help.

@dsaenztagarro dsaenztagarro linked a pull request Jun 8, 2024 that will close this issue
@dsaenztagarro
Copy link

@michaelpj I finally created a PR that uses correctly -fno-show-error-context, as per screenshots in the PR description.

That said, after introducing the change, I realised that some specs are broken, and I have verified in Visual Studio Code that the Code Action replace _ with xxxx changes slightly the behaviour when using the new option.

See Code Actions popover in the example below Screenshot 2024-06-08 at 22 55 32

For comparison, before the change:

Screenshot 2024-06-08 at 22 55 19 Screenshot 2024-06-08 at 22 55 44

After the change:

Screenshot 2024-06-08 at 22 58 18

So in the particular example above, when selecting replace _ with const, after the change the `` wrapping the hole are lost.

Any advice?

@michaelpj
Copy link
Collaborator Author

That's extremely weird. I guess we need to look a the code that is coming up with that information and check what it is doing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hackathon This issue is suitable for hackathon sessions level: easy The issue is suited for beginners type: enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants