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

Validation/Invalidation coordination problem with TreeSitterClient and TextSystemStyler #40

Open
mattmassicotte opened this issue Feb 1, 2024 · 2 comments

Comments

@mattmassicotte
Copy link
Contributor

There is currently no good way to coordinate changes between TreeSitterClient and a TextSystemStyler.

On change both a client and the styler need to be updated.

  • If you update the styler first, it will end up trying to validate synchronously (ok), but the client hasn't yet been updated so that fails.
  • If you update the client first, it will produce invalidations that will result in the styler performing work without yet processing the change.

This coordination problem existed with Neon 0.6 as well. The solution was either to wait for the next runloop turn to apply styling (easy, could result in styling flicker), or to use precise NSTextStorage/NSLayoutManger event hooks that aren't easy to set up (without TSYTextStorage from TextStory).

@mattmassicotte
Copy link
Contributor Author

Ok, this now has better behavior with 64c168b. I'm not sure this is the final solution, but it's something.

@mattmassicotte
Copy link
Contributor Author

I'm going to leave this issue open until I have proved to myself that this can be used successfully to guarantee synchronous styling on content change.

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

1 participant