I just noticed that vscode started adding greyed-out type hints for function parameters, e.g. fun c: char -> ... (where the : char part is not something I typed). Does anyone know how to get rid of this? When I look it up I find instructions to turn off “codelens” but I already did so (and it was doing something different, type annotations above function definitions).
These are called “inlay hints” I am told by a VS Code-using colleague. You should be able to disable them in your preferences.
Cheers,
Nicolas
These were introduced in Preliminary inlay hint support by jfeser · Pull Request #1159 · ocaml/ocaml-lsp · GitHub, by the way.
Cheers,
Nicolas
Thank you, that did it.
I like vscode and the ocaml extension but it’s annoying to have to turn off the latest gimmick (and first find out what it’s called) every few months…
Thank you, that did it.
Can you tell what “did it”?
I cannot find anything related to “inlay hints” (or related keywords) in vscode settings. I added all of the following lines to settings.json but type hints still appear:
"ocaml.inlayHints.enable": false,
"editor.inlayHints.enabled": "off",
"ocaml.lsp.typeHints.enable": false,
"ocaml.trace.server": "off",
"editor.semanticHighlighting.enabled": false
}
For me it appears in the settings GUI. The json line is "editor.inlayHints.enabled": "off".
To set this only for .ml files you need to put it in a "[ocaml]": { ... } block. I also have "editor.codeLens": false in there, to disable some earlier form of intrusive type annotations (I do not know if it still does something).