sway icon indicating copy to clipboard operation
sway copied to clipboard

Handle removing the lsp-lock file in cases of non graceful IDE shutdown

Open JoshuaBatty opened this issue 1 year ago • 0 comments

This lock file was originally introduced in #5094

While it does solve the original issue in #4893 , it can lead to problems when the IDE was shutdown in a non-graceful manner, leaving behind the old lock file. This is the report from Slack:

forc fmt refuses to format claiming that some files are open in an editor. I'm using nvim. Thought it was looking for swap files but there were none, everything was saved cleanly. Turns out the sway lsp marked the file as dirty using a file as a lock over in "$HOME/.forc/.lsp_locks" or something similar. Had to manually remove the file. Don't know how robust the lock file removal process is in cases of a ungraceful shutdown of the sway lsp. In any case it took some digging around the code to figure out what to remove. Maybe it would cause less headaches going forward to lower this from a refusal to format down to a warning?

JoshuaBatty avatar Feb 19 '24 22:02 JoshuaBatty