anaconda_rust icon indicating copy to clipboard operation
anaconda_rust copied to clipboard

Format on save sometimes leaves view stuck read-only

Open mthebridge opened this issue 8 years ago • 3 comments

ST3 build 3126 on Linux (CentOS 7), anaconda_rust 0.2.10.

Sometimes, with rust_format_on_save set, some files will hit a bug where the format seems to hang forever - the progress bar consistently shows "Auto formatting file..." and the view remains read-only. A close and re-open of the file clears the read-only state but sets it again as soon as I save. Restarting Sublime fixes for a while but eventually it starts happening again.

I'm not sure whether I have some other plugin interfering but I've disabled pretty much everything else and I still hit this intermittently. It is intermittent, so it's not that the path to rustfmt is wrong or anything.

From a quick look at commands/rustfmt.py, it looks like the problem might be in the timeout case - that callback doesn't seem to clear the progress bar or clear the read-only state? But I don't know the Anaconda internals well enough to be sure... I've tried looking at the jsonserver logfiles, but they don't show anything that looks like an error.

mthebridge avatar Aug 18 '17 15:08 mthebridge

I've had this occur more often when I've introduced small syntax errors in my code and then tried to format than any other time. I'm unsure if that's just a placebo, but I do think it's related to rustfmt failing.

Restarting sublime text then closing the view and re-opening does remove the read only status for me.

daboross avatar Aug 21 '17 01:08 daboross

We had the same problem in the Go driver, I need to make room in my non existent spare time to try to fix it.

DamnWidget avatar Aug 21 '17 07:08 DamnWidget

I get this error when I run Format Rust Document Style:

INFO:Anaconda.anaconda_lib.callback:Calback 85bbb6584e8e4d4cadca07871f9d5bf7 came back with data but it's status was `timed_out` already
ERROR:root:clean_tmp_file() takes 2 positional arguments but 3 were given
ERROR:root:Traceback (most recent call last):
ERROR:root:  File "C:\Users\User\AppData\Roaming\Sublime Text 3\Packages\Anaconda\anaconda_lib\jsonclient.py", line 104, in process_message
ERROR:root:    callback(data)
ERROR:root:  File "C:\Users\User\AppData\Roaming\Sublime Text 3\Packages\Anaconda\anaconda_lib\callback.py", line 73, in __call__
ERROR:root:    return self._fire_callback(*args, **kwargs)
ERROR:root:  File "C:\Users\User\AppData\Roaming\Sublime Text 3\Packages\Anaconda\anaconda_lib\callback.py", line 219, in _fire_callback
ERROR:root:    return callback and callback(*args, **kwargs)
ERROR:root:TypeError: clean_tmp_file() takes 2 positional arguments but 3 were given

Same behaviour as described above.

sleighsoft avatar Feb 04 '18 23:02 sleighsoft