Revert "Remove --preview as a required argument for ruff server (#12053)" (#12196)

This reverts commit b28dc9ac14.

We're not ready to stabilize the server yet. There's some pending work
for the VS Code extension and documentation improvements.

This change is to unblock Ruff release.
This commit is contained in:
Dhruv Manilawala 2024-07-05 11:58:35 +05:30 committed by GitHub
parent 1e07bfa373
commit f3ccd152e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<ExitStatus> {
pub(crate) fn run_server(preview: bool, worker_threads: NonZeroUsize) -> Result<ExitStatus> {
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)