defmodule Refactorex.Application do
  use Application

  # @options [port: :integer, stdio: :boolean]
  # @default_port 6890

  def start(_, _) do
    Supervisor.start_link(
      [
        {Refactorex.NameCache, []},
        {Task.Supervisor, [name: Refactorex.Refactor]}
      ],
      strategy: :one_for_one,
      name: Refactorex.Supervisor
    )
  end

  # defp children(:refactorex) do
  #   [
  #     {
  #       GenLSP.Buffer,
  #       [communication: communication_config()]
  #     },
  #     {Refactorex.Logger, []},
  #     {Refactorex, []}
  #     | children(nil)
  #   ]
  # end

  # defp communication_config do
  #   {opts, _, _} = OptionParser.parse(System.argv(), strict: @options)

  #   if Keyword.get(opts, :stdio, false) do
  #     {GenLSP.Communication.Stdio, []}
  #   else
  #     {GenLSP.Communication.TCP, [port: Keyword.get(opts, :port, @default_port)]}
  #   end
  # end
end
