(
&self,
Parameters(InlineFunctionParams {
file_path,
line,
character,
}): Parameters<InlineFunctionParams>,
)
| 487 | |
| 488 | #[tool(description = "Inline a function call at specified position")] |
| 489 | async fn inline_function( |
| 490 | &self, |
| 491 | Parameters(InlineFunctionParams { |
| 492 | file_path, |
| 493 | line, |
| 494 | character, |
| 495 | }): Parameters<InlineFunctionParams>, |
| 496 | ) -> Result<CallToolResult, McpError> { |
| 497 | let args = serde_json::json!({ |
| 498 | "file_path": file_path, |
| 499 | "line": line, |
| 500 | "character": character |
| 501 | }); |
| 502 | |
| 503 | let mut analyzer = self.analyzer.lock().await; |
| 504 | match execute_tool("inline_function", args, &mut analyzer).await { |
| 505 | Ok(result) => { |
| 506 | if let Some(content) = result.content.first() { |
| 507 | if let Some(text) = content.get("text") { |
| 508 | return Ok(CallToolResult::success(vec![Content::text( |
| 509 | text.as_str().unwrap_or("No result"), |
| 510 | )])); |
| 511 | } |
| 512 | } |
| 513 | Ok(CallToolResult::success(vec![Content::text( |
| 514 | "Function inlined successfully", |
| 515 | )])) |
| 516 | } |
| 517 | Err(e) => Ok(CallToolResult::success(vec![Content::text(format!( |
| 518 | "Error: {e}" |
| 519 | ))])), |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | #[tool(description = "Change the signature of a function")] |
| 524 | async fn change_signature( |
nothing calls this directly
no test coverage detected