fix: support array form of tsconfig "extends" in document links - #318263
Closed
Andrei L (unrevised6419) wants to merge 2 commits into
Closed
fix: support array form of tsconfig "extends" in document links#318263Andrei L (unrevised6419) wants to merge 2 commits into
Andrei L (unrevised6419) wants to merge 2 commits into
Conversation
TypeScript 5.0 allows `"extends": ["./a.json", "./b.json"]`. The TsconfigLinkProvider only handled the string form, so Cmd+Click silently did nothing on array entries. Iterate over array children and resolve each through the existing tryCreateTsConfigLink path. 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.
Updates the tsconfig document link provider to support multiple extends entries by handling extends as either a single value or an array.
Changes:
- Replace single
extendslink generation with multi-link generation. - Add support for
extends: []by iterating array children and creating links per entry.
Andrei L (unrevised6419)
added a commit
to unrevised6419/vscode
that referenced
this pull request
May 25, 2026
…getters Addresses Copilot review feedback on microsoft#318263. Each get*Links method now returns vscode.DocumentLink[] and filters undefined entries via coalesce internally, so provideDocumentLinks no longer needs an outer coalesce. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…getters Addresses Copilot review feedback on microsoft#318263. Each get*Links method now returns vscode.DocumentLink[] and filters undefined entries via coalesce internally, so provideDocumentLinks no longer needs an outer coalesce. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Andrei L (unrevised6419)
force-pushed
the
fix-tsconfig-extends-array-links
branch
from
May 25, 2026 23:58
a7986f2 to
0e1d78c
Compare
Author
|
@microsoft-github-policy-service agree |
Author
|
Closing in favor of #334894, which covers this along with every other tsconfig value that names a file or a directory, behind a table-driven provider. For this change specifically: the array form of |
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.
Description
TsconfigLinkProvider(inextensions/typescript-language-features/src/languageFeatures/tsconfig.ts) only created a document link when theextendsfield was a string. TypeScript 5.0 added support for an array of base configs:{ "extends": ["./tsconfig.base.json", "@tsconfig/strictest/tsconfig.json"] }In that case, the existing code asked
jsonc.findNodeAtLocation(root, ['extends'])and handed the resulting node straight totryCreateTsConfigLink.isPathValuerequiresnode.type === 'string', so the array case was silently dropped — Cmd+Click did nothing on any of the entries.This change renames
getExtendsLinktogetExtendsLinksand:[]when noextendsis presentmapChildrenhelper whenextendsis an arrayEach element is resolved through the unchanged
tryCreateTsConfigLink→openExtendsLinkCommandId→getTsconfigPathpipeline, so relative paths, absolute paths, andnode_modulespackage resolution continue to work per element.For consistency, all three sibling getters (
getExtendsLinks,getFilesLinks,getReferencesLinks) now carry an explicit(vscode.DocumentLink | undefined)[]return type. The outercoalesceinprovideDocumentLinksis unchanged and still filters theundefinedentries.Reference: TypeScript 5.0 release notes – Supporting Multiple Configuration Files in
extends.How to test
tsconfig.jsonsuch as:{ "extends": ["./tsconfig.base.json", "./tsconfig.strict.json"] }extendsarray — a "Follow link" tooltip should appear.{ "extends": "./tsconfig.base.json" }filesandreferenceslinks are unaffected.