Skip to content

Commit

Permalink
fix: show export to language icon only when copilot is active VSCODE-655
Browse files Browse the repository at this point in the history
 (#882)

* fix: show export to language icon only when copilot is active VSCODE-655

* test: increase timeout for manipulations with a file

* refactor: remove vscode.extensions.onDidChange
  • Loading branch information
alenakhineika authored Nov 25, 2024
1 parent d3d7b81 commit 9c9a722
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
{
"command": "mdb.selectTargetForExportToLanguage",
"group": "navigation@1",
"when": "mdb.isPlayground == true"
"when": "mdb.isPlayground == true && mdb.isCopilotActive == true"
},
{
"command": "mdb.runPlayground",
Expand Down
7 changes: 7 additions & 0 deletions src/mdbExtensionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 2 additions & 0 deletions src/test/suite/participant/participant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,8 @@ Schema:
});

suite('export to playground', function () {
this.timeout(5000);

beforeEach(async function () {
await vscode.commands.executeCommand(
'workbench.action.files.newUntitledFile'
Expand Down

0 comments on commit 9c9a722

Please sign in to comment.