Open
Description
Right now we have the send message notifications hooked up, but there's also a request that looks like this:
It would be cool to have that hooked up in a generally accessible way. Right now you can do this:
using namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
using namespace OmniSharp.Extensions.LanguageServer.Protocol.Server
using namespace OmniSharp.Extensions.LanguageServer.Server
# Type name is fully qualified because there's an ILanguageServer
# in both the Protocol and the Server namespaces.
$server = $psEditor.Components.GetService(
[OmniSharp.Extensions.LanguageServer.Protocol.Server.ILanguageServer])
$task = [ShowMessageRequestExtensions]::Request(
$server.Window,
[ShowMessageRequestParams]@{
Type = [MessageType]::Error
Message = 'Question that is relevant to the options?'
Actions = (
[MessageActionItem]@{ Title = 'Option 1' },
[MessageActionItem]@{ Title = 'Option 2' })
})
while (-not $task.AsyncWaitHandle.WaitOne(200)) { }
# This will hold the chosen MessageActionItem
$result = $task.GetAwaiter().GetResult()
Something like this would be great though:
public partial class EditorWindow
{
public string SendMessage(
MessageType messageType,
string caption,
params string[] options);
}