Introduce the ability to cycle between alternative inline assists (#18098)

Release Notes:

- Added a new `assistant.inline_alternatives` setting to configure
additional models that will be used to perform inline assists in
parallel.

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Roy <roy@anthropic.com>
Co-authored-by: Adam <wolffiex@anthropic.com>
This commit is contained in:
Antonio Scandurra 2024-09-19 17:50:00 -06:00 committed by GitHub
parent ae34872f73
commit 15b4130fa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 642 additions and 178 deletions

View file

@ -1106,6 +1106,26 @@ impl MultiBuffer {
}
}
pub fn forget_transaction(
&mut self,
transaction_id: TransactionId,
cx: &mut ModelContext<Self>,
) {
if let Some(buffer) = self.as_singleton() {
buffer.update(cx, |buffer, _| {
buffer.forget_transaction(transaction_id);
});
} else if let Some(transaction) = self.history.forget(transaction_id) {
for (buffer_id, buffer_transaction_id) in transaction.buffer_transactions {
if let Some(state) = self.buffers.borrow_mut().get_mut(&buffer_id) {
state.buffer.update(cx, |buffer, _| {
buffer.forget_transaction(buffer_transaction_id);
});
}
}
}
}
pub fn stream_excerpts_with_context_lines(
&mut self,
buffer: Model<Buffer>,