| 1 | #nullable enable |
| 2 | |
| 3 | namespace RoslynMcp.ServiceLayer.WorkspaceNavigation; |
| 4 | |
| 5 | /// <summary>Имена видов связей в ответе (режим related / основа subgraph).</summary> |
| 6 | public static class WorkspaceNavigationRelatedKinds |
| 7 | { |
| 8 | public const string PartialPeer = "partial_peer"; |
| 9 | public const string ProjectPeer = "project_peer"; |
| 10 | public const string XamlCodeBehindPair = "xaml_codebehind_pair"; |
| 11 | public const string TestCounterpart = "test_counterpart"; |
| 12 | public const string SameNamespace = "same_namespace"; |
| 13 | public const string SameDirectory = "same_directory"; |
| 14 | |
| 15 | internal static readonly string[] All = |
| 16 | [ |
| 17 | PartialPeer, |
| 18 | ProjectPeer, |
| 19 | XamlCodeBehindPair, |
| 20 | TestCounterpart, |
| 21 | SameNamespace, |
| 22 | SameDirectory |
| 23 | ]; |
| 24 | |
| 25 | /// <summary>Каноническое имя вида или <c>null</c>, если токен не известен.</summary> |
| 26 | public static string? TryCanonicalKind(string? token) |
| 27 | { |
| 28 | if (string.IsNullOrWhiteSpace(token)) |
| 29 | return null; |
| 30 | var s = token.Trim(); |
| 31 | foreach (var k in All) |
| 32 | { |
| 33 | if (string.Equals(k, s, StringComparison.OrdinalIgnoreCase)) |
| 34 | return k; |
| 35 | } |
| 36 | |
| 37 | return null; |
| 38 | } |
| 39 | } |
| 40 | |
View only · write via MCP/CIDE