Open michaelpj opened 1 year ago
I almost never insert the signature for instance methods really, agree to replace it with inlay hints.
cc @jinser
If the argument in this ticket is correct, then maybe we should be looking at the code that currently does the type signature code lenses and figuring out how to extend it to local bindings. Then we can switch that uniformly over to use inlay hints! Note that there was some progress on that here: https://github.com/haskell/haskell-language-server/pull/2966
Prompted by an issue with
lsp-mode
where they started showing code lenses at the end of the line instead of above the line by default (https://github.com/emacs-lsp/lsp-mode/issues/3749). I made an issue in the spec repo (https://github.com/microsoft/language-server-protocol/issues/1558) to ask whether clients can make any assumptions about where code lenses are displayed.The answer seems to be no, we should not make assumptions about where code lenses are displayed. That means that the way we're using them to display type signatures is fundamentally unreliable. Fortunately, there is a feature that does allow specific placement of something in the buffer: inlay hints.
So I think the "right thing" here is to convert the code lenses that display type signatures into inlay hints.