diff --git a/crates/red_knot_server/src/message.rs b/crates/red_knot_server/src/message.rs index 79d7c63ec347a..038416aa46e57 100644 --- a/crates/red_knot_server/src/message.rs +++ b/crates/red_knot_server/src/message.rs @@ -40,7 +40,7 @@ pub(super) fn try_show_message( /// Sends an error to the client with a formatted message. The error is sent in a /// `window/showMessage` notification. macro_rules! show_err_msg { - ($msg:expr$(, $($arg:tt),*)?) => { - crate::message::show_message(::core::format_args!($msg, $($($arg),*)?).to_string(), lsp_types::MessageType::ERROR) + ($msg:expr$(, $($arg:tt)*)?) => { + crate::message::show_message(::core::format_args!($msg$(, $($arg)*)?).to_string(), lsp_types::MessageType::ERROR) }; } diff --git a/crates/ruff_server/src/message.rs b/crates/ruff_server/src/message.rs index ef692e3561488..1b007ea38c5c2 100644 --- a/crates/ruff_server/src/message.rs +++ b/crates/ruff_server/src/message.rs @@ -40,15 +40,15 @@ pub(super) fn try_show_message( /// Sends a request to display an error to the client with a formatted message. The error is sent /// in a `window/showMessage` notification. macro_rules! show_err_msg { - ($msg:expr$(, $($arg:tt),*)?) => { - crate::message::show_message(::core::format_args!($msg, $($($arg),*)?).to_string(), lsp_types::MessageType::ERROR) + ($msg:expr$(, $($arg:tt)*)?) => { + crate::message::show_message(::core::format_args!($msg$(, $($arg)*)?).to_string(), lsp_types::MessageType::ERROR) }; } /// Sends a request to display a warning to the client with a formatted message. The warning is /// sent in a `window/showMessage` notification. macro_rules! show_warn_msg { - ($msg:expr$(, $($arg:tt),*)?) => { - crate::message::show_message(::core::format_args!($msg, $($($arg),*)?).to_string(), lsp_types::MessageType::WARNING) + ($msg:expr$(, $($arg:tt)*)?) => { + crate::message::show_message(::core::format_args!($msg$(, $($arg)*)?).to_string(), lsp_types::MessageType::WARNING) }; } diff --git a/crates/ruff_server/src/session/index/ruff_settings.rs b/crates/ruff_server/src/session/index/ruff_settings.rs index d092885c607b8..08bb79e85e097 100644 --- a/crates/ruff_server/src/session/index/ruff_settings.rs +++ b/crates/ruff_server/src/session/index/ruff_settings.rs @@ -186,10 +186,9 @@ impl RuffSettingsIndex { // means for different editors. if is_default_workspace { if has_error { - let root = root.display(); show_err_msg!( - "Error while resolving settings from workspace {root}. \ - Please refer to the logs for more details.", + "Error while resolving settings from workspace {}. Please refer to the logs for more details.", + root.display() ); } @@ -300,9 +299,9 @@ impl RuffSettingsIndex { }); if has_error.load(Ordering::Relaxed) { - let root = root.display(); show_err_msg!( - "Error while resolving settings from workspace {root}. Please refer to the logs for more details.", + "Error while resolving settings from workspace {}. Please refer to the logs for more details.", + root.display() ); }