clojureVSCode icon indicating copy to clipboard operation
clojureVSCode copied to clipboard

Clojure files hang sometimes in UNSAVED state

Open avli opened this issue 6 years ago • 3 comments

Clojure files hang sometimes in the UNSAVED state event after Cmd+s or File -> Save. Not sure it's an extension issue – need to figure out.

Here is the first mention of the glitch.

avli avatar Mar 11 '18 06:03 avli

for me this will only happen when clojureVSCode.formatOnSave is set to true

paschdan avatar Apr 30 '18 12:04 paschdan

I'm having the same problem. Doesn't seem to happen to every file in my project but definitely most of them although I'm not sure what the difference is which triggers this behavior. Even having a file with just (defn foo [x] x) in it causes this problem. Also, if I make a change that requires a fix from cljfmt, save the file, then close it to discard then unsaved changes, then reopen it, the file will be in the pre-cljfmt-fix state which means that the transformations done by cljfmt are occurring after the save is done. I did a bit of digging on the VS Code documentation and found that the vscode.workspace.onWillSaveTextDocument method allows you to register async work and the formatFile method in clojureFormat.ts looks like it does some async work. So maybe making it async will solve this? I actually created a branch which solves it https://github.com/williamlindsay/clojureVSCode that said I did a bit more work in it since I want to do a few more things.

williamlindsay avatar May 24 '18 17:05 williamlindsay

Is there any progress on this? I'm also experiencing the problem and a fix would be great.

juusaw avatar Nov 26 '18 08:11 juusaw