diff --git a/package.json b/package.json index aa670b06c..22a9633aa 100644 --- a/package.json +++ b/package.json @@ -724,7 +724,7 @@ { "command": "mdb.selectTargetForExportToLanguage", "group": "navigation@1", - "when": "mdb.isPlayground == true" + "when": "mdb.isPlayground == true && mdb.isCopilotActive == true" }, { "command": "mdb.runPlayground", diff --git a/src/mdbExtensionController.ts b/src/mdbExtensionController.ts index 55ec199f4..f4f73262d 100644 --- a/src/mdbExtensionController.ts +++ b/src/mdbExtensionController.ts @@ -168,6 +168,13 @@ export default class MDBExtensionController implements vscode.Disposable { this.showOverviewPageIfRecentlyInstalled(); void this.showSurveyForEstablishedUsers(); void this.showCopilotIntroductionForEstablishedUsers(); + + const copilot = vscode.extensions.getExtension('GitHub.copilot'); + void vscode.commands.executeCommand( + 'setContext', + 'mdb.isCopilotActive', + copilot?.isActive + ); } registerCommands = (): void => { diff --git a/src/test/suite/participant/participant.test.ts b/src/test/suite/participant/participant.test.ts index 5be22ddf5..ce89bf105 100644 --- a/src/test/suite/participant/participant.test.ts +++ b/src/test/suite/participant/participant.test.ts @@ -1698,6 +1698,8 @@ Schema: }); suite('export to playground', function () { + this.timeout(5000); + beforeEach(async function () { await vscode.commands.executeCommand( 'workbench.action.files.newUntitledFile'