Skip to content

Commit

Permalink
Fix nilable param runtime type check in server (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Mar 14, 2024
1 parent cc80b4e commit 641ab1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ruby_lsp/ruby_lsp_rails/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ def start
sig do
params(
request: String,
params: T::Hash[Symbol, T.untyped],
params: T.nilable(T::Hash[Symbol, T.untyped]),
).returns(T.any(Object, T::Hash[Symbol, T.untyped]))
end
def execute(request, params = {})
def execute(request, params)
case request
when "shutdown"
@running = false
VOID
when "model"
resolve_database_info_from_model(params.fetch(:name))
resolve_database_info_from_model(T.must(params).fetch(:name))
when "reload"
::Rails.application.reloader.reload!
VOID
Expand Down

0 comments on commit 641ab1e

Please sign in to comment.