Class: LSP::TextEdit

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

Overview

export interface TextEdit

/**
 * The range of the text document to be manipulated. To insert
 * text into a document create a range where start === end.
 */
range: Range;
/**
 * The string to be inserted. For delete operations use an
 * empty string.
 */
newText: 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

#newTextObject

type: Range # type: string



370
371
372
# File 'lib/lsp/lsp_types.rb', line 370

def newText
  @newText
end

#rangeObject

type: Range # type: string



370
371
372
# File 'lib/lsp/lsp_types.rb', line 370

def range
  @range
end

Instance Method Details

#from_h!(value) ⇒ Object



372
373
374
375
376
377
# File 'lib/lsp/lsp_types.rb', line 372

def from_h!(value)
  value = {} if value.nil?
  self.range = Range.new(value['range']) unless value['range'].nil?
  self.newText = value['newText']
  self
end