Open D-K-E opened 5 years ago
Looks like you have .vim/coc-settings.json
in your project root.
Indeed I do. However cached values are overriding the settings I placed there.
I'm experiencing similar issue with the latest coc-python whenever i open a python file it always prompts me to select/install a linter, even though it's already set, and linter (flake8) is already installed in the current active interpreter I checked the interpreter is set correctly
I also cannot switch from pylint, seems it is always enabled and running CocCommand python.setLinter to flake8 does nothing.
Project root coc-settings:
{
"python.pythonPath": "/Users/jhaine/Envs/sdelements/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--ignore=E501,W601"],
"coc.preferences.jumpCommand": "drop",
"diagnostic.checkCurrentLine": true,
"tsserver.npm": "/usr/local/bin/npm"
}
I seem to be running into a similar situation:
{"python.formatting.provider": "yapf"}
in my workspace config, but CocAction('format')
would continually ask me to install autopep8.{"python.formatting.provider": "yapf"}
in the user config as well, I can now format using yapf.Note: there are other settings in my workspace config that seem to be taking effect. Are the final settings resolved on an individual basis?
Question: is there a way to dump what coc thinks are the final resolved settings? If not, would it be worth making a feature request for this?
Thank you @claytonlemons, after reading your comment I went back to the docs and learned of the :CocConfig
and :CocLocalConfig
commands.
I recently switched to neovim and I assumed coc would still load from ~/.vim/coc-settings.json
but it seems otherwise as copying it to ~/.config/nvim/coc-settings.json
solved it.
But it does beg the question of why my workspace folder wasn't working 👼
Can confirm @claytonlemons 's workaround is working for me
Reproduced, "python.formatting.provider"
could be wrong.
Where do I put the config that's referenced here? Running the CocCommand doesn't save anything, or seem to do anything for the litner.
@zlesnr see @Gee19 's comment
Same, or at least similar, problem here. I want to use mypy
and black
in a specific project, so I created this .vim/coc-settings.json
file:
{
"python.linting.pylintEnabled": false,
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "~/.cache/pypoetry/virtualenvs/usignals-py3.7/bin/mypy",
"python.formatting.provider": "black",
"python.formatting.blackPath": "~/.cache/pypoetry/virtualenvs/usignals-py3.7/bin/black"
}
However, I keep getting asked to install pylint
as a linter.
Hey there.
I moved my global configuration file away and I've this local configuration file :
{
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["-l", "120"]
}
No original story here, coc
still wants me to install pylint
and does not allow me to use flake8
at the moment.
There is no option to clear cache?
Hey there.
I moved my global configuration file away and I've this local configuration file :
{ "python.linting.enabled": true, "python.linting.pylintEnabled": false, "python.linting.flake8Enabled": true, "python.formatting.provider": "black", "python.formatting.blackArgs": ["-l", "120"] }
No original story here,
coc
still wants me to installpylint
and does not allow me to useflake8
at the moment.
I'm no expert or coc-py dev, but if you're using an env you should set it. @claytonlemons and @Gee19 explanations works as a charm :D
I use
black
andmypy
for formatting and linting. I have tried to pass an argument toblack
to use 79 characters for lines by modifying my project'scoc-settings.json
.After that I called
CocRestart
and closed and reopened thenvim
. However somewhere along that process, I assume that the cached values corrupted the use of local settings, because I am constantly asked to installblack
, and select a linter, whereas my projectcoc-settings.json
is the following:Those are valid paths to the executable of
black
andmypy
. I could not find how to clean cached values. The log clearly shows that cached values exist by the way: Here is the relative part from the output ofCocOpenLog
:Here is the output of
CocInfo