Zed does not use the standard capture node and properties in injections.scm #9656
Labels
bug
[core label]
editor
Feedback for code editing, formatting, editor iterations, etc
tree-sitter
Syntax highlighting and tree-sitter
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: