This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Fix handling of "empty" language injections with Tree-sitter#21753
Merged
Fix handling of "empty" language injections with Tree-sitter#21753
Conversation
1 task
Contributor
|
Thank you for the fix. Do we need to bump |
d19528a to
847e787
Compare
Contributor
Author
Yeah. I mentioned in the body that the problems described in the linked issue have two different causes. One of the problems was just a bug in |
Contributor
|
Thanks 🙇🏾♂️ @maxbrunsfeld |
Contributor
Author
|
Thanks for getting this merged @darangi! |
|
When will this appear in stable Atom? |
|
Was this merged into 1.54.0? because this issue is not fixed in that version. |
Contributor
|
@odedharth, it is yet to hit stable, but you can get it on nightly |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Identify the Bug
Fixes #21093
Fixes #20884
Fixes #20897
Fixes atom/language-javascript#676
The Rust grammar had a bug that caused poor error recovery.
There was a bug would occur in documents with language injections, where the injected document is empty. Examples include:
innerHTMLproperty in JavaScript. Usually, we highlight the contents of these strings as HTML.The bug would cause us to accidentally skip highlighting large sections of the document.
Description of the Change
These injected syntax trees are each associated with a Marker in the LanguageMode's
injectionsMarkerLayer. This PR ensures that, when a language injection is empty, its marker is destroyed.I also upgraded to the latest version of
tree-sitter-rustin order to fix the last two issues mentioned in #21093, which were. unrelated, but easy to address.Verification Process
Create files containing all of the code examples in #21093. See that the syntax highlighting is all correct. Edit this files in a variety of ways and see that syntax highlighting stays correct.
Release Notes