Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format on save sometimes leaves view stuck read-only #34

Open
mthebridge opened this issue Aug 18, 2017 · 3 comments
Open

Format on save sometimes leaves view stuck read-only #34

mthebridge opened this issue Aug 18, 2017 · 3 comments

Comments

@mthebridge
Copy link

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.

@daboross
Copy link

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.

@DamnWidget
Copy link
Owner

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.

@sleighsoft
Copy link
Contributor

sleighsoft commented Feb 4, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants