message: Separate code path for --lsp
diff: @@ -60,7 +60,18 @@ struct Args {
  )]
  interactive: bool,
  - #[structopt(long = "lsp", help = "Start an LSP server.")]
  + #[structopt(
  + long = "lsp",
  + help = "Start an LSP server.",
  + conflicts_with_all = &[
  + "interactive",
  + "dap",
  + "check",
  + "json",
  + "evaluate",
  + "files",
  + ],
  + )]
  lsp: bool,
  #[structopt(
  @@ -229,6 +240,10 @@ fn main() -> anyhow::Result<()> {
  args.interactive,
  )?;
  + if args.lsp {
  + ctx.mode = ContextMode::Check;
  + lsp::server(ctx)?;
  + } else {
  let mut stats = Stats::default();
  for e in args.evaluate.clone() {
  stats.increment_file();
  @@ -244,11 +259,6 @@ fn main() -> anyhow::Result<()> {
  interactive(&ctx)?;
  }
  - if args.lsp {
  - ctx.mode = ContextMode::Check;
  - lsp::server(ctx)?;
  - }
  -
  if !args.json {
  println!("{}", stats);
  if stats.error > 0 {
  @@ -256,5 +266,6 @@ fn main() -> anyhow::Result<()> {
  }
  }
  }
  + }
  Ok(())
  }
  