diff --git a/src/SharpIDE.Application/Features/FileWatching/IdeFileWatcher.cs b/src/SharpIDE.Application/Features/FileWatching/IdeFileWatcher.cs index 4bce411..15dabe0 100644 --- a/src/SharpIDE.Application/Features/FileWatching/IdeFileWatcher.cs +++ b/src/SharpIDE.Application/Features/FileWatching/IdeFileWatcher.cs @@ -33,7 +33,7 @@ public sealed class IdeFileWatcher(ILogger logger) : IDisposable fileWatcher.OnCreated += OnEvent; fileWatcher.OnDeleted += OnEvent; fileWatcher.OnRenamed += OnEvent; - fileWatcher.OnError += static (s, e) => Console.WriteLine($"FileSystemWatcher: Error - {e.GetException().Message}"); + fileWatcher.OnError += (s, e) => _logger.LogError(e.GetException(), "FileSystemWatcher: Error"); fileWatcher.Start(); _fileWatcher = fileWatcher; diff --git a/src/SharpIDE.Godot/IdeRoot.cs b/src/SharpIDE.Godot/IdeRoot.cs index f92e3bf..3cb2f23 100644 --- a/src/SharpIDE.Godot/IdeRoot.cs +++ b/src/SharpIDE.Godot/IdeRoot.cs @@ -141,8 +141,9 @@ public partial class IdeRoot : Control var timer = Stopwatch.StartNew(); var solutionModel = await VsPersistenceMapper.GetSolutionModel(path); // TODO: Probably refactor into a DI Service timer.Stop(); - _logger.LogInformation("Solution model fully created in {ElapsedMilliseconds} ms", timer.ElapsedMilliseconds); await _nodeReadyTcs.Task; + // Do not use injected services until after _nodeReadyTcs - Services aren't injected until _Ready + _logger.LogInformation("Solution model fully created in {ElapsedMilliseconds} ms", timer.ElapsedMilliseconds); _solutionExplorerPanel.SolutionModel = solutionModel; _codeEditorPanel.Solution = solutionModel; _bottomPanelManager.Solution = solutionModel;