Class: LanguageServer::Protocol::Interface::DocumentRangeFormattingParams

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

Overview

The parameters of a DocumentRangeFormattingRequest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text_document:, range:, options:, work_done_token: nil) ⇒ DocumentRangeFormattingParams

Returns a new instance of DocumentRangeFormattingParams.

Parameters:

  • text_document: (Object)
  • range: (Object)
  • options: (Object)
  • work_done_token: (Object) (defaults to: nil)


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

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


51
52
53
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 51

def attributes
  @attributes
end

Instance Method Details

#optionsFormattingOptions

The format options

Returns:



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

def options
  attributes.fetch(:options)
end

#rangeRange

The range to format

Returns:



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

def range
  attributes.fetch(:range)
end

#text_documentTextDocumentIdentifier

The document to format.



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

def text_document
  attributes.fetch(:textDocument)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


53
54
55
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 53

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


57
58
59
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 57

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)


47
48
49
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 47

def work_done_token
  attributes.fetch(:workDoneToken)
end