Compare commits

...

8 Commits

Author SHA1 Message Date
Richard Feldman
271a8b5135 Add some search_tool tests 2025-04-15 19:52:19 -04:00
Richard Feldman
81e6e56fe9 Fix text search tool 2025-04-15 16:29:48 -04:00
Richard Feldman
7dcd76995d wip 2025-04-15 16:15:21 -04:00
Richard Feldman
68aadebed9 Revise search_tool 2025-04-15 12:51:46 -04:00
Richard Feldman
a117322907 Revert "Add a bunch of new search_tool output types"
This reverts commit ee336532092c24ddc2b1e3905e38a896b9737c7c.
2025-04-15 12:51:46 -04:00
Richard Feldman
2a8456e936 Add a bunch of new search_tool output types 2025-04-15 12:51:46 -04:00
Richard Feldman
8f0f08d4d7 Revise search_tool 2025-04-15 12:51:46 -04:00
Richard Feldman
132340aa82 Add search_tool 2025-04-15 12:51:46 -04:00
4 changed files with 1301 additions and 0 deletions

View File

@@ -652,6 +652,7 @@
"path_search": true,
"read_file": true,
"regex_search": true,
"search_project": true,
"thinking": true
}
},
@@ -677,6 +678,7 @@
"read_file": true,
"regex_search": true,
"rename": true,
"search_project": true,
"symbol_info": true,
"thinking": true
}

View File

@@ -19,6 +19,7 @@ mod regex_search_tool;
mod rename_tool;
mod replace;
mod schema;
mod search_tool;
mod symbol_info_tool;
mod terminal_tool;
mod thinking_tool;
@@ -48,6 +49,7 @@ use crate::path_search_tool::PathSearchTool;
use crate::read_file_tool::ReadFileTool;
use crate::regex_search_tool::RegexSearchTool;
use crate::rename_tool::RenameTool;
use crate::search_tool::SearchTool;
use crate::symbol_info_tool::SymbolInfoTool;
use crate::terminal_tool::TerminalTool;
use crate::thinking_tool::ThinkingTool;
@@ -77,6 +79,7 @@ pub fn init(http_client: Arc<HttpClientWithUrl>, cx: &mut App) {
registry.register_tool(RegexSearchTool);
registry.register_tool(RenameTool);
registry.register_tool(ThinkingTool);
registry.register_tool(SearchTool);
registry.register_tool(FetchTool::new(http_client));
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
Searches the project for files, code symbols, and text content in a unified way.
This tool combines the functionality of path searching, regex searching within files, and code symbol searching, allowing for powerful and flexible code exploration.
The tool can:
1. Find files by matching path patterns
2. Search for text content within files using regular expressions
3. Find code symbols (functions, classes, variables, etc.) in specific files or across the project
Results are paginated with matches per page varying based on the search mode.
When searching for files, it will return paths in the project matching the path pattern.
When searching for text content, it will return file paths, line numbers, and context for each match.
When searching for code symbols, it will return a hierarchical outline or a flat list of symbols with their locations.
Use this tool when you need to find specific files, code symbols, or text patterns across your project.
You should very strongly prefer to use "output": "symbols" when searching for code symbols such as functions, types, classes, etc. This is because "output": "symbols" uses the language server to perform a semantic search of the project, which will give you more accurate results than "output": "text".
<good_example>
To find where a class named "Item" is defined in the project:
{
"output": "symbols",
"query": "Item"
}
</good_example>
<bad_example>
This is the incorrect way to find where a class named "Item" is defined in the project:
{
"output": "text",
"query": "class.*Item"
}
</bad_example>