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

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

Overview

Parameters for a FoldingRangeRequest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of FoldingRangeParams.

Parameters:

  • text_document: (Object)
  • work_done_token: (Object) (defaults to: nil)
  • partial_result_token: (Object) (defaults to: nil)


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

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


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

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

Returns:

  • (ProgressToken)


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_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


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

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

Returns:

  • (ProgressToken)


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

def work_done_token
  attributes.fetch(:workDoneToken)
end