mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +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)]
|
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
|
@validate_line_column
|
||||||
def help(self, line=None, column=None):
|
def help(self, line=None, column=None):
|
||||||
|
|||||||
@@ -422,3 +422,11 @@ with Foo() as f3:
|
|||||||
#? 6 Foo
|
#? 6 Foo
|
||||||
with Foo() as f3:
|
with Foo() as f3:
|
||||||
f3
|
f3
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# Avoiding multiple definitions
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
some_array = ['', '']
|
||||||
|
#! ['def upper']
|
||||||
|
some_array[some_not_defined_index].upper
|
||||||
|
|||||||
Reference in New Issue
Block a user