vscode-clangd icon indicating copy to clipboard operation
vscode-clangd copied to clipboard

inlay hints gone

Open Trass3r opened this issue 3 years ago • 4 comments

It looks like https://github.com/llvm/llvm-project/commit/3137ca80b9ef99359a4adf77512925c2edc461b9 stopped inlay hints from working for me. editor.inlayHints.enabled is on of course. But there are no textDocument/inlayHint messages. If I comment out https://github.com/clangd/vscode-clangd/blob/dc6518fb0af230c73aa309ef9086e37a49c7e35f/src/inlay-hints.ts#L59 they come back, but based on the clangd/inlayHints protocol of course.

Can anyone confirm this behavior?

System information

Output of clangd --version: clangd version 15.0.0 Features: linux Platform: x86_64-unknown-linux-gnu Editor/LSP plugin: VSCode 1.67.2 / 0.1.17

Trass3r avatar May 24 '22 13:05 Trass3r

I also fail to see where those parts are implemented in https://github.com/llvm/llvm-project/commit/3137ca80b9ef99359a4adf77512925c2edc461b9:

- Don't advertise extension if client has support for standard
  implementation.
- Log a warning at startup about extension being deprecated, if client
  doesn't have support.

Edit: ok got removed later: https://reviews.llvm.org/D125228?id=428072#inline-1200897

Trass3r avatar May 24 '22 13:05 Trass3r

Can anyone confirm this behavior?

Yes, I see the same.

I think the issue may be that the code to send the textDocument/inlayHint requests only appeared in vscode-languageclient version 8.0.0-next.14, but vscode-clangd only requires version 7.1.0-next.1.

HighCommander4 avatar May 25 '22 05:05 HighCommander4

Unfortunately, needed to revert this and push 0.1.19 as it broke completion (e.g. #357).

Apparently the way we use commit characters + snippets is broken and we never noticed because commit characters were broken in languageclient :-(

sam-mccall avatar Jul 11 '22 21:07 sam-mccall

Looks like this is fixed in vscode-clangd 0.1.20.

The inlay hints may look a bit different by default now that it's vscode rendering them natively, but this can be customized (e.g. font size using editor.inlayHints.fontSize, colors using editorInlayHint.foreground/background in workbench.colorCustomizations).

HighCommander4 avatar Jul 15 '22 08:07 HighCommander4

True they did look better in the past iirc. Now they look confusingly similar to selected/highlighted text in the dark theme.

Edit: improved it a lot via

   "workbench.colorCustomizations": {
        "editorInlayHint.foreground": "#a2a2a2c0",
        "editorInlayHint.background": "#00000000",
    },

Trass3r avatar Oct 07 '22 08:10 Trass3r