Tree-sitter rolling fixes, 1.131.0 edition #1377
Open
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.
EDIT: Found another Tree-sitter change worth making, so I've retroactively turned this into the “rolling fixes” PR for the upcoming version. Original description follows.
[language-java] Update to latest
tree-sitter-java……and add support for multi-line string literals.
Fixes #1376.
We hadn't updated the
tree-sitter-javaparser in a long time. After I confirmed that the latest version of the parser does support the multi-line string literals mentioned in #1376, I took this opportunity to bump our parser version.Doing so added recognition of multi-line strings, but also introduced some incompatibilities in the query files having to do with renamed nodes, so that took a little while to fix.
As is my habit when I touch
language-*packages, I've introduced a grammar test file to prove that these changes work. It's bare-bones right now, but it does test the multi-line string literals.As for the other changes to the query files: those were necessary to get the Tree-sitter grammar to do anything at all, since it would've thrown an error during activation if there were any invalid syntax in a query file. Therefore if I'd done any of that wrong, or missed anything, CI would catch it because it would result in all these new grammar tests failing outright.
(I'm in a weird state because I'm submitting these PRs blind! They're against master (still running Electron 12), but my local Pulsar.app is the Electron 30 release candidate. So I'm making these changes in my Electron 30 codebase, verifying they work, then copying them over to my Electron 12 codebase and opening the PR from there. Luckily, there's nothing about the Tree-sitter infrastructure that even needed to change when we bumped to Electron 30 — the upside of all of that stuff using WebAssembly instead of native bindings in Node.)