Skip to content

Commit 984799a

Browse files
author
Kartik Raj
committed
Fix for "Python extension loading..." text never disappears (#14969)
* Fix event * Explicitly activate component adapter * Fix lint error
1 parent d775d8f commit 984799a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/client/extensionActivation.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
import { CodeActionKind, debug, DebugConfigurationProvider, languages, OutputChannel, window } from 'vscode';
99

1010
import { registerTypes as activationRegisterTypes } from './activation/serviceRegistry';
11-
import { IExtensionActivationManager, ILanguageServerExtension } from './activation/types';
11+
import {
12+
IExtensionActivationManager,
13+
IExtensionSingleActivationService,
14+
ILanguageServerExtension
15+
} from './activation/types';
1216
import { registerTypes as appRegisterTypes } from './application/serviceRegistry';
1317
import { IApplicationDiagnostics } from './application/types';
1418
import { DebugService } from './common/application/debugService';
@@ -38,6 +42,7 @@ import { registerTypes as debugConfigurationRegisterTypes } from './debugger/ext
3842
import { IDebugConfigurationService, IDebuggerBanner } from './debugger/extension/types';
3943
import { registerTypes as formattersRegisterTypes } from './formatters/serviceRegistry';
4044
import {
45+
IComponentAdapter,
4146
IInterpreterLocatorProgressHandler,
4247
IInterpreterLocatorProgressService,
4348
IInterpreterService
@@ -153,6 +158,11 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
153158

154159
// "initialize" "services"
155160

161+
// There's a bug now due to which IExtensionSingleActivationService is only activated in background.
162+
// However for some cases particularly IComponentAdapter we need to block on activation before rest
163+
// of the extension is activated. Hence explicitly activate it for now.
164+
await serviceContainer.get<IExtensionSingleActivationService>(IComponentAdapter).activate();
165+
156166
const interpreterManager = serviceContainer.get<IInterpreterService>(IInterpreterService);
157167
interpreterManager.initialize();
158168

src/client/pythonEnvironments/legacyIOC.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class ComponentAdapter implements IComponentAdapter, IExtensionSingleActivationS
171171
}
172172

173173
public get onRefreshed(): vscode.Event<void> | undefined {
174-
return this.enabled ? this.refreshing.event : undefined;
174+
return this.enabled ? this.refreshed.event : undefined;
175175
}
176176

177177
// IInterpreterHelper

0 commit comments

Comments
 (0)