From ddb0417264a20c1ac49298d3bdfe0ef455af3128 Mon Sep 17 00:00:00 2001 From: zcg Date: Sat, 2 Nov 2024 23:39:32 +0800 Subject: [PATCH] fix windows path error (#4) --- extension.toml | 2 +- grammars/vue | 1 + src/vue.rs | 15 +++++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) create mode 160000 grammars/vue diff --git a/extension.toml b/extension.toml index 0d5e514..e3d81e3 100644 --- a/extension.toml +++ b/extension.toml @@ -1,7 +1,7 @@ id = "vue" name = "Vue" description = "Vue support." -version = "0.1.2" +version = "0.1.3" schema_version = 1 authors = ["Zed Industries "] repository = "https://github.com/zed-extensions/vue" diff --git a/grammars/vue b/grammars/vue new file mode 160000 index 0000000..7e48557 --- /dev/null +++ b/grammars/vue @@ -0,0 +1 @@ +Subproject commit 7e48557b903a9db9c38cea3b7839ef7e1f36c693 diff --git a/src/vue.rs b/src/vue.rs index f4b33cd..12cf40d 100644 --- a/src/vue.rs +++ b/src/vue.rs @@ -144,12 +144,15 @@ impl zed::Extension for VueExtension { command: zed::node_binary_path()?, args: vec![ env::current_dir() - .unwrap() - .join(&server_path) - .to_string_lossy() - .to_string(), - "--stdio".to_string(), - ], + .unwrap() + .join(&server_path) + .canonicalize() + .unwrap_or_else(|_| env::current_dir().unwrap().join(&server_path)) + .to_str() + .unwrap() + .replace("/C:", "C:") + .replace("\\", "/") + , "--stdio".to_string()], env: Default::default(), }) }