Skip to content

Commit 9c9a722

Browse files
fix: show export to language icon only when copilot is active VSCODE-655 (#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
1 parent d3d7b81 commit 9c9a722

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@
724724
{
725725
"command": "mdb.selectTargetForExportToLanguage",
726726
"group": "navigation@1",
727-
"when": "mdb.isPlayground == true"
727+
"when": "mdb.isPlayground == true && mdb.isCopilotActive == true"
728728
},
729729
{
730730
"command": "mdb.runPlayground",

src/mdbExtensionController.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ export default class MDBExtensionController implements vscode.Disposable {
168168
this.showOverviewPageIfRecentlyInstalled();
169169
void this.showSurveyForEstablishedUsers();
170170
void this.showCopilotIntroductionForEstablishedUsers();
171+
172+
const copilot = vscode.extensions.getExtension('GitHub.copilot');
173+
void vscode.commands.executeCommand(
174+
'setContext',
175+
'mdb.isCopilotActive',
176+
copilot?.isActive
177+
);
171178
}
172179

173180
registerCommands = (): void => {

src/test/suite/participant/participant.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,8 @@ Schema:
16981698
});
16991699

17001700
suite('export to playground', function () {
1701+
this.timeout(5000);
1702+
17011703
beforeEach(async function () {
17021704
await vscode.commands.executeCommand(
17031705
'workbench.action.files.newUntitledFile'

0 commit comments

Comments
 (0)