diff options
Diffstat (limited to 'helix-lsp')
-rw-r--r-- | helix-lsp/Cargo.toml | 1 | ||||
-rw-r--r-- | helix-lsp/src/client.rs | 7 | ||||
-rw-r--r-- | helix-lsp/src/lib.rs | 12 |
3 files changed, 11 insertions, 9 deletions
diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml index 851351e0..510be6ee 100644 --- a/helix-lsp/Cargo.toml +++ b/helix-lsp/Cargo.toml @@ -13,6 +13,7 @@ homepage.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +helix-stdx = { path = "../helix-stdx" } helix-core = { path = "../helix-core" } helix-loader = { path = "../helix-loader" } helix-parsec = { path = "../helix-parsec" } diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 682d4db6..1af27c1d 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -4,8 +4,9 @@ use crate::{ Call, Error, OffsetEncoding, Result, }; -use helix_core::{find_workspace, path, syntax::LanguageServerFeature, ChangeSet, Rope}; +use helix_core::{find_workspace, syntax::LanguageServerFeature, ChangeSet, Rope}; use helix_loader::{self, VERSION_AND_GIT_HASH}; +use helix_stdx::path; use lsp::{ notification::DidChangeWorkspaceFolders, CodeActionCapabilityResolveSupport, DidChangeWorkspaceFoldersParams, OneOf, PositionEncodingKind, WorkspaceFolder, @@ -68,7 +69,7 @@ impl Client { may_support_workspace: bool, ) -> bool { let (workspace, workspace_is_cwd) = find_workspace(); - let workspace = path::get_normalized_path(&workspace); + let workspace = path::normalize(workspace); let root = find_lsp_workspace( doc_path .and_then(|x| x.parent().and_then(|x| x.to_str())) @@ -204,7 +205,7 @@ impl Client { let (server_rx, server_tx, initialize_notify) = Transport::start(reader, writer, stderr, id, name.clone()); let (workspace, workspace_is_cwd) = find_workspace(); - let workspace = path::get_normalized_path(&workspace); + let workspace = path::normalize(workspace); let root = find_lsp_workspace( doc_path .and_then(|x| x.parent().and_then(|x| x.to_str())) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 83625897..c99ec217 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -11,10 +11,10 @@ pub use lsp::{Position, Url}; pub use lsp_types as lsp; use futures_util::stream::select_all::SelectAll; -use helix_core::{ - path, - syntax::{LanguageConfiguration, LanguageServerConfiguration, LanguageServerFeatures}, +use helix_core::syntax::{ + LanguageConfiguration, LanguageServerConfiguration, LanguageServerFeatures, }; +use helix_stdx::path; use tokio::sync::mpsc::UnboundedReceiver; use std::{ @@ -958,10 +958,10 @@ pub fn find_lsp_workspace( let mut file = if file.is_absolute() { file.to_path_buf() } else { - let current_dir = helix_loader::current_working_dir(); + let current_dir = helix_stdx::env::current_working_dir(); current_dir.join(file) }; - file = path::get_normalized_path(&file); + file = path::normalize(&file); if !file.starts_with(workspace) { return None; @@ -978,7 +978,7 @@ pub fn find_lsp_workspace( if root_dirs .iter() - .any(|root_dir| path::get_normalized_path(&workspace.join(root_dir)) == ancestor) + .any(|root_dir| path::normalize(workspace.join(root_dir)) == ancestor) { // if the worskapce is the cwd do not search any higher for workspaces // but specify |