Class: LanguageServer::Protocol::Interface::RenameClientCapabilities

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dynamic_registration: nil, prepare_support: nil, prepare_support_default_behavior: nil, honors_change_annotations: nil) ⇒ RenameClientCapabilities

Returns a new instance of RenameClientCapabilities.



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

def initialize(dynamic_registration: nil, prepare_support: nil, prepare_support_default_behavior: nil, honors_change_annotations: nil)
  @attributes = {}

  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
  @attributes[:prepareSupport] = prepare_support if prepare_support
  @attributes[:prepareSupportDefaultBehavior] = prepare_support_default_behavior if prepare_support_default_behavior
  @attributes[:honorsChangeAnnotations] = honors_change_annotations if honors_change_annotations

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



57
58
59
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 57

def attributes
  @attributes
end

Instance Method Details

#dynamic_registrationboolean

Whether rename supports dynamic registration.

Returns:

  • (boolean)


20
21
22
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 20

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 rename request’s workspace edit by for example presenting the workspace edit in the user interface and asking for confirmation.

Returns:

  • (boolean)


53
54
55
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 53

def honors_change_annotations
  attributes.fetch(:honorsChangeAnnotations)
end

#prepare_supportboolean

Client supports testing for validity of rename operations before execution.

Returns:

  • (boolean)


29
30
31
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 29

def prepare_support
  attributes.fetch(:prepareSupport)
end

#prepare_support_default_behavior1

Client supports the default behavior result (‘{ defaultBehavior: boolean }`).

The value indicates the default behavior used by the client.

Returns:

  • (1)


41
42
43
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 41

def prepare_support_default_behavior
  attributes.fetch(:prepareSupportDefaultBehavior)
end

#to_hashObject



59
60
61
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 59

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



63
64
65
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 63

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