class RubyLanguageServer::ScopeParser
This class builds on Ripper's sexp processor to add ruby and rails magic. Specifically it knows about things like alias, attr_*, has_one/many, etc. It adds the appropriate definitions for those magic words.
Attributes
root_scope[R]
Public Class Methods
new(text)
click to toggle source
# File lib/ruby_language_server/scope_parser.rb, line 336 def initialize(text) text ||= '' # empty is the same as nil - but it doesn't crash begin sexp = self.class.sexp(text) rescue TypeError => e RubyLanguageServer.logger.error("Exception in sexp: #{e} for text: #{text}") end processor = SEXPProcessor.new(sexp, text.split("\n").length) @root_scope = processor.root_scope end