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!(