class LanguageServer::Protocol::Interface::DocumentSymbol

Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range, e.g. the range of an identifier.

Attributes

attributes[R]

Public Class Methods

new(name:, detail: nil, kind:, tags: nil, deprecated: nil, range:, selection_range:, children: nil) click to toggle source
# File lib/language_server/protocol/interface/document_symbol.rb, line 11
def initialize(name:, detail: nil, kind:, tags: nil, deprecated: nil, range:, selection_range:, children: nil)
  @attributes = {}

  @attributes[:name] = name
  @attributes[:detail] = detail if detail
  @attributes[:kind] = kind
  @attributes[:tags] = tags if tags
  @attributes[:deprecated] = deprecated if deprecated
  @attributes[:range] = range
  @attributes[:selectionRange] = selection_range
  @attributes[:children] = children if children

  @attributes.freeze
end

Public Instance Methods

children() click to toggle source

Children of this symbol, e.g. properties of a class.

@return [DocumentSymbol

# File lib/language_server/protocol/interface/document_symbol.rb, line 92
def children
  attributes.fetch(:children)
end
deprecated() click to toggle source

Indicates if this symbol is deprecated.

@return [boolean]

# File lib/language_server/protocol/interface/document_symbol.rb, line 64
def deprecated
  attributes.fetch(:deprecated)
end
detail() click to toggle source

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

@return [string]

# File lib/language_server/protocol/interface/document_symbol.rb, line 40
def detail
  attributes.fetch(:detail)
end
kind() click to toggle source

The kind of this symbol.

@return [any]

# File lib/language_server/protocol/interface/document_symbol.rb, line 48
def kind
  attributes.fetch(:kind)
end
name() click to toggle source

The name of this symbol. Will be displayed in the user interface and therefore must not be an empty string or a string only consisting of white spaces.

@return [string]

# File lib/language_server/protocol/interface/document_symbol.rb, line 32
def name
  attributes.fetch(:name)
end
range() click to toggle source

The range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to determine if the clients cursor is inside the symbol to reveal in the symbol in the UI.

@return [Range]

# File lib/language_server/protocol/interface/document_symbol.rb, line 75
def range
  attributes.fetch(:range)
end
selection_range() click to toggle source

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`.

@return [Range]

# File lib/language_server/protocol/interface/document_symbol.rb, line 84
def selection_range
  attributes.fetch(:selectionRange)
end
tags() click to toggle source

Tags for this document symbol.

@return [1

# File lib/language_server/protocol/interface/document_symbol.rb, line 56
def tags
  attributes.fetch(:tags)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/document_symbol.rb, line 98
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/document_symbol.rb, line 102
def to_json(*args)
  to_hash.to_json(*args)
end