Path: blob/main/src/vs/workbench/contrib/chat/test/common/mockChatModeService.ts
5267 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*--------------------------------------------------------------------------------------------*/456import { Event } from '../../../../../base/common/event.js';7import { ChatMode, IChatMode, IChatModeService } from '../../common/chatModes.js';89export class MockChatModeService implements IChatModeService {10declare readonly _serviceBrand: undefined;1112public readonly onDidChangeChatModes = Event.None;1314constructor(15private readonly _modes: { builtin: readonly IChatMode[]; custom: readonly IChatMode[] } = { builtin: [ChatMode.Ask], custom: [] }16) { }1718getModes(): { builtin: readonly IChatMode[]; custom: readonly IChatMode[] } {19return this._modes;20}2122findModeById(id: string): IChatMode | undefined {23return this._modes.builtin.find(mode => mode.id === id) ?? this._modes.custom.find(mode => mode.id === id);24}2526findModeByName(name: string): IChatMode | undefined {27return this._modes.builtin.find(mode => mode.name.get() === name) ?? this._modes.custom.find(mode => mode.name.get() === name);28}2930}313233