(
args: Value,
analyzer: &mut RustAnalyzerClient,
)
| 97 | } |
| 98 | |
| 99 | pub async fn inline_function_impl( |
| 100 | args: Value, |
| 101 | analyzer: &mut RustAnalyzerClient, |
| 102 | ) -> Result<ToolResult> { |
| 103 | let file_path = args |
| 104 | .get("file_path") |
| 105 | .and_then(|v| v.as_str()) |
| 106 | .ok_or_else(|| anyhow::anyhow!("Missing file_path parameter"))?; |
| 107 | let line = args |
| 108 | .get("line") |
| 109 | .and_then(|v| v.as_u64()) |
| 110 | .ok_or_else(|| anyhow::anyhow!("Missing line parameter"))?; |
| 111 | let character = args |
| 112 | .get("character") |
| 113 | .and_then(|v| v.as_u64()) |
| 114 | .ok_or_else(|| anyhow::anyhow!("Missing character parameter"))?; |
| 115 | |
| 116 | let result = analyzer |
| 117 | .inline_function(file_path, line as u32, character as u32) |
| 118 | .await?; |
| 119 | |
| 120 | Ok(ToolResult { |
| 121 | content: vec![ |
| 122 | json!({ |
| 123 | "type": "text", |
| 124 | "text": result |
| 125 | }) |
| 126 | .as_object() |
| 127 | .unwrap() |
| 128 | .clone(), |
| 129 | ], |
| 130 | }) |
| 131 | } |
| 132 | |
| 133 | pub async fn change_signature_impl( |
| 134 | args: Value, |
no test coverage detected