The specification should maybe say where code lenses are shown in the client
#1,558 创建于 2022年10月3日
描述
At the moment, the specification says nothing about how code lenses are displayed. In all the existing implementations that I know of, code lenses are displayed inline in the code using the title of the command to provide the text. But there is not agreement about where they are displayed! For example, VSCode shows them above the target line, and recent lsp-mode shows them at the end of the target line.
This is quite important: since code lenses appear in the code, how they are interpreted by the user depends on where they appear! For example, the Haskell language server provides code lenses that show the type signature for functions that do not have one, inserting them on click. This works perfectly when the code lenses appear above the line, but look very weird if they appear at the end.
So it would be good if the specification could provide some guidance for server implementors. Even if the guidance is "you should not make any assumptions about where or whether code lenses are displayed" that would be very useful: then we would know that what we are doing in HLS is making wrong assumptions and we should stop! Basically I would like to know whether it's HLS or the lsp-mode maintainers who are doing something wrong :)