Closed tricomm closed 3 years ago
You need to produce a minimal reproducible test case. I assume that it's simply that Jedi can't find any definitions for the identifier, but from what you've set, it's very hard to tell what we can do about this.
You need to produce a minimal reproducible test case. I assume that it's simply that Jedi can't find any definitions for the identifier, but from what you've set, it's very hard to tell what we can do about this. there is a simple test case text.py is follow
import cv2 import numpy print("sad") cv2.addText() numpy.amax()
when I input :YcmCompleter GoTodefinition for "cv2", "numpy", "print", "addText" and "amax" everything is correct, but except the addText(). for addText() it log a error “RuntimmError: Can't jump to definition”. actually I can't jump every function in opencv(cv2) but when keep my cursor on the cv2's function I can see the doc file and the command ":YcmCompleter GetDoc "is work well.
This isn't a YCM issue, but a jedi issue. Here's what's happening:
import jedi
script = jedi.Script('import cv2;cv2.addText')
definitions = script.goto(line=1, column=18)
assert definitions == 1
definition = definitons[0]
assert definition.module_path is None
assert definition.line is None
assert definition.column is None
This isn't a YCM issue, but a jedi issue. Here's what's happening:
import jedi script = jedi.Script('import cv2;cv2.addText') definitions = script.goto(line=1, column=18) assert definitions == 1 definition = definitons[0] assert definition.module_path is None assert definition.line is None assert definition.column is None
Can you gave some suggestion? how to solve jedi issue
By opening an issue in jedi's repo.
By opening an issue in jedi's repo.
Thank you~
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
inside the brackets) before filing your issue:vim --version
.:YcmDebugInfo
.:YcmToggleLogs
command.vim -Nu /path/to/YCM/vimrc_ycm_minimal
, including what I expected to happen and what actually happened.install.py
(orcmake
/make
/ninja
) including its invocationThank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.
Issue Details
vim -Nu /path/to/YCM/ycm_vimrc_minimal
:edit test.py
.....
What did you expect to happen? I want to jump to the definiton of function in it‘s definition file
What actually happened?
Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
Output of
YcmDiags
Output of
git rev-parse HEAD
in YouCompleteMe installation directoryvimrc_ycm_minimal
" windows default encoding is not supported set encoding=utf-8
" If you using neovim and python isn't loading, copy your python setup from your " vimrc here: " " let g:python3_host_prog = '/path/to/python3/with/neovim/module' " " But remember that neovim is not officially supported, so please reproduce in " Vim.
" Enable debugging let g:ycm_keep_logfiles = 1 let g:ycm_log_level = 'debug'
" If the base settings don't repro, paste your existing config for YCM only, " here: " let g:ycm_....
" Load YCM (only) let &rtp .= ',' . expand( ':p:h' )
filetype plugin indent on
Contents of YCM, ycmd and completion engine logfiles
Traceback (most recent call last): File "/Users/siiyrang/.vim/bundle/YouCompleteMe/python/ycm/client/base_request.py", line 73, in HandleFuture return _JsonFromFuture( future ) File "/Users/siiyrang/.vim/bundle/YouCompleteMe/python/ycm/client/base_request.py", line 256, in _JsonFromFuture raise MakeServerException( response.json() ) ycmd.responses.ServerError: RuntimeError: Can't jump to definition.
OS version, distribution, etc.
macOS 10.15.7
Output of build/install commands
when I input, ":YcmCompleter GoTodefiniton"
there show,RuntimmError: Can't jump to definition