class RubyLsp::ResponseBuilders::DocumentSymbol

def initialize

def initialize
  super
  @stack = T.let(
    [SymbolHierarchyRoot.new],
    T::Array[T.any(SymbolHierarchyRoot, Interface::DocumentSymbol)],
  )
end

def last

def last
  T.must(@stack.last)
end

def pop

def pop
  if @stack.size > 1
    T.cast(@stack.pop, Interface::DocumentSymbol)
  end
end

def push(symbol)

def push(symbol)
  @stack << symbol
end

def response

def response
  T.must(@stack.first).children
end