Revert "agent: Namespace MCP server tools" (#31588)
Reverts zed-industries/zed#30600
This commit is contained in:
parent
e314963f5b
commit
148e9adec2
4 changed files with 3 additions and 12 deletions
|
@ -637,7 +637,7 @@ impl AgentConfiguration {
|
||||||
.hover(|style| style.bg(cx.theme().colors().element_hover))
|
.hover(|style| style.bg(cx.theme().colors().element_hover))
|
||||||
.rounded_sm()
|
.rounded_sm()
|
||||||
.child(
|
.child(
|
||||||
Label::new(tool.ui_name())
|
Label::new(tool.name())
|
||||||
.buffer_font(cx)
|
.buffer_font(cx)
|
||||||
.size(LabelSize::Small),
|
.size(LabelSize::Small),
|
||||||
)
|
)
|
||||||
|
|
|
@ -117,7 +117,7 @@ impl ToolPickerDelegate {
|
||||||
ToolSource::Native => {
|
ToolSource::Native => {
|
||||||
if mode == ToolPickerMode::BuiltinTools {
|
if mode == ToolPickerMode::BuiltinTools {
|
||||||
items.extend(tools.into_iter().map(|tool| PickerItem::Tool {
|
items.extend(tools.into_iter().map(|tool| PickerItem::Tool {
|
||||||
name: tool.ui_name().into(),
|
name: tool.name().into(),
|
||||||
server_id: None,
|
server_id: None,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ impl ToolPickerDelegate {
|
||||||
server_id: server_id.clone(),
|
server_id: server_id.clone(),
|
||||||
});
|
});
|
||||||
items.extend(tools.into_iter().map(|tool| PickerItem::Tool {
|
items.extend(tools.into_iter().map(|tool| PickerItem::Tool {
|
||||||
name: tool.ui_name().into(),
|
name: tool.name().into(),
|
||||||
server_id: Some(server_id.clone()),
|
server_id: Some(server_id.clone()),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,6 @@ impl ContextServerTool {
|
||||||
|
|
||||||
impl Tool for ContextServerTool {
|
impl Tool for ContextServerTool {
|
||||||
fn name(&self) -> String {
|
fn name(&self) -> String {
|
||||||
format!("{}-{}", self.server_id, self.tool.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn ui_name(&self) -> String {
|
|
||||||
self.tool.name.clone()
|
self.tool.name.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -203,11 +203,6 @@ pub trait Tool: 'static + Send + Sync {
|
||||||
/// Returns the name of the tool.
|
/// Returns the name of the tool.
|
||||||
fn name(&self) -> String;
|
fn name(&self) -> String;
|
||||||
|
|
||||||
/// Returns the name to be displayed in the UI for this tool.
|
|
||||||
fn ui_name(&self) -> String {
|
|
||||||
self.name()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the description of the tool.
|
/// Returns the description of the tool.
|
||||||
fn description(&self) -> String;
|
fn description(&self) -> String;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue