coc-eslint: eslint / tsserver errors won't disappear after being fixed

Result from CocInfo

## versions

vim version: NVIM v0.4.4
node version: v12.18.3
coc.nvim version: 0.0.78-fc983ce6dd
term: xterm-256color
platform: linux

## Output channel: eslint

[Info  - 14:24:59] ESLint server running in node v12.18.3
[Info  - 14:25:00] ESLint library loaded from: /home/channi16/imec/innovatrix/images/front/node_modules/eslint/lib/api.js
[Info  - 15:11:19] ESLint library loaded from: /home/channi16/imec/innovatrix/images/api/node_modules/eslint/lib/api.js

Describe the bug

The bug is hard to reproduce because it is only temporary. But it happens multiple times per day.

It happens with both coc-eslint and coc-tsserver so I don’t believe that it is an issue with those individually.

What happens is that I get a linting error message that shows a warning.

I then fix that error but the warning does not go away.

So I am left with a warning that I can’t clear. I can run :CocRestart to clear the warning, but it seems like this is a bug.

Reproduce the bug

I can’t reproduce this directly - it only happens on occasion about twice per day.

I have removed the coc-tsserver plugin to make sure it is nothing to do with coc-tsserver and coc-eslint conflicting.

Screenshots (optional)

You can see here that the eslint warning is pointing to line 661 where the variable used to be - but I have since move the variable a few lines up and fixed the warning.

Screenshot from 2020-09-08 19-37-04

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 15
  • Comments: 36 (10 by maintainers)

Most upvoted comments

I have reproduced the problem with big file, looks like eslint server ignores new text documents when it’s too busy.

I’m using iamcco/coc-diagnostic: diagnostic-languageserver extension for coc.nvim for eslint until coc-eslint improves on this:

coc-settings.json:

{
"diagnostic.refreshOnInsertMode": true,
"diagnostic.messageDelay": 500,
"diagnostic.refreshAfterSave": false,
"diagnostic-languageserver.filetypes": {
    "javascript": "eslint"
  },
"diagnostic-languageserver.linters": {
    "eslint": {
      "command": "./node_modules/.bin/eslint",
      "rootPatterns": [".git", "package.json"],
      "debounce": 100,
      "args": ["--stdin", "--stdin-filename", "%filepath", "--format", "json"],
      "sourceName": "eslint",
      "parseJson": {
        "errorsRoot": "[0].messages",
        "line": "line",
        "column": "column",
        "endLine": "endLine",
        "endColumn": "endColumn",
        "message": "${message} [${ruleId}]",
        "security": "severity"
      },
      "securities": {
        "2": "error",
        "1": "warning"
      }
    }
  }
}

Will try to fix after coc.nvim 0.0.80 released.

Thank you this is great. I haven’t tested it yet but I’ve done the upgrade. This wasn’t obvious to me how to do this. If anyone else is wondering:

  1. Update coc.nvim to v0.0.8 - I’m using Plug and so :PlugUpdate fixed that.
  2. Re-start neovim
  3. To update coc-eslint either re-run :CocInstall coc-eslint or :CocUpdate will update the coc plugin.

Try coc-eslint 1.4.0, if you still have this issue, open new issue with output of eslint.

Hey @chemzqm is there any progress on this? Its a huge detractor for the user experience of coc.nvim which would otherwise make vim every bit as good as VsCode

Auto change location list was removed, use :CocDiagnistic command to open location list with diagnostics

So I’m now seeing this bug:

Screenshot from 2020-09-20 16-31-52

It got “stuck” after this error:

[eslint no-undef] [E] 'c' is not defined. (no-undef) for when I started typing const and then even though I’ve typed the rest of the line const checked = value === null ? false : checked; it stays with the error.

This is the output I get from :CocCommand workspace.showOutput, I’ve created a gist because it’s too big to paste: https://gist.github.com/ianchanning/134988a5d3aed9f87a3dfb464682d51b