Skip to content

Commit

Permalink
Merge pull request tkf#231 from tkf/remove-workaround
Browse files Browse the repository at this point in the history
Remove workaround of invalid jedi version issue
  • Loading branch information
syohex committed May 7, 2015
2 parents bcba1e3 + e4d3659 commit 8449733
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions jediepcserver.py
Expand Up @@ -87,7 +87,9 @@ def complete(*args):


def get_in_function_call(*args):
call_def = jedi_script(*args).get_in_function_call()
sig = jedi_script(*args).call_signatures()
call_def = sig[0] if sig else None

if call_def:
return dict(
# p.get_code(False) should do the job. But jedi-vim use replace.
Expand All @@ -102,9 +104,9 @@ def get_in_function_call(*args):

def _goto(method, *args):
"""
Helper function for `goto` and `related_names`.
Helper function for `goto_assignments` and `usages`.
:arg method: `jedi.Script.goto` or `jedi.Script.related_names`
:arg method: `jedi.Script.goto_assignments` or `jedi.Script.usages`
:arg args: Arguments to `jedi_script`
"""
Expand All @@ -122,11 +124,11 @@ def _goto(method, *args):


def goto(*args):
return _goto(jedi.Script.goto, *args)
return _goto(jedi.Script.goto_assignments, *args)


def related_names(*args):
return _goto(jedi.Script.related_names, *args)
return _goto(jedi.Script.usages, *args)


def definition_to_dict(d):
Expand All @@ -144,7 +146,7 @@ def definition_to_dict(d):


def get_definition(*args):
definitions = jedi_script(*args).get_definition()
definitions = jedi_script(*args).goto_definitions()
return list(map(definition_to_dict, definitions))


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -14,7 +14,7 @@
name='jediepcserver',
py_modules=['jediepcserver'],
install_requires=[
"jedi==0.8.1",
"jedi>=0.8.1",
"epc>=0.0.4",
"argparse",
],
Expand Down

0 comments on commit 8449733

Please sign in to comment.