ocaml / ocaml-lsp

OCaml Language Server Protocol implementation
Other
749 stars 117 forks source link

Option to control inlay hints separately from codelens #1341

Closed rusty-key closed 1 month ago

rusty-key commented 1 month ago

Hi!

I see that inlay hints were enabled in the recent release. They are great but might be annoying in some projects, so would be nice to have an option to disable them. But it looks like you can only disable codelens altogether with ocaml.server.codelens = false and can't control inlay hints separately.

Am I missing something or it is impossible indeed? Is it worth adding?

rgrinberg commented 1 month ago

Don't we respect inlay hint capabilities?

  1. If we do, then your client should pass them correctly.
  2. If we don't, then please send a PR to add support.
rusty-key commented 1 month ago

My bad, I was looking at how it is implemented in other extensions instead of trying to use editor options.

    "[ocaml]": {
        "editor.inlayHints.enabled": "off"
    }

This works perfectly fine ^