mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-26 00:19:46 +00:00
parent
93fbca4242
commit
b18ca1585e
1 changed files with 8 additions and 5 deletions
|
@ -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| {
|
||||
|
|
Loading…
Reference in a new issue