4
4
import { injectable } from 'inversify' ;
5
5
import { intersection } from 'lodash' ;
6
6
import * as vscode from 'vscode' ;
7
- import { IExtensionSingleActivationService } from '../activation/types' ;
8
7
import { DiscoveryVariants } from '../common/experiments/groups' ;
9
8
import { traceError } from '../common/logger' ;
10
9
import { FileChangeType } from '../common/platform/fileSystemWatcher' ;
11
- import { IDisposableRegistry , Resource } from '../common/types' ;
10
+ import { Resource } from '../common/types' ;
12
11
import {
13
12
CONDA_ENV_FILE_SERVICE ,
14
13
CONDA_ENV_SERVICE ,
@@ -69,6 +68,7 @@ import { EnvironmentType, PythonEnvironment } from './info';
69
68
import { EnvironmentsSecurity , IEnvironmentsSecurity } from './security' ;
70
69
import { toSemverLikeVersion } from './base/info/pythonVersion' ;
71
70
import { PythonVersion } from './info/pythonVersion' ;
71
+ import { IExtensionSingleActivationService } from '../activation/types' ;
72
72
73
73
const convertedKinds = new Map (
74
74
Object . entries ( {
@@ -136,7 +136,7 @@ export async function isComponentEnabled(): Promise<boolean> {
136
136
interface IPythonEnvironments extends ILocator { }
137
137
138
138
@injectable ( )
139
- class ComponentAdapter implements IComponentAdapter , IExtensionSingleActivationService {
139
+ class ComponentAdapter implements IComponentAdapter {
140
140
private readonly refreshing = new vscode . EventEmitter < void > ( ) ;
141
141
142
142
private readonly refreshed = new vscode . EventEmitter < void > ( ) ;
@@ -147,23 +147,8 @@ class ComponentAdapter implements IComponentAdapter, IExtensionSingleActivationS
147
147
// The adapter only wraps one thing: the component API.
148
148
private readonly api : IPythonEnvironments ,
149
149
private readonly environmentsSecurity : IEnvironmentsSecurity ,
150
- private readonly disposables : IDisposableRegistry ,
151
150
) { }
152
151
153
- public async activate ( ) : Promise < void > {
154
- this . disposables . push (
155
- this . api . onChanged ( ( e ) => {
156
- const query = {
157
- kinds : e . kind ? [ e . kind ] : undefined ,
158
- searchLocations : e . searchLocation ? { roots : [ e . searchLocation ] } : undefined ,
159
- ignoreCache : true ,
160
- } ;
161
- // Trigger a background refresh of the environments.
162
- getEnvs ( this . api . iterEnvs ( query ) ) . ignoreErrors ( ) ;
163
- } ) ,
164
- ) ;
165
- }
166
-
167
152
// For use in VirtualEnvironmentPrompt.activate()
168
153
169
154
// Call callback if an environment gets created within the resource provided.
@@ -437,11 +422,9 @@ export function registerNewDiscoveryForIOC(
437
422
serviceManager : IServiceManager ,
438
423
api : IPythonEnvironments ,
439
424
environmentsSecurity : EnvironmentsSecurity ,
440
- disposables : IDisposableRegistry ,
441
425
) : void {
442
426
serviceManager . addSingletonInstance < IComponentAdapter > (
443
427
IComponentAdapter ,
444
- new ComponentAdapter ( api , environmentsSecurity , disposables ) ,
428
+ new ComponentAdapter ( api , environmentsSecurity ) ,
445
429
) ;
446
- serviceManager . addBinding ( IComponentAdapter , IExtensionSingleActivationService ) ;
447
430
}
0 commit comments