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
|
@ -89,7 +89,7 @@ impl ContextPicker {
|
|||
ContextKind::Directory,
|
||||
ContextKind::FetchedUrl,
|
||||
];
|
||||
if self.thread_store.is_some() {
|
||||
if self.allow_threads() {
|
||||
context_kinds.push(ContextKind::Thread);
|
||||
}
|
||||
|
||||
|
@ -132,6 +132,11 @@ impl ContextPicker {
|
|||
menu
|
||||
}
|
||||
|
||||
/// Whether threads are allowed as context.
|
||||
pub fn allow_threads(&self) -> bool {
|
||||
self.thread_store.is_some()
|
||||
}
|
||||
|
||||
fn select_kind(&mut self, kind: ContextKind, cx: &mut ViewContext<Self>) {
|
||||
let context_picker = cx.view().downgrade();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue