Class: LanguageServer::Protocol::Interfaces::SymbolInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interfaces/symbol_information.rb

Overview

Represents information about programming constructs like variables, classes, interfaces etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, kind:, location:, container_name: nil) ⇒ SymbolInformation

Returns a new instance of SymbolInformation.



9
10
11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interfaces/symbol_information.rb', line 9

def initialize(name:, kind:, location:, container_name: nil)
  @attributes = {}

  @attributes[:name] = name
  @attributes[:kind] = kind
  @attributes[:location] = location
  @attributes[:containerName] = container_name if container_name

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



52
53
54
# File 'lib/language_server/protocol/interfaces/symbol_information.rb', line 52

def attributes
  @attributes
end

Instance Method Details

#container_namestring

The name of the symbol containing this symbol.

Returns:

  • (string)


48
49
50
# File 'lib/language_server/protocol/interfaces/symbol_information.rb', line 48

def container_name
  attributes.fetch(:containerName)
end

#kindnumber

The kind of this symbol.

Returns:

  • (number)


32
33
34
# File 'lib/language_server/protocol/interfaces/symbol_information.rb', line 32

def kind
  attributes.fetch(:kind)
end

#locationLocation

The location of this symbol.

Returns:



40
41
42
# File 'lib/language_server/protocol/interfaces/symbol_information.rb', line 40

def location
  attributes.fetch(:location)
end

#namestring

The name of this symbol.

Returns:

  • (string)


24
25
26
# File 'lib/language_server/protocol/interfaces/symbol_information.rb', line 24

def name
  attributes.fetch(:name)
end

#to_json(*args) ⇒ Object



54
55
56
# File 'lib/language_server/protocol/interfaces/symbol_information.rb', line 54

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