You are not logged in.

#1 2025-08-19 08:39:28

drslmr
Member
Registered: 2011-05-14
Posts: 63

How to use the hls-eval-plugin?

I try to use the eval plugin with vim, coc, haskell-language-server.

I saw the demo "Evaluation code snippets in comments" here https://haskell-language-server.readthe … tures.html

If I use

-- >>> 2 + 2

I do get some suggestions for completion, so something works?

But how do I tell the eval plugin to evaluate this?
Is there a key to press or to click somewhere?

Offline

#2 2025-08-20 14:53:59

drslmr
Member
Registered: 2011-05-14
Posts: 63

Re: How to use the hls-eval-plugin?

I got my question answered, In vim I  have to do

<leader>cl

Where <leader> is a charecter by default:  '\'

It still does not work.  But this is certainly due to some bad or missing configuration.

Using output channel and tracing verbose I see something about highlight but not codelens:

Trace - 4:51:43 PM] Sending request 'textDocument/documentHighlight - (26)'.
    Params: {
        "textDocument": {
            "uri": "file:///  ... myfile.hs"
        },
        "position": {
            "line": 363,
            "character": 11
        }
    }
    [Trace - 4:51:43 PM] Received response 'textDocument/documentHighlight - (26  )' in 1ms.
    Result: []

Offline

#3 2025-08-21 16:44:59

drslmr
Member
Registered: 2011-05-14
Posts: 63

Re: How to use the hls-eval-plugin?

I think I have it now!

I had to add codeLense.enable int the coc-settings:
~/.vim/coc-settings.json file:

{
  "codeLens.enable":true,
  "codeLens.display": true,
  "languageserver": {  .....

And this is documented in ~/.vim/plugged/coc.nvim/doc/coc-config.txt.

Offline

Board footer

Powered by FluxBB