/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IStringDictionary } from 'vs/base/common/collections'; import { Event } from 'vs/base/common/event'; export type DynamicRecommendation = 'dynamic'; export type ConfigRecommendation = 'config'; export type ExecutableRecommendation = 'executable'; export type CachedRecommendation = 'cached'; export type ApplicationRecommendation = 'application'; export type ExperimentalRecommendation = 'experimental'; export const enum ExtensionRecommendationReason { Workspace, File, Executable, WorkspaceConfig, DynamicWorkspace, Experimental, Application, } export interface IExtensionRecommendationReson { reasonId: ExtensionRecommendationReason; reasonText: string; } export const IExtensionRecommendationsService = createDecorator('extensionRecommendationsService'); export interface IExtensionRecommendationsService { readonly _serviceBrand: undefined; readonly onDidChangeRecommendations: Event; getAllRecommendationsWithReason(): IStringDictionary; getImportantRecommendations(): Promise; getOtherRecommendations(): Promise; getFileBasedRecommendations(): string[]; getExeBasedRecommendations(exe?: string): Promise<{ important: string[], others: string[] }>; getConfigBasedRecommendations(): Promise<{ important: string[], others: string[] }>; getWorkspaceRecommendations(): Promise; getKeymapRecommendations(): string[]; } export type IgnoredRecommendationChangeNotification = { extensionId: string, isRecommended: boolean }; export const IExtensionIgnoredRecommendationsService = createDecorator('IExtensionIgnoredRecommendationsService'); export interface IExtensionIgnoredRecommendationsService { readonly _serviceBrand: undefined; onDidChangeIgnoredRecommendations: Event; readonly ignoredRecommendations: string[]; onDidChangeGlobalIgnoredRecommendation: Event; readonly globalIgnoredRecommendations: string[]; toggleGlobalIgnoredRecommendation(extensionId: string, ignore: boolean): void; }