Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/githubPullRequest.d.ts
13388 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import type { CancellationToken, Disposable, Uri } from 'vscode';
7
8
export interface TitleAndDescriptionProvider {
9
provideTitleAndDescription(context: { commitMessages: string[]; patches: string[] | { patch: string; fileUri: string; previousFileUri?: string }[]; issues?: { reference: string; content: string }[]; template?: string; compareBranch?: string }, token: CancellationToken): Promise<{ title: string; description?: string } | undefined>;
10
}
11
12
export interface ReviewerComments {
13
// To tell which files we should add a comment icon in the "Files Changed" view
14
files: Uri[];
15
succeeded: boolean;
16
// For removing comments
17
disposable?: Disposable;
18
}
19
20
export interface ReviewerCommentsProvider {
21
provideReviewerComments(context: { repositoryRoot: string; commitMessages: string[]; patches: { patch: string; fileUri: string; previousFileUri?: string }[] }, token: CancellationToken): Promise<ReviewerComments>;
22
}
23
24
export interface RepositoryDescription {
25
owner: string;
26
repositoryName: string;
27
defaultBranch: string;
28
currentBranch?: string;
29
pullRequest?: {
30
title: string;
31
url: string;
32
number: number;
33
id: number;
34
};
35
}
36
37
export interface API {
38
/**
39
* Register a PR title and description provider.
40
*/
41
registerTitleAndDescriptionProvider(title: string, provider: TitleAndDescriptionProvider): Disposable;
42
43
/**
44
* Register a PR reviewer comments provider.
45
*/
46
registerReviewerCommentsProvider(title: string, provider: ReviewerCommentsProvider): Disposable;
47
48
/**
49
* Get the repository description for a given URI.
50
* This includes the owner, repository name, default branch, current branch (if applicable),
51
* and pull request information (if applicable).
52
*
53
* @returns A promise that resolves to a `RepositoryDescription` object or `undefined` if no repository is found.
54
*/
55
getRepositoryDescription(uri: Uri): Promise<RepositoryDescription | undefined>;
56
}
57
58