class LanguageServer::Protocol::Interface::SymbolInformation

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

Attributes

attributes[R]

Public Class Methods

new(name:, kind:, tags: nil, deprecated: nil, location:, container_name: nil) click to toggle source
# File lib/language_server/protocol/interface/symbol_information.rb, line 9
def initialize(name:, kind:, tags: nil, deprecated: nil, location:, container_name: nil)
  @attributes = {}

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

  @attributes.freeze
end

Public Instance Methods

container_name() click to toggle source

The name of the symbol containing this symbol. This information is for user interface purposes (e.g. to render a qualifier in the user interface if necessary). It can't be used to re-infer a hierarchy for the document symbols.

@return [string]

# File lib/language_server/protocol/interface/symbol_information.rb, line 77
def container_name
  attributes.fetch(:containerName)
end
deprecated() click to toggle source

Indicates if this symbol is deprecated.

@return [boolean]

# File lib/language_server/protocol/interface/symbol_information.rb, line 50
def deprecated
  attributes.fetch(:deprecated)
end
kind() click to toggle source

The kind of this symbol.

@return [any]

# File lib/language_server/protocol/interface/symbol_information.rb, line 34
def kind
  attributes.fetch(:kind)
end
location() click to toggle source

The location of this symbol. The location's range is used by a tool to reveal the location in the editor. If the symbol is selected in the tool the range's start information is used to position the cursor. So the range usually spans more then the actual symbol's name and does normally include things like visibility modifiers.

The range doesn't have to denote a node range in the sense of a abstract syntax tree. It can therefore not be used to re-construct a hierarchy of the symbols.

@return [Location]

# File lib/language_server/protocol/interface/symbol_information.rb, line 66
def location
  attributes.fetch(:location)
end
name() click to toggle source

The name of this symbol.

@return [string]

# File lib/language_server/protocol/interface/symbol_information.rb, line 26
def name
  attributes.fetch(:name)
end
tags() click to toggle source

Tags for this symbol.

@return [1

# File lib/language_server/protocol/interface/symbol_information.rb, line 42
def tags
  attributes.fetch(:tags)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/symbol_information.rb, line 83
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/symbol_information.rb, line 87
def to_json(*args)
  to_hash.to_json(*args)
end