@@ -12,7 +12,7 @@ import { ExtHostAuthenticationShape, ExtHostContext, IExtHostContext, MainContex
1212import { IDialogService } from 'vs/platform/dialogs/common/dialogs' ;
1313import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
1414import Severity from 'vs/base/common/severity' ;
15- import { MenuRegistry , MenuId , IMenuItem } from 'vs/platform/actions/common/actions' ;
15+ import { MenuRegistry , MenuId } from 'vs/platform/actions/common/actions' ;
1616import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
1717import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput' ;
1818import { INotificationService } from 'vs/platform/notification/common/notification' ;
@@ -57,14 +57,11 @@ export class MainThreadAuthenticationProvider extends Disposable {
5757 private _sessionMenuItems = new Map < string , IDisposable [ ] > ( ) ;
5858 private _accounts = new Map < string , string [ ] > ( ) ; // Map account name to session ids
5959 private _sessions = new Map < string , string > ( ) ; // Map account id to name
60- private _signInMenuItem : IMenuItem | undefined ;
61- private _signInMenuDisposables : IDisposable [ ] = [ ] ;
6260
6361 constructor (
6462 private readonly _proxy : ExtHostAuthenticationShape ,
6563 public readonly id : string ,
6664 public readonly displayName : string ,
67- private readonly supportsMultipleAccounts : boolean ,
6865 private readonly notificationService : INotificationService
6966 ) {
7067 super ( ) ;
@@ -248,27 +245,14 @@ export class MainThreadAuthenticationProvider extends Disposable {
248245 this . _sessionMenuItems . delete ( accountName ) ;
249246 }
250247 this . _accounts . delete ( accountName ) ;
251-
252- if ( this . _signInMenuItem ) {
253- this . _signInMenuItem . command . title = nls . localize ( 'addAccount' , "Sign in to {0}" , this . displayName ) ;
254- }
255248 }
256249 }
257250 } ) ;
258251
259252 addedSessions . forEach ( session => this . registerSession ( session ) ) ;
260-
261- if ( addedSessions . length && this . _signInMenuItem ) {
262- if ( this . supportsMultipleAccounts ) {
263- this . _signInMenuItem . command . title = nls . localize ( 'addAnotherAccount' , "Sign in to another {0} account" , this . displayName ) ;
264- } else {
265- this . _signInMenuDisposables . forEach ( item => item . dispose ( ) ) ;
266- this . _signInMenuItem = undefined ;
267- }
268- }
269253 }
270254
271- login ( scopes ? : string [ ] ) : Promise < modes . AuthenticationSession > {
255+ login ( scopes : string [ ] ) : Promise < modes . AuthenticationSession > {
272256 return this . _proxy . $login ( this . id , scopes ) . then ( session => {
273257 return {
274258 id : session . id ,
@@ -287,7 +271,6 @@ export class MainThreadAuthenticationProvider extends Disposable {
287271 super . dispose ( ) ;
288272 this . _sessionMenuItems . forEach ( item => item . forEach ( d => d . dispose ( ) ) ) ;
289273 this . _sessionMenuItems . clear ( ) ;
290- this . _signInMenuDisposables . forEach ( item => item . dispose ( ) ) ;
291274 }
292275}
293276
@@ -306,8 +289,8 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
306289 this . _proxy = extHostContext . getProxy ( ExtHostContext . ExtHostAuthentication ) ;
307290 }
308291
309- async $registerAuthenticationProvider ( id : string , displayName : string , supportsMultipleAccounts : boolean ) : Promise < void > {
310- const provider = new MainThreadAuthenticationProvider ( this . _proxy , id , displayName , supportsMultipleAccounts , this . notificationService ) ;
292+ async $registerAuthenticationProvider ( id : string , displayName : string ) : Promise < void > {
293+ const provider = new MainThreadAuthenticationProvider ( this . _proxy , id , displayName , this . notificationService ) ;
311294 await provider . initialize ( ) ;
312295 this . authenticationService . registerAuthenticationProvider ( id , provider ) ;
313296 }
0 commit comments