Class: RubyLsp::Notification

Inherits:
Message
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/ruby_lsp/utils.rb

Instance Attribute Summary

Attributes inherited from Message

#method, #params

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Message

#initialize

Constructor Details

This class inherits a constructor from RubyLsp::Message

Class Method Details

.window_log_message(message, type: Constant::MessageType::LOG) ⇒ Object



69
70
71
72
73
74
# File 'lib/ruby_lsp/utils.rb', line 69

def window_log_message(message, type: Constant::MessageType::LOG)
  new(
    method: "window/logMessage",
    params: Interface::LogMessageParams.new(type: type, message: message),
  )
end

.window_show_error(message) ⇒ Object



58
59
60
61
62
63
64
65
66
# File 'lib/ruby_lsp/utils.rb', line 58

def window_show_error(message)
  new(
    method: "window/showMessage",
    params: Interface::ShowMessageParams.new(
      type: Constant::MessageType::ERROR,
      message: message,
    ),
  )
end

Instance Method Details

#to_hashObject



80
81
82
# File 'lib/ruby_lsp/utils.rb', line 80

def to_hash
  { method: @method, params: T.unsafe(@params).to_hash }
end