Path: blob/main/src/vs/workbench/contrib/chat/test/common/mockChatModeService.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*--------------------------------------------------------------------------------------------*/456import { Event } from '../../../../../base/common/event.js';7import { ChatMode, IChatMode, IChatModeService } from '../../common/chatModes.js';89export class MockChatModeService implements IChatModeService {10readonly _serviceBrand: undefined;1112private _modes: { builtin: readonly IChatMode[]; custom: readonly IChatMode[] } = { builtin: [ChatMode.Ask], custom: [] };1314public readonly onDidChangeChatModes = Event.None;1516getModes(): { builtin: readonly IChatMode[]; custom: readonly IChatMode[] } {17return this._modes;18}1920findModeById(id: string): IChatMode | undefined {21return this._modes.builtin.find(mode => mode.id === id) ?? this._modes.custom.find(mode => mode.id === id);22}2324findModeByName(name: string): IChatMode | undefined {25return this._modes.builtin.find(mode => mode.name === name) ?? this._modes.custom.find(mode => mode.name === name);26}27}282930