flycheck / flycheck-inline

Display Flycheck errors inline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

package gets confused by character deletion via insert-in-front-hooks

jgarvin opened this issue · comments

I have a package that inserts a text snippet into the buffer, where one of the characters in the snippet has an overlay with an insert-in-front-hooks setup that deletes the character when you try to type anything in front of it with (delete-forward-char 1). This was the only way I was able to get the visual impression of having a placeholder for a string in the buffer that you could actually put the cursor on and then begin filling in. flycheck-inline seems to get confused by this and will keep any underlines around that character around even after the errors have been fixed until I manually close and reopen the file. I'm guessing that's because the package for efficiency is trying to do some sort of "damage" tracking of what has been changed in the buffer and it gets confused because it doesn't know about this deletion.

I am using rust-analyzer with lsp-mode. I know my errors are fixed because my code compiles, so I expect that analyzer also knows the code is fine (which is consistent with it being fixed when I reopen the file). I would expect flycheck to notice it is getting different results for a line from analyzer even if it's a part of a line hasn't changed from its point of view, but I've never integrated anything with lsp or known flycheck internals so there may be issues at play I'm not aware of.

I'm guessing that's because the package for efficiency is trying to do some sort of "damage" tracking of what has been changed in the buffer and it gets confused because it doesn't know about this deletion.

I don't think Flycheck does anything like that — we send the whole buffer to the analyzer every time.

When is your Flycheck set up to run? Is it configured to run only on save? Does saving the file remove the overlays?