class LanguageServer::Protocol::Interface::TextDocumentItem

Attributes

attributes[R]

Public Class Methods

new(uri:, language_id:, version:, text:) click to toggle source
# File lib/language_server/protocol/interface/text_document_item.rb, line 5
def initialize(uri:, language_id:, version:, text:)
  @attributes = {}

  @attributes[:uri] = uri
  @attributes[:languageId] = language_id
  @attributes[:version] = version
  @attributes[:text] = text

  @attributes.freeze
end

Public Instance Methods

language_id() click to toggle source

The text document's language identifier.

@return [string]

# File lib/language_server/protocol/interface/text_document_item.rb, line 28
def language_id
  attributes.fetch(:languageId)
end
text() click to toggle source

The content of the opened text document.

@return [string]

# File lib/language_server/protocol/interface/text_document_item.rb, line 45
def text
  attributes.fetch(:text)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/text_document_item.rb, line 51
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/text_document_item.rb, line 55
def to_json(*args)
  to_hash.to_json(*args)
end
uri() click to toggle source

The text document's URI.

@return [string]

# File lib/language_server/protocol/interface/text_document_item.rb, line 20
def uri
  attributes.fetch(:uri)
end
version() click to toggle source

The version number of this document (it will increase after each change, including undo/redo).

@return [number]

# File lib/language_server/protocol/interface/text_document_item.rb, line 37
def version
  attributes.fetch(:version)
end