go_to_implementation
Find implementations of interfaces or abstract methods in Svelte projects to navigate code structure and understand component relationships.
Instructions
Find implementations of an interface or abstract method.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Absolute path to the file | |
| symbolName | Yes | Name of the symbol to find | |
| symbolKind | No | Kind of symbol | |
| filter | No | Optional regex filter on symbol/file names in results | |
| limit | No | Max results to return. Default: 50 |
Implementation Reference
- src/tools/navigation.ts:134-174 (handler)The "go_to_implementation" tool is registered and implemented in src/tools/navigation.ts. It uses the `prepareSymbolRequest` helper to find the context, then requests `textDocument/implementation` from the LSP, and finally formats the results using `formatLocations`.
server.registerTool( "go_to_implementation", { title: "Go to Implementation", description: "Find implementations of an interface or abstract method.", inputSchema: z.object({ filePath: z.string().describe("Absolute path to the file"), symbolName: z.string().describe("Name of the symbol to find"), symbolKind: z.string().optional().describe("Kind of symbol"), filter: z .string() .optional() .describe("Optional regex filter on symbol/file names in results"), limit: z .number() .default(50) .describe("Max results to return. Default: 50"), }), }, async ({ filePath, symbolName, symbolKind, filter, limit, }): Promise<ToolResult> => { try { const prep = await prepareSymbolRequest(lsp, filePath, symbolName, symbolKind); if ("error" in prep) return textResult(prep.error); const result = await lsp.request( "textDocument/implementation", makePositionParams(prep.ctx) ); return textResult(formatLocations(result, "implementation", filter, limit)); } catch (ex) { return textResult(formatError(ex)); } } );