You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement request related to a problem? Please describe.
I find the choice of having evaluation (-- >>>) result as comments suboptimal, since I would like the result to be only shown to the reader of the code and not be a textual part of the document. This is not a blocker, but it can be better.
Describe the solution you'd like
Scala's MetaLS1 supports a special file type: "worksheets". For this kind of files, every expression is evaluated on-the-fly and the value of that line is shown as virtual text on the side.
It is worth considering evaluating each (pure) expression and have their value on the right-hand side. It can be an interesting feature, documenting examples for beginners. However, the focus of my suggestion remains on using virtual text over comments.
I think the best way to do this would be via proper notebook support. It looks like there may be something like this in the next 3.18 version of the LSP spec. So ideally we would just hook into the notebook support. That would be a big task, though.
However, I guess we possibly could provide an explicitly triggered version of this using inlay hints? Something like:
x :: Int
x = 1 + 2 // eval: <hint>3</hint>
Might be kind of expensive to keep computing, not sure.
Is your enhancement request related to a problem? Please describe.
I find the choice of having evaluation (
-- >>>
) result as comments suboptimal, since I would like the result to be only shown to the reader of the code and not be a textual part of the document. This is not a blocker, but it can be better.Describe the solution you'd like
Scala's MetaLS1 supports a special file type: "worksheets". For this kind of files, every expression is evaluated on-the-fly and the value of that line is shown as virtual text on the side.
It is worth considering evaluating each (pure) expression and have their value on the right-hand side. It can be an interesting feature, documenting examples for beginners. However, the focus of my suggestion remains on using virtual text over comments.
I have previously opened an issue here mrcjkb/haskell-tools.nvim#258
Describe alternatives you've considered
ghci
, but it's nowhere as immersive and intuitive as having inline evaluation on the fly.Additional context
Maybe long lines will be truncated (at least, I do not know how to avoid it). I might do some research on this when I have free time.
Thank you for the project and for reading my suggestion :)
Footnotes
Meta Language Server ↩
The text was updated successfully, but these errors were encountered: