Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/chat/test/common/mockPromptsService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { CancellationToken } from '../../../../../base/common/cancellation.js';
7
import { Emitter } from '../../../../../base/common/event.js';
8
import { URI } from '../../../../../base/common/uri.js';
9
import { ICustomChatMode, IPromptsService } from '../../common/promptSyntax/service/promptsService.js';
10
11
export class MockPromptsService implements IPromptsService {
12
_serviceBrand: undefined;
13
14
private readonly _onDidChangeCustomChatModes = new Emitter<void>();
15
readonly onDidChangeCustomChatModes = this._onDidChangeCustomChatModes.event;
16
17
private _customModes: ICustomChatMode[] = [];
18
19
setCustomModes(modes: ICustomChatMode[]): void {
20
this._customModes = modes;
21
this._onDidChangeCustomChatModes.fire();
22
}
23
24
async getCustomChatModes(token: CancellationToken): Promise<readonly ICustomChatMode[]> {
25
return this._customModes;
26
}
27
28
// Stub implementations for required interface methods
29
getSyntaxParserFor(_model: any): any { throw new Error('Not implemented'); }
30
listPromptFiles(_type: any): Promise<readonly any[]> { throw new Error('Not implemented'); }
31
getSourceFolders(_type: any): readonly any[] { throw new Error('Not implemented'); }
32
asPromptSlashCommand(_command: string): any { return undefined; }
33
resolvePromptSlashCommand(_data: any, _token: CancellationToken): Promise<any> { throw new Error('Not implemented'); }
34
findPromptSlashCommands(): Promise<any[]> { throw new Error('Not implemented'); }
35
parse(_uri: URI, _type: any, _token: CancellationToken): Promise<any> { throw new Error('Not implemented'); }
36
getPromptFileType(_resource: URI): any { return undefined; }
37
dispose(): void { }
38
}
39
40