Class: LanguageServer::Protocol::Interface::DocumentRangeFormattingParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::DocumentRangeFormattingParams
- Defined in:
- lib/language_server/protocol/interface/document_range_formatting_params.rb
Overview
The parameters of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(text_document:, range:, options:, work_done_token: nil) ⇒ DocumentRangeFormattingParams
constructor
A new instance of DocumentRangeFormattingParams.
-
#options ⇒ FormattingOptions
The format options.
-
#range ⇒ Range
The range to format.
-
#text_document ⇒ TextDocumentIdentifier
The document to format.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
Constructor Details
#initialize(text_document:, range:, options:, work_done_token: nil) ⇒ DocumentRangeFormattingParams
Returns a new instance of DocumentRangeFormattingParams.
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] = @attributes[:workDoneToken] = work_done_token if work_done_token @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
51 52 53 |
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 51 def attributes @attributes end |
Instance Method Details
#options ⇒ FormattingOptions
The format options
39 40 41 |
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 39 def attributes.fetch(:options) end |
#range ⇒ Range
The range to format
31 32 33 |
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 31 def range attributes.fetch(:range) end |
#text_document ⇒ TextDocumentIdentifier
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_hash ⇒ Object
53 54 55 |
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 53 def to_hash attributes end |
#to_json(*args) ⇒ Object
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_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
47 48 49 |
# File 'lib/language_server/protocol/interface/document_range_formatting_params.rb', line 47 def work_done_token attributes.fetch(:workDoneToken) end |