Expand description
SourceControlManagementProvider: exposes SCM repository state and actions.
§SourceControlManagementProvider (Environment)
Implements the SourceControlManagementProvider trait for the
MountainEnvironment.
§SCM provider architecture
Each SCM provider maintains:
- Handle - unique
u32identifier; callers may supply their own so the same handle key used inScmNamespace.tsmaps correctly on both sides of the IPC boundary. - Label - user-friendly name (e.g., “Git”)
- Root URI - URI of the repository root
- Groups - resource groups organizing changed resources
- Input box - user input widget (e.g., commit messages)
- Count - badge count for changed items
§Resource groups
Groups organize resources by their state:
- Changes - modified files ready to commit
- Untracked - new files not yet tracked
- Staged - files staged for commit
- Merge changes - files with merge conflicts
- Conflict unresolved - unresolved conflict markers
§SCM lifecycle
- CreateSourceControl - register provider, emit
SCMProviderAdded - UpdateSourceControl - update badge/input-box, emit
SCMProviderChanged - UpdateSourceControlGroup - upsert group entry, emit
SCMGroupChanged - RegisterInputBox - attach input-box DTO to provider
- DisposeSourceControl - remove provider + groups, emit
SCMProviderRemoved
§Git integration patterns
Typical Git provider workflow:
- Detect
.gitdirectory, rungit statusto populate groups - Run
git difffor file diffs; use input box for commit messages - Show badge count for changed files
- Provide commands: Stage, Unstage, Commit, Push, Pull, Discard
§VS Code reference
vs/workbench/services/scm/common/scmService.tsvs/platform/scm/common/scm.tsvs/sourcecontrol/git/common/git.ts