POST
/
symbol
/
find-referenced-symbols
curl --request POST \
  --url http://localhost:4444/v1/symbol/find-referenced-symbols \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "full_scan": false,
  "identifier_position": {
    "path": "src/main.py",
    "position": {
      "character": 5,
      "line": 10
    }
  }
}'
{
  "external_symbols": [
    {
      "file_range": {
        "path": "src/main.py",
        "range": {
          "end": {
            "character": 5,
            "line": 10
          },
          "start": {
            "character": 5,
            "line": 10
          }
        }
      },
      "kind": "<string>",
      "name": "<string>"
    }
  ],
  "not_found": [
    {
      "file_range": {
        "path": "src/main.py",
        "range": {
          "end": {
            "character": 5,
            "line": 10
          },
          "start": {
            "character": 5,
            "line": 10
          }
        }
      },
      "kind": "<string>",
      "name": "<string>"
    }
  ],
  "workspace_symbols": [
    {
      "definitions": [
        {
          "file_range": {
            "path": "src/main.py",
            "range": {
              "end": {
                "character": 5,
                "line": 10
              },
              "start": {
                "character": 5,
                "line": 10
              }
            }
          },
          "identifier_position": {
            "path": "src/main.py",
            "position": {
              "character": 5,
              "line": 10
            }
          },
          "kind": "class",
          "name": "User"
        }
      ],
      "reference": {
        "file_range": {
          "path": "src/main.py",
          "range": {
            "end": {
              "character": 5,
              "line": 10
            },
            "start": {
              "character": 5,
              "line": 10
            }
          }
        },
        "kind": "<string>",
        "name": "<string>"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

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.

identifier_position
object
required

The identifier position of the symbol to find references within

full_scan
boolean

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.

Example:

false

Response

200
application/json
Referenced symbols retrieved successfully

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
external_symbols
object[]
required
not_found
object[]
required
workspace_symbols
object[]
required

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)