Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/chatSessions/copilotcli/vscode-node/commands/addSelection.ts
13406 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 * as vscode from 'vscode';
7
import { ILogger } from '../../../../../platform/log/common/logService';
8
import { ICopilotCLISessionTracker } from '../copilotCLISessionTracker';
9
import { InProcHttpServer } from '../inProcHttpServer';
10
import { sendEditorContextToSession } from './sendContext';
11
12
export const ADD_SELECTION_COMMAND = 'github.copilot.chat.copilotCLI.addSelection';
13
14
export function registerAddSelectionCommand(logger: ILogger, httpServer: InProcHttpServer, sessionTracker: ICopilotCLISessionTracker): vscode.Disposable {
15
return vscode.commands.registerCommand(ADD_SELECTION_COMMAND, async () => {
16
logger.debug('Add selection command executed');
17
await sendEditorContextToSession(logger, httpServer, sessionTracker);
18
});
19
}
20
21