Class: LanguageServer::Protocol::Interface::CodeActionRegistrationOptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_selector:, work_done_progress: nil, code_action_kinds: nil, resolve_provider: nil) ⇒ CodeActionRegistrationOptions

Returns a new instance of CodeActionRegistrationOptions.



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

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

  @attributes[:documentSelector] = document_selector
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
  @attributes[:codeActionKinds] = code_action_kinds if code_action_kinds
  @attributes[:resolveProvider] = resolve_provider if resolve_provider

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



50
51
52
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 50

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[])


37
38
39
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 37

def code_action_kinds
  attributes.fetch(:codeActionKinds)
end

#document_selectorDocumentSelector

A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.

Returns:

  • (DocumentSelector)


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

def document_selector
  attributes.fetch(:documentSelector)
end

#resolve_providerboolean

The server provides support to resolve additional information for a code action.

Returns:

  • (boolean)


46
47
48
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 46

def resolve_provider
  attributes.fetch(:resolveProvider)
end

#to_hashObject



52
53
54
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 52

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



56
57
58
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 56

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

#work_done_progressboolean

Returns:

  • (boolean)


26
27
28
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 26

def work_done_progress
  attributes.fetch(:workDoneProgress)
end