neoclide / coc-vetur

Vue language server extension for coc.nvim
219 stars 7 forks source link

Errors show up delayed, only after first write #20

Closed doits closed 4 years ago

doits commented 4 years ago

I noticed a new strange behavior that it will only display errors after first write. So when I open a file no error is displayed until I do a :w. Then it shoes up instantly. And I have to wait some seconds, probably because the linter boots up. If I hit :w too early, no errors are displayed (and will not until I hit :w again).

This all started after updating @vue/eslint-config-typescript to 5.0.0 and with it @typescript-eslint/parser to 2.7.0.

doits commented 4 years ago

@chemzqm I again found it to be a much simpler issue ... sorry for the mess, but I still don't know why it behaves llike this.

chemzqm commented 4 years ago

Probably we can't do anything.

doits commented 4 years ago

I'm just guessing but maybe this is happening:

  1. When opening a file, the language server starts up and this takes some time (lets say 2-4 seconds)
  2. coc-vetur asks to lint the file but the language server is not ready, so it does not return any errors
  3. the language server gets ready
  4. on save the file is linted again, now the language server is ready and it returns the errors

Can this be the case? Or do you think there is something different happening?

I don't know any internals about coc or coc-vetur so I'm not sure if this is what might happen or coc works differently. Maybe you can give an educated guess and then I can take a look at the code to see if there is anything we can do.

chemzqm commented 4 years ago

Should be problem of your vetur, I don't know anything about the detail.

doits commented 4 years ago

Can you please test if you too have the problem? If not, then maybe my local vim config is the problem.

I just uploaded an example project at https://github.com/doits/vue-delay-bug. Can you please clone it and simply open src/App.vue in vim.

For me it has the mentioned behavior of not displaying the linting error (wrong return in methods) directly after opening the file, but only after I save the file after waiting 1-2 seconds.

Is it like this for you too?

chemzqm commented 4 years ago

I don't have any issue with your project, so no idea. Try minimal vimrc instead.

doits commented 4 years ago

Alright, thanks for testing, then it must be something with my config ... I'll see if I find this out, but it is no problem with coc-vetur then.