Nvim highlight group for LSP inferred type

When I write source code of:

let f x y = x + y

my buffer displays:

let f x y = x + y  int -> int -> int

where the int -> int -> int is not part of the source, but an inferred type LSP injects.

This information is great; but it’s in the color white, which makes it hard to separate from source; I’d prefer to make this be in light blue.

Question: what nvim highlight group is this “lsp injected inferred type” in ?

The exact answer may depends on your set-up. But assuming you are using the support in the native lsp client (and not CoC or something like that) then you are looking for LspCodeLens (see Lsp - Neovim docs)

Screenshot 2023-03-24 at 21.47.23

1 Like
  1. This fixed it. Thanks!

  2. This is weird: before setting the higlight, “:hilight Lsp” … shows others (like InfoTip as completion), but not CodeLens as completion

  3. However, setting LspCodeLens fixed it.

Thanks again!