Skip to content

Commit 0bcf607

Browse files
authored
agent_ui: Always allow to include symbols (#42261)
We can always include symbols, since we either include a ResourceLink to the symbol (when `PromptCapabilities::embedded_context = false`) or a Resource (when `PromptCapabilities::embedded_context = true`) Release Notes: - Fixed an issue where symbols could not be included when using specific ACP agents
1 parent 431a195 commit 0bcf607

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

crates/agent_ui/src/acp/completion_provider.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -646,16 +646,14 @@ impl ContextPickerCompletionProvider {
646646
cx: &mut App,
647647
) -> Vec<ContextPickerEntry> {
648648
let embedded_context = self.prompt_capabilities.borrow().embedded_context;
649-
let mut entries = if embedded_context {
650-
vec![
651-
ContextPickerEntry::Mode(ContextPickerMode::File),
652-
ContextPickerEntry::Mode(ContextPickerMode::Symbol),
653-
ContextPickerEntry::Mode(ContextPickerMode::Thread),
654-
]
655-
} else {
656-
// File is always available, but we don't need a mode entry
657-
vec![]
658-
};
649+
let mut entries = vec![
650+
ContextPickerEntry::Mode(ContextPickerMode::File),
651+
ContextPickerEntry::Mode(ContextPickerMode::Symbol),
652+
];
653+
654+
if embedded_context {
655+
entries.push(ContextPickerEntry::Mode(ContextPickerMode::Thread));
656+
}
659657

660658
let has_selection = workspace
661659
.read(cx)

crates/agent_ui/src/acp/message_editor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,8 @@ mod tests {
21992199
format!("seven.txt b{slash}"),
22002200
format!("six.txt b{slash}"),
22012201
format!("five.txt b{slash}"),
2202+
"Files & Directories".into(),
2203+
"Symbols".into()
22022204
]
22032205
);
22042206
editor.set_text("", window, cx);

0 commit comments

Comments
 (0)