Use tree-sitter when returning symbols to the model for a given file (#28352)
This also increases the threshold for when we return an outline during `read_file`. Release Notes: - Fixed an issue that caused the agent to fail reading large files if the LSP hadn't started yet.
This commit is contained in:
parent
ca8f6e8a3f
commit
97641c3298
6 changed files with 46 additions and 218 deletions
|
@ -1,7 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use crate::code_symbols_tool::file_outline;
|
||||
use crate::schema::json_schema_for;
|
||||
use crate::{code_symbols_tool::file_outline, schema::json_schema_for};
|
||||
use anyhow::{Result, anyhow};
|
||||
use assistant_tool::{ActionLog, Tool};
|
||||
use gpui::{App, Entity, Task};
|
||||
|
@ -16,7 +15,7 @@ use util::markdown::MarkdownString;
|
|||
/// If the model requests to read a file whose size exceeds this, then
|
||||
/// the tool will return an error along with the model's symbol outline,
|
||||
/// and suggest trying again using line ranges from the outline.
|
||||
const MAX_FILE_SIZE_TO_READ: usize = 4096;
|
||||
const MAX_FILE_SIZE_TO_READ: usize = 16384;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct ReadFileToolInput {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue