castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
423 stars 25 forks source link

Formatter running infinetly #173

Closed Vearmox closed 4 years ago

Vearmox commented 4 years ago

When i try to save an .rb file a window stating Saving 'xxxxxx.rb': Running 'Ruby Solargraph' Formatter (configure). pops u and it keeps running forever without saving the file. I tried reinstalling the solargraph gem, the extension, rvm, ruby itself but it wont help and im still getting the same error. Im running MacOs Mojave and ruby 2.6.6 (same version stated in .ruby-verision file Other extensions formatters work(ruby-rubocop) for example.

henriquetatagiba commented 4 years ago

Environment Info: MacOS High Sierra VS Code: 1.44.2 Solargraph Gem: 0.39.7 Ruby Solargraph Plugin: 0.21.1 Ruby: 2.6.6p146

Happens with me when I try to save a file with special characters (é, ã, ê, ç...) in it.

If I remove those chars and restart vscode, the solargraph will work again.

Maybe there's something to do with castwide/solargraph#33.

castwide commented 4 years ago

Do either of you get a backtrace in the developer console (Help -> Toggle Developer Tools)?

Vearmox commented 4 years ago

Environment Info: MacOS High Sierra VS Code: 1.44.2 Solargraph Gem: 0.39.7 Ruby Solargraph Plugin: 0.21.1 Ruby: 2.6.6p146

Happens with me when I try to save a file with special characters (é, ã, ê, ç...) in it.

If I remove those chars and restart vscode, the solargraph will work again.

Maybe there's something to do with this issue

You were right. Its letters like Ä which break the formatter (even if its just a string). Is there any way to fix this?

henriquetatagiba commented 4 years ago

Do either of you get a backtrace in the developer console (Help -> Toggle Developer Tools)?

@castwide, here's my console when I save a file with special characters:

image

It's the same error on #166

castwide commented 4 years ago

The latest version of the gem (0.39.11) declares UTF-8 as the default external encoding. I'm closing this issue since the same bug is being tracked in #166. Please feel free to comment there if the problem persists.