Skip to content

brought hack methods that were removed by accident #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 });
}
}
}