| 1 | namespace CascadeIDE.Cockpit.ComputingUnits.IdeHealth; |
| 2 | |
| 3 | using CascadeIDE.Cockpit.DataBus; |
| 4 | using CascadeIDE.Contracts; |
| 5 | |
| 6 | /// <summary> |
| 7 | /// CCU «страт C / IDE host» (ADR 0097): из <see cref="IdeHostStateChanged"/> в <see cref="IdeHealthIdeHostInput"/> (краткая подсказка LSP). |
| 8 | /// </summary> |
| 9 | [ComputingUnit] |
| 10 | public sealed class IdeHealthIdeHostUnit : ICockpitComputeUnit |
| 11 | { |
| 12 | public static IdeHealthIdeHostUnit Default { get; } = new(); |
| 13 | |
| 14 | private IdeHealthIdeHostUnit() |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | public IdeHealthIdeHostInput Compose(in IdeHostStateChanged state) => |
| 19 | Compose(state.CSharpLspProcessActive, state.MarkdownLspProcessActive); |
| 20 | |
| 21 | public IdeHealthIdeHostInput Compose(bool csharpLspActive, bool markdownLspActive) |
| 22 | { |
| 23 | var hint = (csharpLspActive, markdownLspActive) switch |
| 24 | { |
| 25 | (true, true) => "LSP · C# · MD", |
| 26 | (true, false) => "LSP · C#", |
| 27 | (false, true) => "LSP · MD", |
| 28 | _ => (string?)null |
| 29 | }; |
| 30 | return new IdeHealthIdeHostInput(LspStatusHint: hint); |
| 31 | } |
| 32 | } |
| 33 | |
View only · write via MCP/CIDE