parent
93fbca4242
commit
b18ca1585e
1 changed files with 8 additions and 5 deletions
|
@ -62,11 +62,14 @@ impl LanguageModelTool for CreateBufferTool {
|
||||||
})?
|
})?
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let buffer = cx.update(|cx| {
|
let buffer = cx
|
||||||
project.update(cx, |project, cx| {
|
.update(|cx| project.update(cx, |project, cx| project.create_buffer(cx)))?
|
||||||
project.create_buffer(&text, Some(language), cx)
|
.await?;
|
||||||
})
|
|
||||||
})??;
|
buffer.update(&mut cx, |buffer, cx| {
|
||||||
|
buffer.edit([(0..0, text)], None, cx);
|
||||||
|
buffer.set_language(Some(language), cx)
|
||||||
|
})?;
|
||||||
|
|
||||||
workspace
|
workspace
|
||||||
.update(&mut cx, |workspace, cx| {
|
.update(&mut cx, |workspace, cx| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue