Replies: 4 comments 1 reply
This comment was marked as off-topic.
This comment was marked as off-topic.
-
This was done for performance reasons. Solargraph formats code by running Rubocop from scratch every time. This is typically done on file write, and it has to be synchronous: the editor can't allow input until the formatting has finished (otherwise it'll then have to reconcile the edits against a file that has changed underneath it). So a synchronous format on file write is great unless the formatter is slow. With Solargraph using Rubocop, I'm seeing writes that take 3 seconds or more. Standardrb's Note that you can run multiple LSP servers concurrently. I can imagine a world where Solargraph provides tab completion, refactoring, etc., and Rubocop provides formatting and linting. |
Beta Was this translation helpful? Give feedback.
-
FYI, I opened PR #11926 to support built-in LSP. |
Beta Was this translation helpful? Give feedback.
-
Built-in RuboCop LSP server is now supported on RuboCop 1.53+. If you are a VS Code user, you can use vscode-rubocop which is a VS Code extension for the built-in LSP. Enjoy! |
Beta Was this translation helpful? Give feedback.
-
I've noticed that StandardRB has added an LSP server recently (see https://blog.testdouble.com/posts/2023-02-16-its-official-the-standard-ruby-vscode-extension/) and I've been wondering if that'd be a reasonable direction for us to take as well. Obviously RuboCop can't provide support for everything in the LSP API but formatting and linting is probably plenty for some people.
On the other other hand I think some fully-fledged Ruby LSP servers are using RuboCop internally anyways. Admittedly I don't follow the trends in this department that much.
Beta Was this translation helpful? Give feedback.
All reactions