This fixes a few issues that have popped up. These include
Formatting only working on the second run of the intellij default formatter. The issue was our DprintExternalFormatter was sending ranges to dprint and IntelliJ was reporting a formatting range larger than the actual file content. I have ensured that we are just sending the actual size of the file as range formatting is not entirely supported yet
I silenced an error that was thrown when restarting dprint, this was caused by shutting down a process while the StdoutListener was waiting to read from the processes stdout. As this is a known exception we now log it quietly.
I improved handling on virtual files, apparently we should be checking if there is an "originalFile" in the case when a PsiFile has a null virtual file.
I fixed the stderr logger so it logs more frequently. It is still in a different thread so timings may be off but due to the nature of Java stream reading I think this is necessary at this time. I don't believe its possible to check if there is readable content without blocking a thread.
Add a listener for config file changes and restart if a change is detected. This won't pick up changes if they are made outside of IntelliJ
Overview
This fixes a few issues that have popped up. These include
DprintExternalFormatter
was sending ranges to dprint and IntelliJ was reporting a formatting range larger than the actual file content. I have ensured that we are just sending the actual size of the file as range formatting is not entirely supported yetStdoutListener
was waiting to read from the processes stdout. As this is a known exception we now log it quietly.PsiFile
has a null virtual file.Fixes #33