Skip to content

Commit

Permalink
brought hack methods that were removed by accident (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll authored Aug 4, 2020
1 parent 7d4ecc5 commit 899eb2f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Protocol/Window/IShowMessageHandler.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using OmniSharp.Extensions.JsonRpc;
using OmniSharp.Extensions.JsonRpc.Generation;
using OmniSharp.Extensions.LanguageServer.Protocol.Client;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
using OmniSharp.Extensions.LanguageServer.Protocol.Server;

Expand All @@ -16,4 +18,32 @@ public abstract class ShowMessageHandler : IShowMessageHandler
{
public abstract Task<Unit> Handle(ShowMessageParams request, CancellationToken cancellationToken);
}

public static partial class ShowMessageExtensions
{
public static void Show(this IWindowLanguageServer mediator, ShowMessageParams @params)
{
mediator.ShowMessage(@params);
}

public static void ShowError(this IWindowLanguageServer mediator, string message)
{
mediator.ShowMessage(new ShowMessageParams() { Type = MessageType.Error, Message = message });
}

public static void Show(this IWindowLanguageServer mediator, string message)
{
mediator.ShowMessage(new ShowMessageParams() { Type = MessageType.Log, Message = message });
}

public static void ShowWarning(this IWindowLanguageServer mediator, string message)
{
mediator.ShowMessage(new ShowMessageParams() { Type = MessageType.Warning, Message = message });
}

public static void ShowInfo(this IWindowLanguageServer mediator, string message)
{
mediator.ShowMessage(new ShowMessageParams() { Type = MessageType.Info, Message = message });
}
}
}

0 comments on commit 899eb2f

Please sign in to comment.