From b2de28ccfc9b3c1428693e5e7a30e7e7df64d157 Mon Sep 17 00:00:00 2001 From: Julia Date: Tue, 27 Jun 2023 14:16:01 -0400 Subject: [PATCH] Match original logic when determining server to request formatting --- crates/project/src/project.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 0820eaf26e..561235d35f 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -3895,7 +3895,7 @@ impl Project { let formatting_provider = capabilities.document_formatting_provider.as_ref(); let range_formatting_provider = capabilities.document_range_formatting_provider.as_ref(); - let lsp_edits = if !matches!(formatting_provider, Some(OneOf::Left(false))) { + let lsp_edits = if matches!(formatting_provider, Some(p) if *p != OneOf::Left(false)) { language_server .request::(lsp::DocumentFormattingParams { text_document, @@ -3903,7 +3903,7 @@ impl Project { work_done_progress_params: Default::default(), }) .await? - } else if !matches!(range_formatting_provider, Some(OneOf::Left(false))) { + } else if matches!(range_formatting_provider, Some(p) if *p != OneOf::Left(false)) { let buffer_start = lsp::Position::new(0, 0); let buffer_end = buffer.read_with(cx, |b, _| point_to_lsp(b.max_point_utf16()));