Skip to content

Commit 5fabd2a

Browse files
Use CachingLocator.
1 parent fd1c006 commit 5fabd2a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/client/pythonEnvironments/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
import * as vscode from 'vscode';
55
import { IServiceContainer, IServiceManager } from '../ioc/types';
6+
import { EmptyCache } from './base/cache';
67
import { PythonEnvInfo } from './base/info';
78
import { ILocator, IPythonEnvsIterator, PythonLocatorQuery } from './base/locator';
9+
import { CachingLocator } from './base/locators/composite/cachingLocator';
810
import { PythonEnvsChangedEvent } from './base/watcher';
911
import { ExtensionLocators, WorkspaceLocators } from './discovery/locators';
1012
import { registerForIOC } from './legacyIOC';
@@ -49,11 +51,15 @@ export class PythonEnvironments implements ILocator {
4951
*/
5052
export function createAPI(): [PythonEnvironments, () => void] {
5153
const [locators, activateLocators] = initLocators();
54+
// For now we use a noop cache.
55+
const cache = new EmptyCache();
56+
const cachingLocator = new CachingLocator(cache, locators);
5257

5358
return [
54-
new PythonEnvironments(locators),
59+
new PythonEnvironments(cachingLocator),
5560
() => {
5661
activateLocators();
62+
cachingLocator.initialize().ignoreErrors();
5763
// Any other activation needed for the API will go here later.
5864
}
5965
];

0 commit comments

Comments
 (0)