Skip to content

Commit 05ecbdc

Browse files
authored
Resolve homedir references in Jedi environment path (#394)
1 parent 297099c commit 05ecbdc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pylsp/workspace.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,11 @@ def jedi_script(self, position=None, use_document_path=False):
389389
jedi.settings.auto_import_modules = jedi_settings.get('auto_import_modules',
390390
DEFAULT_AUTO_IMPORT_MODULES)
391391
environment_path = jedi_settings.get('environment')
392+
# Jedi itself cannot deal with homedir-relative paths.
393+
# On systems, where it is expected, expand the home directory.
394+
if environment_path and os.name != 'nt':
395+
environment_path = os.path.expanduser(environment_path)
396+
392397
extra_paths = jedi_settings.get('extra_paths') or []
393398
env_vars = jedi_settings.get('env_vars')
394399

0 commit comments

Comments
 (0)