coc-python
coc-python copied to clipboard
diagnostic icons not showing when "diagnostic.refreshAfterSave": true
Result from CocInfo
## versions
vim version: VIM - Vi IMproved 8.2 8020450
node version: v10.16.3
coc.nvim version: 0.0.78
coc.nvim directory: /Users/Samu/.vim/bundle/coc.nvim
term: iTerm.app
platform: darwin
## Output channel: Python
Starting Jedi Python language engine.
##########Linting Output - pylint##########
************* Module brilliant
12,7,error,E0001:invalid syntax (<unknown>, line 12) (syntax-error)
Describe the bug
in :CocConfig
, when "diagnostic.refreshAfterSave": false
(default value), the diagnostic error icon properly shows on the left of the line number.
![Screenshot 2020-07-15 at 21 25 39](https://user-images.githubusercontent.com/15846595/87587265-2c845500-c6e2-11ea-82f8-2b427708fd6a.png)
However, when "diagnostic.refreshAfterSave": true
, the diagnostic error icon does not show. As you can see, the error text still shows. However, without this icon it is not easy to spot errors in the file.
![Screenshot 2020-07-15 at 21 26 45](https://user-images.githubusercontent.com/15846595/87587514-7a00c200-c6e2-11ea-99e2-a7fb5c0be8c8.png)
Reproduce the bug
- In vim, call
:CocConfig
- Add the
diagnostic.refreshAfterSave": true
tococ-settings.json
. Save file. - Open a python file and deliberate introduce an error. Save file.
Expected result: icon showing which line has the error Actual result: no icons on the left side. Error message still appears when hovering over line.
Minimal reproduction steps for me.
Flake8 installed with pip install --user flake8
mini.vim:
set nocompatible
set runtimepath^=/home/ash/etc/vim/plugged/coc.nvim
filetype plugin indent on
syntax on
set hidden
call coc#config('python', {
\ "linting.flake8Enabled":1,
\ "linting.flake8Path": "~/.local/bin/flake8",
\ "linting.pylintEnabled": 0,
\ "linting.mypyEnabled": 0,
\})
call coc#config('diagnostic', {
\ "refreshAfterSave": 1
\})
example.py
fooc this is not valid
import os
os.path.
Edit with VIMINIT= nvim -u mini.vim example.py
, wait a few moments for the python interpreter to be found. No diagnostic icons will appear. Edit config to set refreshAfterSave to 0 and they appear.
workspaceOutput:
##########Linting Output - flake8##########
1,9,E,E999:SyntaxError: invalid syntax
2,1,E,E402:module level import not at top of file
18,1,W,W391:blank line at end of file