neoclide / coc-python

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

[Q] CocCommand python.setInterpreter #127

Closed yujinyuz closed 4 years ago

yujinyuz commented 4 years ago

I've been searching for some workarounds on how to make neovim autocomplete support virtualenvs by creating a .vim/coc-settings.json inside my project directory. But this seems quite tedious for me.

Is there any way that after calling :CocCommand python.setInterperter, it would automatically create the .vim/coc-settings.json file for me with the settings:

{
    "python.pythonPath": "/Users/me/.virtualenvs/amazing/bin/python"
}

Side Question: Every time Vim is restarted, I'm getting this message

⠦ Analyzing in background, 115 items left... Python 3.6.8 64-bit ('amazing': virtualenv)

Is this normal? Would there be a way to somehow cache this? I have to wait for it to finish before making the autocomplete work

VSCode doesn't seem to re-analyze the virtualenvs when restarting them

you-n-g commented 4 years ago

@yujinyuz I have found similar problem. #197 How did you solve it ?

yujinyuz commented 4 years ago

@you-n-g I forgot what I did. You can check my coc-settings.json here: https://github.com/yujinyuz/dotfiles-old/blob/master/vim/coc-settings.json

And it seems that my current settings (coc and vimrc) already caches virtualenvs

you-n-g commented 4 years ago

@yujinyuz thanks.

geo7 commented 4 years ago

@yujinyuz that link is dead - is the file anywhere else?

yujinyuz commented 4 years ago

@geo7 I've updated the link

https://github.com/yujinyuz/dotfiles-old/blob/master/vim/coc-settings.json