Class: LSP::SelectionRange

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

Overview

export interface SelectionRange

/**
 * The [range](#Range) of this selection range.
 */
range: Range;
/**
 * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
 */
parent?: SelectionRange;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ SelectionRange

Returns a new instance of SelectionRange.



1407
1408
1409
1410
# File 'lib/lsp/lsp_types.rb', line 1407

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[parent]
end

Instance Attribute Details

#parentObject

type: Range # type: SelectionRange



1405
1406
1407
# File 'lib/lsp/lsp_types.rb', line 1405

def parent
  @parent
end

#rangeObject

type: Range # type: SelectionRange



1405
1406
1407
# File 'lib/lsp/lsp_types.rb', line 1405

def range
  @range
end

Instance Method Details

#from_h!(value) ⇒ Object



1412
1413
1414
1415
1416
1417
# File 'lib/lsp/lsp_types.rb', line 1412

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