File tree Expand file tree Collapse file tree
src/client/pythonEnvironments Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import * as vscode from 'vscode' ;
55import { IServiceContainer , IServiceManager } from '../ioc/types' ;
6+ import { EmptyCache } from './base/cache' ;
67import { PythonEnvInfo } from './base/info' ;
78import { ILocator , IPythonEnvsIterator , PythonLocatorQuery } from './base/locator' ;
9+ import { CachingLocator } from './base/locators/composite/cachingLocator' ;
810import { PythonEnvsChangedEvent } from './base/watcher' ;
911import { ExtensionLocators , WorkspaceLocators } from './discovery/locators' ;
1012import { registerForIOC } from './legacyIOC' ;
@@ -49,11 +51,15 @@ export class PythonEnvironments implements ILocator {
4951 */
5052export 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 ] ;
You can’t perform that action at this time.
0 commit comments