Class: Solargraph::Arc::Debug

Inherits:
Object
  • Object
show all
Defined in:
lib/solargraph/arc/debug.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(query = nil) ⇒ Object



4
5
6
# File 'lib/solargraph/arc/debug.rb', line 4

def self.run(query=nil)
  self.new.run(query)
end

Instance Method Details

#run(query) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/solargraph/arc/debug.rb', line 8

def run(query)
  Solargraph.logger.level = Logger::DEBUG

  api_map = Solargraph::ApiMap.load('./')

  puts "Ruby version: #{RUBY_VERSION}"
  puts "Solargraph version: #{Solargraph::VERSION}"
  puts "Solargraph ARC version: #{Solargraph::Arc::VERSION}"

  return unless query

  puts "Known methods for #{query}"

  pin = api_map.pins.find {|p| p.path == query }
  return unless pin

  api_map.get_complex_type_methods(pin.return_type).each do |pin|
    puts "- #{pin.path}"
  end
end