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

Get modern rubyfmt working #628

Merged
merged 2 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Improvements:
- Support SLIM heredocs [#274](https://github.com/rubyide/vscode-ruby/issues/274)
- Support heredocs defined inline during a method call [#183](https://github.com/rubyide/vscode-ruby/issues/183)
- Drop `spawn-rx` for custom version which allows greater control over failed commands
- Support [RubyFMT](https://github.com/samphippen/rubyfmt) as a formatter [#445](https://github.com/rubyide/vscode-ruby/issues/445)
- Support [RubyFMT](https://github.com/penelopezone/rubyfmt) as a formatter [#445](https://github.com/rubyide/vscode-ruby/issues/445)
- Add command palette entries for viewing extension and language server logs (`Ruby: Show Output Channel` and `Ruby: Show Language Server Output Channel`)
- Support multiline and keyword option YARD comments [#371](https://github.com/rubyide/vscode-ruby/pull/371)
- Improve/Fix Block Parameter Highlighting [#514](https://github.com/rubyide/vscode-ruby/pull/514)
Expand Down
2 changes: 1 addition & 1 deletion docs/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The language server currently supports formatting via the following formatters:
- [RuboCop](https://github.com/rubocop-hq/rubocop)
- [Standard](https://github.com/testdouble/standard)
- [Rufo](https://github.com/ruby-formatter/rufo)
- [RubyFMT](https://github.com/samphippen/rubyfmt)
- [RubyFMT](https://github.com/penelopezone/rubyfmt)

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion docs/language-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The server is built to be extensible, accurate, and performant with such feature
- Automatic Ruby environment detection with support for rvm, rbenv, chruby, and asdf
- Robust language feature extraction powered by the [tree-sitter](https://tree-sitter.github.io/tree-sitter/) project
- Lint support via RuboCop, Reek, and Standard
- Format support via RuboCop, Standard, and Rufo
- Format support via RuboCop, Standard, Rubyfmt, and Rufo
- Semantic code folding support
- Semantic highlighting support
- Intellisense support
Expand Down
7 changes: 2 additions & 5 deletions packages/language-server-ruby/src/formatters/RubyFMT.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import path from 'path';
import BaseFormatter from './BaseFormatter';

const RUBYFMT_PATH = path.resolve(__dirname, 'rubyfmt.rb');

export default class RubyFMT extends BaseFormatter {
get cmd(): string {
return 'ruby';
return 'rubyfmt';
}

get args(): string[] {
return ['--disable=gems', RUBYFMT_PATH];
return [];
}

get useBundler(): boolean {
Expand Down
Loading