mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-13 05:42:59 +00:00
windows: Fix path parsing issue when launching Zed from command line (#15856)
Closes #15826 Closes #16068 When launching zed from the command line, the path parsing prefixes with `\\?\`. Some LSP servers do not support this type of path, so here I just simply remove the prefix. Release Notes: - N/A
This commit is contained in:
parent
aec8fb7e37
commit
e6d5f4406f
1 changed files with 4 additions and 1 deletions
|
@ -1071,7 +1071,10 @@ struct Args {
|
||||||
|
|
||||||
fn parse_url_arg(arg: &str, cx: &AppContext) -> Result<String> {
|
fn parse_url_arg(arg: &str, cx: &AppContext) -> Result<String> {
|
||||||
match std::fs::canonicalize(Path::new(&arg)) {
|
match std::fs::canonicalize(Path::new(&arg)) {
|
||||||
Ok(path) => Ok(format!("file://{}", path.to_string_lossy())),
|
Ok(path) => Ok(format!(
|
||||||
|
"file://{}",
|
||||||
|
path.to_string_lossy().trim_start_matches(r#"\\?\"#)
|
||||||
|
)),
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
if arg.starts_with("file://")
|
if arg.starts_with("file://")
|
||||||
|| arg.starts_with("zed-cli://")
|
|| arg.starts_with("zed-cli://")
|
||||||
|
|
Loading…
Reference in a new issue