Skip to content

Add js/ts.projectConfig.additionalFilePatterns setting#318274

Open
unrevised6419 wants to merge 2 commits into
microsoft:mainfrom
unrevised6419:tsconfig-additional-file-patterns
Open

Add js/ts.projectConfig.additionalFilePatterns setting#318274
unrevised6419 wants to merge 2 commits into
microsoft:mainfrom
unrevised6419:tsconfig-additional-file-patterns

Conversation

@unrevised6419
Copy link
Copy Markdown

@unrevised6419 unrevised6419 commented May 26, 2026

Summary

  • Adds the js/ts.projectConfig.additionalFilePatterns setting (array of glob patterns).
  • TsconfigLinkProvider now also activates for files matching user-supplied globs, in addition to the existing **/[jt]sconfig.json and **/[jt]sconfig.*.json defaults.
  • Introduces TsconfigLinkProviderRegistration to 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/jsconfig in the filename (for example base.json, build.json).

image image
image image

Test plan

  • Open a workspace with a standard tsconfig.json containing extends / references / files — verify document links still work.
  • Add "js/ts.projectConfig.additionalFilePatterns": ["**/server.json"] to user settings; open a matching server.json — verify links appear on its extends/references/files entries.
  • Edit the setting at runtime — links update without a window reload.
  • Set the value to an invalid type (e.g. a string instead of an array) — defaults still apply, no errors thrown.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 26, 2026 01:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 TsconfigLinkProviderRegistration to register/re-register the document link provider when configuration changes.
  • Adds a new setting js/ts.projectConfig.additionalFilePatterns (schema + localized description).
  • Keeps existing tsconfig/jsconfig default 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.

Comment thread extensions/typescript-language-features/src/languageFeatures/tsconfig.ts Outdated
Comment thread extensions/typescript-language-features/package.nls.json Outdated
Comment thread extensions/typescript-language-features/package.json
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants