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

Update Tree-sitter syntax highlighting synchronously for parses that complete sync #17923

Merged
merged 8 commits into from Aug 24, 2018

Conversation

Projects
None yet
1 participant
@maxbrunsfeld
Contributor

maxbrunsfeld commented Aug 24, 2018

The Background

In #17339, I moved Tree-sitter's parsing to a background thread, but allowed a limited amount of parsing work to be done on the main thread. But even if the parsing completed on the main thread, the syntax tree would be returned via an async method.

While working on #17879, I noticed that this asynchronous behavior was somewhat inconvenient. Some tests failed because the syntax tree wouldn't update until the next tick after a small text change.

The Fix

In this PR, I've updated the TreeSitterLanguageMode so that in the case where parsing completes synchronously, the language mode's state will be updated synchronously too.

I've also fixed a number of other small bugs in TreeSitterLanguageMode that showed up in the test suite during #17339.

Refs tree-sitter/node-tree-sitter#26

@maxbrunsfeld maxbrunsfeld merged commit bc00369 into master Aug 24, 2018

2 of 3 checks passed

VSTS: Atom Pull Requests in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@maxbrunsfeld maxbrunsfeld deleted the mb-tree-sitter-sync-updates branch Aug 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment