3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import { Disposable , IDisposable } from '../../../../base/common/lifecycle.js' ;
6
+ import { Disposable } from '../../../../base/common/lifecycle.js' ;
7
7
import { localize } from '../../../../nls.js' ;
8
- import { MenuId , MenuRegistry , registerAction2 } from '../../../../platform/actions/common/actions.js' ;
8
+ import { registerAction2 } from '../../../../platform/actions/common/actions.js' ;
9
9
import { CommandsRegistry } from '../../../../platform/commands/common/commands.js' ;
10
- import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js' ;
11
10
import { IExtensionManifest } from '../../../../platform/extensions/common/extensions.js' ;
12
11
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js' ;
13
12
import { Registry } from '../../../../platform/registry/common/platform.js' ;
14
13
import { IWorkbenchContribution , WorkbenchPhase , registerWorkbenchContribution2 } from '../../../common/contributions.js' ;
15
14
import { SignOutOfAccountAction } from './actions/signOutOfAccountAction.js' ;
16
- import { IAuthenticationService } from '../../../services/authentication/common/authentication.js' ;
17
15
import { IBrowserWorkbenchEnvironmentService } from '../../../services/environment/browser/environmentService.js' ;
18
16
import { Extensions , IExtensionFeatureTableRenderer , IExtensionFeaturesRegistry , IRenderedData , IRowData , ITableData } from '../../../services/extensionManagement/common/extensionFeatures.js' ;
19
17
import { ManageTrustedExtensionsForAccountAction } from './actions/manageTrustedExtensionsForAccountAction.js' ;
@@ -80,44 +78,14 @@ const extensionFeature = Registry.as<IExtensionFeaturesRegistry>(Extensions.Exte
80
78
class AuthenticationContribution extends Disposable implements IWorkbenchContribution {
81
79
static ID = 'workbench.contrib.authentication' ;
82
80
83
- private _placeholderMenuItem : IDisposable | undefined = MenuRegistry . appendMenuItem ( MenuId . AccountsContext , {
84
- command : {
85
- id : 'noAuthenticationProviders' ,
86
- title : localize ( 'authentication.Placeholder' , "No accounts requested yet..." ) ,
87
- precondition : ContextKeyExpr . false ( )
88
- } ,
89
- } ) ;
90
-
91
- constructor ( @IAuthenticationService private readonly _authenticationService : IAuthenticationService ) {
81
+ constructor ( ) {
92
82
super ( ) ;
93
83
this . _register ( codeExchangeProxyCommand ) ;
94
84
this . _register ( extensionFeature ) ;
95
85
96
- // Clear the placeholder menu item if there are already providers registered.
97
- if ( _authenticationService . getProviderIds ( ) . length ) {
98
- this . _clearPlaceholderMenuItem ( ) ;
99
- }
100
- this . _registerHandlers ( ) ;
101
86
this . _registerActions ( ) ;
102
87
}
103
88
104
- private _registerHandlers ( ) : void {
105
- this . _register ( this . _authenticationService . onDidRegisterAuthenticationProvider ( _e => {
106
- this . _clearPlaceholderMenuItem ( ) ;
107
- } ) ) ;
108
- this . _register ( this . _authenticationService . onDidUnregisterAuthenticationProvider ( _e => {
109
- if ( ! this . _authenticationService . getProviderIds ( ) . length ) {
110
- this . _placeholderMenuItem = MenuRegistry . appendMenuItem ( MenuId . AccountsContext , {
111
- command : {
112
- id : 'noAuthenticationProviders' ,
113
- title : localize ( 'loading' , "Loading..." ) ,
114
- precondition : ContextKeyExpr . false ( )
115
- }
116
- } ) ;
117
- }
118
- } ) ) ;
119
- }
120
-
121
89
private _registerActions ( ) : void {
122
90
this . _register ( registerAction2 ( SignOutOfAccountAction ) ) ;
123
91
this . _register ( registerAction2 ( ManageTrustedExtensionsForAccountAction ) ) ;
@@ -126,11 +94,6 @@ class AuthenticationContribution extends Disposable implements IWorkbenchContrib
126
94
this . _register ( registerAction2 ( ManageAccountPreferencesForMcpServerAction ) ) ;
127
95
this . _register ( registerAction2 ( RemoveDynamicAuthenticationProvidersAction ) ) ;
128
96
}
129
-
130
- private _clearPlaceholderMenuItem ( ) : void {
131
- this . _placeholderMenuItem ?. dispose ( ) ;
132
- this . _placeholderMenuItem = undefined ;
133
- }
134
97
}
135
98
136
99
class AuthenticationUsageContribution implements IWorkbenchContribution {
0 commit comments