@@ -26,7 +26,6 @@ import {
2626import { resolveFilePath } from './utils' ;
2727import { ITerminalHelper } from '../common/terminal/types' ;
2828import { IRecommendedEnvironmentService } from '../interpreter/configuration/types' ;
29- import { IDiscoveryAPI } from '../pythonEnvironments/base/locator' ;
3029import { CreateVirtualEnvTool } from './createVirtualEnvTool' ;
3130import { SelectPythonEnvTool } from './selectEnvTool' ;
3231
@@ -36,9 +35,9 @@ export class ConfigurePythonEnvTool implements LanguageModelTool<IResourceRefere
3635 private readonly recommendedEnvService : IRecommendedEnvironmentService ;
3736 public static readonly toolName = 'configure_python_environment' ;
3837 constructor (
39- private readonly discoveryApi : IDiscoveryAPI ,
4038 private readonly api : PythonExtension [ 'environments' ] ,
4139 private readonly serviceContainer : IServiceContainer ,
40+ private readonly createVirtualEnvTool : CreateVirtualEnvTool ,
4241 ) {
4342 this . terminalExecutionService = this . serviceContainer . get < TerminalCodeExecutionProvider > (
4443 ICodeExecutionService ,
@@ -78,11 +77,7 @@ export class ConfigurePythonEnvTool implements LanguageModelTool<IResourceRefere
7877
7978 let reason : 'cancelled' | undefined ;
8079 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 )
8681 ) {
8782 reason = 'cancelled' ;
8883 try {
0 commit comments