mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 18:54:44 +08:00
pythonx/jedi_vim: flake8 fixes
This commit is contained in:
committed by
Dave Halter
parent
79c6172be7
commit
d430570fd0
@@ -229,6 +229,7 @@ def tempfile(content):
|
|||||||
finally:
|
finally:
|
||||||
os.unlink(f.name)
|
os.unlink(f.name)
|
||||||
|
|
||||||
|
|
||||||
@_check_jedi_availability(show_error=True)
|
@_check_jedi_availability(show_error=True)
|
||||||
@catch_and_print_exceptions
|
@catch_and_print_exceptions
|
||||||
def goto(mode="goto", no_output=False):
|
def goto(mode="goto", no_output=False):
|
||||||
@@ -250,7 +251,6 @@ def goto(mode="goto", no_output=False):
|
|||||||
elif mode == "assignment":
|
elif mode == "assignment":
|
||||||
definitions = script.goto_assignments()
|
definitions = script.goto_assignments()
|
||||||
|
|
||||||
|
|
||||||
if no_output:
|
if no_output:
|
||||||
return definitions
|
return definitions
|
||||||
if not definitions:
|
if not definitions:
|
||||||
@@ -270,10 +270,12 @@ def goto(mode="goto", no_output=False):
|
|||||||
using_tagstack=using_tagstack)
|
using_tagstack=using_tagstack)
|
||||||
if not result:
|
if not result:
|
||||||
return []
|
return []
|
||||||
if d.module_path and os.path.exists(d.module_path) and using_tagstack:
|
if (using_tagstack and d.module_path and
|
||||||
|
os.path.exists(d.module_path)):
|
||||||
tagname = d.name
|
tagname = d.name
|
||||||
with tempfile('{0}\t{1}\t{2}'.format(tagname, d.module_path,
|
with tempfile('{0}\t{1}\t{2}'.format(
|
||||||
'call cursor({0}, {1})'.format(d.line, d.column + 1))) as f:
|
tagname, d.module_path, 'call cursor({0}, {1})'.format(
|
||||||
|
d.line, d.column + 1))) as f:
|
||||||
old_tags = vim.eval('&tags')
|
old_tags = vim.eval('&tags')
|
||||||
old_wildignore = vim.eval('&wildignore')
|
old_wildignore = vim.eval('&wildignore')
|
||||||
try:
|
try:
|
||||||
@@ -389,7 +391,8 @@ def show_call_signatures(signatures=()):
|
|||||||
line = vim_eval("getline(%s)" % line_to_replace)
|
line = vim_eval("getline(%s)" % line_to_replace)
|
||||||
|
|
||||||
# Descriptions are usually looking like `param name`, remove the param.
|
# Descriptions are usually looking like `param name`, remove the param.
|
||||||
params = [p.description.replace('\n', '').replace('param ', '', 1) for p in signature.params]
|
params = [p.description.replace('\n', '').replace('param ', '', 1)
|
||||||
|
for p in signature.params]
|
||||||
try:
|
try:
|
||||||
# *_*PLACEHOLDER*_* makes something fat. See after/syntax file.
|
# *_*PLACEHOLDER*_* makes something fat. See after/syntax file.
|
||||||
params[signature.index] = '*_*%s*_*' % params[signature.index]
|
params[signature.index] = '*_*%s*_*' % params[signature.index]
|
||||||
@@ -587,7 +590,8 @@ def do_rename(replace, orig=None):
|
|||||||
assert r.module_path is not None
|
assert r.module_path is not None
|
||||||
result = new_buffer(r.module_path)
|
result = new_buffer(r.module_path)
|
||||||
if not result:
|
if not result:
|
||||||
echo_highlight("Jedi-vim: failed to create buffer window for {0}!".format(r.module_path))
|
echo_highlight('Failed to create buffer window for %s!' % (
|
||||||
|
r.module_path))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
buffers.add(vim.current.buffer.name)
|
buffers.add(vim.current.buffer.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user