1
0
forked from VimPlug/jedi

goto_assignments should work even if something is only defined in a stub

This commit is contained in:
Dave Halter
2019-05-17 14:58:55 +02:00
parent 9d5f57d798
commit c640aa9213
2 changed files with 21 additions and 9 deletions

View File

@@ -62,15 +62,19 @@ def try_stub_to_actual_names(names, prefer_stub_to_compiled=False):
name_list[:-1],
ignore_compiled=prefer_stub_to_compiled,
)
if contexts:
if name_list:
for new_name in contexts.py__getattribute__(name_list[-1], is_goto=True):
yield new_name
else:
for c in contexts:
yield c.name
else:
yield name
if contexts and name_list:
new_names = contexts.py__getattribute__(name_list[-1], is_goto=True)
for new_name in new_names:
yield new_name
if new_names:
continue
elif contexts:
for c in contexts:
yield c.name
continue
# This is the part where if we haven't found anything, just return the
# stub name.
yield name
def _load_stub_module(module):

View File

@@ -13,6 +13,14 @@ with_stub.in_with_stub_python
#? float()
with_stub.in_with_stub_stub
#! ['in_stub_only: int']
stub_only.in_stub_only
#! ['in_with_stub_both = 5']
with_stub.in_with_stub_both
#! ['in_with_stub_python = 8']
with_stub.in_with_stub_python
#! ['in_with_stub_stub: float']
with_stub.in_with_stub_stub
# -------------------------
# Folders