Closed ColemanGariety closed 4 years ago
Can you provide a bit more info on what hints you are referring to? lsp-mode + package extension have 10+ different hints.
I only have experience with the code action and linting hints. They appear to "flicker" because they are added and removed when you move the cursor.
Can you post a screenshot? My guess is that you are referring to lsp-ui-sideline.
These are from typescript language server. I am using emacs 27 compiled with json serialization, if that helps.
I am referring to both "remove declaration for 'setFieldValue'" and "'setFieldValue' is declared but never read."
EDIT: but not the type description in the minibuffer.
On second though, it isn't necessary to check whether the string is same. All that's needed is to prevent the hint from updating until the next hint (or lack thereof) is ready.
@JacksonGariety Would this config solves your issue ?
(setq lsp-ui-sideline-update-mode 'line)
(setq lsp-ui-sideline-update-mode 'line)
Using this will break the code actions because a lot of them are available only on a specific position.
@yyoncho Ah, I see
@yyoncho does it concern only code actions ? Or hover informations too ?
I see that hover informations are not affected by lsp-ui-sideline-update-mode
, but we still make the same requests and replace the sidelines when moving the point left or right on the same line.
Would it make sense to not refresh those hover datas (not code actions), even with lsp-ui-sideline-update-mode
set to 'point
?
Is the current method for getting the symbol positions ((bounds-of-thing-at-point 'symbol)
) correct ?
Are we missing some data by not sending the point
position instead ?
Would it make sense to not refresh those hover datas (not code actions), even with lsp-ui-sideline-update-mode set to 'point ?
Yes. The symbol data has to be updated only if there is a change of line/change of content of the line.
Is the current method for getting the symbol positions ((bounds-of-thing-at-point 'symbol)) correct ?
I think it is the best thing that we can do. Technically, symbol-at-point is less precise than the server notion of a symbol.
Are we missing some data by not sending the point position instead ?
Can you elaborate? I think that we are sending the position.
Can you elaborate? I think that we are sending the position.
Thanks, I think you answered my question with your 2nd answer
Describe the bug Right now, the hints are re-drawn every time the cursor moves. This results in everything constantly flickering as you move around.
Even if performance were perfect, there's no need to replace already drawn text with exactly the same text. Can we do a simple equality check before drawing?