Class: LanguageServer::Protocol::Interface::DocumentLinkRegistrationOptions

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_selector:, resolve_provider: nil, work_done_progress: nil) ⇒ DocumentLinkRegistrationOptions

Returns a new instance of DocumentLinkRegistrationOptions.



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

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

  @attributes[:documentSelector] = document_selector
  @attributes[:resolveProvider] = resolve_provider if resolve_provider
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

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/document_link_registration_options.rb', line 23

def document_selector
  attributes.fetch(:documentSelector)
end

#resolve_providerboolean | nil

Document links have a resolve provider as well.

Returns:

  • (boolean | nil)


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

def resolve_provider
  attributes.fetch(:resolveProvider)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



46
47
48
# File 'lib/language_server/protocol/interface/document_link_registration_options.rb', line 46

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

#work_done_progressboolean | nil

Returns:

  • (boolean | nil)


36
37
38
# File 'lib/language_server/protocol/interface/document_link_registration_options.rb', line 36

def work_done_progress
  attributes.fetch(:workDoneProgress)
end