vheon / JediHTTP

Simple http wrapper around jedi
Apache License 2.0
40 stars 9 forks source link

[READY] Update Jedi to latest commit #35

Closed micbou closed 7 years ago

micbou commented 7 years ago

Current version of Jedi may return an empty docstring when completing in the middle of a function. For instance, the following code that completes the get function from requests and prints its docstring:

import jedi
import pprint

args = (
  '''import requests
requests.ge
''',
  2,
  len( 'requests.ge' ),
  'example.py'
)

for completion in jedi.Script(*args).completions():
     pprint.pprint( completion.docstring() )

args = (
  '''import requests
requests.get
''',
  2,
  len( 'requests.get' ),
  'example.py'
)

for completion in jedi.Script(*args).completions():
     pprint.pprint( completion.docstring() )

will output:

''
('get(url, params=None, **kwargs)\n'
 '\n'
 'Sends a GET request.\n'
 '\n'
 ':param url: URL for the new :class:`Request` object.\n'
 ':param params: (optional) Dictionary or bytes to be sent in the query string '
 'for the :class:`Request`.\n'
 ':param \\*\\*kwargs: Optional arguments that ``request`` takes.\n'
 ':return: :class:`Response <Response>` object\n'
 ':rtype: requests.Response')

The docstring is empty after completing ge but not after get. This issue was fixed in commit https://github.com/davidhalter/jedi/commit/7ca62578e11031ae09a6ad79fd74089de25ed46d. We update the Jedi dependency to include the commit.

In addition, we update the tests as latest Jedi version seems to have improved its docstring parsing.


This change is Reviewable

vheon commented 7 years ago

Sorry for the late response.

:lgtm: @homu r+


Reviewed 2 of 2 files at r1. Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

homu commented 7 years ago

:pushpin: Commit ad800f7 has been approved by vheon

homu commented 7 years ago

:hourglass: Testing commit ad800f7 with merge 75b8b74...

homu commented 7 years ago

:sunny: Test successful - status