find_referencing_symbols
Identify symbols referencing a specified symbol in code, returning metadata and code snippets. Use to locate direct subclasses or other references efficiently in large codebases.
Instructions
Finds symbols that reference the symbol at the given name_path
. The result will contain metadata about the referencing symbols
as well as a short code snippet around the reference (unless include_body
is True, then the short snippet will be omitted).
Note that among other kinds of references, this function can be used to find (direct) subclasses of a class,
as subclasses are referencing symbols that have the kind class. Returns a list of JSON objects with the symbols referencing the requested symbol.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
exclude_kinds | No | Same as in the `find_symbol` tool. | |
include_kinds | No | Same as in the `find_symbol` tool. | |
max_answer_chars | No | Same as in the `find_symbol` tool. | |
name_path | Yes | For finding the symbol to find references for, same logic as in the `find_symbol` tool. | |
relative_path | Yes | The relative path to the file containing the symbol for which to find references. Note that here you can't pass a directory but must pass a file. |