Closed sebastiencs closed 3 years ago
Yes, it fixes that issue.
Though I noticed one problem - if I move cursor quickly old requests are not cancelled and they start to execute with new ones and redraw the same sideline multiple times.
I fixed it in this commit: https://github.com/emacs-lsp/lsp-ui/commit/4094eaf557ae43229abf3a0cf6e53c0a446f7bf0 But for some reason it was deleted :(
Though I noticed one problem - if I move cursor quickly old requests are not cancelled and they start to execute with new ones and redraw the same sideline multiple times.
Does this occurs on the master branch ?
I fixed it in this commit: 4094eaf But for some reason it was deleted :(
Ah, this has been removed for https://github.com/emacs-lsp/lsp-ui/issues/483
Does this occurs on the master branch ?
Yes.
I think we should cancel such requests - currently I have an example when it takes ~3s so when moving cursor up-down on such line it loads cpu a lot and continue redrawing/loading after I stop for a long time.
@sebastiencs will you merge this? At least it doesn't make things worse :)
line-number-at-pos
is the slowest operation in lsp-ui-sideline and was called several times, including in post-command-hook. It impacts performance only with big buffers.This reduce the number of calls to this function to 0 or 1. It is now called only after the timer
lsp-ui-sideline-delay
, and when the cursor changes of line. When the cursor stays on the same line it doesn't callline-number-at-pos
@kurnevsky This should also fix the issue we mentioned in https://github.com/emacs-lsp/lsp-ui/pull/509 Can you please confirm ?