-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 virtual text to show evaluation results #258
Comments
Hey 😊👋 Thanks for the request. I like the idea though. Maybe it could be added to haskell-language-server, in the form of a code action that produces diagnostics or inlay hints or something similar that can be displayed as virtual text. I'm not sure, but I think what you're seeing in Scala are inlay hints, not actual code snippet evaluations? |
I see, maybe I'll create a feature suggestion in their repo :)
That's also a valid concern that I haven't thought of. In
These are "worksheets", I'm not sure if there is an equivalent of it in Haskell. Also thank you for the |
It definitely sounds like a good idea 😄
Haskell doesn't have a recursion limit (it doesn't have a traditional call stack. So the evaluation would probably have to be an async action with a timeout.
I could imagine this being very practical for pure evaluations (not in
No problem. I'm happy to share 😄 |
Just read through the Scala documentation on worksheets So if I understand correctly, this is available in files with a special extension, but not regular scala files. Hmm, that could be an interesting feature... Let's leave this issue open and I'll think about whether it makes sense to contribute it to haskell-language-server. But please feel free to open an issue there. Maybe someone will be faster to implement it than me 😊 |
Feature description
Hello,
I noticed that with Scala's
metals
, the results of an evaluation show up as virtual text; on the other hand,haskell-tools
puts them in comments.Is it possible to have the option to use virtual text instead of comments for evaluation results? I simply think it's neater to not have the file changed when one's simply "probing variables and functions"
A possible problem I can foresee is that longer messages won't fit. A solution could be to place a code action over the evaluated line, which when triggered, shows the complete result.
Here's an image how it looks like for Scala. Note that I can't actually change the text on the right after
//
because it's virtual text.Thanks, have a nice day :)
The text was updated successfully, but these errors were encountered: