File tree Expand file tree Collapse file tree 5 files changed +12
-10
lines changed Expand file tree Collapse file tree 5 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ export class OpenCloudPatchCommand extends Command {
344344 return ;
345345 }
346346
347- const session = await integration . getSession ( ) ;
347+ const session = await integration . getSession ( 'cloud-patches' ) ;
348348 if ( session == null ) {
349349 void window . showErrorMessage ( `Cannot open ${ type } ; provider not connected.` ) ;
350350 return ;
Original file line number Diff line number Diff line change @@ -766,7 +766,7 @@ export class DraftService implements Disposable {
766766 }
767767 if ( integration == null ) return undefined ;
768768
769- const session = await integration . getSession ( ) ;
769+ const session = await integration . getSession ( 'code-suggest' ) ;
770770 if ( session == null ) return undefined ;
771771
772772 return {
Original file line number Diff line number Diff line change @@ -129,15 +129,15 @@ export abstract class IntegrationBase<
129129 }
130130
131131 protected _session : ProviderAuthenticationSession | null | undefined ;
132- getSession ( ) {
132+ getSession ( source : Sources ) {
133133 if ( this . _session === undefined ) {
134- return this . ensureSession ( { createIfNeeded : false } ) ;
134+ return this . ensureSession ( { createIfNeeded : false , source : source } ) ;
135135 }
136136 return this . _session ?? undefined ;
137137 }
138138
139139 @log ( )
140- async connect ( source ? : Sources ) : Promise < boolean > {
140+ async connect ( source : Sources ) : Promise < boolean > {
141141 try {
142142 return Boolean ( await this . ensureSession ( { createIfNeeded : true , source : source } ) ) ;
143143 } catch ( ex ) {
@@ -290,7 +290,7 @@ export abstract class IntegrationBase<
290290 @gate ( )
291291 @debug ( { exit : true } )
292292 async isConnected ( ) : Promise < boolean > {
293- return ( await this . getSession ( ) ) != null ;
293+ return ( await this . getSession ( 'integrations' ) ) != null ;
294294 }
295295
296296 @gate ( )
Original file line number Diff line number Diff line change 11import type { AuthenticationSession , CancellationToken } from 'vscode' ;
2+ import type { Sources } from '../../../constants' ;
23import type { Container } from '../../../container' ;
34import type { Account , UnidentifiedAuthor } from '../../../git/models/author' ;
45import type { DefaultBranch } from '../../../git/models/defaultBranch' ;
@@ -302,7 +303,7 @@ export class GitHubEnterpriseIntegration extends GitHubIntegrationBase<SelfHoste
302303 }
303304
304305 @log ( )
305- override async connect ( ) : Promise < boolean > {
306+ override async connect ( source : Sources ) : Promise < boolean > {
306307 if (
307308 ! ( await ensurePaidPlan ( this . container , `Rich integration with ${ this . name } is a Pro feature.` , {
308309 source : 'integrations' ,
@@ -312,6 +313,6 @@ export class GitHubEnterpriseIntegration extends GitHubIntegrationBase<SelfHoste
312313 return false ;
313314 }
314315
315- return super . connect ( ) ;
316+ return super . connect ( source ) ;
316317 }
317318}
Original file line number Diff line number Diff line change 11import type { AuthenticationSession , CancellationToken } from 'vscode' ;
22import { window } from 'vscode' ;
3+ import type { Sources } from '../../../constants' ;
34import type { Container } from '../../../container' ;
45import type { Account } from '../../../git/models/author' ;
56import type { DefaultBranch } from '../../../git/models/defaultBranch' ;
@@ -349,7 +350,7 @@ export class GitLabSelfHostedIntegration extends GitLabIntegrationBase<SelfHoste
349350 }
350351
351352 @log ( )
352- override async connect ( ) : Promise < boolean > {
353+ override async connect ( source : Sources ) : Promise < boolean > {
353354 if (
354355 ! ( await ensurePaidPlan ( this . container , `Rich integration with ${ this . name } is a Pro feature.` , {
355356 source : 'integrations' ,
@@ -359,6 +360,6 @@ export class GitLabSelfHostedIntegration extends GitLabIntegrationBase<SelfHoste
359360 return false ;
360361 }
361362
362- return super . connect ( ) ;
363+ return super . connect ( source ) ;
363364 }
364365}
You can’t perform that action at this time.
0 commit comments