@@ -26,7 +26,6 @@ import {
26
26
import { resolveFilePath } from './utils' ;
27
27
import { ITerminalHelper } from '../common/terminal/types' ;
28
28
import { IRecommendedEnvironmentService } from '../interpreter/configuration/types' ;
29
- import { IDiscoveryAPI } from '../pythonEnvironments/base/locator' ;
30
29
import { CreateVirtualEnvTool } from './createVirtualEnvTool' ;
31
30
import { SelectPythonEnvTool } from './selectEnvTool' ;
32
31
@@ -36,9 +35,9 @@ export class ConfigurePythonEnvTool implements LanguageModelTool<IResourceRefere
36
35
private readonly recommendedEnvService : IRecommendedEnvironmentService ;
37
36
public static readonly toolName = 'configure_python_environment' ;
38
37
constructor (
39
- private readonly discoveryApi : IDiscoveryAPI ,
40
38
private readonly api : PythonExtension [ 'environments' ] ,
41
39
private readonly serviceContainer : IServiceContainer ,
40
+ private readonly createVirtualEnvTool : CreateVirtualEnvTool ,
42
41
) {
43
42
this . terminalExecutionService = this . serviceContainer . get < TerminalCodeExecutionProvider > (
44
43
ICodeExecutionService ,
@@ -78,11 +77,7 @@ export class ConfigurePythonEnvTool implements LanguageModelTool<IResourceRefere
78
77
79
78
let reason : 'cancelled' | undefined ;
80
79
if (
81
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
82
- await new CreateVirtualEnvTool ( this . discoveryApi , this . api , this . serviceContainer ) . canCreateNewVirtualEnv (
83
- resolveFilePath ( options . input . resourcePath ) ,
84
- token ,
85
- )
80
+ await this . createVirtualEnvTool . canCreateNewVirtualEnv ( resolveFilePath ( options . input . resourcePath ) , token )
86
81
) {
87
82
reason = 'cancelled' ;
88
83
try {
0 commit comments