Skip to content

Commit 84ef0ee

Browse files
authored
Fix for issue with environment path and Jedi (#22713)
Fixes #22659 Fixes #22672 Jedi checks if the environment path is a path to a file or directory. If it is a path, it uses it as is. If not it looks for a binary assuming it is a virtual environment. Conda environments are structured differently and it fails to find the binary, if we pass in the path to environment directory. The fix here is to always pass the path to the binary.
1 parent e27119b commit 84ef0ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/client/activation/jedi/analysisOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class JediLanguageServerAnalysisOptions extends LanguageServerAnalysisOpt
7979
},
8080
workspace: {
8181
extraPaths: distinctExtraPaths,
82-
environmentPath: this.interpreter?.envPath,
82+
environmentPath: this.interpreter?.path,
8383
symbols: {
8484
// 0 means remove limit on number of workspace symbols returned
8585
maxSymbols: 0,

src/test/activation/jedi/jediAnalysisOptions.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ suite('Jedi LSP - analysis Options', () => {
9292

9393
const result = await analysisOptions.getAnalysisOptions();
9494

95-
expect(result.initializationOptions.workspace.environmentPath).to.deep.equal('.../.venv');
95+
expect(result.initializationOptions.workspace.environmentPath).to.deep.equal('.../.venv/bin/python');
9696
});
9797

9898
test('Without extraPaths provided and no workspace', async () => {

0 commit comments

Comments
 (0)