feat(extensions): match file languages by filename or glob - #851
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryThe PR expands extension file-language registration from extension suffixes to exact filenames and basename/path globs, while preserving deterministic precedence and protected TypeScript mappings.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issues identified. Matcher validation, precedence, metadata propagation, generation replacement, and reload rollback are implemented consistently and covered across unit and host-level tests. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Extension factory] --> B[Validate matcher]
B --> C[Extension registry]
C --> D[Replace active selector generation]
D --> E[Load changeset]
E --> F[Resolve filename, glob, or extension]
F --> G[Pin language into Pierre metadata]
E -->|Failure| H[Restore previous generation]
G --> I[Commit review and extension generation]
Reviews (1): Last reviewed commit: "feat(extensions): match file languages b..." | Re-trigger Greptile |
benvinegar
force-pushed
the
feat/file-language-matchers
branch
from
August 26, 2026 03:40
4357848 to
a1b5fe1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hunk.registerFileLanguagewith declarative exact-filename and basename/path glob matchers while preserving the existing extension-string shorthand.mts/.ctsmappingsThis provides the extension seam needed to move mappings such as Bazel/Starlark filenames out of core in a follow-up to #813 without exposing arbitrary regular expressions.
Example use cases for extension implementers
This lets extensions support conventions that cannot be represented by a final extension alone: Bazel/Starlark files such as
BUILD, Dockerfile variants such asDockerfile.dev, framework-specific filename families, and files whose language depends on where they live in a repository.String registrations remain extension-only shorthand: use
{ kind: "filename" }for a literal bare filename. Filename and glob selectors are case-sensitive.target: "basename"sees only the last path component, whiletarget: "path"sees the decoded review path using/as its only separator; backslashes remain literal filename characters.Validation
bun run typecheckbun run lintbun run deps:checkbun run check:docsbun run check:packbun run test— 3,054 passed, 10 skippedbun run test:integration— 128 passedbun run test:tty-smoke— 9 passedThis PR description was generated by Pi using gpt-5.6-sol