-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Zed does not use the standard capture node and properties in injections.scm #9656
Comments
Hi there! 👋 |
Is there any interest from the Zed team in making these changes? Frustrating to support multiple editors and have to change injections queries every update to match what Zed does here |
Ah sorry I see there was a PR. I'll look into reviving it with that backwards compatibility as mentioned. |
Closes #9656. Continuation of #9654, but with the addition of backwards compatibility for the existing captures. Release Notes: - Improved Tree-sitter support with added compatibility for standard injections captures --------- Co-authored-by: Finn Evers <[email protected]>
Check for existing issues
Describe the bug / provide steps to reproduce it
Introduction
The standard capture nodes and properties for injections, documented here, are not being used by Zed to handle injection queries. Instead, Zed has been using a shorthand for these constructs, namely:
This means that Zed would not handle injection queries from extensions if they used the proper captures and properties. In fact, this is the case with the existing Java extension https://github.com/samuser107/zed-java-extension/blob/main/languages/java/injections.scm.
Reproduce Steps
crates/languages/src/markdown/injections.scm
, (also visible on github), and confirm that the captures that markdown is using does not match what is documented.crates/languages/src/markdown/injections.scm
with the standard captures.Alternative Reproduction Step
On the other hand, if you wish to see that Zed is ignoring standard injection.scm written by extension authors,
you can do the following.
/* */
to trigger injection attempt.PR:
I currently have a PR up #9654, which makes zed use the standard captures, updates the injections.scm files, and updates all tests which reference injection queries (as many as I could grep) to test for the standard captures and props.
Environment
Zed: v0.129.0 (Zed Dev)
OS: macOS 13.4.1
Memory: 32 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.No response
The text was updated successfully, but these errors were encountered: