description.md

 1Returns either an outline of the public code symbols in the entire project (grouped by file) or else an outline of both the public and private code symbols within a particular file.
 2
 3When a path is provided, this tool returns a hierarchical outline of code symbols for that specific file.
 4When no path is provided, it returns a list of all public code symbols in the project, organized by file.
 5
 6You can also provide an optional regular expression which filters the output by only showing code symbols which match that regex.
 7
 8Results are paginated with 2000 entries per page. Use the optional 'offset' parameter to request subsequent pages.
 9
10Markdown headings indicate the structure of the output; just like
11with markdown headings, the more # symbols there are at the beginning of a line,
12the deeper it is in the hierarchy.
13
14Each code symbol entry ends with a line number or range, which tells you what portion of the
15underlying source code file corresponds to that part of the outline. You can use
16that line information with other tools, to strategically read portions of the source code.
17
18For example, you can use this tool to find a relevant symbol in the project, then get the outline of the file which contains that symbol, then use the line number information from that file's outline to read different sections of that file, without having to read the entire file all at once (which can be slow, or use a lot of tokens).
19
20<example>
21# class Foo [L123-136]
22## method do_something(arg1, arg2) [L124-126]
23## method process_data(data) [L128-135]
24# class Bar [L145-161]
25## method initialize() [L146-149]
26## method update_state(new_state) [L160]
27## private method _validate_state(state) [L161-162]
28</example>
29
30This example shows how tree-sitter outlines the structure of source code:
31
321. `class Foo` is defined on lines 123-136
33   - It contains a method `do_something` spanning lines 124-126
34   - It also has a method `process_data` spanning lines 128-135
35
362. `class Bar` is defined on lines 145-161
37   - It has an `initialize` method spanning lines 146-149
38   - It has an `update_state` method on line 160
39   - It has a private method `_validate_state` spanning lines 161-162