diff --git a/crates/ruff/src/commands/server.rs b/crates/ruff/src/commands/server.rs index ef7b8a42e9f33..d35b2c1ce46f6 100644 --- a/crates/ruff/src/commands/server.rs +++ b/crates/ruff/src/commands/server.rs @@ -4,7 +4,12 @@ use crate::ExitStatus; use anyhow::Result; use ruff_server::Server; -pub(crate) fn run_server(_preview: bool, worker_threads: NonZeroUsize) -> Result { +pub(crate) fn run_server(preview: bool, worker_threads: NonZeroUsize) -> Result { + if !preview { + tracing::error!("--preview needs to be provided as a command line argument while the server is still unstable.\nFor example: `ruff server --preview`"); + return Ok(ExitStatus::Error); + } + let server = Server::new(worker_threads)?; server.run().map(|()| ExitStatus::Success)