Closed Yachint closed 2 years ago
Check your coc.nvim version by :CocInfo
, old version have bug with diagnostic refresh.
Output of my ':CocInfo':
vim version: NVIM v0.7.2 node version: v16.17.0 coc.nvim version: 0.0.82-347e33d7 2022-09-09 18:16:50 +0800 coc.nvim directory: /Users/yachintmacbook/.local/share/nvim/plugged/coc.nvim term: iTerm.app platform: darwin
I have updated Coc, nvim and also Tsserver to latest version. I have tested also on a Linux machine with similar results, will test a bit more scenarios to confirm. In the event that I still find the issue persisting, just wanted to confirm that nothing is wrong from tsserver end so that I can possibly raise an issue in Coc repo regarding diagnostic refresh.
Thanks
Also, I have found a way to replicate it on both Linux and Mac systems, the version details for the Linux one are:
vim version: NVIM v0.7.2 node version: v18.9.0 coc.nvim version: 0.0.82-b797c032 2022-09-04 21:59:01 +0800 coc.nvim directory: /home/yachint/.local/share/nvim/plugged/coc.nvim term: alacritty platform: linux
The replication steps are explained in the video link below: https://youtu.be/BtzG3WRyy_A (NOTE: Also tried the same with the .jsx extension and still same results)
Step details:
After 7th step, no matter how many times we save the file, the incorrect error is still shown. Only when we reload again, the error disappears.
I would be grateful if you could look into this and let me know if this issue is related to tsserver or Coc in general since it is only happening in React based files in my experience.
Confirmed bug of coc.nvim
Thanks for the acknowledgment, let me know if I should open an issue in Coc.nvim regarding the same.
Fixed on latest release branch of coc.nvim.
Thanks for the quick resolution, can confirm it has been fixed!
I keep having this issue that whenever I am writing writing jsx code, 5/10 times the errors are not getting refreshed even after saving. The errors were valid before but after I have fixed them it should not keep showing it, some errors are also shown without line indicators, like in the case below (showing 4 errors, but only 2 line indicators):
Also, in this case, I never had this error but still the server showing me this:
All gets fixed after I manually reload in nvim using ':e' command. I am not sure if this issue is coming from vim or tsserver but it seems like the server is not re-analyzing the file once it is written using ':w' or when we come to normal mode from insert. This does not happen all the time but as I said, 5/10 times it happens and I have to manually reload to fix it.