Skip to content

Commit 2cc172b

Browse files
authored
Add activated context (#8388)
Part of microsoft/vscode#282428
1 parent b272691 commit 2cc172b

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,12 +3731,12 @@
37313731
{
37323732
"command": "pr.checkoutFromDescription",
37333733
"group": "navigation@0",
3734-
"when": "chatSessionType == copilot-cloud-agent && workspaceFolderCount > 0"
3734+
"when": "chatSessionType == copilot-cloud-agent && workspaceFolderCount > 0 && github.vscode-pull-request-github.activated"
37353735
},
37363736
{
37373737
"command": "pr.applyChangesFromDescription",
37383738
"group": "navigation@1",
3739-
"when": "chatSessionType == copilot-cloud-agent && workspaceFolderCount > 0"
3739+
"when": "chatSessionType == copilot-cloud-agent && workspaceFolderCount > 0 && github.vscode-pull-request-github.activated"
37403740
}
37413741
]
37423742
},

src/common/executeCommands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export namespace contexts {
2020
export const ACTIVE_COMMENT_HAS_SUGGESTION = 'github:activeCommentHasSuggestion'; // Boolean indicating if the active comment has a suggestion
2121
export const CREATING = 'pr:creating';
2222
export const NOTIFICATION_COUNT = 'github:notificationCount'; // Number of notifications in the notifications view
23+
export const ACTIVATED = 'github.vscode-pull-request-github.activated'; // Boolean indicating if the extension has been activated
2324
}
2425

2526
export namespace commands {

src/extension.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { PostCommitCommandsProvider, Repository } from './api/api';
1111
import { GitApiImpl } from './api/api1';
1212
import { registerCommands } from './commands';
1313
import { COPILOT_SWE_AGENT } from './common/copilot';
14-
import { commands } from './common/executeCommands';
14+
import { commands, contexts } from './common/executeCommands';
1515
import { isSubmodule } from './common/gitUtils';
1616
import Logger from './common/logger';
1717
import * as PersistentState from './common/persistentState';
@@ -341,7 +341,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<GitApi
341341
telemetry = new ExperimentationTelemetry(new TelemetryReporter(ingestionKey));
342342
context.subscriptions.push(telemetry);
343343

344-
return await deferredActivate(context, showPRController);
344+
const deferred = await deferredActivate(context, showPRController);
345+
await commands.setContext(contexts.ACTIVATED, true);
346+
return deferred;
345347
}
346348

347349
async function setGitSettingContexts(context: vscode.ExtensionContext) {

0 commit comments

Comments
 (0)