After I save a file, LSP updates the file but does not refresh the buffer
joe-humphreys opened this issue · 1 comments
Describe the bug
Every time I save a Java file, LSP's save hooks run, which usually results in the file being changed on disk. However, the buffer where I am visiting the file does not get refreshed. So when I go to make further changes, I get a message <filename> changed on disk; really edit the buffer? (y, n, r or C-h)
. Effectively, that means every time I save, I have to wait a moment and then hit 'r' before doing further edits, which is very distracting.
To Reproduce
- Open a java file.
- Go to any line with code on it and add a few spaces at the beginning of the line.
- Save the file
- Begin typing
Expected behavior
If a background process changes a file I've got open in a buffer, the changes should just show up immediately in the buffer, without prompting me to revert.
Logs
Content of Messages buffer with lsp-print-io
set to t:
LSP :: Disconnected
LSP :: Connected to [jdtls:15943 /home/joh/git/mailific/mailific-spf].
Saving file /home/joh/git/mailific/mailific-spf/src/main/java/net/mailific/spf/Spf.java...
Wrote /home/joh/git/mailific/mailific-spf/src/main/java/net/mailific/spf/Spf.java
Spf.java changed on disk; really edit the buffer? (y, n, r or C-h) r
LSP :: Disconnected
LSP :: Connected to [jdtls:15943 /home/joh/git/mailific/mailific-spf].
ask-user-about-supersession-threat: File reverted: ~/git/mailific/mailific-spf/src/main/java/net/mailific/spf/Spf.java