lsp_find_references
Find all references to a symbol at a specified line and character in a JavaScript/TypeScript file, outputting each occurrence's file, line, and column.
Instructions
Find all usages/references of symbol at position.
🔴 CRITICAL: Line and character are STRICTLY 0-INDEXED (0, 1, 2...), NOT 1-indexed!
❌ WRONG (what editor displays):
Editor shows: "Ln 5, Col 10"
❌ DON'T use: {"line": 5, "character": 10}
✅ CORRECT (0-indexed):
✅ DO use: {"line": 4, "character": 9}
Formula: lsp_value = editor_value - 1
CHARACTER COUNTING (0-indexed from start of line):
Line: "const greeting = "Hello";"
Index: 0123456789...
• 'c' in const → character: 0
• 'o' in const → character: 1
• 'g' in greeting → character: 6
• 'H' in string → character: 18
Args:
params (LSPInput): Must provide line and character as 0-indexed values
Returns:
str: "Found N references:
file:line:column ..." or "No references found"
Example:
✅ {"file_path": "src/app.ts", "line": 4, "character": 9}
→ "Found 2 references:
/path/src/app.ts:5:9 /path/src/utils.ts:10:2"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |