diff --git a/crates/copilot2/src/copilot2.rs b/crates/copilot2/src/copilot2.rs index 01ee77369adce1bfe29d242ef79ffb4c2b570967..b2454728644b212c8736b49876b213123cf039e8 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,15 +1129,16 @@ 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(), + buffer_1_uri.clone(), "plaintext".into(), 0, - "Goodbye".into() + "Hello world".into() ), } ); @@ -1146,14 +1147,13 @@ mod tests { .await, lsp::DidOpenTextDocumentParams { text_document: lsp::TextDocumentItem::new( - buffer_1_uri.clone(), + buffer_2_uri.clone(), "plaintext".into(), 0, - "Hello world".into() + "Goodbye".into() ), } ); - // Dropping a buffer causes it to be closed on the LSP side as well. cx.update(|_| drop(buffer_2)); assert_eq!(