Skip to main content

workspace_relative_display

Function workspace_relative_display 

Source
pub fn workspace_relative_display(workspace_root: &Path, path: &Path) -> String
Expand description

Render a path relative to the workspace when it belongs to that workspace.

Paths outside the workspace remain absolute (or otherwise unchanged) so a diagnostic never hides that it refers to an external location. The filesystem-resolved comparison handles workspace aliases and symlink escapes without requiring callers to canonicalize their candidate first.