Class: LanguageServer::Protocol::Interface::ExecuteCommandParams

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/execute_command_params.rb

Overview

The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest).

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (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

#argumentsLSPAny[] | nil

Arguments that the command should be invoked with.

Returns:

  • (LSPAny[] | nil)


30
31
32
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 30

def arguments
  attributes.fetch(:arguments)
end

#commandstring

The identifier of the actual command handler.

Returns:

  • (string)


22
23
24
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 22

def command
  attributes.fetch(:command)
end

#to_hashObject



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_tokenProgressToken | nil

An optional token that a server can use to report work done progress.

Returns:

  • (ProgressToken | nil)


38
39
40
# File 'lib/language_server/protocol/interface/execute_command_params.rb', line 38

def work_done_token
  attributes.fetch(:workDoneToken)
end