Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split ServerAddon into new file #469

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

johansenja
Copy link

@johansenja johansenja commented Oct 2, 2024

  • It is able to benefit from strict typing now removed because of some runtime problems
  • It simplifies server.rb
  • It is now possible to require it specifically in other files, eg if you want to write tests for your server addon, you can require the server addon file specifically

I originially had some other changes here too, but there are no longer needed!

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I think extracting the server addon definition to another file is fine, but the rails runner client changes are breaking some of the conventions we're putting in place

lib/ruby_lsp/ruby_lsp_rails/addon.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/runner_client.rb Outdated Show resolved Hide resolved
@johansenja johansenja changed the title Improve ease of use of ServerAddon Split ServerAddon into new file Oct 2, 2024
@johansenja
Copy link
Author

Thanks for the feedback! The comments definitely make sense and so I've taken out two of the commits which would no longer be necessary - leaving this just with the changes to move ServerAddon into a new file (and have updated description and title accordingly). IMO this change could still be useful to split up server.rb, and to give the addon typings - but of course I leave it up to you to make the decision!

@vinistock
Copy link
Member

@andyw8 now that I think about it, didn't we hit issues when trying to require the Sorbet runtime in the server? If my memory serves me right, it sometimes led to issues with the application.

Maybe we could just split the files, but still make that one untyped.

@andyw8
Copy link
Contributor

andyw8 commented Oct 3, 2024

Yes, I remember there was a problem, but not the exact details.

I agree with the splitting, but for now let's keep sorbet-runtime out of the server to reduce the risk.

@@ -0,0 +1,54 @@
# typed: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since .rubocop.yml was updated I think this shouldn't be needed?

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a rebase, but the split looks good

@andyw8
Copy link
Contributor

andyw8 commented Oct 30, 2024

Hi @johansenja, are you hoping to continue on this?

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.

3 participants