Add js/ts.projectConfig.additionalFilePatterns setting#318274
Open
unrevised6419 wants to merge 2 commits into
Open
Add js/ts.projectConfig.additionalFilePatterns setting#318274unrevised6419 wants to merge 2 commits into
unrevised6419 wants to merge 2 commits into
Conversation
Lets users extend the glob patterns used to identify TypeScript and JavaScript project configuration files recognized by the tsconfig document link provider. Useful for monorepos where config files do not follow the standard tsconfig.json/jsconfig.json naming (for example base.json, build.json). The default patterns are always included; user entries are added on top, deduped, and the provider re-registers live when the setting changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new user setting to extend which JSON/JSONC files are treated as JS/TS project config files for purposes of providing document links, and wires it into dynamic document link provider registration.
Changes:
- Introduces
TsconfigLinkProviderRegistrationto register/re-register the document link provider when configuration changes. - Adds a new setting
js/ts.projectConfig.additionalFilePatterns(schema + localized description). - Keeps existing
tsconfig/jsconfigdefault patterns while allowing extra glob patterns.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| extensions/typescript-language-features/src/languageFeatures/tsconfig.ts | Adds configuration-driven document selector + config-change re-registration for tsconfig/jsconfig link provider. |
| extensions/typescript-language-features/package.nls.json | Adds localized description string for the new setting. |
| extensions/typescript-language-features/package.json | Contributes the new configuration setting schema. |
- Trim whitespace-only entries before adding to pattern set - Cache last computed patterns key; skip re-register when unchanged - Reword nls description to scope it to document links and clarify that it does not affect TypeScript/JavaScript project loading - Mark schema items as uniqueItems Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
js/ts.projectConfig.additionalFilePatternssetting (array of glob patterns).TsconfigLinkProvidernow also activates for files matching user-supplied globs, in addition to the existing**/[jt]sconfig.jsonand**/[jt]sconfig.*.jsondefaults.TsconfigLinkProviderRegistrationto own the provider lifecycle: re-registers when the setting changes, disposes cleanly, defends against malformed config values.This is useful for monorepos that name TSConfig/JSConfig files without
tsconfig/jsconfigin the filename (for examplebase.json,build.json).Test plan
tsconfig.jsoncontainingextends/references/files— verify document links still work."js/ts.projectConfig.additionalFilePatterns": ["**/server.json"]to user settings; open a matchingserver.json— verify links appear on itsextends/references/filesentries.🤖 Generated with Claude Code