From fd2f1c25940353a26d7b35dba81d86905812c1f8 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:26:34 +0100 Subject: [PATCH] Fix up copilot2 test Co-authored-by: Antonio --- crates/copilot2/src/copilot2.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/copilot2/src/copilot2.rs b/crates/copilot2/src/copilot2.rs index 01ee77369a..b245472864 100644 --- a/crates/copilot2/src/copilot2.rs +++ b/crates/copilot2/src/copilot2.rs @@ -1108,14 +1108,14 @@ mod tests { lsp.receive_notification::() .await, lsp::DidCloseTextDocumentParams { - text_document: lsp::TextDocumentIdentifier::new(buffer_2_uri.clone()), + text_document: lsp::TextDocumentIdentifier::new(buffer_1_uri.clone()), } ); assert_eq!( lsp.receive_notification::() .await, lsp::DidCloseTextDocumentParams { - text_document: lsp::TextDocumentIdentifier::new(buffer_1_uri.clone()), + text_document: lsp::TextDocumentIdentifier::new(buffer_2_uri.clone()), } ); @@ -1129,18 +1129,7 @@ mod tests { .update(cx, |copilot, cx| copilot.sign_in(cx)) .await .unwrap(); - assert_eq!( - lsp.receive_notification::() - .await, - lsp::DidOpenTextDocumentParams { - text_document: lsp::TextDocumentItem::new( - buffer_2_uri.clone(), - "plaintext".into(), - 0, - "Goodbye".into() - ), - } - ); + assert_eq!( lsp.receive_notification::() .await, @@ -1153,7 +1142,18 @@ mod tests { ), } ); - + assert_eq!( + lsp.receive_notification::() + .await, + lsp::DidOpenTextDocumentParams { + text_document: lsp::TextDocumentItem::new( + buffer_2_uri.clone(), + "plaintext".into(), + 0, + "Goodbye".into() + ), + } + ); // Dropping a buffer causes it to be closed on the LSP side as well. cx.update(|_| drop(buffer_2)); assert_eq!(