Class: Solargraph::Plugin::Runtime

Inherits:
Base
  • Object
show all
Defined in:
lib/solargraph/plugin/runtime.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#api_map

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Solargraph::Plugin::Base

Instance Attribute Details

#executableObject



8
9
10
# File 'lib/solargraph/plugin/runtime.rb', line 8

def executable
  @executable ||= 'solargraph-runtime'
end

Instance Method Details

#get_constants(namespace, root) ⇒ Array<String>

Get an array of constant names.

Returns:

  • (Array<String>)


32
33
34
35
# File 'lib/solargraph/plugin/runtime.rb', line 32

def get_constants namespace, root
  response = send_get_constants namespace, root
  response['data']
end

#get_fqns(namespace, root) ⇒ Object



37
38
39
40
# File 'lib/solargraph/plugin/runtime.rb', line 37

def get_fqns namespace, root
  response = send_get_fqns namespace, root
  response['data']
end

#get_methods(namespace:, root:, scope:, with_private: false) ⇒ Array<String>

Get an array of method names.

Returns:

  • (Array<String>)


24
25
26
27
# File 'lib/solargraph/plugin/runtime.rb', line 24

def get_methods namespace:, root:, scope:, with_private: false
  response = send_get_methods(namespace, root, scope, with_private)
  response['data']
end

#post_initializeObject



12
13
14
# File 'lib/solargraph/plugin/runtime.rb', line 12

def post_initialize
  start_process
end

#refreshObject



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/solargraph/plugin/runtime.rb', line 42

def refresh
  if api_map.nil?
    false
  else
    if @current_required != api_map.required
      @io.close unless @io.nil? or @io.closed?
      start_process
      true
    else
      false
    end
  end
end

#runtime?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/solargraph/plugin/runtime.rb', line 17

def runtime?
  true
end

#stopObject



56
57
58
# File 'lib/solargraph/plugin/runtime.rb', line 56

def stop
  @io.close
end