feat(services): add a shared read-only org metadata catalog - W-23613533 - #7918
Open
peternhale wants to merge 9 commits into
Open
feat(services): add a shared read-only org metadata catalog - W-23613533#7918peternhale wants to merge 9 commits into
peternhale wants to merge 9 commits into
Conversation
mshanemc
reviewed
Jul 29, 2026
| readonly orgId: string; | ||
| }; | ||
|
|
||
| const documentExtension = (xmlName: string): string => { |
Contributor
There was a problem hiding this comment.
why not use Registry to get these? What's special about class/trigger
mshanemc
reviewed
Jul 29, 2026
| }; | ||
| }; | ||
|
|
||
| export const isOrgMetadataComponentReference = ( |
Contributor
There was a problem hiding this comment.
please use Schema/struct stuff. You get the isWhatever for free.
Consolidate React state management, simplify expansion restore flow, and improve error visibility. Key improvements: - Extract all React state into useOrgBrowserState hook for better organization - Delete restoreExpandedProjection abstraction, use normal expand messages instead - Batch filter state workspace writes atomically to prevent partial corruption - Log protocol decode failures for debugging - Add architecture documentation to package README All tests passing (22/22), lint clean.
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.
What does this PR do?
This PR introduces
OrgMetadataCatalogin the Services extension as the shared, read-oriented authority for metadata facts about the active org. It gives extensions one service for discovering metadata, correlating it with workspace source, observing changes, and opening org-only source while allowing each extension to retain ownership of its domain-specific behavior and UI.OrgMetadataCatalog
The catalog provides a common model for:
It uses the source best suited to each fact:
Metadata API inventory remains authoritative for membership and timestamps. REST descriptions enrich SObjects and Custom Fields with details such as type, length, precision, scale, and relationship name without deciding whether metadata exists.
Org-only source is materialized lazily into a revision-aware shadow store. The catalog exposes that content through a read-only
TextDocumentContentProviderusingsf-org-metadata:URIs, allowing editor navigation, language support, formatting, highlighting, and CodeLens without exposing the shadow location to consumers. Non-Apex metadata retrieval is grouped by metadata type.Remote observations are persisted as formatted JSON under
.sf/orgs/<orgId>/metadata-catalog/catalog.json. State is hydrated once per org, while workspace presence is always rescanned rather than trusted from persisted data. Inventory acquisition, persistence, and notifications are coalesced to prevent duplicate requests, file churn, and refresh storms.The public
OrgMetadataCatalogservice remains the consumer boundary. Its implementation is decomposed into private modules for state, workspace correlation, inventory acquisition, SObjects, tree projection, remote retrieval, source materialization, documents, and source tracking.OrgMetadataCatalogChangePubSubprovides consumers with deduplicated catalog-change notifications.Extension consumption
Org Browser
Apex Testing
sf-org-metadata:source when the test class is org-only.Metadata, tracking, and SObjects
SOQL
API and ownership boundaries
FileSystemProvider, public content-write API, writer registration API, or requirement that consumers share one tree or filesystem layout.The architectural decision, implementation plan, and manual test matrix are recorded in:
packages/salesforcedx-vscode-services/docs/adr/0001-org-catalog-over-shared-vfs.mddocs/adr/0021-org-metadata-catalog.mddocs/superpowers/plans/2026-07-30-org-metadata-catalog-generalization.mddocs/superpowers/plans/2026-08-03-orgcatalog-service-decomposition.mddocs/superpowers/manual-tests/2026-07-31-org-metadata-catalog.mdWhat issues does this PR fix or reference?
@W-23613533@
Functionality Before
Functionality After
sf-org-metadata:; explicit download places source in the workspace and updates consumers coherently.Validation
Automated:
Manual:
Reviewer focus