Solargraph: Error on Formatting: Solargraph::LanguageServer::Message::TextDocument::Formatting::Shellwords

Created on 22 Dec 2018  路  5Comments  路  Source: castwide/solargraph

Using VSCode, solargraph unable to format any of my files. This exception given:

[Error - 7:16:13 PM] Request textDocument/formatting failed.
  Message: [NameError] uninitialized constant Solargraph::LanguageServer::Message::TextDocument::Formatting::Shellwords
  Code: -32603 

All 5 comments

I'm not able to reproduce this error, but I can see a likely reason why. The Formatting message class uses Shellwords but does not explicitly require it. If some other process that uses Shellwords has already executed, it's fine. If not, formatting fails.

The obvious solution is to require 'shellwords' with the Formatting class. It doesn't make a difference in my setup, but it doesn't hurt anything either. It's pushed to master. Let me know if that works for you.

Fixed here.

Thank you!

Released in v0.30.0.

@castwide, I got the same error on 0.30.0. (release not master)

0.30.1 fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

taylorthurlow picture taylorthurlow  路  4Comments

art-solopov picture art-solopov  路  3Comments

siumennel picture siumennel  路  5Comments

PyvesB picture PyvesB  路  4Comments

castwide picture castwide  路  4Comments