(
args: Value,
analyzer: &mut RustAnalyzerClient,
)
| 66 | } |
| 67 | |
| 68 | pub async fn create_module_impl( |
| 69 | args: Value, |
| 70 | analyzer: &mut RustAnalyzerClient, |
| 71 | ) -> Result<ToolResult> { |
| 72 | let module_name = args |
| 73 | .get("module_name") |
| 74 | .and_then(|v| v.as_str()) |
| 75 | .ok_or_else(|| anyhow::anyhow!("Missing module_name parameter"))?; |
| 76 | let module_path = args |
| 77 | .get("module_path") |
| 78 | .and_then(|v| v.as_str()) |
| 79 | .ok_or_else(|| anyhow::anyhow!("Missing module_path parameter"))?; |
| 80 | let is_public = args |
| 81 | .get("is_public") |
| 82 | .and_then(|v| v.as_bool()) |
| 83 | .unwrap_or(false); |
| 84 | |
| 85 | let result = analyzer |
| 86 | .create_module(module_name, module_path, is_public) |
| 87 | .await?; |
| 88 | |
| 89 | Ok(ToolResult { |
| 90 | content: vec![ |
| 91 | json!({ |
| 92 | "type": "text", |
| 93 | "text": result |
| 94 | }) |
| 95 | .as_object() |
| 96 | .unwrap() |
| 97 | .clone(), |
| 98 | ], |
| 99 | }) |
| 100 | } |
| 101 | |
| 102 | pub async fn move_items_impl(args: Value, analyzer: &mut RustAnalyzerClient) -> Result<ToolResult> { |
| 103 | let source_file = args |
no test coverage detected