11// tslint:disable:no-require-imports no-var-requires no-unnecessary-callback-wrapper
2+ // tslint:disable-next-line:no-single-line-block-comment
3+ /* eslint-disable max-classes-per-file */
4+
25import { inject , injectable } from 'inversify' ;
36import * as path from 'path' ;
4- import { Uri } from 'vscode' ;
57import { IFileSystem , IPlatformService } from '../../../../common/platform/types' ;
68import { ICurrentProcess , IPathUtils } from '../../../../common/types' ;
79import { IInterpreterHelper , IKnownSearchPathsForInterpreters } from '../../../../interpreter/contracts' ;
@@ -10,6 +12,7 @@ import { EnvironmentType, PythonEnvironment } from '../../../info';
1012import { lookForInterpretersInDirectory } from '../helpers' ;
1113import { CacheableLocatorService } from './cacheableLocatorService' ;
1214
15+ // eslint-disable-next-line global-require
1316const flatten = require ( 'lodash/flatten' ) as typeof import ( 'lodash/flatten' ) ;
1417
1518/**
@@ -30,15 +33,17 @@ export class KnownPathsService extends CacheableLocatorService {
3033 *
3134 * Called by VS Code to indicate it is done with the resource.
3235 */
33- // tslint:disable-next-line:no-empty
34- public dispose ( ) { }
36+ // tslint:disable:no-empty
37+ // eslint-disable-next-line @typescript-eslint/no-empty-function,class-methods-use-this
38+ public dispose ( ) : void { }
39+ // tslint:enable:no-empty
3540
3641 /**
3742 * Return the located interpreters.
3843 *
3944 * This is used by CacheableLocatorService.getInterpreters().
4045 */
41- protected getInterpretersImplementation ( _resource ?: Uri ) : Promise < PythonEnvironment [ ] > {
46+ protected getInterpretersImplementation ( ) : Promise < PythonEnvironment [ ] > {
4247 return this . suggestionsFromKnownPaths ( ) ;
4348 }
4449
@@ -66,7 +71,7 @@ export class KnownPathsService extends CacheableLocatorService {
6671 private async getInterpreterDetails ( interpreter : string ) {
6772 const details = await this . helper . getInterpreterInformation ( interpreter ) ;
6873 if ( ! details ) {
69- return ;
74+ return undefined ;
7075 }
7176 this . _hasInterpreters . resolve ( true ) ;
7277 return {
@@ -109,7 +114,7 @@ export class KnownSearchPathsForInterpreters implements IKnownSearchPathsForInte
109114 searchPaths . push ( path . join ( pathUtils . home , p ) ) ;
110115 } ) ;
111116 // Add support for paths such as /Users/xxx/anaconda/bin.
112- if ( process . env . HOME ) {
117+ if ( pathUtils . home && pathUtils . home !== '' ) {
113118 searchPaths . push ( path . join ( pathUtils . home , 'anaconda' , 'bin' ) ) ;
114119 searchPaths . push ( path . join ( pathUtils . home , 'python' , 'bin' ) ) ;
115120 }
0 commit comments