Class: LanguageServer::Protocol::Interface::CallHierarchyOutgoingCall

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb

Overview

Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(to:, from_ranges:) ⇒ CallHierarchyOutgoingCall

Returns a new instance of CallHierarchyOutgoingCall.

Since:

  • 3.16.0



10
11
12
13
14
15
16
17
# File 'lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb', line 10

def initialize(to:, from_ranges:)
  @attributes = {}

  @attributes[:to] = to
  @attributes[:fromRanges] = from_ranges

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.16.0



37
38
39
# File 'lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb', line 37

def attributes
  @attributes
end

Instance Method Details

#from_rangesRange[]

The range at which this item is called. This is the range relative to the caller, e.g the item passed to [provideCallHierarchyOutgoingCalls](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) and not [this.to](#CallHierarchyOutgoingCall.to).

Returns:

Since:

  • 3.16.0



33
34
35
# File 'lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb', line 33

def from_ranges
  attributes.fetch(:fromRanges)
end

#toCallHierarchyItem

The item that is called.

Returns:

Since:

  • 3.16.0



23
24
25
# File 'lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb', line 23

def to
  attributes.fetch(:to)
end

#to_hashObject

Since:

  • 3.16.0



39
40
41
# File 'lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb', line 39

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.16.0



43
44
45
# File 'lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb', line 43

def to_json(*args)
  to_hash.to_json(*args)
end