LSP icon indicating copy to clipboard operation
LSP copied to clipboard

Inlay Hints positions seems not accurate

Open NEX-S opened this issue 3 years ago • 6 comments

In vi mode, if I press x here, the 7 will be removed, so now the cursor is on the 7, I guess it's inlay hints cause this image

another thing is that are there any options that can disable inlay hints when in the insert mode?

when we were editing in insert mode, the inlay hint popup and cursor jumped with it too was annoying

maybe we need a feature that will disable inlay hints in the current line when editing, the function's args should be provided in a popup window by LSP's function signature, not the inlay hints

NEX-S avatar Sep 18 '22 05:09 NEX-S

What language server is this?

predragnikolic avatar Sep 19 '22 12:09 predragnikolic

I feel like this is talking about known issues with phantoms/inlay hints listed at https://github.com/sublimelsp/LSP/issues/2007

rchl avatar Sep 19 '22 13:09 rchl

I see a couple of things reported here regarding inlay hints:

1

In vi mode, if I press x here, the 7 will be removed, so now the cursor is on the 7

That is how Sublime Texte phantoms(inlay hints) behaves. While it looks like that the cursor is on an inlay hint, it is actually on 7.

Kapture 2022-09-20 at 08 57 16

Here is one official answer from the devs of ST, regarding this behavior: Screenshot 2022-09-20 at 09 01 35 https://discord.com/channels/280102180189634562/280157067396775936/897071781762957313

2

when we were editing in insert mode, the inlay hint popup and cursor jumped with it too was annoying

I think that @jwortmann warned about this: https://github.com/sublimelsp/LSP/pull/2018#issuecomment-1224166187

3

maybe we need a feature that will disable inlay hints in the current line when editing, the function's args should be provided in a popup window by LSP, not the inlay hints

There will be a feature toggle inlay hints. (there is an open PR for that https://github.com/sublimelsp/LSP/pull/2033)


We cannot do anything regarding 1, you could open an issue at the ST repo https://github.com/sublimehq/sublime_text .

We could improve 2 as @jwortmann mentioned in his comment to increase the timeout.

For 3, there is no option to toggle inlay hints when going into insert mode. IMO that would likely distract users when doing that. However there will be an option to toggle inlay hints (via the command palette or via a keybinding).

predragnikolic avatar Sep 20 '22 07:09 predragnikolic

What language server is this?

is clangd

NEX-S avatar Sep 20 '22 08:09 NEX-S

oh, maybe we need to change the inlay hint's position to A in vi mode and B in insert mode?

NEX-S avatar Sep 20 '22 08:09 NEX-S

just open a feature enhancement of question 1 to sublime's github repo.

NEX-S avatar Sep 20 '22 08:09 NEX-S