Class: LanguageServer::Protocol::Interface::CodeActionClientCapabilities

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dynamic_registration: nil, code_action_literal_support: nil, is_preferred_support: nil, disabled_support: nil, data_support: nil, resolve_support: nil, honors_change_annotations: nil) ⇒ CodeActionClientCapabilities

Returns a new instance of CodeActionClientCapabilities.



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

def initialize(dynamic_registration: nil, code_action_literal_support: nil, is_preferred_support: nil, disabled_support: nil, data_support: nil, resolve_support: nil, honors_change_annotations: nil)
  @attributes = {}

  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
  @attributes[:codeActionLiteralSupport] = code_action_literal_support if code_action_literal_support
  @attributes[:isPreferredSupport] = is_preferred_support if is_preferred_support
  @attributes[:disabledSupport] = disabled_support if disabled_support
  @attributes[:dataSupport] = data_support if data_support
  @attributes[:resolveSupport] = resolve_support if resolve_support
  @attributes[:honorsChangeAnnotations] = honors_change_annotations if honors_change_annotations

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



83
84
85
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 83

def attributes
  @attributes
end

Instance Method Details

#code_action_literal_support{ codeActionKind: { valueSet: string[]; }; }

The client supports code action literals as a valid response of the ‘textDocument/codeAction` request.

Returns:

  • ({ codeActionKind: { valueSet: string[]; }; })


32
33
34
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 32

def code_action_literal_support
  attributes.fetch(:codeActionLiteralSupport)
end

#data_supportboolean

Whether code action supports the ‘data` property which is preserved between a `textDocument/codeAction` and a `codeAction/resolve` request.

Returns:

  • (boolean)


58
59
60
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 58

def data_support
  attributes.fetch(:dataSupport)
end

#disabled_supportboolean

Whether code action supports the ‘disabled` property.

Returns:

  • (boolean)


48
49
50
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 48

def disabled_support
  attributes.fetch(:disabledSupport)
end

#dynamic_registrationboolean

Whether code action supports dynamic registration.

Returns:

  • (boolean)


23
24
25
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 23

def dynamic_registration
  attributes.fetch(:dynamicRegistration)
end

#honors_change_annotationsboolean

Whether the client honors the change annotations in text edits and resource operations returned via the ‘CodeAction#edit` property by for example presenting the workspace edit in the user interface and asking for confirmation.

Returns:

  • (boolean)


79
80
81
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 79

def honors_change_annotations
  attributes.fetch(:honorsChangeAnnotations)
end

#is_preferred_supportboolean

Whether code action supports the ‘isPreferred` property.

Returns:

  • (boolean)


40
41
42
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 40

def is_preferred_support
  attributes.fetch(:isPreferredSupport)
end

#resolve_support{ properties: string[]; }

Whether the client supports resolving additional code action properties via a separate ‘codeAction/resolve` request.

Returns:

  • ({ properties: string[]; })


67
68
69
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 67

def resolve_support
  attributes.fetch(:resolveSupport)
end

#to_hashObject



85
86
87
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 85

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



89
90
91
# File 'lib/language_server/protocol/interface/code_action_client_capabilities.rb', line 89

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