Class: LSP::DocumentHighlight

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

Overview

export interface DocumentHighlight

/**
 * The range this highlight applies to.
 */
range: Range;
/**
 * The highlight kind, default is [text](#DocumentHighlightKind.Text).
 */
kind?: DocumentHighlightKind;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ DocumentHighlight

Returns a new instance of DocumentHighlight.



1058
1059
1060
1061
# File 'lib/lsp/lsp_types.rb', line 1058

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

Instance Attribute Details

#kindObject

type: Range # type: DocumentHighlightKind



1056
1057
1058
# File 'lib/lsp/lsp_types.rb', line 1056

def kind
  @kind
end

#rangeObject

type: Range # type: DocumentHighlightKind



1056
1057
1058
# File 'lib/lsp/lsp_types.rb', line 1056

def range
  @range
end

Instance Method Details

#from_h!(value) ⇒ Object



1063
1064
1065
1066
1067
1068
# File 'lib/lsp/lsp_types.rb', line 1063

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