coc-python icon indicating copy to clipboard operation
coc-python copied to clipboard

Gd does not jump to definitions in a different file

Open ntruongv opened this issue 4 years ago • 8 comments

When I gd on some_function defined in a different file, the navigation just takes me to the importing statement from local_module import some_function instead of leading to the original file where the definition of some_function is. I have tried to search for answers but can't find anything. I tried to disable jedi and used MPLS instead, but the problem persisted.

I used jedi-vim before this, and code navigation worked as expected then (jumping to file where definition is given).

Please help and tolerate; I'm a noob.

ntruongv avatar May 28 '20 21:05 ntruongv

Try minimal vimrc, I can't reproduce.

chemzqm avatar May 29 '20 07:05 chemzqm

I encounter the same problem, but I can jump to another file by gd one time when a file is opened. After jump back to the original file, I cannot jump to another file again. I can't use completions either, always show source jedi timeout after 5000ms

I use the same vimrc and it works properly 1 month ago.

dean-ho avatar May 30 '20 06:05 dean-ho

It's weird. The symptom happened on both win10 env which I use vim frequently. I install vim on the third computer, it works fine. After uninstalling coc-python and add recommend config from https://github.com/neoclide/coc.nvim/wiki/Language-servers. The completions function and gd work perfectly.

dean-ho avatar May 31 '20 07:05 dean-ho

Try minimal vimrc, I can't reproduce.

I tried with minimial vimrc, but the same problem appears. Here's the screenshot: coc-python

It's weird. The symptom happened on both win10 env which I use vim frequently. I install vim on the third computer, it works fine. After uninstalling coc-python and add recommend config from https://github.com/neoclide/coc.nvim/wiki/Language-servers. The completions function and gd work perfectly.

Thanks for the suggestion. I will try this, but it seems like it's a stand-in for coc-python?

ntruongv avatar Jun 01 '20 01:06 ntruongv

I tried to uninstall python2.X then coc-python work fine.

dean-ho avatar Jun 01 '20 14:06 dean-ho

I found a way to reproduce it.

  1. Install python27 and python3x on the system, install jedi, python-language-server for them.
  2. Open vim. Select interpreter many times, :CocCommand python.setInterpreter and :CocRestart several times.
  3. Check the Goto definition and completion function don't work properly.

dean-ho avatar Jun 01 '20 15:06 dean-ho

I found a way to reproduce it.

  1. Install python27 and python3x on the system, install jedi, python-language-server for them.
  2. Open vim. Select interpreter many times, :CocCommand python.setInterpreter and :CocRestart several times.
  3. Check the Goto definition and completion function don't work properly.

Thank you. This made a lot of sense. I use Mac, so it comes with python27 in the OS. I'm kinda not sure about deleting it though. I hope the owner of the repo can figure out the bug.

ntruongv avatar Jun 05 '20 00:06 ntruongv

I fixed this by setting python.pythonPath in :CocConfig to the correct version of python (I'm using 3.7.8).

I encountered this problem after installing a different version of python using pyenv on a Mac which comes with python27 like you guys mentioned.

johnsonsu avatar Aug 21 '20 14:08 johnsonsu