forked from VimPlug/jedi
can now refactor statements ahead of '=', fixes #20
This commit is contained in:
@@ -328,8 +328,14 @@ class Script(object):
|
||||
|
||||
TODO implement additional_module_paths
|
||||
"""
|
||||
user_stmt = self.parser.user_stmt
|
||||
definitions, search_name = self._goto(add_import_name=True)
|
||||
if not isinstance(self.parser.user_stmt, parsing.Import):
|
||||
if isinstance(user_stmt, parsing.Statement) \
|
||||
and self.pos < user_stmt.get_assignment_calls().start_pos:
|
||||
# the search_name might be before `=`
|
||||
definitions = [v for v in user_stmt.set_vars
|
||||
if str(v) == search_name]
|
||||
if not isinstance(user_stmt, parsing.Import):
|
||||
# import case is looked at with add_import_name option
|
||||
definitions = dynamic.related_name_add_import_modules(definitions,
|
||||
search_name)
|
||||
|
||||
@@ -1373,9 +1373,9 @@ def follow_call_list(call_list):
|
||||
# comprehensions
|
||||
result += follow_statement(stmt)
|
||||
else:
|
||||
# With things like params, these can also be functions...
|
||||
if isinstance(call, (Function, Class, Instance,
|
||||
dynamic.ArrayInstance)):
|
||||
# With things like params, these can also be functions...
|
||||
result.append(call)
|
||||
# The string tokens are just operations (+, -, etc.)
|
||||
elif not isinstance(call, str):
|
||||
|
||||
@@ -90,8 +90,8 @@ from import_tree.rename1 import not_existing
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
response = 3
|
||||
#< 0 (95, 0), (96, 0), (97, 0), (99, 0)
|
||||
response = HttpResponse(mimetype='application/pdf')
|
||||
response['Content-Disposition'] = 'attachment; filename=%s.pdf' % id
|
||||
response.write(pdf)
|
||||
|
||||
Reference in New Issue
Block a user