class LanguageServer::Protocol::Interface::DocumentOnTypeFormattingParams

Attributes

attributes[R]

Public Class Methods

new(text_document:, position:, ch:, options:) click to toggle source
# File lib/language_server/protocol/interface/document_on_type_formatting_params.rb, line 5
def initialize(text_document:, position:, ch:, options:)
  @attributes = {}

  @attributes[:textDocument] = text_document
  @attributes[:position] = position
  @attributes[:ch] = ch
  @attributes[:options] = options

  @attributes.freeze
end

Public Instance Methods

ch() click to toggle source

The character that has been typed that triggered the formatting on type request. That is not necessarily the last character that got inserted into the document since the client could auto insert characters as well (e.g. like automatic brace completion).

@return [string]

# File lib/language_server/protocol/interface/document_on_type_formatting_params.rb, line 41
def ch
  attributes.fetch(:ch)
end
options() click to toggle source

The formatting options.

@return [FormattingOptions]

# File lib/language_server/protocol/interface/document_on_type_formatting_params.rb, line 49
def options
  attributes.fetch(:options)
end
position() click to toggle source

The position around which the on type formatting should happen. This is not necessarily the exact position where the character denoted by the property ‘ch` got typed.

@return [Position]

# File lib/language_server/protocol/interface/document_on_type_formatting_params.rb, line 30
def position
  attributes.fetch(:position)
end
text_document() click to toggle source

The document to format.

@return [TextDocumentIdentifier]

# File lib/language_server/protocol/interface/document_on_type_formatting_params.rb, line 20
def text_document
  attributes.fetch(:textDocument)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/document_on_type_formatting_params.rb, line 55
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/document_on_type_formatting_params.rb, line 59
def to_json(*args)
  to_hash.to_json(*args)
end