Path: blob/main/src/vs/workbench/contrib/issue/common/issue.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { UriComponents } from '../../../../base/common/uri.js';6import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';78// Since data sent through the service is serialized to JSON, functions will be lost, so Color objects9// should not be sent as their 'toString' method will be stripped. Instead convert to strings before sending.10export interface WindowStyles {11backgroundColor?: string;12color?: string;13}14export interface WindowData {15styles: WindowStyles;16zoomLevel: number;17}1819export const enum IssueType {20Bug,21PerformanceIssue,22FeatureRequest23}2425export enum IssueSource {26VSCode = 'vscode',27Extension = 'extension',28Marketplace = 'marketplace'29}3031export interface IssueReporterStyles extends WindowStyles {32textLinkColor?: string;33textLinkActiveForeground?: string;34inputBackground?: string;35inputForeground?: string;36inputBorder?: string;37inputErrorBorder?: string;38inputErrorBackground?: string;39inputErrorForeground?: string;40inputActiveBorder?: string;41buttonBackground?: string;42buttonForeground?: string;43buttonHoverBackground?: string;44sliderBackgroundColor?: string;45sliderHoverColor?: string;46sliderActiveColor?: string;47}4849export interface IssueReporterExtensionData {50name: string;51publisher: string | undefined;52version: string;53id: string;54isTheme: boolean;55isBuiltin: boolean;56displayName: string | undefined;57repositoryUrl: string | undefined;58bugsUrl: string | undefined;59extensionData?: string;60extensionTemplate?: string;61data?: string;62uri?: UriComponents;63privateUri?: UriComponents;64}6566export interface IssueReporterData extends WindowData {67styles: IssueReporterStyles;68enabledExtensions: IssueReporterExtensionData[];69issueType?: IssueType;70issueSource?: IssueSource;71extensionId?: string;72experiments?: string;73restrictedMode: boolean;74isUnsupported: boolean;75githubAccessToken: string;76issueTitle?: string;77issueBody?: string;78data?: string;79uri?: UriComponents;80privateUri?: UriComponents;81}8283export interface ISettingSearchResult {84extensionId: string;85key: string;86score: number;87}8889export const IIssueFormService = createDecorator<IIssueFormService>('issueFormService');9091export interface IIssueFormService {92readonly _serviceBrand: undefined;9394// Used by the issue reporter95openReporter(data: IssueReporterData): Promise<void>;96reloadWithExtensionsDisabled(): Promise<void>;97showConfirmCloseDialog(): Promise<void>;98showClipboardDialog(): Promise<boolean>;99sendReporterMenu(extensionId: string): Promise<IssueReporterData | undefined>;100closeReporter(): Promise<void>;101}102103export const IWorkbenchIssueService = createDecorator<IWorkbenchIssueService>('workbenchIssueService');104105export interface IWorkbenchIssueService {106readonly _serviceBrand: undefined;107openReporter(dataOverrides?: Partial<IssueReporterData>): Promise<void>;108}109110111