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 18:17:36 +00:00
committed by GitHub
parent 0339d654d2
commit 46e86f003f
22 changed files with 98 additions and 18 deletions
@@ -9,6 +9,7 @@ use language_model::LanguageModelRequestMessage;
use project::Project;
use std::fmt::{self, Debug, Formatter};
use std::sync::Arc;
use ui::IconName;
pub use crate::tool_registry::*;
pub use crate::tool_working_set::*;
@@ -33,6 +34,9 @@ pub trait Tool: 'static + Send + Sync {
/// Returns the description of the tool.
fn description(&self) -> String;
/// Returns the icon for the tool.
fn icon(&self) -> IconName;
/// Returns the source of the tool.
fn source(&self) -> ToolSource {
ToolSource::Native