@@ -23,6 +23,7 @@ import { CodeQLCliServer, CliVersionConstraint } from './cli';
2323import {
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 "runRemoteQuery" 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