Use the official Jedi goto API instead of multiple calls

Fixes #802.
This commit is contained in:
Dave Halter
2018-04-24 00:21:03 +02:00
parent 5f98bfb62e
commit a54729ef63
2 changed files with 3 additions and 6 deletions

View File

@@ -293,10 +293,7 @@ def goto(mode="goto", no_output=False):
"""
script = get_script()
if mode == "goto":
definitions = [x for x in script.goto_definitions()
if not x.in_builtin_module()]
if not definitions:
definitions = script.goto_assignments()
definitions = script.goto_assignments(follow_imports=True)
elif mode == "related_name":
definitions = script.usages()
elif mode == "definition":

View File

@@ -22,8 +22,8 @@ describe 'goto simple'
it 'goto definitions'
normal \d
Expect line('.') == 1
Expect col('.') == 5
Expect line('.') == 2
Expect col('.') == 1
end
it 'goto assignments'