Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/issue/common/issue.ts
3296 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 { UriComponents } from '../../../../base/common/uri.js';
7
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
8
9
// Since data sent through the service is serialized to JSON, functions will be lost, so Color objects
10
// should not be sent as their 'toString' method will be stripped. Instead convert to strings before sending.
11
export interface WindowStyles {
12
backgroundColor?: string;
13
color?: string;
14
}
15
export interface WindowData {
16
styles: WindowStyles;
17
zoomLevel: number;
18
}
19
20
export const enum IssueType {
21
Bug,
22
PerformanceIssue,
23
FeatureRequest
24
}
25
26
export enum IssueSource {
27
VSCode = 'vscode',
28
Extension = 'extension',
29
Marketplace = 'marketplace'
30
}
31
32
export interface IssueReporterStyles extends WindowStyles {
33
textLinkColor?: string;
34
textLinkActiveForeground?: string;
35
inputBackground?: string;
36
inputForeground?: string;
37
inputBorder?: string;
38
inputErrorBorder?: string;
39
inputErrorBackground?: string;
40
inputErrorForeground?: string;
41
inputActiveBorder?: string;
42
buttonBackground?: string;
43
buttonForeground?: string;
44
buttonHoverBackground?: string;
45
sliderBackgroundColor?: string;
46
sliderHoverColor?: string;
47
sliderActiveColor?: string;
48
}
49
50
export interface IssueReporterExtensionData {
51
name: string;
52
publisher: string | undefined;
53
version: string;
54
id: string;
55
isTheme: boolean;
56
isBuiltin: boolean;
57
displayName: string | undefined;
58
repositoryUrl: string | undefined;
59
bugsUrl: string | undefined;
60
extensionData?: string;
61
extensionTemplate?: string;
62
data?: string;
63
uri?: UriComponents;
64
privateUri?: UriComponents;
65
}
66
67
export interface IssueReporterData extends WindowData {
68
styles: IssueReporterStyles;
69
enabledExtensions: IssueReporterExtensionData[];
70
issueType?: IssueType;
71
issueSource?: IssueSource;
72
extensionId?: string;
73
experiments?: string;
74
restrictedMode: boolean;
75
isUnsupported: boolean;
76
githubAccessToken: string;
77
issueTitle?: string;
78
issueBody?: string;
79
data?: string;
80
uri?: UriComponents;
81
privateUri?: UriComponents;
82
}
83
84
export interface ISettingSearchResult {
85
extensionId: string;
86
key: string;
87
score: number;
88
}
89
90
export const IIssueFormService = createDecorator<IIssueFormService>('issueFormService');
91
92
export interface IIssueFormService {
93
readonly _serviceBrand: undefined;
94
95
// Used by the issue reporter
96
openReporter(data: IssueReporterData): Promise<void>;
97
reloadWithExtensionsDisabled(): Promise<void>;
98
showConfirmCloseDialog(): Promise<void>;
99
showClipboardDialog(): Promise<boolean>;
100
sendReporterMenu(extensionId: string): Promise<IssueReporterData | undefined>;
101
closeReporter(): Promise<void>;
102
}
103
104
export const IWorkbenchIssueService = createDecorator<IWorkbenchIssueService>('workbenchIssueService');
105
106
export interface IWorkbenchIssueService {
107
readonly _serviceBrand: undefined;
108
openReporter(dataOverrides?: Partial<IssueReporterData>): Promise<void>;
109
}
110
111