Skip to content

Commit 6b56755

Browse files
authored
Remove another windows path workaround (#87)
1 parent d6428c7 commit 6b56755

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/debugger.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::HashMap, env::current_dir, fs, path::PathBuf};
1+
use std::{collections::HashMap, env, fs, path::PathBuf};
22

33
use serde::{Deserialize, Serialize};
44
use zed_extension_api::{
@@ -299,15 +299,8 @@ impl Debugger {
299299
&self,
300300
initialization_options: Option<Value>,
301301
) -> zed::Result<Value> {
302-
let mut current_dir =
303-
current_dir().map_err(|err| format!("could not get current dir: {err}"))?;
304-
305-
if current_platform().0 == Os::Windows {
306-
current_dir = current_dir
307-
.strip_prefix("/")
308-
.map_err(|err| err.to_string())?
309-
.to_path_buf();
310-
}
302+
let current_dir =
303+
env::current_dir().map_err(|err| format!("could not get current dir: {err}"))?;
311304

312305
let canonical_path = Value::String(
313306
current_dir

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mod debugger;
22
mod lsp;
33
use std::{
44
collections::BTreeSet,
5-
env::current_dir,
5+
env,
66
fs::{self, create_dir},
77
path::{Path, PathBuf},
88
str::FromStr,
@@ -427,8 +427,8 @@ impl Extension for Java {
427427
language_server_id: &LanguageServerId,
428428
worktree: &Worktree,
429429
) -> zed::Result<zed::Command> {
430-
let mut current_dir =
431-
current_dir().map_err(|err| format!("could not get current dir: {err}"))?;
430+
let current_dir =
431+
env::current_dir().map_err(|err| format!("could not get current dir: {err}"))?;
432432

433433
let configuration =
434434
self.language_server_workspace_configuration(language_server_id, worktree)?;

0 commit comments

Comments
 (0)