assistant2: Don't suggest thread context for inline assist without a ThreadStore
(#23506)
This PR makes it so we don't suggest threads as context in the inline assist when we don't have a `ThreadStore` to pull from. Release Notes: - N/A
This commit is contained in:
parent
ecf70db7f0
commit
82cee9e9a4
4 changed files with 15 additions and 6 deletions
|
@ -118,6 +118,10 @@ impl ContextStrip {
|
|||
}
|
||||
|
||||
fn suggested_thread(&self, cx: &ViewContext<Self>) -> Option<SuggestedContext> {
|
||||
if !self.context_picker.read(cx).allow_threads() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let workspace = self.workspace.upgrade()?;
|
||||
let active_thread = workspace
|
||||
.read(cx)
|
||||
|
@ -432,7 +436,7 @@ impl Render for ContextStrip {
|
|||
}
|
||||
})
|
||||
.children(context.iter().enumerate().map(|(i, context)| {
|
||||
ContextPill::new_added(
|
||||
ContextPill::added(
|
||||
context.clone(),
|
||||
dupe_names.contains(&context.name),
|
||||
self.focused_index == Some(i),
|
||||
|
@ -454,7 +458,7 @@ impl Render for ContextStrip {
|
|||
}))
|
||||
.when_some(suggested_context, |el, suggested| {
|
||||
el.child(
|
||||
ContextPill::new_suggested(
|
||||
ContextPill::suggested(
|
||||
suggested.name().clone(),
|
||||
suggested.icon_path(),
|
||||
suggested.kind(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue