Path: blob/main/src/vs/platform/extensionRecommendations/common/extensionRecommendationsIpc.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 { Event } from '../../../base/common/event.js';6import { IChannel, IServerChannel } from '../../../base/parts/ipc/common/ipc.js';7import { IExtensionRecommendationNotificationService, IExtensionRecommendations, RecommendationsNotificationResult } from './extensionRecommendations.js';89export class ExtensionRecommendationNotificationServiceChannelClient implements IExtensionRecommendationNotificationService {1011declare readonly _serviceBrand: undefined;1213constructor(private readonly channel: IChannel) { }1415get ignoredRecommendations(): string[] { throw new Error('not supported'); }1617promptImportantExtensionsInstallNotification(extensionRecommendations: IExtensionRecommendations): Promise<RecommendationsNotificationResult> {18return this.channel.call('promptImportantExtensionsInstallNotification', [extensionRecommendations]);19}2021promptWorkspaceRecommendations(recommendations: string[]): Promise<void> {22throw new Error('not supported');23}2425hasToIgnoreRecommendationNotifications(): boolean {26throw new Error('not supported');27}2829}3031export class ExtensionRecommendationNotificationServiceChannel implements IServerChannel {3233constructor(private service: IExtensionRecommendationNotificationService) { }3435listen(_: unknown, event: string): Event<any> {36throw new Error(`Event not found: ${event}`);37}3839call(_: unknown, command: string, args?: any): Promise<any> {40switch (command) {41case 'promptImportantExtensionsInstallNotification': return this.service.promptImportantExtensionsInstallNotification(args[0]);42}4344throw new Error(`Call not found: ${command}`);45}46}474849