assistant_tool: Pass an Entity<Project>
to Tool::run
(#26312)
This PR updates the `Tool::run` method to take an `Entity<Project>` instead of a `WeakEntity<Project>`. Release Notes: - N/A
This commit is contained in:
parent
921c24e274
commit
e70d0edfac
7 changed files with 20 additions and 30 deletions
|
@ -1,8 +1,9 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use anyhow::{anyhow, bail};
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use assistant_tool::Tool;
|
||||
use gpui::{App, Entity, Task};
|
||||
use project::Project;
|
||||
|
||||
use crate::manager::ContextServerManager;
|
||||
use crate::types;
|
||||
|
@ -49,11 +50,11 @@ impl Tool for ContextServerTool {
|
|||
}
|
||||
|
||||
fn run(
|
||||
self: std::sync::Arc<Self>,
|
||||
self: Arc<Self>,
|
||||
input: serde_json::Value,
|
||||
_project: gpui::WeakEntity<project::Project>,
|
||||
_project: Entity<Project>,
|
||||
cx: &mut App,
|
||||
) -> gpui::Task<gpui::Result<String>> {
|
||||
) -> Task<Result<String>> {
|
||||
if let Some(server) = self.server_manager.read(cx).get_server(&self.server_id) {
|
||||
cx.foreground_executor().spawn({
|
||||
let tool_name = self.tool.name.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue