Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flycheck-display-errors-delay must be larger than sideline-delay for this to work #2

Open
blahgeek opened this issue Jan 10, 2023 · 4 comments

Comments

@blahgeek
Copy link

blahgeek commented Jan 10, 2023

Apparently it currently works like this:

  1. sideline-render is called after an idle timer of sideline-delay (default 0.2s)
  2. Inside sideline-render, it calls sideline-flycheck backend which is async. sideline-flycheck only keeps the callback for future use
  3. flycheck-display-error-at-point is called after an idle timer of flycheck-display-errors-delay (default 0.9s)
  4. Inside flycheck-display-error-at-point, it calls sideline-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 than sideline-delay.

@jcs090218
Copy link
Member

Hmm... this may sounds like a trouble! What would you propose to fix this issue? Add documentation? Code fix? etc.

@blahgeek
Copy link
Author

blahgeek commented Jan 11, 2023

Well I guess ideally we should eliminate the async process mixed by the two different timers. I can think of two ways:

  1. Only keep the 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.
  2. Only keep the 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?

@blahgeek
Copy link
Author

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?)

@jcs090218
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants