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.



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

def attributes
  @attributes
end

Instance Method Details

#dynamic_registrationboolean | nil

Whether rename supports dynamic registration.

Returns:

  • (boolean | nil)


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

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

Since:

  • 3.16.0



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

def honors_change_annotations
  attributes.fetch(:honorsChangeAnnotations)
end

#prepare_supportboolean | nil

Client supports testing for validity of rename operations before execution.

Returns:

  • (boolean | nil)

Since:

  • 3.12.0



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

def prepare_support
  attributes.fetch(:prepareSupport)
end

#prepare_support_default_behaviorPrepareSupportDefaultBehavior | nil

Client supports the default behavior result.

The value indicates the default behavior used by the client.

Returns:

  • (PrepareSupportDefaultBehavior | nil)

Since:

  • 3.16.0



44
45
46
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 44

def prepare_support_default_behavior
  attributes.fetch(:prepareSupportDefaultBehavior)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



68
69
70
# File 'lib/language_server/protocol/interface/rename_client_capabilities.rb', line 68

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