Add ShowMessageRequest API to psEditor
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 43/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp, powershell
- Domain
- developer-experience
Research direction
Start with the psEditor EditorWindow API and trace the existing ShowMessageRequestExtensions call through ILanguageServer and its Window service. Compare the requested SendMessage signature with the current notification support and determine how the selected MessageActionItem should be exposed. Done means a generally accessible EditorWindow API can present the options and return the user's choice.
Written by the indexing model from the issue text.
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);
}
- Dominant language
- C#
- Stars
- 767
- Forks
- 266
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. Open
PowerShell/PowerShellEditorServices#2331 · 1 reaction · 2 assignees ·
-
Area-Language Server Issue-Enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
PowerShell/PowerShellEditorServices#2315 · 1 comment ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 reaction · 2 assignees ·
-
Issue-Bug Needs: Triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
PowerShell/PowerShellEditorServices#2293 · 1 comment ·
-
PowerShell/PowerShellEditorServices#2282 · 1 comment · 1 reaction · 2 assignees ·
All issues in PowerShell/PowerShellEditorServices
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1425 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Difficulty 2/5 1-2 days Newbie friendliness 75/100
Altinn/altinn-auth#4143 ·