Class: LanguageServer::Protocol::Interface::CodeLensRegistrationOptions

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

Overview

Registration options for a CodeLensRequest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CodeLensRegistrationOptions.

Parameters:

  • document_selector: (Object)
  • resolve_provider: (Boolean) (defaults to: nil)
  • work_done_progress: (Boolean) (defaults to: nil)


8
9
10
11
12
13
14
15
16
# File 'lib/language_server/protocol/interface/code_lens_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

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


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

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)


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

def document_selector
  attributes.fetch(:documentSelector)
end

#resolve_providerboolean

Code lens has a resolve provider as well.

Returns:

  • (boolean)


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

def resolve_provider
  attributes.fetch(:resolveProvider)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


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

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

#work_done_progressboolean

Returns:

  • (boolean)


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

def work_done_progress
  attributes.fetch(:workDoneProgress)
end