Class: LSP::ColorInformation

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

Overview

export interface ColorInformation

/**
 * The range in the document where this color appers.
 */
range: Range;
/**
 * The actual color value for this color range.
 */
color: Color;

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

#colorObject

type: Range # type: Color



160
161
162
# File 'lib/lsp/lsp_types.rb', line 160

def color
  @color
end

#rangeObject

type: Range # type: Color



160
161
162
# File 'lib/lsp/lsp_types.rb', line 160

def range
  @range
end

Instance Method Details

#from_h!(value) ⇒ Object



162
163
164
165
166
167
# File 'lib/lsp/lsp_types.rb', line 162

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