Class: LanguageServer::Protocol::Interface::FoldingRangeParams

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

Overview

Parameters for a [FoldingRangeRequest](#FoldingRangeRequest).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text_document:, work_done_token: nil, partial_result_token: nil) ⇒ FoldingRangeParams



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

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

  @attributes[:textDocument] = text_document
  @attributes[:workDoneToken] = work_done_token if work_done_token
  @attributes[:partialResultToken] = partial_result_token if partial_result_token

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#partial_result_tokenProgressToken | nil

An optional token that a server can use to report partial results (e.g. streaming) to the client.



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

def partial_result_token
  attributes.fetch(:partialResultToken)
end

#text_documentTextDocumentIdentifier

The text document.



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

def text_document
  attributes.fetch(:textDocument)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#work_done_tokenProgressToken | nil

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



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

def work_done_token
  attributes.fetch(:workDoneToken)
end