ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.44k stars 2.81k forks source link

line number outside range #3389

Closed 0xff91 closed 5 years ago

0xff91 commented 5 years ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank 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

Provide a clear description of the problem, including the following key questions: hello, i am using ycm for python , and now i have a problem about going to definition. i write import requests in my python file, and the first press g to go requests definition everything is ok, but i press g to go requests definition the second, the problems occur, just liek the picture like below pic

Include steps to reproduce here.

i donot know what shuld i do.

Include description of a minimal test case, including any actual code required

it is easy, goto definition of requests the second failed

import requests

to reproduce the issue.

Include description of the expected behaviour.

Include description of the observed behaviour, including actual output, screenshots, etc.

Diagnostic data

Output of vim --version

Place the output here, or a link to a gist.


NVIM v0.3.5
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wconversion -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.3.5/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
编译者 builduser

Features: +acl +iconv +jemalloc +tui See ":help feature-compile"

 系统 vimrc 文件: "$VIM/sysinit.vim"
     $VIM 预设值: "/usr/share/nvim"

Run :checkhealth for more info


## Output of `YcmDebugInfo`

> Place the output here, or a link to a [gist][].

```shell
Printing YouCompleteMe debug information...                                                                         
-- Client logfile: /tmp/ycm_ctnycx6i.log
-- Server Python interpreter: /usr/bin/python
-- Server Python version: 3.7.3
-- Server has Clang support compiled in: True
-- Clang version: clang version 8.0.0 (tags/RELEASE_800/final)
-- Extra configuration file found and loaded
-- Extra configuration path: /home/forever/.ycm_extra_conf.py
-- Python completer debug information:
--   Python interpreter: /home/forever/.local/share/virtualenvs/python_work-bWYGwZyh/bin/python
--   Python path: ['/home/forever', '/home/forever/third_party/bottle', '/home/forever/third_party/cregex/regex_3', '/home/for
ever/third_party/frozendict', '/home/forever/third_party/jedi_deps/jedi', '/home/forever/third_party/jedi_deps/parso', '/home/
forever/third_party/requests_deps/requests', '/home/forever/third_party/requests_deps/urllib3/src', '/home/forever/third_party
/requests_deps/chardet', '/home/forever/third_party/requests_deps/certifi', '/home/forever/third_party/requests_deps/idna', '/
home/forever/third_party/waitress', '/home/forever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python37.zip', '/home/for
ever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7', '/home/forever/third_party/python-future/src', '/home/forev
er/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7/lib-dynload', '/usr/lib64/python3.7', '/usr/lib/python3.7', '/h
ome/forever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7/site-packages']
--   Python version: 3.7.3
--   Jedi version: 0.13.3
--   Parso version: 0.3.4
-- Server running at: http://127.0.0.1:56029
-- Server process ID: 28054
-- Server logfiles:
--   /tmp/ycmd_56029_stdout_sgtf6gi9.log
--   /tmp/ycmd_56029_stderr_ev0ljgst.log

Contents of YCM, ycmd and completion engine logfiles

Add let g:ycm_log_level = 'debug' to vimrc, restart Vim, reproduce the issue, and include link here to a gist containing the entire logfiles for ycm, ycmd and any completer logfiles listed by :YcmToggleLogs.

there is noting in ycm.

ycmd stderr

2019-05-04 10:43:16,087 - DEBUG - No global extra conf, not calling method YcmCorePreload
2019-05-04 10:43:16,184 - INFO - Received ready request
2019-05-04 10:43:16,241 - INFO - Received event notification
2019-05-04 10:43:16,241 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:16,246 - INFO - Received event notification
2019-05-04 10:43:16,246 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:16,246 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/test.py
Traceback (most recent call last):
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/watchdog_plugin.py", line 104, in wrapper
    return callback( *args, **kwargs )
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/hmac_plugin.py", line 68, in wrapper
    body = callback( *args, **kwargs )
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/handlers.py", line 67, in EventNotification
    event_handler )( request_data )
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/completers/python/python_completer.py", line 57, in OnFileReadyToParse
    environment = self._EnvironmentForRequest( request_data )
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/completers/python/python_completer.py", line 120, in _EnvironmentForRequest
    settings = self._SettingsForRequest( request_data )
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/completers/python/python_completer.py", line 69, in _SettingsForRequest
    module = extra_conf_store.ModuleForSourceFile( filepath )
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 62, in ModuleForSourceFile
    return Load( ModuleFileForSourceFile( filename ) )
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 73, in ModuleFileForSourceFile
    if Load( module_file ):
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 158, in Load
    if not force and not _ShouldLoad( module_file, is_global ):
  File "/home/forever/.cache/plugins/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 141, in _ShouldLoad
    raise UnknownExtraConf( module_file )
ycmd.responses.UnknownExtraConf: Found /home/forever/.ycm_extra_conf.py. Load? 

(Question can be turned off with options, see YCM docs)
2019-05-04 10:43:16,348 - INFO - Received filetype completion available request
2019-05-04 10:43:17,008 - INFO - Received extra conf load request
2019-05-04 10:43:17,019 - INFO - Received event notification
2019-05-04 10:43:17,019 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:17,019 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/test.py
2019-05-04 10:43:18,700 - INFO - Received command request
2019-05-04 10:43:18,802 - DEBUG - pickle loaded: /home/forever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7/site-packages/requests/__init__.py
2019-05-04 10:43:18,853 - INFO - Received event notification
2019-05-04 10:43:18,853 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:18,856 - INFO - Received event notification
2019-05-04 10:43:18,856 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:18,857 - INFO - Adding buffer identifiers for file: /home/forever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7/site-packages/requests/__init__.py
2019-05-04 10:43:20,195 - INFO - Received event notification
2019-05-04 10:43:20,195 - DEBUG - Event name: BufferUnload
2019-05-04 10:43:20,227 - INFO - Received event notification
2019-05-04 10:43:20,227 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:20,230 - INFO - Received event notification
2019-05-04 10:43:20,230 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:20,230 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/test.py
2019-05-04 10:43:21,235 - INFO - Received command request
2019-05-04 10:43:21,295 - INFO - Received event notification
2019-05-04 10:43:21,295 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:21,299 - INFO - Received event notification
2019-05-04 10:43:21,299 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:21,300 - INFO - Adding buffer identifiers for file: /home/forever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7/site-packages/requests/__init__.py
2019-05-04 10:43:22,963 - INFO - Received event notification
2019-05-04 10:43:22,963 - DEBUG - Event name: BufferUnload
2019-05-04 10:43:22,995 - INFO - Received event notification
2019-05-04 10:43:22,995 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:22,998 - INFO - Received event notification
2019-05-04 10:43:22,998 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:22,998 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/test.py
2019-05-04 10:43:24,104 - INFO - Received command request
2019-05-04 10:43:24,155 - INFO - Received event notification
2019-05-04 10:43:24,155 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:24,158 - INFO - Received event notification
2019-05-04 10:43:24,159 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:24,159 - INFO - Adding buffer identifiers for file: /home/forever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7/site-packages/requests/__init__.py
2019-05-04 10:43:25,020 - INFO - Received event notification
2019-05-04 10:43:25,020 - DEBUG - Event name: BufferUnload
2019-05-04 10:43:25,048 - INFO - Received event notification
2019-05-04 10:43:25,048 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:25,051 - INFO - Received event notification
2019-05-04 10:43:25,051 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:25,051 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/test.py
2019-05-04 10:43:27,567 - INFO - Received command request
2019-05-04 10:43:27,570 - DEBUG - pickle loaded: /home/forever/Downloads/python_work/__init__.py
2019-05-04 10:43:27,574 - DEBUG - pickle loaded: /home/forever/Downloads/python_work/b/c/a.py
2019-05-04 10:43:27,631 - INFO - Received event notification
2019-05-04 10:43:27,632 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:27,634 - INFO - Received event notification
2019-05-04 10:43:27,634 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:27,634 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/b/c/a.py
2019-05-04 10:43:28,405 - INFO - Received event notification
2019-05-04 10:43:28,405 - DEBUG - Event name: BufferUnload
2019-05-04 10:43:28,436 - INFO - Received event notification
2019-05-04 10:43:28,436 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:28,438 - INFO - Received event notification
2019-05-04 10:43:28,438 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:28,438 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/test.py
2019-05-04 10:43:30,434 - INFO - Received command request
2019-05-04 10:43:30,502 - INFO - Received event notification
2019-05-04 10:43:30,502 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:30,505 - INFO - Received event notification
2019-05-04 10:43:30,505 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:30,505 - INFO - Adding buffer identifiers for file: /home/forever/.local/share/virtualenvs/python_work-bWYGwZyh/lib/python3.7/site-packages/requests/__init__.py
2019-05-04 10:43:30,511 - INFO - Received event notification
2019-05-04 10:43:30,511 - DEBUG - Event name: BufferUnload
2019-05-04 10:43:30,544 - INFO - Received event notification
2019-05-04 10:43:30,544 - DEBUG - Event name: BufferVisit
2019-05-04 10:43:30,546 - INFO - Received event notification
2019-05-04 10:43:30,546 - DEBUG - Event name: FileReadyToParse
2019-05-04 10:43:30,546 - INFO - Adding buffer identifiers for file: /home/forever/Downloads/python_work/test.py
2019-05-04 10:43:47,428 - INFO - Received debug info request
2019-05-04 10:47:05,403 - INFO - Received debug info request

ycmd stdout

serving on http://localhost:53969

OS version, distribution, etc.

Include system information here.

os: arch linux
kernel: Linux arch 5.0.10-arch1-1-ARCH #1 SMP PREEMPT Sat Apr 27 20:06:45 UTC 2019 x86_64 GNU/Linux

Output of build/install commands

Include link to a gist containing the invocation and entire output of install.py if reporting an installation issue.

puremourning commented 5 years ago

Does the same issue happen in Vim?

0xff91 commented 5 years ago

Does the same issue happen in Vim?

sorry,i am not try it on vim. so i donot know whether it is happen in vim.

i will test it soon

0xff91 commented 5 years ago

Does the same issue happen in Vim?

oh, i try it just now, it woks every well in vim, the problem doesnot occur, but the speed is slower than neovim.

and this is a neovim problem?

puremourning commented 5 years ago

We only support Vim. If it's broken in neovim, then it could be a neovim issue, but we're probably not going to investigate it it isn't broken in Vim.