Class: LanguageServer::Protocol::Interface::ExecuteCommandParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ExecuteCommandParams
- Defined in:
- lib/language_server/protocol/interface/execute_command_params.rb
Overview
The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest).
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#arguments ⇒ LSPAny[] | nil
Arguments that the command should be invoked with.
-
#command ⇒ string
The identifier of the actual command handler.
-
#initialize(command:, arguments: nil, work_done_token: nil) ⇒ ExecuteCommandParams
constructor
A new instance of ExecuteCommandParams.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
Constructor Details
#initialize(command:, arguments: nil, work_done_token: nil) ⇒ ExecuteCommandParams
Returns a new instance of ExecuteCommandParams.
8 9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 8 def initialize(command:, arguments: nil, work_done_token: nil) @attributes = {} @attributes[:command] = command @attributes[:arguments] = arguments if arguments @attributes[:workDoneToken] = work_done_token if work_done_token @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
42 43 44 |
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 42 def attributes @attributes end |
Instance Method Details
#arguments ⇒ LSPAny[] | nil
Arguments that the command should be invoked with.
30 31 32 |
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 30 def arguments attributes.fetch(:arguments) end |
#command ⇒ string
The identifier of the actual command handler.
22 23 24 |
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 22 def command attributes.fetch(:command) end |
#to_hash ⇒ Object
44 45 46 |
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 44 def to_hash attributes end |
#to_json(*args) ⇒ Object
48 49 50 |
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 48 def to_json(*args) to_hash.to_json(*args) end |
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
38 39 40 |
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 38 def work_done_token attributes.fetch(:workDoneToken) end |