csharpdeeb25a2 | 1 | #nullable enable |
| 2 | using CascadeIDE.Contracts; |
| 3 | using CascadeIDE.Features.Launch.DataAcquisition; |
| 4 | using CascadeIDE.Services; |
| 5 | |
| 6 | namespace CascadeIDE.Features.IdeMcp.Application; |
| 7 | |
| 8 | /// <summary>UI-мутации редактора/документов для MCP (маршалинг остаётся на хосте).</summary> |
| 9 | [ApplicationOrchestrator] |
| 10 | public static class IdeMcpEditorDocumentOrchestrator |
| 11 | { |
| 12 | public static void ScheduleOpenFile( |
| 13 | IUiScheduler scheduler, |
| 14 | string path, |
| 15 | Action<string> openNormalizedExistingFile) |
| 16 | { |
| 17 | if (string.IsNullOrEmpty(path)) |
| 18 | return; |
| 19 | |
| 20 | var pathCopy = path; |
| 21 | scheduler.Post(() => |
| 22 | { |
| 23 | var normalized = LaunchProjectPathResolver.NormalizeExistingProjectFileFullPath(pathCopy); |
| 24 | if (normalized is null) |
| 25 | return; |
| 26 | openNormalizedExistingFile(normalized); |
| 27 | }); |
| 28 | } |
| 29 | |
| 30 | public static void ScheduleLoadSolution(IUiScheduler scheduler, string path, Action<string> loadSolution) |
| 31 | { |
| 32 | if (string.IsNullOrEmpty(path)) |
| 33 | return; |
| 34 | |
| 35 | var pathCopy = path; |
| 36 | scheduler.Post(() => loadSolution(pathCopy)); |
| 37 | } |
| 38 | } |
| 39 | |
View only · write via MCP/CIDE