-
Notifications
You must be signed in to change notification settings - Fork 28
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
WIP: Server addons #438
Conversation
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 |
There was a problem hiding this comment.
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
.
e7ca765
to
715f97e
Compare
lib/ruby_lsp/ruby_lsp_rails/addon.rb
Outdated
@@ -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) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
See #454 instead. |
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:
entries_for
method to indexer ruby-lsp#2500Co-authored with @KaanOzkan and @vinistock