Skip to content

Commit

Permalink
Resolve homedir references in Jedi environment path (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
odiroot committed Jun 29, 2023
1 parent 297099c commit 05ecbdc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pylsp/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ def jedi_script(self, position=None, use_document_path=False):
jedi.settings.auto_import_modules = jedi_settings.get('auto_import_modules',
DEFAULT_AUTO_IMPORT_MODULES)
environment_path = jedi_settings.get('environment')
# Jedi itself cannot deal with homedir-relative paths.
# On systems, where it is expected, expand the home directory.
if environment_path and os.name != 'nt':
environment_path = os.path.expanduser(environment_path)

extra_paths = jedi_settings.get('extra_paths') or []
env_vars = jedi_settings.get('env_vars')

Expand Down

0 comments on commit 05ecbdc

Please sign in to comment.