coc-tsserver icon indicating copy to clipboard operation
coc-tsserver copied to clipboard

Typescript errors/warnings not showing until save

Open sam-mfb opened this issue 3 years ago • 2 comments

I am having an issue where TS errors will start to not show until I save the file. Usually everything works when I first open vim, but after a while the errors will stop appearing (or disappearing when fixed) until I do :w to save the file. If have been using this coc.nvim setup for years without a problem, and this only started in the last few weeks.

I realize this issue is a little vague. I'd be happy even for a little help on how to further troubleshoot/debug it.

CocInfo shows:

image

sam-mfb avatar Feb 13 '23 18:02 sam-mfb

Here's a small gif that captures the behavior. Note the first time I add the colon the error does not show up until I save. But then it disappears and reappears without saving after that, so it is intermittent. Any ideas on troubleshooting would be great. Thank you!

tserr

sam-mfb avatar Feb 13 '23 19:02 sam-mfb

I am still experiencing this bug. I am able to reproduce on a minimal linux setup as follows:

  • Install vim8 and coc.nvim on a minimal Ubuntu jammy 22 distribution. I have created a minimal Dockerfile with the necessary files in this repo. This is the exact setup I'm using to reproduce the bug
  • Launch vim, install coc.nvim, and coc-tsserver
  • Quit and relaunch vim with the mini.vim config file, i.e., vim -u mini.vm
  • Create a test.ts file and edit and fix TS errors. The TS diagnostics will not reliably update until you save, as shown in this gif:

coc-tsserver bug

I'm surprised more people aren't seeing this given that its reproducible on such a minimal configuration. I have used vim, coc.nvim, and typescript for years and had not seen this until earlier this year. Until then it worked flawlessly.

Additional Info:

vim version: VIM - Vi IMproved 8.2 8024919                                                                                                 
node version: v16.20.0                                                                                                                    
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800            |                                                                   
coc.nvim directory: /home/devuser/.vim/plugged/coc.nvim                                                                                   
term: dumb                                                                                                                            
platform: linux    

coc-tsserver: 2.1.3

I'm happy to provide any additional troubleshooting or diagnostics. Just let me know what would be helpful.

sam-mfb avatar Apr 17 '23 21:04 sam-mfb

I see, it seems expected as diagnostics not refreshed on insert mode by default, seems you're using easy mode vim, configure "diagnostic.refreshOnInsertMode": true to enable diagnostic refresh on insert mode. Checkout :h coc-diagnostics-refresh

chemzqm avatar May 15 '25 14:05 chemzqm

thanks for taking a look at this. this actually "fixed itself" at some point a while ago in my setup, and i'm not sure why. if it comes up again this is a good tip. thanks.

sam-mfb avatar May 15 '25 14:05 sam-mfb