@@ -12,6 +12,8 @@ import { WorkspaceService } from '../../../client/common/application/workspace';
12
12
import { ConfigurationService } from '../../../client/common/configuration/service' ;
13
13
import { IConfigurationService } from '../../../client/common/types' ;
14
14
import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types' ;
15
+ import { EnvironmentType , PythonEnvironment } from '../../../client/pythonEnvironments/info' ;
16
+ import { Architecture } from '../../../client/common/utils/platform' ;
15
17
16
18
suite ( 'Jedi LSP - analysis Options' , ( ) => {
17
19
const workspacePath = path . join ( 'this' , 'is' , 'fake' , 'workspace' , 'path' ) ;
@@ -74,6 +76,25 @@ suite('Jedi LSP - analysis Options', () => {
74
76
expect ( result . initializationOptions . workspace . symbols . maxSymbols ) . to . deep . equal ( 0 ) ;
75
77
} ) ;
76
78
79
+ test ( 'With interpreter path' , async ( ) => {
80
+ when ( workspaceService . getWorkspaceFolder ( anything ( ) ) ) . thenReturn ( undefined ) ;
81
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
+ when ( configurationService . getSettings ( anything ( ) ) ) . thenReturn ( { } as any ) ;
83
+ const pythonEnvironment : PythonEnvironment = {
84
+ envPath : '.../.venv' ,
85
+ id : 'base_env' ,
86
+ envType : EnvironmentType . Conda ,
87
+ path : '.../.venv/bin/python' ,
88
+ architecture : Architecture . x86 ,
89
+ sysPrefix : 'prefix/path' ,
90
+ } ;
91
+ analysisOptions . initialize ( undefined , pythonEnvironment ) ;
92
+
93
+ const result = await analysisOptions . getAnalysisOptions ( ) ;
94
+
95
+ expect ( result . initializationOptions . workspace . environmentPath ) . to . deep . equal ( '.../.venv' ) ;
96
+ } ) ;
97
+
77
98
test ( 'Without extraPaths provided and no workspace' , async ( ) => {
78
99
when ( workspaceService . getWorkspaceFolder ( anything ( ) ) ) . thenReturn ( undefined ) ;
79
100
// eslint-disable-next-line @typescript-eslint/no-explicit-any
0 commit comments