Skip to content

Comments

Increase surrounding pair performance#3186

Open
AndreasArvidsson wants to merge 7 commits intomainfrom
srPerformance
Open

Increase surrounding pair performance#3186
AndreasArvidsson wants to merge 7 commits intomainfrom
srPerformance

Conversation

@AndreasArvidsson
Copy link
Member

No description provided.

@AndreasArvidsson AndreasArvidsson requested a review from a team as a code owner February 21, 2026 17:54
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 722355c4ec

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +97 to +103
if (hasFilteredCapture == null) {
hasFilteredCapture = match.captures.some((capture) =>
captureNameFilter.has(getNormalizedCaptureName(capture.name)),
);
patternContainsFilteredCapture.set(
match.patternIndex,
hasFilteredCapture,

Choose a reason for hiding this comment

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

P1 Badge Recompute filtered-capture presence per match

The patternContainsFilteredCapture cache assumes a pattern either always has or never has a filtered capture, but Tree-sitter patterns can include optional captures (for example queries/r.scm and queries/ruby.scm use (string_content)? @textFragment). If the first match for a pattern omits that optional capture (eg an empty string), this code caches false for the whole patternIndex and skips all later matches from that pattern, including ones that do contain @textFragment. In getCapturesMap(..., ["textFragment", ...]) this drops valid text fragments and can make surrounding-pair logic treat delimiters inside strings/comments as structural delimiters.

Useful? React with 👍 / 👎.

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.

1 participant