Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.ts
13401 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 { Event } from '../../../../base/common/event.js';
7
import { URI } from '../../../../base/common/uri.js';
8
import { IActiveCodeEditor, ICodeEditor } from '../../../../editor/browser/editorBrowser.js';
9
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
10
import { IInlineChatSession, IInlineChatSessionService } from '../../../../workbench/contrib/inlineChat/browser/inlineChatSessionService.js';
11
12
class NullInlineChatSessionService implements IInlineChatSessionService {
13
declare _serviceBrand: undefined;
14
15
readonly onWillStartSession: Event<IActiveCodeEditor> = Event.None;
16
readonly onDidChangeSessions: Event<this> = Event.None;
17
18
dispose(): void { }
19
20
createSession(_editor: ICodeEditor): IInlineChatSession {
21
throw new Error('Inline chat sessions are not supported in the sessions window');
22
}
23
24
getSessionByTextModel(_uri: URI): IInlineChatSession | undefined {
25
return undefined;
26
}
27
28
getSessionBySessionUri(_uri: URI): IInlineChatSession | undefined {
29
return undefined;
30
}
31
}
32
33
registerSingleton(IInlineChatSessionService, NullInlineChatSessionService, InstantiationType.Delayed);
34
35