Skip to content

MetaLS-like virtual text evaluation instead of comments #4246

Open
@leana8959

Description

@leana8959

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.

image

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

  1. Meta Language Server

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions