Class: LanguageServer::Protocol::Interface::InlayHintParams

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

Overview

A parameter literal used in inlay hint requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work_done_token: nil, text_document:, range:) ⇒ InlayHintParams

Returns a new instance of InlayHintParams.



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

def initialize(work_done_token: nil, text_document:, range:)
  @attributes = {}

  @attributes[:workDoneToken] = work_done_token if work_done_token
  @attributes[:textDocument] = text_document
  @attributes[:range] = range

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#rangeRange

The visible document range for which inlay hints should be computed.

Returns:



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

def range
  attributes.fetch(:range)
end

#text_documentTextDocumentIdentifier

The text document.



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

def text_document
  attributes.fetch(:textDocument)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#work_done_tokenProgressToken

An optional token that a server can use to report work done progress.

Returns:

  • (ProgressToken)


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

def work_done_token
  attributes.fetch(:workDoneToken)
end