Skip to content

Commit

Permalink
Provide sys_path to jedi (#1471)
Browse files Browse the repository at this point in the history
Fixes #1445
Fixes #1469
Fixes #1460
  • Loading branch information
DonJayamanne authored Apr 24, 2018
1 parent 22a816f commit c910551
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pythonFiles/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def _process_request(self, request):

self._normalize_request_path(request)
path = self._get_top_level_module(request.get('path', ''))
if path not in sys.path:
if len(path) > 0 and path not in sys.path:
sys.path.insert(0, path)
lookup = request.get('lookup', 'completions')

Expand All @@ -563,9 +563,10 @@ def _process_request(self, request):
all_scopes=True),
request['id'])

script = jedi.api.Script(
script = jedi.Script(
source=request.get('source', None), line=request['line'] + 1,
column=request['column'], path=request.get('path', ''))
column=request['column'], path=request.get('path', ''),
sys_path=sys.path)

if lookup == 'definitions':
defs = []
Expand Down

0 comments on commit c910551

Please sign in to comment.