Skip to content

Preserve glob range negation and path boundaries - #65477

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/glob
Nov 13, 2026
Merged

Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/glob

Conversation

@jakebailey

Copy link
Copy Markdown
Member

This code is vendored from gopls, but sadly it's also buggy.

Caught in an audit.

Honor negated character ranges when matching and rendering patterns.
Keep separators available after star matches and stop consuming slashes
before indexing an exhausted input.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 04:55
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 13, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the glob matcher changes.

No open issues 🎉

What changed in this PR

This PR fixes range negation and path-boundary handling in the native TypeScript compiler’s vendored glob matcher.

Changes:

  • Preserve negated character ranges when formatting and matching patterns.
  • Keep path separators available after * matches and prevent out-of-bounds access when consuming trailing slashes.
  • Add regression tests for negated ranges, Unicode, wildcard boundaries, and trailing separators.
File Description
tsc/​internal/​glob/​glob.go Corrects range negation, wildcard boundaries, and slash handling.
tsc/​internal/​glob/​glob_test.go Adds formatting and matching regression tests.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 13, 2026
@jakebailey

Copy link
Copy Markdown
Member Author

This one is probably worth a bug report upstream, or I just send a CL

@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 13, 2026
Merged via the queue into microsoft:main with commit d55dd50 Nov 13, 2026
34 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the compiler-fixes/glob branch November 13, 2026 18:35
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants