message: Separate code path for handling --dap
  Summary: Do not create `Context` which is not used.
diff: @@ -63,7 +63,21 @@ struct Args {
  #[structopt(long = "lsp", help = "Start an LSP server.")]
  lsp: bool,
  - #[structopt(long = "dap", help = "Start a DAP server.")]
  + #[structopt(
  + long = "dap",
  + help = "Start a DAP server.",
  + // Conflicts with all options.
  + conflicts_with_all = &[
  + "interactive",
  + "lsp",
  + "check",
  + "json",
  + "extension",
  + "prelude",
  + "evaluate",
  + "files",
  + ],
  + )]
  dap: bool,
  #[structopt(
  @@ -195,7 +209,10 @@ fn main() -> anyhow::Result<()> {
  gazebo::terminate_on_panic();
  let args = argfile::expand_args(argfile::parse_fromfile, argfile::PREFIX)?;
  - let args = Args::from_iter(args);
  + let args: Args = Args::from_iter(args);
  + if args.dap {
  + dap::server();
  + } else {
  let ext = args
  .extension
  .as_ref()
  @@ -230,8 +247,6 @@ fn main() -> anyhow::Result<()> {
  if args.lsp {
  ctx.mode = ContextMode::Check;
  lsp::server(ctx)?;
  - } else if args.dap {
  - dap::server()
  }
  if !args.json {
  @@ -240,5 +255,6 @@ fn main() -> anyhow::Result<()> {
  return Err(anyhow!("Failed with {} errors", stats.error));
  }
  }
  + }
  Ok(())
  }
  