| 1 | using CascadeIDE.Features.HybridIndex.Application; |
| 2 | using CascadeIDE.Features.Git; |
| 3 | using CascadeIDE.Features.IdeMcp.Execution; |
| 4 | using CascadeIDE.Models; |
| 5 | using CascadeIDE.Services; |
| 6 | |
| 7 | namespace CascadeIDE.ViewModels; |
| 8 | |
| 9 | /// <summary>Внутренний мост для <see cref="Features.IdeMcp.Application.MainWindowIdeMcpHost"/> (Wave 2 Big Bang).</summary> |
| 10 | public partial class MainWindowViewModel |
| 11 | { |
| 12 | internal ContextMinimizer McpContextMinimizer => _contextMinimizer; |
| 13 | |
| 14 | internal McpDotnetBuildTestService McpBuildTest => _mcpBuildTest; |
| 15 | |
| 16 | internal McpAgentNotesService McpAgentNotes => _mcpAgentNotes; |
| 17 | |
| 18 | internal HybridIndexOrchestrator McpHybridIndex => _hybridIndex; |
| 19 | |
| 20 | internal CascadeIdeSettings McpSettings => _settings; |
| 21 | |
| 22 | internal IGitCommandRunner McpGitRunner => _gitRunner; |
| 23 | |
| 24 | internal string McpGetWorkspacePath() => GetWorkspacePath(); |
| 25 | |
| 26 | internal Task McpRefreshGitSummaryAsync() => RefreshGitSummaryAsync(); |
| 27 | |
| 28 | internal void McpRegisterIdeMcpBreakpoint(string filePath, int line, string? condition) => |
| 29 | Editor.RegisterIdeMcpBreakpoint(filePath, line, condition); |
| 30 | |
| 31 | internal void McpNotifyBreakpointGlyphBindings() => Editor.NotifyBreakpointGlyphBindings(); |
| 32 | |
| 33 | internal void McpResyncDapBreakpointsFireAndForget() => ResyncDapBreakpointsFireAndForget(); |
| 34 | |
| 35 | internal int? McpEditorCaretOffset => NavigationMap.EditorCaretOffset; |
| 36 | |
| 37 | internal Action? McpFocusEditorAction => _focusEditorAction; |
| 38 | |
| 39 | internal Func<int?, EditorStateDto?>? McpEditorStateProvider => _editorStateProvider; |
| 40 | |
| 41 | internal Func<int, int, string?>? McpEditorContentRangeProvider => _editorContentRangeProvider; |
| 42 | |
| 43 | internal Action<string, int, int, int, int, string>? McpApplyEditAction => _applyEditAction; |
| 44 | |
| 45 | internal Action<string?, int, int, int?>? McpRevealEditorRangeAction => _revealEditorRangeAction; |
| 46 | |
| 47 | internal void McpNotifyPropertyChanged(string propertyName) => OnPropertyChanged(propertyName); |
| 48 | |
| 49 | internal void McpPublishToIdeDataBusAndRebuild<T>(T evt) => PublishToIdeDataBusAndRebuild(evt); |
| 50 | |
| 51 | internal void HostSaveSettingsIfChanged() => SaveSettingsIfChanged(); |
| 52 | |
| 53 | internal Services.CSharpLanguageService HostCsharpLanguageService => _csharpLanguageService; |
| 54 | |
| 55 | internal Services.WorkspaceDiagnosticsCoordinator HostWorkspaceDiagnostics => _workspaceDiagnostics; |
| 56 | |
| 57 | internal Services.IDotnetCommandRunner HostDotnetRunner => _dotnetRunner; |
| 58 | |
| 59 | internal void HostUpdateCodeNavigationMapCaretOffset(int? offset) => |
| 60 | UpdateCodeNavigationMapCaretOffset(offset); |
| 61 | |
| 62 | internal int McpDebugStackSelectedIndex |
| 63 | { |
| 64 | get => _debugStackSelectedIndex; |
| 65 | set => _debugStackSelectedIndex = value; |
| 66 | } |
| 67 | |
| 68 | internal bool McpSuppressDebugStackSelectedIndex |
| 69 | { |
| 70 | get => _suppressDebugStackSelectedIndex; |
| 71 | set => _suppressDebugStackSelectedIndex = value; |
| 72 | } |
| 73 | |
| 74 | internal string? McpLastBuildBinlogPath |
| 75 | { |
| 76 | get => _lastBuildBinlogPath; |
| 77 | set => _lastBuildBinlogPath = value; |
| 78 | } |
| 79 | |
| 80 | /// <summary>Прокси для UI редактора (клик по полю брейкпоинта).</summary> |
| 81 | public void ToggleBreakpointInFile(int line) => _ideMcpHost.ToggleBreakpointInFile(line); |
| 82 | |
| 83 | MainWindowViewModel IMainWindowMcpHostContext.Vm => this; |
| 84 | } |
| 85 | |