pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.33k stars 140 forks source link

Tree-sitter rolling fixes, 1.122 edition #1101

Closed savetheclocktower closed 1 month ago

savetheclocktower commented 1 month ago

1100 gives me a great excuse to get the new Tree-sitter PR up. Unlike last month's PR, this one starts off small.

Fixes #1100.

Changelog

savetheclocktower commented 1 month ago

I meant to put this in draft mode like the others, so pretend I just took it out of draft mode!

savetheclocktower commented 1 month ago

Sorry if this is something I've just missed in the past, but was there a change we made to support the languageSegment and highlightsQuery keys? It seems it just allows us to define multiple highlight query files, which is awesome as I assume that reduces duplication and effort, but I'm curious if there's anything big we had to do previously to support this? Or has it always been around as a possibility?

Every *Query key has the ability to accept an array with multiple paths as values; they're concatenated together in order. That was added at the same time as languageSegment.

That's been around for a while; I think I created it so that I could cut down on redundancy between the TypeScript and TypeScript-with-TSX grammars. If I'd had it in place when I first wrote the C and C++ highlighting I would've used it there as well. It's documented in the Sharing query files section.

confused-Techie commented 1 month ago

@savetheclocktower Thanks for taking the time to answer my question, and super awesome you've already written some documentation for it!

But seems we should be good to merge then!