MCPcopy Create free account
hub / github.com/dexwritescode/rust-mcp / inline_function_impl

Function inline_function_impl

src/tools/refactoring.rs:99–131  ·  view source on GitHub ↗
(
    args: Value,
    analyzer: &mut RustAnalyzerClient,
)

Source from the content-addressed store, hash-verified

97}
98
99pub 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
133pub async fn change_signature_impl(
134 args: Value,

Callers 1

execute_toolFunction · 0.85

Calls 1

inline_functionMethod · 0.45

Tested by

no test coverage detected