-
-
Notifications
You must be signed in to change notification settings - Fork 389
User-friendly error message when modules aren't listed #3711
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
Conversation
This looks like the perfect first step! It would be great if we can include the cabal file in question in the error message. For cabal cradles, Further, I, personally, think we should show this error message only for cabal cradles (and perhaps stack cradles), so the error message still needs to be guarded. Look at the call site of As a word of warning, our tests are unfortunately rather flaky. Sometimes a test just fails. In that case, don't panic, we rerun the testsuite. |
The dependencies were empty in my test case, I'm afraid. This is all the information in the CradleError: Should we show them the component(s) from the prefixes instead?
|
It looks like parsing any information from the prefixes is going to be too complicated to be worth it. Here are all the possibilities from hie-bios:
We can show them the output of each prefix directly, something like:
Which, while it isn't the most user-friendly, at least surfaces all the relevant information. |
Oof, that is unintended behaviour that we have never realised before! We have to fix that in hie-bios! You can do that if you'd like! The code that eventually produces the error message is this: https://github.com/haskell/hie-bios/blob/master/src/HIE/Bios/Cradle.hs#L107 It is a bit tricky to follow, but essentially, we take a After L107, override the |
I'd be happy to take a look at it, if you can help me figure out how to test hie-bios locally. I got it compiling. Is there a way to run hie-bios on my error test project and get it to generate this error? My naive attempts didn't work. Even better, I would like to get haskell-language-server to compile against a local hie-bios, but when I tried this on the latest master for both, they didn't compile. Any guidance? I can post the error here if that would help |
Install the
It is possible, that we changed something, and now it doesn't compile any more... I haven't looked into it yet, I am afraid. Perhaps you want to |
6847b16
to
b9cd6e8
Compare
I pushed changes to limit to |
I think I'm in over my head. Here's the issue I'm running in to:
I found this related comment in flake.nix. I have VERY limited exposure to nix, but I think I'm getting the error for the same reason mentioned in the comment:
|
…es or exposed-modules + only show if isCabaltype + show prefixes
b9cd6e8
to
b759787
Compare
Yeah, that was something we changed. So, essentially, clone implicit-hie pass in However, checking out an older hie-bios (the latest released tag) is likely quicker. |
@fendor I think I'm not going to have time to address the hie-bios changes ATM. Would you consider this PR without them? What else should change? Final error output is:
|
@seanhess Yes, we will take the PR as is. Our HSoC student @VeryMilkyJoe can take it over to push it over the finish line, maybe try to fix the hie-bios issue in the process as well. Regarding the error message, I would ask you to write down what kind of information you would have needed to understand/be able to resolve the issue you encountered in #3693? Is the given information enough? |
Great!
Yes for me personally, the PR is at the point that satisfies everything I
needed from it and would have prevented me from getting lost and needing to
ask for help.
Also I’m happy to “finish” the PR if we are sticking to the
haskell-language-server repository. I just don’t have time to dig in to
hie-bios.
…On Thu, Jul 13, 2023 at 1:55 AM fendor ***@***.***> wrote:
@seanhess <https://github.com/seanhess> Yes, we will take the PR as is.
Our HSoC student @VeryMilkyJoe <https://github.com/VeryMilkyJoe> can take
it over to push it over the finish line, maybe try to fix the hie-bios
issue in the process as well.
Regarding the error message, I would ask you to write down what kind of
information you would have needed to understand/be able to resolve the
issue you encountered in #3693
<#3693>? Is the
given information enough?
—
Reply to this email directly, view it on GitHub
<#3711 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAD66LDILQNMYKV7656FW3XP6SYTANCNFSM6AAAAAA2GR5INE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hey @fendor, anything short of cracking open hie-bios I can do to help get this merged? |
I have it on my to-do list for the next weeks to improve the hie-bios error messages, and also get this merged. From my perspective, you don't need to do anything, it is a matter of plugging everything together, which requires some work and coordination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! First step to help new users. Many more improvements are yet to follow.
Addresses #3695. When a user forgets to add their module to other-modules or exposed-modules, they would get a confusing "Multi Cradle: no prefixes matched" error.
This PR replaces the old error message with the following:
This is my first PR for HLS, please let me know which conventions I've missed.