Open pjg opened 1 year ago
FWIW I was able to use conform.nvim to run rubyfmt, and then an AutoCmd to run rubocop via LSP on rubyfmt's results. Reference: https://github.com/pjg/dotfiles/commit/2d6c577cba8ea0cd1f7e931489354b2e3097d1c0
I think something like ruby-lsp-rubyfmt would be necessary to integrate with ruby-lsp in vim. I don't think such project exists.
Hey @pjg! I stumbled across this issue recently and wanted to let you know that I've created a such a project, for bridging these technologies together. https://github.com/jscharf/ruby-lsp-rubyfmt
If you have any feedback for me or if you have time to test it out to make sure it works for you, I would really appreciate it.
I initially wanted to do this around December 2022 and asked in the Ruby LSP project here https://github.com/Shopify/ruby-lsp/issues/409
I've been looking for a way to integrate rubyfmt with my ruby-lsp vim (via coc.nvim), but was unable to do so.
Rubocop integration in coc-settings.json works perfectly as ruby-lsp provides integration with it by default:
I think something like ruby-lsp-rubyfmt would be necessary to integrate with ruby-lsp in vim. I don't think such project exists. Also my hope is that I can configure multiple formatters with different priorities, so that I can run rubyfmt first, and then/afterwards rubocop (or standardrb).
Also I'm coming to a realisation that rubyfmt will probably never support/read rubocop's (or standard's) config (https://github.com/fables-tales/rubyfmt/issues/445).
Edit: I've found similar request in vscode-ruby-lsp repo: https://github.com/Shopify/ruby-lsp/issues/1740