1use crate::{
2 progress::client::{LspClient, CLIENT},
3 workspace::Workspace,
4};
5use std::{path::PathBuf, sync::Arc};
6
7pub mod client;
8pub mod layer;
9
10pub fn lsp_port_path(workspace: &Workspace) -> PathBuf {
11 workspace.root().join(".lux").join("lsp-port")
12}
13
14pub fn set_connection(workspace: &Workspace) {
15 match LspClient::connect(workspace) {
16 Ok(client) => {
17 if let Ok(mut guard) = CLIENT.write() {
18 *guard = Some(Arc::new(client));
19 }
20 }
21 Err(err) => {
22 tracing::debug!(
23 "no lx-lsp server found, LSP progress forwarding remains disabled: {err}"
24 );
25 }
26 }
27}