From 9c8e37a1565873665bf7f196edb1a72b813da69a Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 6 Nov 2025 16:12:34 +0100 Subject: [PATCH] clangd: Fix switch source header action on windows (#42105) Fixes https://github.com/zed-industries/zed/issues/40935 Release Notes: - Fixed clangd's switch source header action not working on windows --- crates/editor/src/clangd_ext.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/clangd_ext.rs b/crates/editor/src/clangd_ext.rs index 17ed522211369fafef4ea40c15b6dc365cb33f33..49936580987188e13ba88f919288f65371951f4b 100644 --- a/crates/editor/src/clangd_ext.rs +++ b/crates/editor/src/clangd_ext.rs @@ -88,10 +88,14 @@ pub fn switch_source_header( ) })?; - let path = PathBuf::from(goto); - workspace .update_in(cx, |workspace, window, cx| { + let goto = if workspace.path_style(cx).is_windows() { + goto.strip_prefix('/').unwrap_or(goto) + } else { + goto + }; + let path = PathBuf::from(goto); workspace.open_abs_path( path, OpenOptions {