Skip to content

refactor: use ocache's built-in invalidate API#85

Merged
9romise merged 2 commits intomainfrom
ocache
Mar 21, 2026
Merged

refactor: use ocache's built-in invalidate API#85
9romise merged 2 commits intomainfrom
ocache

Conversation

@9romise
Copy link
Member

@9romise 9romise commented Mar 21, 2026

Upgrade ocache to 0.1.4 to use the new .invalidate() method

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6fa63dc9-eeb7-4e26-9479-e1396cb997c7

📥 Commits

Reviewing files that changed from the base of the PR and between c88bbcf and d9807db.

📒 Files selected for processing (1)
  • extensions/vscode/src/composables/workspace-context.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • extensions/vscode/src/composables/workspace-context.ts

📝 Walkthrough

Walkthrough

This PR refactors workspace-context caching and invalidation: it removes WorkspaceContext's internal path-tracking set and its previous invalidate behavior, renames/retargets the cached loader from loadWorkspaceCatalogInfo to loadWorkspaceFileInfo, and makes getWorkspaceContext a cached function keyed by a Uri. Cache invalidation now awaits invalidateDependencyInfo and chooses which cached loader to invalidate based on the provided Uri. Call sites (e.g. definition provider) were updated to use loadWorkspaceFileInfo. The ocache catalog version in pnpm-workspace.yaml was bumped to ^0.1.4.

Possibly related PRs

  • npmx-dev/vscode-npmx PR 78 — Changes definition provider lookups from catalog to workspace-file loaders, matching this PR's provider updates.
  • npmx-dev/vscode-npmx PR 76 — Modifies workspace loading and caching logic in src/core/workspace.ts, overlapping on cache-entrypoint and loader naming changes.
  • npmx-dev/vscode-npmx PR 74 — Reworks workspace caching/invalidation helpers and their usage, related to this PR's invalidateDependencyInfo and cache export changes.
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the purpose of upgrading ocache to use its new .invalidate() method.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ocache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67aa9674-f27c-4816-9b75-85341346d4bf

📥 Commits

Reviewing files that changed from the base of the PR and between f09aa27 and c88bbcf.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • extensions/vscode/src/composables/workspace-context.ts
  • extensions/vscode/src/core/workspace.ts
  • extensions/vscode/src/providers/definition/catalog.ts
  • pnpm-workspace.yaml

@9romise 9romise added this pull request to the merge queue Mar 21, 2026
Merged via the queue into main with commit 9600da9 Mar 21, 2026
11 checks passed
@9romise 9romise deleted the ocache branch March 21, 2026 12:50
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.

1 participant