linter: Warnings / Errors sporadically not updating

Often (but sporadically) certain warnings and errors aren’t updated to reflect that they are no longer present. For example, using linter-flake8 (for python) F841 - local variable '<VARNAME> is assigned to but never used`, will remain even after that variable is definitely being used.

Work-arounds:

  • Closing the open window/buffer and reopening it fixes the problem.
  • Cutting and pasting the line causing the error sometimes seems to force a re-check, and fixes the problem.

It seems like there is some underlying bug the warnings/errors not to be updated, or for previous warnings not to be erased.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 2
  • Comments: 30 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@lzkelley Thanks for the gif, if I understand the bug pointed out correctly, I think I’ve already fixed it in the rewrite UI branch. I am sorry it’s taking too much, I am not good at css 😦

Anyways, the fix is to observe the marker and update the message object with the latest range after each update, then recalculate the key for the message and garbage collect it. I’ll try to backport the fixes soon

Some of the issues seem to be associated with having split panes. For example, sometimes only a single pane of the same file will have problems, but I just had an instance of closing a file in the right-pane, fixing the issues (many locations incorrectly marked as warnings/errors) in the left-pane. I don’t know if that might mean something more significantly for finding/determining the underlying problem…

Anything related to the display of messages, or triggering a run of the linter providers would be here in linter, not in one of the providers.

@emileber You can expect a fix real soon

I’ve noticed this with a few different linter-* providers, messages simply not being removed from display when they are no longer present in the return of the linter. I’ve never been able to get a good way to reproduce it though.