class RubyLsp::Scope
def add(name, type)
Add a new local to this scope. The types should only be `:parameter` or `:variable`
def add(name, type) @locals[name.to_sym] = Local.new(type) end
def initialize(parent = nil)
def initialize(parent = nil) @parent = parent # A hash of name => type @locals = {} #: Hash[Symbol, Local] end
def lookup(name)
def lookup(name) sym = name.to_sym entry = @locals[sym] return entry if entry return unless @parent @parent.lookup(sym) end