Skip to main content
POST
Get References

Overview

Find every place in your workspace where a symbol (function, class, variable, etc.) is referenced. This is essential for understanding symbol usage, refactoring, and impact analysis.

Request

string
required
File URI (e.g., file:///workspace/main.py)
number
required
Line number (0-indexed)
number
required
Character position (0-indexed)
boolean
default:"true"
Include the declaration/definition in results

Response

array
Array of all reference locations
number
Total number of references found

Example Request

Example Response

Use Cases

Before Refactoring

Understand Function Usage

Find Unused Code

Track Variable Usage

Reference Types

References are found in various contexts:

Filtering Results

Results are ordered by file path, then by line number within each file.

Include/Exclude Declaration

Performance Tips

Large Projects: First reference search may take 1-2 seconds while indexing workspace
Cache Results: Reference locations don’t change unless code changes
Use Filters: Exclude test files if you only care about production usage

Analyzing Results

Group references by file to understand impact:

Error Responses

Rate Limits

Large projects may return thousands of references. Consider pagination for better performance.

Get Definition

Find where a symbol is defined

Rename Symbol

Safely rename across all references

Get Hover

See symbol documentation

Get Diagnostics

Find errors in your code