haskell / haskell/haskell-language-server

MetaLS-like virtual text evaluation instead of comments

Open
#4,246 1 comment 4 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

## 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 MetaLS[^1] 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 :)

[^1]: [Meta Language Server](https://github.com/scalameta/nvim-metals)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.