mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
Merge pull request #304863 from mjbvz/dev/mjbvz/xenacious-roundworm
Remove unused `hasAnySessionOptions` method
This commit is contained in:
@@ -909,47 +909,6 @@ suite('MainThreadChatSessions', function () {
|
||||
|
||||
mainThread.$unregisterChatSessionContentProvider(1);
|
||||
});
|
||||
|
||||
test('hasAnySessionOptions returns correct values', async function () {
|
||||
const sessionScheme = 'test-session-type';
|
||||
mainThread.$registerChatSessionContentProvider(1, sessionScheme);
|
||||
|
||||
const resourceWithOptions = URI.parse(`${sessionScheme}:/session-with-options`);
|
||||
const resourceWithoutOptions = URI.parse(`${sessionScheme}:/session-without-options`);
|
||||
|
||||
// Session with options
|
||||
const sessionContentWithOptions: IChatSessionDto = {
|
||||
resource: resourceWithOptions,
|
||||
history: [],
|
||||
hasActiveResponseCallback: false,
|
||||
hasRequestHandler: false,
|
||||
hasForkHandler: false,
|
||||
supportsInterruption: false,
|
||||
options: { 'models': 'gpt-4' }
|
||||
};
|
||||
|
||||
// Session without options
|
||||
const sessionContentWithoutOptions: IChatSessionDto = {
|
||||
resource: resourceWithoutOptions,
|
||||
history: [],
|
||||
hasActiveResponseCallback: false,
|
||||
hasRequestHandler: false,
|
||||
hasForkHandler: false,
|
||||
supportsInterruption: false,
|
||||
};
|
||||
|
||||
asSinonMethodStub(proxy.$provideChatSessionContent)
|
||||
.onFirstCall().resolves(sessionContentWithOptions)
|
||||
.onSecondCall().resolves(sessionContentWithoutOptions);
|
||||
|
||||
await chatSessionsService.getOrCreateChatSession(resourceWithOptions, CancellationToken.None);
|
||||
await chatSessionsService.getOrCreateChatSession(resourceWithoutOptions, CancellationToken.None);
|
||||
|
||||
assert.strictEqual(chatSessionsService.hasAnySessionOptions(resourceWithOptions), true);
|
||||
assert.strictEqual(chatSessionsService.hasAnySessionOptions(resourceWithoutOptions), false);
|
||||
|
||||
mainThread.$unregisterChatSessionContentProvider(1);
|
||||
});
|
||||
});
|
||||
|
||||
suite('ExtHostChatSessions', function () {
|
||||
|
||||
@@ -361,7 +361,6 @@ export interface IChatSessionsService {
|
||||
canResolveChatSession(sessionType: string): Promise<boolean>;
|
||||
getOrCreateChatSession(sessionResource: URI, token: CancellationToken): Promise<IChatSession>;
|
||||
|
||||
hasAnySessionOptions(sessionResource: URI): boolean;
|
||||
getSessionOptions(sessionResource: URI): ReadonlyChatSessionOptionsMap | undefined;
|
||||
getSessionOption(sessionResource: URI, optionId: string): string | IChatSessionProviderOptionItem | undefined;
|
||||
setSessionOption(sessionResource: URI, optionId: string, value: string | IChatSessionProviderOptionItem): boolean;
|
||||
|
||||
@@ -202,10 +202,6 @@ export class MockChatSessionsService implements IChatSessionsService {
|
||||
return true;
|
||||
}
|
||||
|
||||
hasAnySessionOptions(resource: URI): boolean {
|
||||
return this.sessionOptions.has(resource) && this.sessionOptions.get(resource)!.size > 0;
|
||||
}
|
||||
|
||||
getCapabilitiesForSessionType(chatSessionType: string): IChatAgentAttachmentCapabilities | undefined {
|
||||
return this.contributions.find(c => c.type === chatSessionType)?.capabilities;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user