using System.Diagnostics; using Godot; using Microsoft.Extensions.Logging; using SharpIDE.Application.Features.Analysis; using SharpIDE.Application.Features.Build; using SharpIDE.Application.Features.Events; using SharpIDE.Application.Features.FilePersistence; using SharpIDE.Application.Features.FileWatching; using SharpIDE.Application.Features.NavigationHistory; using SharpIDE.Application.Features.Run; using SharpIDE.Application.Features.SolutionDiscovery; using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; using SharpIDE.Godot.Features.BottomPanel; using SharpIDE.Godot.Features.CodeEditor; using SharpIDE.Godot.Features.CustomControls; using SharpIDE.Godot.Features.Run; using SharpIDE.Godot.Features.Search; using SharpIDE.Godot.Features.Search.SearchAllFiles; using SharpIDE.Godot.Features.SolutionExplorer; namespace SharpIDE.Godot; public partial class IdeRoot : Control { public IdeWindow IdeWindow { get; set; } = null!; private Button _openSlnButton = null!; private Button _buildSlnButton = null!; private Button _rebuildSlnButton = null!; private Button _cleanSlnButton = null!; private Button _restoreSlnButton = null!; private SearchWindow _searchWindow = null!; private SearchAllFilesWindow _searchAllFilesWindow = null!; private CodeEditorPanel _codeEditorPanel = null!; private SolutionExplorerPanel _solutionExplorerPanel = null!; private InvertedVSplitContainer _invertedVSplitContainer = null!; private RunPanel _runPanel = null!; private Button _runMenuButton = null!; private Popup _runMenuPopup = null!; private BottomPanelManager _bottomPanelManager = null!; private readonly PackedScene _runMenuItemScene = ResourceLoader.Load("res://Features/Run/RunMenuItem.tscn"); private TaskCompletionSource _nodeReadyTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); [Inject] private readonly FileChangedService _fileChangedService = null!; [Inject] private readonly IdeFileExternalChangeHandler _fileExternalChangeHandler = null!; [Inject] private readonly IdeFileWatcher _fileWatcher = null!; [Inject] private readonly BuildService _buildService = null!; [Inject] private readonly IdeOpenTabsFileManager _openTabsFileManager = null!; [Inject] private readonly RoslynAnalysis _roslynAnalysis = null!; [Inject] private readonly SharpIdeSolutionModificationService _sharpIdeSolutionModificationService = null!; [Inject] private readonly IdeNavigationHistoryService _navigationHistoryService = null!; [Inject] private readonly ILogger _logger = null!; public override void _EnterTree() { GodotGlobalEvents.Instance = new GodotGlobalEvents(); GlobalEvents.Instance = new GlobalEvents(); } public override void _ExitTree() { _fileWatcher?.Dispose(); GetTree().GetRoot().FocusExited -= OnFocusExited; } public override void _Ready() { _openSlnButton = GetNode