Class: LanguageServer::Protocol::Interface::InlineValueRegistrationOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/inline_value_registration_options.rb,
sig/language_server/protocol/interface/inline_value_registration_options.rbs

Overview

Inline value options used during static or dynamic registration.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work_done_progress: nil, document_selector:, id: nil) ⇒ InlineValueRegistrationOptions

Returns a new instance of InlineValueRegistrationOptions.

Parameters:

  • work_done_progress: (Boolean) (defaults to: nil)
  • document_selector: (Object)
  • id: (String) (defaults to: nil)

Since:

  • 3.17.0



10
11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/inline_value_registration_options.rb', line 10

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

  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
  @attributes[:documentSelector] = document_selector
  @attributes[:id] = id if id

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.17.0



43
44
45
# File 'lib/language_server/protocol/interface/inline_value_registration_options.rb', line 43

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector | nil

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

Since:

  • 3.17.0



30
31
32
# File 'lib/language_server/protocol/interface/inline_value_registration_options.rb', line 30

def document_selector
  attributes.fetch(:documentSelector)
end

#idstring

The id used to register the request. The id can be used to deregister the request again. See also Registration#id.

Returns:

  • (string)

Since:

  • 3.17.0



39
40
41
# File 'lib/language_server/protocol/interface/inline_value_registration_options.rb', line 39

def id
  attributes.fetch(:id)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.17.0



45
46
47
# File 'lib/language_server/protocol/interface/inline_value_registration_options.rb', line 45

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)

Since:

  • 3.17.0



49
50
51
# File 'lib/language_server/protocol/interface/inline_value_registration_options.rb', line 49

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

#work_done_progressboolean

Returns:

  • (boolean)

Since:

  • 3.17.0



21
22
23
# File 'lib/language_server/protocol/interface/inline_value_registration_options.rb', line 21

def work_done_progress
  attributes.fetch(:workDoneProgress)
end