treesitter_find_usage
Find all usages and references of a symbol in a source file. Automatically detects the language or accepts an override, and can write large outputs to a file.
Instructions
Find all usages/references of a symbol (identifier) in a source file.
Args: name: Symbol name to search for file_path: Path to the source code file language: Optional language override (auto-detected from file extension if not provided) output_file: If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.
Returns: Dictionary containing: - query: The search query (symbol name) - matches: List of Symbol objects representing all usages of the symbol OR if output_file is set: {"status": "written", "output_file": "...", "bytes_written": N}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| language | No | ||
| file_path | Yes | ||
| output_file | No |