PowerShell / PowerShell/PowerShellEditorServices
Add ShowMessageRequest API to psEditor
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 767
- Forks
- 266
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 1
Descripción
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);
}
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la API EditorWindow de psEditor y sigue la llamada existente a ShowMessageRequestExtensions a través de ILanguageServer y su servicio Window. Compara la firma de SendMessage solicitada con la compatibilidad actual con notificaciones y determina cómo debe exponerse el MessageActionItem seleccionado. Se considera terminado cuando una API EditorWindow generalmente accesible pueda presentar las opciones y devolver la elección del usuario.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, powershell
- Área
- developer-experience
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 43/100