-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Eval plugin: mark exceptions #2775
Conversation
Hi @jneira, there seems to be no code owner of the eval plugin - do you know who might be familiar with the code? 🙂 |
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.
Looks good to me.
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.
This no "Exception" message is intended AFAIK: https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-eval-plugin#multiline-output
I think we cannot change this at least before we have somewhat "proper" handling of IO.
C.C. @tittoassini |
Thanks, @Ailrun, I was not aware of this hack. I do find the missing message a bit confusing, but if someone is using |
I was not aware of this hack either! We should strive to make this hack unnecessary, some options come to mind:
What do you think @Ailrun ? |
@pepeiborra I think the second would be more feasible. If we can handle IO better, that would be better, but that may take quite effort |
Hi @pepeiborra, I am not entirely sure what you mean by the second option? I imagine this could be hacked around by recognizing some prefix like If supporting this hack should involve more effort, I would rather attempt to fix the #1977 instead 🙂 |
Sorry I wasn't clear: The only way to properly fix #1977 is by using the external interpreter, which is far from obvious. |
Yes, I understood that the first option is fixing #1977 with an external interpreter though I have no idea how to do that (yet). What I can not imagine is how to "wrap all the user code" which you suggested as the second option. 🤔 |
Yes, I can see now that the 2nd option is not trivial either. |
Another solution that comes to mind would be to make this configurable by the user. Currently, the eval plugin has the So I suggest adding an
What do you think, @pepeiborra, @Ailrun? It seems relatively low effort and once we get better IO support, we could just turn it on by default or keep it off. 🙂 |
OK, the behaviour is now configurable via Does this resolve your concerns @Ailrun? Btw. thanks for the scaffolding around |
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 :) Here is one minor comment for documentation.
plugins/hls-eval-plugin/README.md
Outdated
@@ -274,6 +279,8 @@ To display it properly, we can exploit the fact that the output of an error is d | |||
] | |||
``` | |||
|
|||
This assumes you did not turn on exception marking (see #) |
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.
It looks like a link is missing?
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.
Thanks, I was about to look up how to link sections and got distracted. 😅
Fixed ✔️
bde1c3e
to
f92eb82
Compare
At the last minute, I remembered to check the docs for configuration options and added the eval section. 😅 I wonder if it needs to be added to vscode-haskell too? |
Eval plugin gains new configuration options in haskell/haskell-language-server#2622 (diff) and haskell/haskell-language-server#2775 (exception).
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.
Docs look fine to me. The way the config options are documented is suboptimal, but this doesn't make it worse!
I don't know what the deal is with exposing options in vscode-haskell
...
This change will* format exception results in the same way as doctest:
*) EDIT: if the configuration option
haskell.plugin.eval.config.exception
is set totrue
.