lsp_goto_definition
Locate a symbol's definition in JavaScript/TypeScript code. Given a file and 0-indexed cursor position, returns the definition's file:line:column or 'Definition not found'.
Instructions
Jump to symbol definition location.
š“ 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: "file:line:column" or "Definition not found"
Example: ā {"file_path": "src/app.ts", "line": 4, "character": 9} ā "/path/src/app.ts:15:5"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |