File tree 1 file changed +7
-1
lines changed
src/client/pythonEnvironments
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import * as vscode from 'vscode' ;
5
5
import { IServiceContainer , IServiceManager } from '../ioc/types' ;
6
+ import { EmptyCache } from './base/cache' ;
6
7
import { PythonEnvInfo } from './base/info' ;
7
8
import { ILocator , IPythonEnvsIterator , PythonLocatorQuery } from './base/locator' ;
9
+ import { CachingLocator } from './base/locators/composite/cachingLocator' ;
8
10
import { PythonEnvsChangedEvent } from './base/watcher' ;
9
11
import { ExtensionLocators , WorkspaceLocators } from './discovery/locators' ;
10
12
import { registerForIOC } from './legacyIOC' ;
@@ -49,11 +51,15 @@ export class PythonEnvironments implements ILocator {
49
51
*/
50
52
export function createAPI ( ) : [ PythonEnvironments , ( ) => void ] {
51
53
const [ locators , activateLocators ] = initLocators ( ) ;
54
+ // For now we use a noop cache.
55
+ const cache = new EmptyCache ( ) ;
56
+ const cachingLocator = new CachingLocator ( cache , locators ) ;
52
57
53
58
return [
54
- new PythonEnvironments ( locators ) ,
59
+ new PythonEnvironments ( cachingLocator ) ,
55
60
( ) => {
56
61
activateLocators ( ) ;
62
+ cachingLocator . initialize ( ) . ignoreErrors ( ) ;
57
63
// Any other activation needed for the API will go here later.
58
64
}
59
65
] ;
You can’t perform that action at this time.
0 commit comments