Class: LanguageServer::Protocol::Interface::CodeActionOptions

Inherits:
WorkDoneProgressOptions show all
Defined in:
lib/language_server/protocol/interface/code_action_options.rb

Direct Known Subclasses

CodeActionRegistrationOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from WorkDoneProgressOptions

#work_done_progress

Constructor Details

#initialize(work_done_progress: nil, code_action_kinds: nil) ⇒ CodeActionOptions

Returns a new instance of CodeActionOptions.



5
6
7
8
9
10
11
12
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 5

def initialize(work_done_progress: nil, code_action_kinds: nil)
  @attributes = {}

  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
  @attributes[:codeActionKinds] = code_action_kinds if code_action_kinds

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



25
26
27
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 25

def attributes
  @attributes
end

Instance Method Details

#code_action_kindsstring[]

CodeActionKinds that this server may return.

The list of kinds may be generic, such as ‘CodeActionKind.Refactor`, or the server may list out every specific kind they provide.

Returns:

  • (string[])


21
22
23
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 21

def code_action_kinds
  attributes.fetch(:codeActionKinds)
end

#to_hashObject



27
28
29
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 27

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



31
32
33
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 31

def to_json(*args)
  to_hash.to_json(*args)
end