neoclide / coc-python

Python extension for coc.nvim, fork of vscode-python
574 stars 51 forks source link

Go To Definition not working #302

Open davidlubomirov opened 4 years ago

davidlubomirov commented 4 years ago

coc-settings.json

{
    "python.jediPath": "/usr/local/lib/python3.8/site-packages",
    "coc.preferences.formatOnSaveFiletypes": ["python"]
}

I've installed jedi as global in order not to install it every time for each project that's using virtual environment.

$: pip3 show jedi
Name: jedi
Version: 0.17.2
Summary: An autocompletion tool for Python that can be used for text editors.
Home-page: https://github.com/davidhalter/jedi
Author: David Halter
Author-email: davidhalter88@gmail.com
License: MIT
Location: /usr/local/lib/python3.8/site-packages
Requires: parso
Required-by: python-language-server

With this setup, go to definition isn't working. I've just started using coc and I'm not sure what I'm missing.

xylix commented 4 years ago

I'm using python MSLS and having problem with go to definition

{
    "codeLens.enable": true,
    "python.jediEnabled": false,
    "python.formatting.provider": "black",
    "python.linting.mypyEnabled": false,
    "python.linting.mypyArgs": ["--ignore-missing-imports","--follow-imports=silent","--show-column-numbers"],
    "python.linting.pylintEnabled": true
}

And go to definition is broken for me as well:

2020-11-10T10:50:35.656 INFO (pid:40506) [extension:coc-python] - Python Extension: Cached data exists getEnvironmentVariables, /Users/kerkko/Code/rpaframework
2020-11-10T10:50:36.228 ERROR (pid:40506) [attach] - Notification error: jumpDeclaration [] TypeError: Cannot destructure property 'uri' of 'location' as it is undefined.
    at Handler.handleLocations (/Users/kerkko/.vim/plugged/coc.nvim/build/index.js:89031:19)
    at Handler.gotoDeclaration (/Users/kerkko/.vim/plugged/coc.nvim/build/index.js:88199:20)
    at async Plugin.cocAction (/Users/kerkko/.vim/plugged/coc.nvim/build/index.js:23990:16)
    at async NeovimClient.<anonymous> (/Users/kerkko/.vim/plugged/coc.nvim/build/index.js:11595:21)

Running nightly neovim

## versions

vim version: NVIM v0.5.0-nightly-88-gc10c2fab5
node version: v12.18.3
coc.nvim version: 0.0.79-6cb5c6cd2d
coc.nvim directory: /Users/kerkko/.vim/plugged/coc.nvim
term: iTerm.app
platform: darwin