forked from microsoft/vscode-pull-request-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
33 lines (26 loc) · 1.22 KB
/
Copy pathconfig.ts
File metadata and controls
33 lines (26 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import vscode from 'vscode';
import { CODING_AGENT, CODING_AGENT_AUTO_COMMIT_AND_PUSH, CODING_AGENT_ENABLED, CODING_AGENT_PROMPT_FOR_CONFIRMATION } from './settingKeys';
/**
* Handles configuration settings for the Copilot Remote Agent
*/
export namespace CopilotRemoteAgentConfig {
function config() {
return vscode.workspace.getConfiguration(CODING_AGENT);
}
export function getEnabled(): boolean {
return config().get(CODING_AGENT_ENABLED, false);
}
export function getPromptForConfirmation(): boolean {
return config().get(CODING_AGENT_PROMPT_FOR_CONFIRMATION, true);
}
export function getAutoCommitAndPushEnabled(): boolean {
return config().get(CODING_AGENT_AUTO_COMMIT_AND_PUSH, false);
}
export async function disablePromptForConfirmation(): Promise<void> {
await config().update(CODING_AGENT_PROMPT_FOR_CONFIRMATION, false, vscode.ConfigurationTarget.Global);
}
}