POST
/
symbol
/
find-references
curl --request POST \
  --url http://localhost:4444/v1/symbol/find-references \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "identifier_position": {
    "path": "src/main.py",
    "position": {
      "character": 5,
      "line": 10
    }
  },
  "include_code_context_lines": 5,
  "include_raw_response": false
}'
{
  "context": [
    {
      "range": {
        "path": "src/main.py",
        "range": {
          "end": {
            "character": 5,
            "line": 10
          },
          "start": {
            "character": 5,
            "line": 10
          }
        }
      },
      "source_code": "<string>"
    }
  ],
  "raw_response": "<any>",
  "references": [
    {
      "path": "src/main.py",
      "position": {
        "character": 5,
        "line": 10
      }
    }
  ],
  "selected_identifier": {
    "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
identifier_position
object
required

A position within a specific file in the workspace

include_code_context_lines
integer | null

Whether to include the source code of the symbol in the response. Defaults to none.

Required range: x >= 0
Example:

5

include_raw_response
boolean

Whether to include the raw response from the langserver in the response. Defaults to false.

Example:

false

Response

200
application/json
References retrieved successfully

Response to a references request.

Points to the start position of the symbol's identifier.

e.g. for the references of User on line 0 character 6 of src/main.py with the code:

0: class User:
1:     def __init__(self, name, age):
2:         self.name = name
3:         self.age = age
4:
5: user = User("John", 30)
_________^
6:
7: print(user.name)

The references will be [{"path": "src/main.py", "line": 5, "character": 7}].

references
object[]
required

A position within a specific file in the workspace

selected_identifier
object
required

The identifier that was "clicked-on" to get the references.

context
object[] | null

The source code around the references.