Skip to content

Commit 85b2b6b

Browse files
Use CachingLocator.
1 parent 7a2e014 commit 85b2b6b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/client/pythonEnvironments/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { IServiceContainer, IServiceManager } from '../ioc/types';
66
import { PythonEnvInfo } from './base/info';
77
import { ILocator, IPythonEnvsIterator, PythonLocatorQuery } from './base/locator';
88
import { PythonEnvsChangedEvent } from './base/watcher';
9+
import { CachingLocator } from './collection/cachingLocator';
910
import { ExtensionLocators, WorkspaceLocators } from './discovery/locators';
1011
import { registerForIOC } from './legacyIOC';
1112

@@ -49,11 +50,14 @@ export class PythonEnvironments implements ILocator {
4950
*/
5051
export function createAPI(): [PythonEnvironments, () => void] {
5152
const [locators, activateLocators] = initLocators();
53+
const cache = {}; // This will be filled in once we have it.
54+
const cachingLocator = new CachingLocator(cache!, locators);
5255

5356
return [
54-
new PythonEnvironments(locators),
57+
new PythonEnvironments(cachingLocator),
5558
() => {
5659
activateLocators();
60+
cachingLocator.initialize().ignoreErrors();
5761
// Any other activation needed for the API will go here later.
5862
}
5963
];

0 commit comments

Comments
 (0)