protected override void OnItemReady() { base.OnItemReady(); if (!IsGodotProject()) { return; } string godotProjectDir = Path.GetDirectoryName(GetGodotProjectPath()); LoggingService.LogInfo($"Godot project directory is: {godotProjectDir}"); try { string DetermineIdentity() => // TODO: Proper detection of whether we are running on VSMac or MD RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "VisualStudioForMac" : "MonoDevelop"; GodotMessagingClient?.Dispose(); GodotMessagingClient = new Client(DetermineIdentity(), godotProjectDir, new MessageHandler(), new MonoDevelopLogger()); GodotMessagingClient.Connected += OnClientConnected; GodotMessagingClient.Start(); BaseCompletionProvider.Context = new GodotProviderContext(this); } catch (Exception e) { LoggingService.LogError("Exception when initializing Godot Ide Client", e); } }
public override void Dispose() { base.Dispose(); GodotMessagingClient?.Dispose(); }