Skip to content

Commit d38b345

Browse files
committed
Fully hide canary features
1 parent 4078a45 commit d38b345

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

extensions/ql-vscode/src/extension.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { CodeQLCliServer, CliVersionConstraint } from './cli';
2323
import {
2424
CliConfigListener,
2525
DistributionConfigListener,
26+
isCanary,
2627
MAX_QUERIES,
2728
QueryHistoryConfigListener,
2829
QueryServerConfigListener
@@ -643,11 +644,15 @@ async function activateWithInstalledDistribution(
643644
}
644645
)
645646
);
647+
// The "run.RemoteQuery" command is internal-only.
646648
ctx.subscriptions.push(
647649
commandRunner('codeQL.runRemoteQuery', async (
648650
uri: Uri | undefined
649651
) => {
650-
await runRemoteQuery(credentials, uri || window.activeTextEditor?.document.uri);
652+
if (isCanary()) {
653+
const credentials = await Credentials.initialize(ctx);
654+
await runRemoteQuery(credentials, uri || window.activeTextEditor?.document.uri);
655+
}
651656
})
652657
);
653658
ctx.subscriptions.push(
@@ -722,17 +727,19 @@ async function activateWithInstalledDistribution(
722727
void helpers.showAndLogInformationMessage(text);
723728
}));
724729

725-
/**
726-
* Credentials for authenticating to GitHub.
727-
* These are used when making API calls.
728-
*/
729-
const credentials = await Credentials.initialize(ctx);
730-
730+
// The "authenticateToGitHub" command is internal-only.
731731
ctx.subscriptions.push(
732732
commandRunner('codeQL.authenticateToGitHub', async () => {
733-
const octokit = await credentials.getOctokit();
734-
const userInfo = await octokit.users.getAuthenticated();
735-
void helpers.showAndLogInformationMessage(`Authenticated to GitHub as user: ${userInfo.data.login}`);
733+
if (isCanary()) {
734+
/**
735+
* Credentials for authenticating to GitHub.
736+
* These are used when making API calls.
737+
*/
738+
const credentials = await Credentials.initialize(ctx);
739+
const octokit = await credentials.getOctokit();
740+
const userInfo = await octokit.users.getAuthenticated();
741+
void helpers.showAndLogInformationMessage(`Authenticated to GitHub as user: ${userInfo.data.login}`);
742+
}
736743
}));
737744

738745
void logger.log('Starting language server.');

0 commit comments

Comments
 (0)