Skip to content

Commit 8ba70d8

Browse files
committed
Revert "Make github-authentication a UI extension again"
This reverts commit cd55420. This change seems to have caused issues activating extensions
1 parent 4e96cef commit 8ba70d8

7 files changed

Lines changed: 11 additions & 35 deletions

File tree

extensions/github-authentication/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"categories": [
1212
"Other"
1313
],
14-
"extensionKind": [
15-
"ui",
16-
"workspace",
17-
"web"
18-
],
1914
"activationEvents": [
2015
"*",
2116
"onAuthenticationRequest:github"

src/vs/workbench/api/browser/mainThreadAuthentication.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
249249
}
250250

251251
$ensureProvider(id: string): Promise<void> {
252-
return this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id), true);
252+
return this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id));
253253
}
254254

255255
$sendDidChangeSessions(id: string, event: modes.AuthenticationSessionsChangeEvent): void {

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ export type IResolveAuthorityResult = IResolveAuthorityErrorResult | IResolveAut
10741074
export interface ExtHostExtensionServiceShape {
10751075
$resolveAuthority(remoteAuthority: string, resolveAttempt: number): Promise<IResolveAuthorityResult>;
10761076
$startExtensionHost(enabledExtensionIds: ExtensionIdentifier[]): Promise<void>;
1077-
$activateByEvent(activationEvent: string, eager?: boolean): Promise<void>;
1077+
$activateByEvent(activationEvent: string): Promise<void>;
10781078
$activate(extensionId: ExtensionIdentifier, reason: ExtensionActivationReason): Promise<boolean>;
10791079
$setRemoteEnvironment(env: { [key: string]: string | null; }): Promise<void>;
10801080
$updateRemoteConnectionData(connectionData: IRemoteConnectionData): Promise<void>;

src/vs/workbench/api/common/extHostExtensionService.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
686686
return this._startExtensionHost();
687687
}
688688

689-
public $activateByEvent(activationEvent: string, eager: boolean = true): Promise<void> {
690-
if (eager) {
691-
return this._activateByEvent(activationEvent, false);
692-
}
693-
689+
public $activateByEvent(activationEvent: string): Promise<void> {
694690
return (
695691
this._readyToRunExtensions.wait()
696692
.then(_ => this._activateByEvent(activationEvent, false))

src/vs/workbench/services/extensions/common/abstractExtensionService.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export abstract class AbstractExtensionService extends Disposable implements IEx
186186
this._startExtensionHosts(false, Array.from(this._allRequestedActivateEvents.keys()));
187187
}
188188

189-
public activateByEvent(activationEvent: string, eager?: boolean): Promise<void> {
189+
public activateByEvent(activationEvent: string): Promise<void> {
190190
if (this._installedExtensionsReady.isOpen()) {
191191
// Extensions have been scanned and interpreted
192192

@@ -205,17 +205,13 @@ export abstract class AbstractExtensionService extends Disposable implements IEx
205205
// Record the fact that this activationEvent was requested (in case of a restart)
206206
this._allRequestedActivateEvents.add(activationEvent);
207207

208-
if (eager) {
209-
return this._activateByEvent(activationEvent, eager);
210-
}
211-
212208
return this._installedExtensionsReady.wait().then(() => this._activateByEvent(activationEvent));
213209
}
214210
}
215211

216-
private _activateByEvent(activationEvent: string, eager?: boolean): Promise<void> {
212+
private _activateByEvent(activationEvent: string): Promise<void> {
217213
const result = Promise.all(
218-
this._extensionHostManagers.map(extHostManager => extHostManager.activateByEvent(activationEvent, eager))
214+
this._extensionHostManagers.map(extHostManager => extHostManager.activateByEvent(activationEvent))
219215
).then(() => { });
220216
this._onWillActivateByEvent.fire({
221217
event: activationEvent,

src/vs/workbench/services/extensions/common/extensionHostManager.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export class ExtensionHostManager extends Disposable {
4848
*/
4949
private _proxy: Promise<{ value: ExtHostExtensionServiceShape; } | null> | null;
5050
private _resolveAuthorityAttempt: number;
51-
private _hasStarted = false;
5251

5352
constructor(
5453
extensionHost: IExtensionHost,
@@ -66,7 +65,6 @@ export class ExtensionHostManager extends Disposable {
6665
this.onDidExit = this._extensionHost.onExit;
6766
this._proxy = this._extensionHost.start()!.then(
6867
(protocol) => {
69-
this._hasStarted = true;
7068
return { value: this._createExtensionHostCustomers(protocol) };
7169
},
7270
(err) => {
@@ -219,18 +217,14 @@ export class ExtensionHostManager extends Disposable {
219217
return proxy.$activate(extension, reason);
220218
}
221219

222-
public activateByEvent(activationEvent: string, eager?: boolean): Promise<void> {
223-
if (eager && !this._hasStarted) {
224-
return Promise.resolve();
225-
}
226-
220+
public activateByEvent(activationEvent: string): Promise<void> {
227221
if (!this._cachedActivationEvents.has(activationEvent)) {
228-
this._cachedActivationEvents.set(activationEvent, this._activateByEvent(activationEvent, eager));
222+
this._cachedActivationEvents.set(activationEvent, this._activateByEvent(activationEvent));
229223
}
230224
return this._cachedActivationEvents.get(activationEvent)!;
231225
}
232226

233-
private async _activateByEvent(activationEvent: string, eager?: boolean): Promise<void> {
227+
private async _activateByEvent(activationEvent: string): Promise<void> {
234228
if (!this._proxy) {
235229
return;
236230
}
@@ -240,7 +234,7 @@ export class ExtensionHostManager extends Disposable {
240234
// i.e. the extension host could not be started
241235
return;
242236
}
243-
return proxy.value.$activateByEvent(activationEvent, eager);
237+
return proxy.value.$activateByEvent(activationEvent);
244238
}
245239

246240
public async getInspectPort(tryEnableInspector: boolean): Promise<number> {

src/vs/workbench/services/extensions/common/extensions.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,8 @@ export interface IExtensionService {
177177

178178
/**
179179
* Send an activation event and activate interested extensions.
180-
*
181-
* Normally, this will queue the activation event if the extension hosts are not ready
182-
* and send it to all of them. If the extension needs to be activated before this,
183-
* the eager flag can be used to ignore extension hosts that aren't yet started. Do not
184-
* use this flag unless necessary.
185180
*/
186-
activateByEvent(activationEvent: string, eager?: boolean): Promise<void>;
181+
activateByEvent(activationEvent: string): Promise<void>;
187182

188183
/**
189184
* An promise that resolves when the installed extensions are registered after

0 commit comments

Comments
 (0)