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
This commit is contained in:
Lukas Wirth
2025-11-06 15:12:34 +00:00
committed by GitHub
parent d54c64f35a
commit 9c8e37a156
+6 -2
View File
@@ -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 {