class Solargraph::LanguageServer::Host::Cataloger

An asynchronous library cataloging handler.

Attributes

host[R]

@return [Host]

Public Class Methods

new(host) click to toggle source
# File lib/solargraph/language_server/host/cataloger.rb, line 8
def initialize host
  @host = host
  @stopped = true
end

Public Instance Methods

start() click to toggle source

Start the catalog thread.

@return [void]

# File lib/solargraph/language_server/host/cataloger.rb, line 30
def start
  return unless stopped?
  @stopped = false
  Thread.new do
    until stopped?
      tick
      sleep 0.01
    end
  end
end
stop() click to toggle source

Stop the catalog thread.

@return [void]

# File lib/solargraph/language_server/host/cataloger.rb, line 16
def stop
  @stopped = true
end
stopped?() click to toggle source

True if the cataloger is stopped.

@return [Boolean]

# File lib/solargraph/language_server/host/cataloger.rb, line 23
def stopped?
  @stopped
end
tick() click to toggle source

Perform cataloging.

@return [void]

# File lib/solargraph/language_server/host/cataloger.rb, line 44
def tick
  host.catalog
end