ocaml-lsp
ocaml-lsp copied to clipboard
VSCode CodeLens not displayed as of ocaml-lsp-server 1.16
Until ocaml-lsp-server
1.16, the OCaml Platform extension for VSCode correctly showed types above functions (with VSCode's "CodeLens"). As of 1.16, CodeLens type hints are no longer displayed. Types on hover continue to work.
ocaml-lsp-server.1.15.1-5.0
:
ocaml-lsp-server.1.16.2
and 1.16.2
:
A minimal example is to create one switch for each of the two versions:
opam switch create 5.0.0+lsp.1.15 5.0.0
opam switch 5.0.0+lsp.1.15
opam install "ocaml-lsp-server<1.16"
and
opam switch create 5.0.0+lsp.1.16 5.0.0
opam switch 5.0.0+lsp.1.16
opam install "ocaml-lsp-server>=1.16"
A simple project with a dune
, dune-project
, and single ml
source file shows the problem.
OCaml version: 5.0.0 as per the switch create
commands above.
System: Linux Mint, like Ubuntu
VScode version: VSCodium 1.80.0
See 60fcf3f82107c1b53b79403c011a4b59c6f8c1c5.
We're moving towards inlay hints to provide the code lens features.
The linked commit does not provide any context. The relevant discussion is rather in #1134. I don't have much to add to that discussion, but I would agree with Khady that dropping this feature by default before inlay hints are available effectively leaves users with a broken development experience.
The relevant fix for the VSCode extension is https://github.com/ocamllabs/vscode-ocaml-platform/pull/1157. Until that is available in a release, is there any way of re-enabling CodeLens without compiling from source? For now, my solution is to install "ocaml-lsp-server<1.16"
, but that's obviously not a proper solution.