Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Selection formatting broken with rubocop and standardrb #434

Closed
@solnic

Description

@solnic

Your environment

  • vscode-ruby version: 0.22.0
  • Ruby version: 2.4.1
  • Ruby version manager (if any): chruby
  • VS Code version: 1.31.1
  • Operating System: macOS Mojave
  • Using language server? yes

Expected behavior

When I select one or more lines in a file and execute "Format Selection" command, it should use the configured tool (rubocop or standardrb) to format selected part of the file.

FWIW - rufo does work and "Format Document" command works fine too, regardless of the formatting tool.

Actual behavior

Getting exceptions in the console like this:

rubocop:

[Error - 11:50:39 AM] Request textDocument/rangeFormatting failed.
  Message: Request textDocument/rangeFormatting failed with message: 
    unable to execute rubocop -s /absolute/path/to/the/file.rb -a:
    Error: Failed with exit code: 1 - unknown error
  Code: -32603 

standardb:

Format: executing standardrb -s  /absolute/path/to/the/file.rb --fix...
[Error - 11:52:44 AM] Request textDocument/rangeFormatting failed.
  Message: Request textDocument/rangeFormatting failed with message: 
    unable to execute standardrb -s /absolute/path/to/the/file.rb --fix:
    Error: Failed with exit code: 1 - unknown error

Metadata

Metadata

Assignees

Labels

bugBug reports

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions