Skip to content

Conversation

@aaronlifton
Copy link

  • Update formatter runner to implement RubyLsp::Requests::Support::Formatter interface, implementing run_formatting
  • Update to register addon with global state, similar to the built-in Rubocop formatter in ruby-lsp
  • This allows the addon to work with version 0.17.1 of ruby-lsp, the latest version of ruby-lsp at time of writing

- Update formatter runner to implement RubyLsp::Requests::Support::Formatter
  interface, implementing `run_formatting`
- Update to register addon with global state, similar to the Rubocop
  formatter in `ruby-lsp`
- This allows the addon to work with version 0.17.1 of ruby-lsp
@cirdes
Copy link

cirdes commented Jun 9, 2024

I'm trying to make rubyfmt work with ruby-lsp on devcontainers but it's not working. I'm using ruby-lsp (0.17.2).

I have rubyfmt installed and can run it on the terminal and everything seems to be fine on ruby-lsp
Screenshot 2024-06-09 at 5 00 17 PM

This PR could solve my issue.

@schpet
Copy link

schpet commented Jun 10, 2024

just tried setting this up, and vscode shows me the following error:

Error loading addons: Ruby Fmt Formatter: wrong number of arguments (given 2, expected 0)

hoping confirmed this PR resolves it via

  # Gemfile
  gem 'ruby-lsp-rubyfmt', :git => 'https://github.com/aaronlifton/ruby-lsp-rubyfmt.git', :branch => 'main'

@cirdes
Copy link

cirdes commented Jun 19, 2024

@jscharf , any change to get this merged?

@jscharf
Copy link
Owner

jscharf commented Oct 12, 2025

@cirdes I would love to get this merged! One of my problems is that I've been away from this type of work for a while so I need to come up testing steps so I can test this locally before merging. I will try to get to this but any context you or others can help provide to get me caught up on what's changed in Ruby LSP integrations in the last year or so would be a big help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants