Rename conversations to contexts (#12724)

This just changes nomenclature within the codebase and should have no
external effect.

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2024-06-06 11:40:54 +02:00 committed by GitHub
parent 70ce06cb95
commit a0c0f1ebcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 400 additions and 455 deletions

View file

@ -66,7 +66,7 @@ impl InlineAssistant {
&mut self,
editor: &View<Editor>,
workspace: Option<WeakView<Workspace>>,
include_conversation: bool,
include_context: bool,
cx: &mut WindowContext,
) {
let selection = editor.read(cx).selections.newest_anchor().clone();
@ -144,7 +144,7 @@ impl InlineAssistant {
self.pending_assists.insert(
inline_assist_id,
PendingInlineAssist {
include_conversation,
include_context,
editor: editor.downgrade(),
inline_assist_editor: Some((block_id, inline_assist_editor.clone())),
codegen: codegen.clone(),
@ -375,11 +375,11 @@ impl InlineAssistant {
return;
};
let conversation = if pending_assist.include_conversation {
let context = if pending_assist.include_context {
pending_assist.workspace.as_ref().and_then(|workspace| {
let workspace = workspace.upgrade()?.read(cx);
let assistant_panel = workspace.panel::<AssistantPanel>(cx)?;
assistant_panel.read(cx).active_conversation(cx)
assistant_panel.read(cx).active_context(cx)
})
} else {
None
@ -461,8 +461,8 @@ impl InlineAssistant {
});
let mut messages = Vec::new();
if let Some(conversation) = conversation {
let request = conversation.read(cx).to_completion_request(cx);
if let Some(context) = context {
let request = context.read(cx).to_completion_request(cx);
messages = request.messages;
}
let model = CompletionProvider::global(cx).model();
@ -818,7 +818,7 @@ struct PendingInlineAssist {
codegen: Model<Codegen>,
_subscriptions: Vec<Subscription>,
workspace: Option<WeakView<Workspace>>,
include_conversation: bool,
include_context: bool,
}
#[derive(Debug)]