symbol
Get symbols in a specific file (uses ast-grep)
Returns a list of symbols (functions, classes, variables, etc.) defined in the specified file.
Only the variabels defined at the file level are included.
The returned positions point to the start of the symbol’s identifier.
e.g. for User
on line 0 of src/main.py
:
0: class User:
_________^
1: def __init__(self, name, age):
2: self.name = name
3: self.age = age
GET
/
symbol
/
definitions-in-file
Query Parameters
file_path
string
requiredThe path to the file to get the symbols for, relative to the root of the workspace.
Response
200 - application/json
identifier_position
object
requiredThe start position of the symbol's identifier.
kind
string
requiredThe kind of the symbol (e.g., function, class).
name
string
requiredThe name of the symbol.
range
object
requiredThe full range of the symbol.