Sha256: 24f75b19fb5cbafe810d8f644e044c2cf7ada500904794e6b19a5de3b2303fe6

Contents?: true

Size: 1.68 KB

Versions: 30

Compression:

Stored size: 1.68 KB

Contents

module Steep
  module Drivers
    class Langserver
      attr_reader :stdout
      attr_reader :stderr
      attr_reader :stdin
      attr_reader :latest_update_version
      attr_reader :write_mutex
      attr_reader :type_check_queue
      attr_reader :type_check_thread

      include Utils::DriverHelper

      TypeCheckRequest = Struct.new(:version, keyword_init: true)

      def initialize(stdout:, stderr:, stdin:)
        @stdout = stdout
        @stderr = stderr
        @stdin = stdin
        @write_mutex = Mutex.new
        @type_check_queue = Queue.new
      end

      def writer
        @writer ||= LanguageServer::Protocol::Transport::Io::Writer.new(stdout)
      end

      def reader
        @reader ||= LanguageServer::Protocol::Transport::Io::Reader.new(stdin)
      end

      def project
        @project or raise "Empty #project"
      end

      def run
        @project = load_config()

        loader = Project::FileLoader.new(project: project)
        loader.load_sources([])
        loader.load_signatures()

        interaction_worker = Server::WorkerProcess.spawn_worker(:interaction, name: "interaction", steepfile: project.steepfile_path)
        signature_worker = Server::WorkerProcess.spawn_worker(:signature, name: "signature", steepfile: project.steepfile_path)
        code_workers = Server::WorkerProcess.spawn_code_workers(steepfile: project.steepfile_path)

        master = Server::Master.new(
          project: project,
          reader: reader,
          writer: writer,
          interaction_worker: interaction_worker,
          signature_worker: signature_worker,
          code_workers: code_workers
        )

        master.start()

        0
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
steep-0.41.0 lib/steep/drivers/langserver.rb
steep-0.40.0 lib/steep/drivers/langserver.rb
steep-0.39.0 lib/steep/drivers/langserver.rb
steep-0.38.0 lib/steep/drivers/langserver.rb
steep-0.37.0 lib/steep/drivers/langserver.rb
steep-0.36.0 lib/steep/drivers/langserver.rb
steep-0.35.0 lib/steep/drivers/langserver.rb
steep-0.34.0 lib/steep/drivers/langserver.rb
steep-0.33.0 lib/steep/drivers/langserver.rb
steep-0.32.0 lib/steep/drivers/langserver.rb
steep-0.31.1 lib/steep/drivers/langserver.rb
steep-0.31.0 lib/steep/drivers/langserver.rb
steep-0.30.0 lib/steep/drivers/langserver.rb
steep-0.29.0 lib/steep/drivers/langserver.rb
steep-0.28.0 lib/steep/drivers/langserver.rb
steep-0.27.0 lib/steep/drivers/langserver.rb
steep-0.25.0 lib/steep/drivers/langserver.rb
steep-0.24.0 lib/steep/drivers/langserver.rb
steep-0.23.0 lib/steep/drivers/langserver.rb
steep-0.22.0 lib/steep/drivers/langserver.rb