From b18ca1585e058b51577703a6ce274a16b5a5cfe9 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 30 Apr 2024 16:26:10 -0600 Subject: [PATCH] Fix merge conflict (#11232) Release Notes: - N/A --- crates/assistant2/src/tools/create_buffer.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/assistant2/src/tools/create_buffer.rs b/crates/assistant2/src/tools/create_buffer.rs index ddc66ba15a..b2c6f7d8a9 100644 --- a/crates/assistant2/src/tools/create_buffer.rs +++ b/crates/assistant2/src/tools/create_buffer.rs @@ -62,11 +62,14 @@ impl LanguageModelTool for CreateBufferTool { })? .await?; - let buffer = cx.update(|cx| { - project.update(cx, |project, cx| { - project.create_buffer(&text, Some(language), cx) - }) - })??; + let buffer = cx + .update(|cx| project.update(cx, |project, cx| project.create_buffer(cx)))? + .await?; + + buffer.update(&mut cx, |buffer, cx| { + buffer.edit([(0..0, text)], None, cx); + buffer.set_language(Some(language), cx) + })?; workspace .update(&mut cx, |workspace, cx| {