Open blahgeek opened 1 year ago
Hmm... this may sounds like a trouble! What would you propose to fix this issue? Add documentation? Code fix? etc.
Well I guess ideally we should eliminate the async process mixed by the two different timers. I can think of two ways:
flycheck-display-error-at-point
timer, synchronously call sideline-render
in it. I think it should work if flycheck is the only backend, but not sure if it's possible for multiple backends.sideline-render
timer, call flycheck-display-error-at-point
in it to gather the output and return synchronously. This seems better?How do you think?
Only keep the sideline-render timer, call flycheck-display-error-at-point in it to gather the output and return synchronously. This seems better?
The problem of this approach is that, the re-rendering of sideline (currently based on if the symbol-at-point is different?) may not correctly update flycheck errors (e.g. one symbol contains multiple errors at different chars?)
The first option sounds like more trouble since you will force render other backends as well. I would go for the second option if we go for code fix!
I suggest to add a note to the README so users acknowledge this issue. Having multiple timers seems to be normal in Emacs world, albeit awkward. I don't want to abandon flycheck's timer since it opens option to users, so other frontend packages may co-exists with this plugin. They should able to cancel other UI frontends if they only want sideline to be the only to appear on the screen.
Apparently it currently works like this:
sideline-render
is called after an idle timer ofsideline-delay
(default 0.2s)sideline-render
, it callssideline-flycheck
backend which is async.sideline-flycheck
only keeps the callback for future useflycheck-display-error-at-point
is called after an idle timer offlycheck-display-errors-delay
(default 0.9s)flycheck-display-error-at-point
, it callssideline-flycheck--show
which in turn calls the sideline render callback in step 2.So this process only works when
flycheck-display-error-at-point
is larger thansideline-delay
.