PowerShell / PowerShell/PowerShellEditorServices
Add ShowMessageRequest API to psEditor
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 767
- Fork
- 266
- Merge medio
- 3g 16h
- PR unite (30g)
- 1
Descrizione
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);
}
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’API EditorWindow di psEditor e segui la chiamata esistente a ShowMessageRequestExtensions attraverso ILanguageServer e il relativo servizio Window. Confronta la firma SendMessage richiesta con il supporto attuale per le notifiche e determina come debba essere esposto il MessageActionItem selezionato. Il lavoro è completo quando un’API EditorWindow generalmente accessibile può presentare le opzioni e restituire la scelta dell’utente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, powershell
- Ambito
- developer-experience
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 43/100