Fixes fixture errors

This commit is contained in:
Henning Dieterichs
2026-04-07 17:37:04 +02:00
committed by Henning Dieterichs
parent 706c2ced9e
commit da411733c0
4 changed files with 24 additions and 0 deletions

View File

@@ -480,6 +480,7 @@ export function createEditorServices(disposables: DisposableStore, options?: Cre
definePartialInstance(ISessionsManagementService, {
_serviceBrand: undefined,
activeSession: constObservable(undefined),
getSession: () => undefined,
getSessions: () => [],
});

View File

@@ -48,7 +48,10 @@ function createMockSession(overrides: Partial<IAgentSession> & { label: string;
};
override isArchived(): boolean { return overrides.isArchived?.() ?? false; }
override setArchived(): void { }
override isPinned(): boolean { return overrides.isPinned?.() ?? false; }
override setPinned(): void { }
override isRead(): boolean { return overrides.isRead?.() ?? true; }
override isMarkedUnread(): boolean { return false; }
override setRead(): void { }
}();
}

View File

@@ -51,6 +51,7 @@ function createMockPromptsService(instructionFiles: IFixtureInstructionFile[], a
override readonly onDidChangeCustomAgents = Event.None;
override readonly onDidChangeSlashCommands = Event.None;
override readonly onDidChangeSkills = Event.None;
override readonly onDidChangeInstructions = Event.None;
override getDisabledPromptFiles(): ResourceSet { return new ResourceSet(); }
override async listPromptFiles(type: PromptsType) {
if (type === PromptsType.instructions) {
@@ -60,6 +61,15 @@ function createMockPromptsService(instructionFiles: IFixtureInstructionFile[], a
}
override async listAgentInstructions() { return agentInstructionFiles; }
override async getCustomAgents() { return []; }
override async getInstructionFiles() {
return instructionFiles.map(f => ({
uri: f.promptPath.uri,
name: f.name ?? '',
description: f.description,
storage: f.promptPath.storage,
pattern: f.applyTo,
}));
}
override async parseNew(uri: URI): Promise<ParsedPromptFile> {
const file = instructionFiles.find(f => isEqual(f.promptPath.uri, uri));
const headerLines = [];

View File

@@ -134,6 +134,16 @@ function createMockPromptsService(files: IFixtureFile[], agentInstructions: IAge
return new ParsedPromptFile(uri, header as never);
}
override async getSourceFolders() { return [] as never[]; }
override async getInstructionFiles() {
return files.filter(f => f.type === PromptsType.instructions).map(f => ({
uri: f.uri,
name: f.name ?? '',
description: f.description,
storage: f.storage,
pattern: f.applyTo,
extension: toExtensionInfo(f) as never,
}));
}
override async findAgentSkills(): Promise<IAgentSkill[]> {
return files.filter(f => f.type === PromptsType.skill).map(f => ({
uri: f.uri,