Skip to content

Commit 534311d

Browse files
committed
Updates SCM api types
- Removes deprecated/removed commit message provider support
1 parent 28aee08 commit 534311d

File tree

3 files changed

+22
-103
lines changed

3 files changed

+22
-103
lines changed

src/@types/vscode.git.d.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { Disposable, Event, ProviderResult, Uri, Command } from 'vscode';
6+
import { Command, CancellationToken, Disposable, Event, ProviderResult, Uri } from 'vscode';
77
import { GitErrorCodes, RefType, Status, ForcePushMode } from '../@types/vscode.git.enums';
88

99
export interface Git {
@@ -24,6 +24,7 @@ export interface Ref {
2424
export interface UpstreamRef {
2525
readonly remote: string;
2626
readonly name: string;
27+
readonly commit?: string;
2728
}
2829

2930
export interface Branch extends Ref {
@@ -32,6 +33,12 @@ export interface Branch extends Ref {
3233
readonly behind?: number;
3334
}
3435

36+
export interface CommitShortStat {
37+
readonly files: number;
38+
readonly insertions: number;
39+
readonly deletions: number;
40+
}
41+
3542
export interface Commit {
3643
readonly hash: string;
3744
readonly message: string;
@@ -40,6 +47,7 @@ export interface Commit {
4047
readonly authorName?: string;
4148
readonly authorEmail?: string;
4249
readonly commitDate?: Date;
50+
readonly shortStat?: CommitShortStat;
4351
}
4452

4553
export interface Submodule {
@@ -77,6 +85,7 @@ export interface RepositoryState {
7785
readonly mergeChanges: Change[];
7886
readonly indexChanges: Change[];
7987
readonly workingTreeChanges: Change[];
88+
readonly untrackedChanges: Change[];
8089

8190
readonly onDidChange: Event<void>;
8291
}
@@ -97,6 +106,11 @@ export interface LogOptions {
97106
readonly range?: string;
98107
readonly reverse?: boolean;
99108
readonly sortByAuthorDate?: boolean;
109+
readonly shortStats?: boolean;
110+
readonly author?: string;
111+
readonly refNames?: string[];
112+
readonly maxParents?: number;
113+
readonly skip?: number;
100114
}
101115

102116
export interface CommitOptions {
@@ -147,6 +161,8 @@ export interface Repository {
147161
readonly state: RepositoryState;
148162
readonly ui: RepositoryUIState;
149163

164+
readonly onDidCommit: Event<void>;
165+
150166
getConfigs(): Promise<{ key: string; value: string }[]>;
151167
getConfig(key: string): Promise<string>;
152168
setConfig(key: string, value: string): Promise<string>;
@@ -185,9 +201,11 @@ export interface Repository {
185201
getBranchBase(name: string): Promise<Branch | undefined>;
186202
setBranchUpstream(name: string, upstream: string): Promise<void>;
187203

204+
checkIgnore(paths: string[]): Promise<Set<string>>;
205+
188206
getRefs(query: RefQuery, cancellationToken?: CancellationToken): Promise<Ref[]>;
189207

190-
getMergeBase(ref1: string, ref2: string): Promise<string>;
208+
getMergeBase(ref1: string, ref2: string): Promise<string | undefined>;
191209

192210
tag(name: string, upstream: string): Promise<void>;
193211
deleteTag(name: string): Promise<void>;
@@ -208,6 +226,8 @@ export interface Repository {
208226
log(options?: LogOptions): Promise<Commit[]>;
209227

210228
commit(message: string, opts?: CommitOptions): Promise<void>;
229+
merge(ref: string): Promise<void>;
230+
mergeAbort(): Promise<void>;
211231
}
212232

213233
export interface RemoteSource {
@@ -268,16 +288,6 @@ export interface BranchProtectionProvider {
268288
provideBranchProtection(): BranchProtection[];
269289
}
270290

271-
export interface CommitMessageProvider {
272-
readonly title: string;
273-
readonly icon?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
274-
provideCommitMessage(
275-
repository: Repository,
276-
changes: string[],
277-
cancellationToken?: CancellationToken,
278-
): Promise<string | undefined>;
279-
}
280-
281291
export type APIState = 'uninitialized' | 'initialized';
282292

283293
export interface PublishEvent {
@@ -305,7 +315,6 @@ export interface API {
305315
registerPostCommitCommandsProvider(provider: PostCommitCommandsProvider): Disposable;
306316
registerPushErrorHandler(handler: PushErrorHandler): Disposable;
307317
registerBranchProtectionProvider(root: Uri, provider: BranchProtectionProvider): Disposable;
308-
registerCommitMessageProvider(provider: CommitMessageProvider): Disposable;
309318
}
310319

311320
export interface GitExtension {

src/env/node/git/commitMessageProvider.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

src/env/node/git/localGitProvider.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ import { equalsIgnoreCase, getDurationMilliseconds } from '../../../system/strin
7474
import { compare, fromString } from '../../../system/version';
7575
import type { CachedBlame, CachedDiff, TrackedGitDocument } from '../../../trackers/trackedDocument';
7676
import { GitDocumentState } from '../../../trackers/trackedDocument';
77-
import { registerCommitMessageProvider } from './commitMessageProvider';
7877
import type { Git, PushForceOptions } from './git';
7978
import type { GitLocation } from './locator';
8079
import { findGitPath, InvalidGitConfigError, UnableToFindGitError } from './locator';
@@ -245,8 +244,6 @@ export class LocalGitProvider implements GitProvider, Disposable {
245244
const scmGit = await scmGitPromise;
246245
if (scmGit == null) return;
247246

248-
registerCommitMessageProvider(this.container, scmGit);
249-
250247
// Find env to pass to Git
251248
if ('env' in scmGit.git) {
252249
Logger.debug(scope, 'Found built-in Git env');

0 commit comments

Comments
 (0)