MCPcopy
hub / github.com/davidhalter/jedi-vim / _goto_specific_name

Function _goto_specific_name

pythonx/jedi_vim.py:435–470  ·  view source on GitHub ↗
(n, options='')

Source from the content-addressed store, hash-verified

433
434
435def _goto_specific_name(n, options=''):
436 if n.column is None:
437 if n.is_keyword:
438 echo_highlight("Cannot get the definition of Python keywords.")
439 else:
440 name = 'Namespaces' if n.type == 'namespace' else 'Builtin modules'
441 echo_highlight(
442 "%s cannot be displayed (%s)."
443 % (name, n.full_name or n.name)
444 )
445 else:
446 using_tagstack = int(vim_eval('g:jedi#use_tag_stack')) == 1
447 result = set_buffer(n.module_path, options=options,
448 using_tagstack=using_tagstack)
449 if not result:
450 return []
451 if (using_tagstack and n.module_path and
452 n.module_path.exists()):
453 tagname = n.name
454 with tempfile('{0}\t{1}\t{2}'.format(
455 tagname, n.module_path, 'call cursor({0}, {1})'.format(
456 n.line, n.column + 1))) as f:
457 old_tags = vim.eval('&tags')
458 old_wildignore = vim.eval('&wildignore')
459 try:
460 # Clear wildignore to ensure tag file isn't ignored
461 vim.command('set wildignore=')
462 vim.command('let &tags = %s' %
463 repr(PythonToVimStr(f.name)))
464 vim.command('tjump %s' % tagname)
465 finally:
466 vim.command('let &tags = %s' %
467 repr(PythonToVimStr(old_tags)))
468 vim.command('let &wildignore = %s' %
469 repr(PythonToVimStr(old_wildignore)))
470 vim.current.window.cursor = n.line, n.column
471
472
473def relpath(path):

Callers 2

gotoFunction · 0.85
py_importFunction · 0.85

Calls 5

echo_highlightFunction · 0.85
vim_evalFunction · 0.85
set_bufferFunction · 0.85
tempfileFunction · 0.85
PythonToVimStrClass · 0.85

Tested by

no test coverage detected