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

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

Overview

Registration options for a [RenameRequest](#RenameRequest).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RenameRegistrationOptions.



8
9
10
11
12
13
14
15
16
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 8

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



42
43
44
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 42

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector | null

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


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

def document_selector
  attributes.fetch(:documentSelector)
end

#prepare_providerboolean | nil

Renames should be checked and tested before being executed.

Returns:

  • (boolean | nil)

Since:

  • version 3.12.0



33
34
35
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 33

def prepare_provider
  attributes.fetch(:prepareProvider)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#work_done_progressboolean | nil

Returns:

  • (boolean | nil)


38
39
40
# File 'lib/language_server/protocol/interface/rename_registration_options.rb', line 38

def work_done_progress
  attributes.fetch(:workDoneProgress)
end