@@ -13,10 +13,10 @@ import {
13
13
import { ConfigurationItem } from 'vscode-languageserver-protocol' ;
14
14
15
15
import { HiddenFilePrefix } from '../common/constants' ;
16
- import { IConfigurationService } from '../common/types' ;
17
16
import { createDeferred , isThenable } from '../common/utils/async' ;
18
17
import { StopWatch } from '../common/utils/stopWatch' ;
19
18
import { IEnvironmentVariablesProvider } from '../common/variables/types' ;
19
+ import { IInterpreterService } from '../interpreter/contracts' ;
20
20
import { IServiceContainer } from '../ioc/types' ;
21
21
import { EventName } from '../telemetry/constants' ;
22
22
import { LanguageServerType } from './types' ;
@@ -66,7 +66,7 @@ export class LanguageClientMiddlewareBase implements Middleware {
66
66
return next ( params , token ) ;
67
67
}
68
68
69
- const configService = this . serviceContainer . get < IConfigurationService > ( IConfigurationService ) ;
69
+ const interpreterService = this . serviceContainer . get < IInterpreterService > ( IInterpreterService ) ;
70
70
const envService = this . serviceContainer . get < IEnvironmentVariablesProvider > ( IEnvironmentVariablesProvider ) ;
71
71
72
72
let settings = next ( params , token ) ;
@@ -87,9 +87,10 @@ export class LanguageClientMiddlewareBase implements Middleware {
87
87
const settingDict : LSPObject & { pythonPath : string ; _envPYTHONPATH : string } = settings [
88
88
i
89
89
] as LSPObject & { pythonPath : string ; _envPYTHONPATH : string } ;
90
-
91
90
settingDict . pythonPath =
92
- ( await this . getPythonPathOverride ( uri ) ) ?? configService . getSettings ( uri ) . pythonPath ;
91
+ ( await this . getPythonPathOverride ( uri ) ) ??
92
+ ( await interpreterService . getActiveInterpreter ( uri ) ) ?. path ??
93
+ 'python' ;
93
94
94
95
const env = await envService . getEnvironmentVariables ( uri ) ;
95
96
const envPYTHONPATH = env . PYTHONPATH ;
0 commit comments