22// Licensed under the MIT License.
33
44import * as path from 'path' ;
5- import { Uri } from 'vscode' ;
65import { chain , iterable } from '../../../../common/utils/async' ;
76import { findInterpretersInDir , looksLikeBasicVirtualPython } from '../../../common/commonUtils' ;
87import { pathExists } from '../../../common/externalDependencies' ;
@@ -54,9 +53,9 @@ async function getVirtualEnvKind(interpreterPath: string): Promise<PythonEnvKind
5453export class WorkspaceVirtualEnvironmentLocator extends FSWatchingLocator {
5554 public readonly providerId : string = 'workspaceVirtualEnvLocator' ;
5655
57- public constructor ( private readonly root : Uri ) {
56+ public constructor ( private readonly root : string ) {
5857 super (
59- ( ) => ( this . root . scheme === 'file' ? getWorkspaceVirtualEnvDirs ( this . root . fsPath ) : [ ] ) ,
58+ ( ) => getWorkspaceVirtualEnvDirs ( this . root ) ,
6059 getVirtualEnvKind ,
6160 {
6261 // Note detecting kind of virtual env depends on the file structure around the
@@ -68,8 +67,8 @@ export class WorkspaceVirtualEnvironmentLocator extends FSWatchingLocator {
6867 }
6968
7069 protected doIterEnvs ( ) : IPythonEnvsIterator < BasicEnvInfo > {
71- async function * iterator ( root : Uri ) {
72- const envRootDirs = root . scheme === 'file' ? await getWorkspaceVirtualEnvDirs ( root . fsPath ) : [ ] ;
70+ async function * iterator ( root : string ) {
71+ const envRootDirs = await getWorkspaceVirtualEnvDirs ( root ) ;
7372 const envGenerators = envRootDirs . map ( ( envRootDir ) => {
7473 async function * generator ( ) {
7574 traceVerbose ( `Searching for workspace virtual envs in: ${ envRootDir } ` ) ;
0 commit comments