-
Notifications
You must be signed in to change notification settings - Fork 23
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
Rubocop formatting does not work #83
Comments
Confirmed. The server responds with the formatted document and a null range, which is supposed to mean that the whole document should be replaced. Apparently the client ignores edits without ranges. I'll fix it in the gem for the next release. |
@castwide, Thank you so much. I was driving nuts by thinking if I did something wrong with config. Hopefully, wait for a fix now. Gencer. |
Fixed in gem v0.28.3. |
@castwide , I do not know what other fixes/additions other than this fix happen in master branch but at the moment everytime I open VSCode and work on Ruby, solargraph (actually ruby.exe) terminates itself. "Restart solargraph" does not work either. |
This is only output i can find at the moment:
|
One possibility: can you tell me the results of |
I always uninstall eventmachine and install with system libraries as stated in README. When eventmachine is wrong, Solargraph doesnt even start. In my case, it starts, works for a while then ruby.exe exits. |
The only time I've seen that happen is in an experimental version of the extension that uses a stdio transport. This is the first time I've seen anything similar with the socket transport. Does it happen with any workspace you open? How about a single ruby file without a workspace? |
Also, one other thing you can try is removing the experimental |
Let me try both with another project and without runtime and report back. I do not want to report without being sure. If this happens again I will raise a new issue and link here. |
@gencer I may have found the issue. The server crashes intermittently while generating additional documentation for completion items. Best I can tell, it's an access violation due to some component in the RDoc library that's not thread-safe. That would explain why you and I encounter the same bug under different circumstances. I'll fast-track a fix and update the gem in a day or so. |
I got it again:
This is happen usually and especially two or more projects are open at the same time. Any log in anywhere? |
@castwide, one more thing. I am not sure if this log entry belongs to your gem but I got this:
|
The There might be more information in the console (Help -> Toggle Developer Tools). |
Unfortunately, there is no any log in developer tools rather than I sent above. Usually happens when I work inside each blocks. Like;
|
@gencer Thanks. I haven't been able to reproduce it yet, but I think we're getting closer. I tried a few different ways of copy/pasting blocks in code, including variations that result in parse errors. Nothing so far. If you can share the file where it happens, or point me to a GitHub repo that contains the code, that might help, but I understand if it's not an option. |
@castwide. This is what I did:
But if I try this code block only outside of that file then it works without problem. This means there is an another thing that trigger this error. Do you have an email? I can send you that file privately. Or how can I transfer that file to you privately? Gencer. |
Update: I found your email on your profile and send to you. |
@gencer I'm finally able to reproduce the error following the steps you posted with the file you sent. Now I'll get to work on tracking down the root cause. With any luck, I can have a fix released within a week or so. Thanks again for all your help. |
@castwide, I'm glad I could help. Let me know if anything needed! Awaiting for your fixes. Thanks, |
The root cause turned out to be a bug in how AST nodes are generated for code with unrecoverable syntax errors. It worked most of the time by sheer coincidence, but in rare instances it would result in recursive trees. The fix is in the master branch and will be released in gem version 0.29.0. |
I've tested Thank you so much, Fred, for your awesome gem and help. (P.S.: If I encounter any problem again, I will ping here and send you the whole file via email if necessary) |
The fix is published in gem v0.29.0. |
Could you please close this issue? |
I want to fix, clean and format my *.rb files when I press Format Document. However, it doesn't work. It was working before but today I want to format few files and it just doesn't work.
.solargraph.yml:
No
rubocop.yml
file present in folder. Simply pressF1
and selectFormat Document
. ruby.exe starts in the background and exits after few seconds. No formatting done to the document. No logs (including in debug console) indicating any error. This is my settings:VScode + OS Env:
The text was updated successfully, but these errors were encountered: