assistant tools: Add Tool::icon method instead of matching on name (#27444)

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-03-25 15:17:36 -03:00 committed by GitHub
parent 0339d654d2
commit 46e86f003f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 98 additions and 18 deletions

View file

@ -30,5 +30,6 @@ serde.workspace = true
serde_json.workspace = true
settings.workspace = true
smol.workspace = true
ui.workspace = true
url = { workspace = true, features = ["serde"] }
util.workspace = true

View file

@ -5,6 +5,7 @@ use assistant_tool::{ActionLog, Tool, ToolSource};
use gpui::{App, Entity, Task};
use language_model::LanguageModelRequestMessage;
use project::Project;
use ui::IconName;
use crate::manager::ContextServerManager;
use crate::types;
@ -38,6 +39,10 @@ impl Tool for ContextServerTool {
self.tool.description.clone().unwrap_or_default()
}
fn icon(&self) -> IconName {
IconName::Cog
}
fn source(&self) -> ToolSource {
ToolSource::ContextServer {
id: self.server_id.clone().into(),