Class: LanguageServer::Protocol::Interface::CallHierarchyItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, kind:, tags: nil, detail: nil, uri:, range:, selection_range:, data: nil) ⇒ CallHierarchyItem

Returns a new instance of CallHierarchyItem.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 5

def initialize(name:, kind:, tags: nil, detail: nil, uri:, range:, selection_range:, data: nil)
  @attributes = {}

  @attributes[:name] = name
  @attributes[:kind] = kind
  @attributes[:tags] = tags if tags
  @attributes[:detail] = detail if detail
  @attributes[:uri] = uri
  @attributes[:range] = range
  @attributes[:selectionRange] = selection_range
  @attributes[:data] = data if data

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



88
89
90
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 88

def attributes
  @attributes
end

Instance Method Details

#dataunknown

A data entry field that is preserved between a call hierarchy prepare and incoming calls or outgoing calls requests.

Returns:

  • (unknown)


84
85
86
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 84

def data
  attributes.fetch(:data)
end

#detailstring

More detail for this item, e.g. the signature of a function.

Returns:

  • (string)


48
49
50
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 48

def detail
  attributes.fetch(:detail)
end

#kindSymbolKind

The kind of this item.

Returns:

  • (SymbolKind)


32
33
34
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 32

def kind
  attributes.fetch(:kind)
end

#namestring

The name of this item.

Returns:

  • (string)


24
25
26
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 24

def name
  attributes.fetch(:name)
end

#rangeRange

The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.

Returns:



65
66
67
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 65

def range
  attributes.fetch(:range)
end

#selection_rangeRange

The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. Must be contained by the [‘range`](#CallHierarchyItem.range).

Returns:



75
76
77
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 75

def selection_range
  attributes.fetch(:selectionRange)
end

#tags1[]

Tags for this item.

Returns:

  • (1[])


40
41
42
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 40

def tags
  attributes.fetch(:tags)
end

#to_hashObject



90
91
92
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 90

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



94
95
96
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 94

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

#uristring

The resource identifier of this item.

Returns:

  • (string)


56
57
58
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 56

def uri
  attributes.fetch(:uri)
end