Skip to content
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

Tree-sitter rolling fixes, 1.122 edition #1101

Merged
merged 9 commits into from
Oct 16, 2024
Merged

Conversation

savetheclocktower
Copy link
Contributor

@savetheclocktower savetheclocktower commented Sep 19, 2024

#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

  • [language-php] Highlight “null-safe” property access correctly.
  • [language-c] Scope template delimiters properly in C++.
  • [language-c] Consolidate common highlighting queries between the C and C++ grammars for more consistency in syntax highlighting.
  • Fix incorrect behavior in certain scenarios for “Fold at Indent Level X” commands.
  • Fix exception when resolving divided folds (e.g., #ifdefs in C/C++).

@savetheclocktower
Copy link
Contributor Author

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

Copy link
Member

@confused-Techie confused-Techie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks a lot like many of your past improvements.

Love to see exceptional testing on this, gives lots of faith to the passing specs on these changes.

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?

@savetheclocktower
Copy link
Contributor Author

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
Copy link
Member

@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!

@savetheclocktower savetheclocktower merged commit a2c236f into master Oct 16, 2024
103 checks passed
@savetheclocktower savetheclocktower deleted the tree-sitter-october branch October 16, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP color coding not respecting null-safe operator
2 participants