Skip to content

Add package.json catalog support for npm completions and hover#307989

Open
yogeshwaran-c wants to merge 2 commits intomicrosoft:mainfrom
yogeshwaran-c:feat/npm-catalog-support
Open

Add package.json catalog support for npm completions and hover#307989
yogeshwaran-c wants to merge 2 commits intomicrosoft:mainfrom
yogeshwaran-c:feat/npm-catalog-support

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

@yogeshwaran-c yogeshwaran-c commented Apr 6, 2026

Summary

  • Extends the npm extension to recognize the catalog section in package.json, enabling IntelliSense completions, version suggestions, and hover information for packages listed under the catalog key
  • Supports the catalog feature used by pnpm, bun, and yarn for centralizing dependency versions in monorepos
  • Adds location.matches(['catalog']) and location.matches(['catalog', '*']) to the three relevant methods in packageJSONContribution.ts: collectPropertySuggestions, collectValueSuggestions, and getInfoContribution

Fixes #294609

Test plan

  • Open a package.json file that contains a catalog section (e.g., a pnpm workspace root)
  • Verify that typing a package name inside "catalog": { } triggers npm package name completions
  • Verify that typing a version value for a catalog entry triggers version suggestions (latest, ^latest, ~latest)
  • Verify that hovering over a package name in the catalog section shows package description, latest version, and homepage
  • Verify that existing dependencies, devDependencies, optionalDependencies, and peerDependencies behavior is unchanged

@aeschli
Copy link
Copy Markdown
Contributor

aeschli commented Apr 7, 2026

Are unrelated changes to AI instruction files. Please remove these.

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.

Should not be included in this PR.

Extend the npm extension to recognize the `catalog` section in
package.json, enabling IntelliSense completions, version suggestions,
and hover information for packages listed under the catalog key.
This supports the catalog feature used by pnpm, bun, and yarn for
centralizing dependency versions in monorepos.

Fixes microsoft#294609
@yogeshwaran-c yogeshwaran-c force-pushed the feat/npm-catalog-support branch from a2472a9 to c43386c Compare April 8, 2026 08:41
@yogeshwaran-c
Copy link
Copy Markdown
Contributor Author

Removed the unrelated AI instruction files. PR now only contains the npm catalog change (1 file, 3 lines).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package.json catalog version tooltips

3 participants