csharpdeeb25a2 | 1 | using CascadeIDE.Contracts; |
| 2 | using CascadeIDE.Features.Workspace.Application; |
| 3 | |
| 4 | namespace CascadeIDE.Features.Search.Application; |
| 5 | |
| 6 | /// <summary>Разрешение каталога workspace для палитры и относительных путей.</summary> |
| 7 | [PresentationProjection("command palette goto workspace root")] |
| 8 | public static class CommandPaletteGoToWorkspacePresentation |
| 9 | { |
| 10 | public static string? TryResolveRoot(string? solutionPath) => |
| 11 | WorkspaceBreakpointsRootPresentation.TryResolveExistingDirectory(solutionPath, out var root) ? root : null; |
| 12 | |
| 13 | public static string? TryRelativePath(string workspaceRoot, string fullPath) |
| 14 | { |
| 15 | try |
| 16 | { |
| 17 | return Path.GetRelativePath(workspaceRoot, fullPath); |
| 18 | } |
| 19 | catch |
| 20 | { |
| 21 | return null; |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
View only · write via MCP/CIDE