Class: LanguageServer::Protocol::Interface::RenameRegistrationOptions

Inherits:
TextDocumentRegistrationOptions show all
Defined in:
lib/language_server/protocol/interface/rename_registration_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from TextDocumentRegistrationOptions

#document_selector

Constructor Details

#initialize(document_selector:, prepare_provider: nil) ⇒ RenameRegistrationOptions

Returns a new instance of RenameRegistrationOptions.



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

def initialize(document_selector:, prepare_provider: nil)
  @attributes = {}

  @attributes[:documentSelector] = document_selector
  @attributes[:prepareProvider] = prepare_provider if prepare_provider

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



22
23
24
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 22

def attributes
  @attributes
end

Instance Method Details

#prepare_providerboolean

Renames should be checked and tested for validity before being executed.

Returns:

  • (boolean)


18
19
20
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 18

def prepare_provider
  attributes.fetch(:prepareProvider)
end

#to_hashObject



24
25
26
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 24

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



28
29
30
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 28

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