neoclide / coc-python

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

Wrong expansion of ${workspaceFolder} #99

Open mmoya opened 5 years ago

mmoya commented 5 years ago

Using:

I have the following configuration in ~/.nvim/coc-settings.json.

{
    "python.pythonPath": "${workspaceFolder}/.venv/bin/python"
}

coc used to pick the correct interpreter. If a .venv folder is found in the current workspace, use it, otherwise launch interpreter selection dialog.

But now the ${workspaceFolder} is expanded to the installation path of coc-python.

Steps to reproduce

$ cd /var/tmp
$ mkdir test
$ cd test
$ python3 -m venv .venv
$ nvim example.py

Actual result

The coc interpreter selection dialog launches because the current configured interpreter /home/mmoya/.config/coc/extensions/node_modules/coc-python/lib/.venv/bin/python is invalid. In the proposed list of interpreters I can't select .venv/bin/python.

Expected result

coc-python picking /var/tmp/test/.venv/bin/python as interpreter.

Gee19 commented 5 years ago

This seems to work for me:

"coc.preferences.rootPatterns": [".git", ".vim", ".vscode"],
"python.linting.flake8Args": ["--append-config='${workspaceFolder}/.flake8'"]

https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders