Forge
csharpdeeb25a2
1using CascadeIDE.Contracts;
2using CascadeIDE.Features.Workspace.Application;
3
4namespace CascadeIDE.Features.Search.Application;
5
6/// <summary>Разрешение каталога workspace для палитры и относительных путей.</summary>
7[PresentationProjection("command palette goto workspace root")]
8public 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