How to enable codeLens into neovim?

I’m new into ocaml world and I saw a video from TJ DeVries about ocaml and own his neovim the code lens above each expression works. I tried many configs about but nothing working…Can anybody help me? :smiley:

ex:
image

my neovim config:

  • neovim 0.11

    vim.lsp.config(‘ocamllsp’, {
    cmd = { ‘ocamllsp’ },
    filetypes = { ‘ocaml’, ‘menhir’, ‘ocamlinterface’, ‘ocamlocamllex’, ‘reason’, ‘dune’ },
    settings = {
    ocamllsp = {
    codelens = { enable = true },
    inlayHints = { enable = true },
    syntaxDocumentation = { enable = true },
    },
    },
    })

1 Like

worked for me with

vim.lsp.config('ocamllsp', {
  settings = { codelens = { enable = true } },
})

and then doing

:lua vim.lsp.codelens.refresh()
2 Likes

Also try inlayHints:

settings = {
  inlayHints = {
    hintPatternVariables = true,
    hintLetBindings = true,
    hintFunctionParams = true,
  }
}
2 Likes