Find all symbols that are referenced from a given symbol's definition
The input position must point to a symbol (e.g. function name, class name, variable name). Returns all symbols referenced within that symbol’s implementation, categorized into:
- Workspace symbols (with their definitions)
- External symbols (built-in functions like ‘len’, ‘print’ or from external libraries)
- Symbols that couldn’t be found
e.g. for a function definition in main.py
:
@log_execution_time # Reference to decorator
def process_user(): # <-- Input position here
user = User() # Reference to User class
print("Done") # Reference to built-in function
This would return:
- Workspace symbols: [ log_execution_time (with definition from decorators.py), User (with definition from models.py) ]
- External symbols: print (Python built-in)
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Request to get all symbols that are referenced from a symbol at the given position, either focusing on function calls, or more permissively finding all references
The input position must point to a symbol (e.g. function name, class name, variable name). The response will include all symbols that are referenced from that input symbol. For example, if the position points to a function name, the response will include all symbols referenced within that function's implementation.
The identifier position of the symbol to find references within
Whether to use the more permissive rules to find referenced symbols. This will be not just code that is executed but also things like type hints and chained indirection. Defaults to false.
false
Response
Response containing symbols referenced from the requested position
The symbols are categorized into:
- workspace_symbols: References to symbols that were found and have definitions in the workspace
- external_symbols: References to symbols from outside the workspace (built-in functions, external libraries)
- not_found: References where the symbol definition could not be found
A reference to a symbol along with its definition(s) found in the workspace
e.g. for a reference to User
in main.py
:
user = User("John", 30)
_______^
This would contain:
- The reference location and name ("User" at line 0)
- The symbol definition(s) (e.g. "class User" in models.py)