Add more context to the terminal assistant (#15492)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-07-30 20:21:45 +03:00 committed by GitHub
parent 73e3dfc0c3
commit eedef487ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 8 deletions

View file

@ -11,6 +11,8 @@ use terminal_view::{terminal_panel::TerminalPanel, TerminalView};
use ui::prelude::*;
use workspace::{dock::Panel, Workspace};
use crate::DEFAULT_CONTEXT_LINES;
use super::create_label_for_command;
pub(crate) struct TermSlashCommand;
@ -73,7 +75,9 @@ impl SlashCommand for TermSlashCommand {
return Task::ready(Err(anyhow::anyhow!("no active terminal")));
};
let line_count = argument.and_then(|a| parse_argument(a)).unwrap_or(20);
let line_count = argument
.and_then(|a| parse_argument(a))
.unwrap_or(DEFAULT_CONTEXT_LINES);
let lines = active_terminal
.read(cx)