flycheck / flycheck-inline

Display Flycheck errors inline
GNU General Public License v3.0
139 stars 10 forks source link

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

Open jgarvin opened 4 years ago

jgarvin commented 4 years ago

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.

cpitclaudel commented 4 years ago

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?

jgarvin commented 4 years ago

I haven't changed flycheck's behavior from whatever the default is. Saving does not fix it though.

On Fri, Jun 12, 2020, 1:49 PM Clément Pit-Claudel notifications@github.com wrote:

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?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/flycheck/flycheck-inline/issues/15#issuecomment-643431595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAY7MVR5Q3N2W3J42DDIH3RWJ2DHANCNFSM4N4QDBUQ .