Open savetheclocktower opened 9 months ago
By the way, I've purposefully been making atomic PRs, but I've also got a branch with all of these changes combined. If they all look good to you individually, I can open a PR against that branch and we can save ourselves some merging headaches.
@savetheclocktower I would love for you to make a PR for the same. It would save us time as well
Much of zed's svelte issues come from the lack of support for things like this
Also, are you sure about not making it like the former you shared?
Else, how will we do something like
[
(attribute_value)
(quoted_attribute_value)
] @string
For zed's syntax highlighting?
Else, how will we do something like
[ (attribute_value) (quoted_attribute_value) ] @string
For zed's syntax highlighting?
I might be misunderstanding, but I don't see how this PR affects your ability to do that. The fact that all quoted_attribute_value
s have an inner attribute_value
node is a behavior that this parser inherits from the HTML parser. It seems like your sample query would still work.
If you're saying that you want a way to identify everything but the expression so that you can highlight those parts like a string but not the expression… I imagine that could be solved by explicitly highlighting the inner expression in a non-string-like way to override the styles it would inherit from the surrounding string.
Fixes #44.
I tried to roughly follow the design of template strings in
tree-sitter-javascript
. Instead of doing something like……I instead did…
…so if you want to identify just the literal string parts, you can take
(attribute_value)
and ignore/subtract its children.