We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ed37d3 commit 90d9fe9Copy full SHA for 90d9fe9
pyls/workspace.py
@@ -217,8 +217,11 @@ def sys_path(self):
217
# Copy our extra sys path
218
path = list(self._extra_sys_path)
219
220
- # TODO(gatesn): #339 - make better use of jedi environments, they seem pretty powerful
221
- environment = jedi.api.environment.get_default_environment()
+ virtual_env = os.getenv('VIRTUAL_ENV')
+ if virtual_env:
222
+ environment = jedi.api.environment.create_environment(virtual_env, safe=False)
223
+ else:
224
+ environment = jedi.api.environment.get_default_environment()
225
path.extend(environment.get_sys_path())
226
227
return path
0 commit comments