mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Avoid duplicate definitions for goto, fixes #1514
This commit is contained in:
@@ -318,7 +318,8 @@ class Script(object):
|
||||
)
|
||||
|
||||
defs = [classes.Definition(self._inference_state, d) for d in set(names)]
|
||||
return helpers.sorted_definitions(defs)
|
||||
# Avoid duplicates
|
||||
return list(set(helpers.sorted_definitions(defs)))
|
||||
|
||||
@validate_line_column
|
||||
def help(self, line=None, column=None):
|
||||
|
||||
@@ -422,3 +422,11 @@ with Foo() as f3:
|
||||
#? 6 Foo
|
||||
with Foo() as f3:
|
||||
f3
|
||||
|
||||
# -----------------
|
||||
# Avoiding multiple definitions
|
||||
# -----------------
|
||||
|
||||
some_array = ['', '']
|
||||
#! ['def upper']
|
||||
some_array[some_not_defined_index].upper
|
||||
|
||||
Reference in New Issue
Block a user