Skip to content

Commit fd1c006

Browse files
Add a noop envs cache implementation.
1 parent a7b8cd6 commit fd1c006

File tree

1 file changed

+30
-0
lines changed
  • src/client/pythonEnvironments/base

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
import { PythonEnvInfo } from './info';
5+
import { IPythonEnvsCache } from './locators/composite/cachingLocator';
6+
7+
/**
8+
* A rudimentary empty cache.
9+
*/
10+
export class EmptyCache implements IPythonEnvsCache {
11+
public async initialize(): Promise<void> {
12+
// Do nothing!
13+
}
14+
15+
public getAllEnvs(): PythonEnvInfo[] | undefined {
16+
return undefined;
17+
}
18+
19+
public matchEnv(_env: Partial<PythonEnvInfo>): PythonEnvInfo[] {
20+
return [];
21+
}
22+
23+
public setAllEnvs(_envs: PythonEnvInfo[]): void {
24+
// Do nothing!
25+
}
26+
27+
public async flush(): Promise<void> {
28+
// Do nothing!
29+
}
30+
}

0 commit comments

Comments
 (0)