File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
src/client/pythonEnvironments/base Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { chain } from '../../common/utils/async' ;
5
+ import { PythonEnvInfo } from './info' ;
6
+ import { ILocator , PythonEnvsIterator , PythonLocatorQuery } from './locator' ;
7
+ import { PythonEnvsWatchers } from './watchers' ;
8
+
9
+ /**
10
+ * A wrapper around a set of locators.
11
+ *
12
+ * Events and iterator results are combined.
13
+ */
14
+ export class Locators extends PythonEnvsWatchers {
15
+ constructor (
16
+ // The locators will be watched as well as iterated.
17
+ private readonly locators : ReadonlyArray < ILocator >
18
+ ) {
19
+ super ( locators ) ;
20
+ }
21
+
22
+ public iterEnvs ( query ?: PythonLocatorQuery ) : PythonEnvsIterator {
23
+ const iterators = this . locators . map ( ( loc ) => loc . iterEnvs ( query ) ) ;
24
+ return chain < PythonEnvInfo > ( iterators ) ;
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments