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

Optimize populating Tree-sitter syntax tree injections #18438

merged 1 commit into from Nov 14, 2018


None yet
1 participant

maxbrunsfeld commented Nov 14, 2018

This is a quick follow-up to #18435. It fixes another problem that I discovered when addressing atom/language-javascript#600.

In a very large file, when you make an edit that changes the syntax of a large part of the file (e.g. by introducing an error), there is currently a lot of time spent re-querying injection nodes and populating injections.

In this PR, I restructure that computation so that it does a single descendantsOfType query with an array of all of the necessary node types. Then it can iterate through these nodes in a single loop, looking up the appropriate injection point(s) for each node.

@maxbrunsfeld maxbrunsfeld force-pushed the mb-optimize-populate-injections branch from 3c7f6d7 to dfea325 Nov 14, 2018

@maxbrunsfeld maxbrunsfeld merged commit ae67bca into master Nov 14, 2018

3 checks passed

Atom Pull Requests #20181114.5 succeeded
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@maxbrunsfeld maxbrunsfeld deleted the mb-optimize-populate-injections branch Nov 14, 2018

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