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

WIP: Server addons #438

Closed
wants to merge 32 commits into from
Closed

WIP: Server addons #438

wants to merge 32 commits into from

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Aug 26, 2024

This PR adds support for addons which need to running within a Rails context.

This is being initially aimed a supporting an LSP for Tapioca.

Related:

Co-authored with @KaanOzkan and @vinistock

class << self
def require_server_addon(gem_name)
require "ruby_lsp/#{gem_name}/addon"
Object.const_get("RubyLsp::#{gem_name.classify}::Addon") # rubocop:disable Sorbet/ConstantsFromStrings
Copy link
Contributor Author

@andyw8 andyw8 Aug 27, 2024

Choose a reason for hiding this comment

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

This assumes a naming convention such that foo_bar would have an addon named RubyLsp::FooBar::Addon.

@andyw8 andyw8 added the enhancement New feature or request label Aug 28, 2024
@@ -26,23 +26,27 @@ def initialize

# We first initialize the client as a NullClient, so that we can start the server in a background thread. Until
# the real client is initialized, features that depend on it will not be blocked by using the NullClient
@client = T.let(NullClient.new, RunnerClient)
@rails_runner_client = T.let(NullClient.new, RunnerClient)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed for clarity.

@@ -170,6 +174,12 @@ def make_request(request, params = nil)
read_response
end

# Notifications are like messages, but one-way, with no response sent back.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made public so that addons can call it.

@andyw8
Copy link
Contributor Author

andyw8 commented Sep 20, 2024

See #454 instead.

@andyw8 andyw8 closed this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants