(
request: FormatDocumentRequest,
)
| 331 | |
| 332 | #[tauri::command] |
| 333 | pub async fn lsp_format_document( |
| 334 | request: FormatDocumentRequest, |
| 335 | ) -> Result<serde_json::Value, String> { |
| 336 | let manager = get_global_lsp_manager().map_err(|e| format!("LSP not initialized: {}", e))?; |
| 337 | |
| 338 | let tab_size = request.tab_size.unwrap_or(4); |
| 339 | let insert_spaces = request.insert_spaces.unwrap_or(true); |
| 340 | |
| 341 | let guard = manager.read().await; |
| 342 | let edits = guard |
| 343 | .format_document(&request.language, &request.uri, tab_size, insert_spaces) |
| 344 | .await |
| 345 | .map_err(|e| format!("Failed to format document: {}", e))?; |
| 346 | |
| 347 | Ok(edits) |
| 348 | } |
| 349 | |
| 350 | #[tauri::command] |
| 351 | pub async fn lsp_install_plugin(request: InstallPluginRequest) -> Result<String, String> { |
nothing calls this directly
no test coverage detected