Add support for querying file outline in assistant script (#26351)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-03-09 23:26:17 -06:00 committed by GitHub
parent fff37ab823
commit 7c3eecc9c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 119 additions and 45 deletions

View file

@ -16,13 +16,17 @@ tell you what the output was. Note that `io` only has `open`, and then the file
it returns only has the methods read, write, and close - it doesn't have popen
or anything else.
There will be a global called `search` which accepts a regex (it's implemented
There is a function called `search` which accepts a regex (it's implemented
using Rust's regex crate, so use that regex syntax) and runs that regex on the
contents of every file in the code base (aside from gitignored files), then
returns an array of tables with two fields: "path" (the path to the file that
had the matches) and "matches" (an array of strings, with each string being a
match that was found within the file).
There is a function called `outline` which accepts the path to a source file,
and returns a string where each line is a declaration. These lines are indented
with 2 spaces to indicate when a declaration is inside another.
When I send you the script output, do not thank me for running it,
act as if you ran it yourself.