(file_hint: Option<&Path>)
| 3365 | } |
| 3366 | |
| 3367 | async fn create_lsp_client(file_hint: Option<&Path>) -> anyhow::Result<LspClient> { |
| 3368 | let cwd = std::env::current_dir()?; |
| 3369 | let config = load_config(&cwd)?; |
| 3370 | let (id, server) = select_lsp_server(&config, file_hint)?; |
| 3371 | let command = server.command[0].clone(); |
| 3372 | let args = server.command.iter().skip(1).cloned().collect::<Vec<_>>(); |
| 3373 | let initialization_options = server |
| 3374 | .initialization |
| 3375 | .map(serde_json::to_value) |
| 3376 | .transpose()?; |
| 3377 | |
| 3378 | LspClient::start( |
| 3379 | LspServerConfig { |
| 3380 | id, |
| 3381 | command, |
| 3382 | args, |
| 3383 | initialization_options, |
| 3384 | }, |
| 3385 | cwd, |
| 3386 | ) |
| 3387 | .await |
| 3388 | .map_err(|e| anyhow::anyhow!(e.to_string())) |
| 3389 | } |
| 3390 | |
| 3391 | async fn handle_debug_command(action: DebugCommands) -> anyhow::Result<()> { |
| 3392 | match action { |
no test coverage detected