mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
goto_assignments should work even if something is only defined in a stub
This commit is contained in:
@@ -62,14 +62,18 @@ def try_stub_to_actual_names(names, prefer_stub_to_compiled=False):
|
|||||||
name_list[:-1],
|
name_list[:-1],
|
||||||
ignore_compiled=prefer_stub_to_compiled,
|
ignore_compiled=prefer_stub_to_compiled,
|
||||||
)
|
)
|
||||||
if contexts:
|
if contexts and name_list:
|
||||||
if name_list:
|
new_names = contexts.py__getattribute__(name_list[-1], is_goto=True)
|
||||||
for new_name in contexts.py__getattribute__(name_list[-1], is_goto=True):
|
for new_name in new_names:
|
||||||
yield new_name
|
yield new_name
|
||||||
else:
|
if new_names:
|
||||||
|
continue
|
||||||
|
elif contexts:
|
||||||
for c in contexts:
|
for c in contexts:
|
||||||
yield c.name
|
yield c.name
|
||||||
else:
|
continue
|
||||||
|
# This is the part where if we haven't found anything, just return the
|
||||||
|
# stub name.
|
||||||
yield name
|
yield name
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,14 @@ with_stub.in_with_stub_python
|
|||||||
#? float()
|
#? float()
|
||||||
with_stub.in_with_stub_stub
|
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
|
# Folders
|
||||||
|
|||||||
Reference in New Issue
Block a user