Class: LSP::TextDocumentItem

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_types.rb

Overview

export interface TextDocumentItem

/**
 * The text document's uri.
 */
uri: DocumentUri;
/**
 * The text document's language identifier
 */
languageId: string;
/**
 * The version number of this document (it will increase after each
 * change, including undo/redo).
 */
version: number;
/**
 * The content of the opened text document.
 */
text: string;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#initialize, #to_h, #to_json

Constructor Details

This class inherits a constructor from LSP::LSPBase

Instance Attribute Details

#languageIdObject

type: DocumentUri # type: string # type: number # type: string



715
716
717
# File 'lib/lsp/lsp_types.rb', line 715

def languageId
  @languageId
end

#textObject

type: DocumentUri # type: string # type: number # type: string



715
716
717
# File 'lib/lsp/lsp_types.rb', line 715

def text
  @text
end

#uriObject

type: DocumentUri # type: string # type: number # type: string



715
716
717
# File 'lib/lsp/lsp_types.rb', line 715

def uri
  @uri
end

#versionObject

type: DocumentUri # type: string # type: number # type: string



715
716
717
# File 'lib/lsp/lsp_types.rb', line 715

def version
  @version
end

Instance Method Details

#from_h!(value) ⇒ Object



717
718
719
720
721
722
723
724
# File 'lib/lsp/lsp_types.rb', line 717

def from_h!(value)
  value = {} if value.nil?
  self.uri = value['uri'] # Unknown type
  self.languageId = value['languageId']
  self.version = value['version']
  self.text = value['text']
  self
end