powershell-es/test/PowerShellEditorServices.Test.E2E/Hosts/IDebugAdapterClientExtensions.cs
fwastring baa0056244
Some checks are pending
CI Tests / dotnet (push) Waiting to run
CI Tests / dotnet-1 (push) Waiting to run
CI Tests / dotnet-2 (push) Waiting to run
Emacs End-to-End Tests / ert (push) Waiting to run
Vim End-to-End Tests / themis (push) Waiting to run
initial
2026-02-17 13:06:31 +01:00

27 lines
962 B
C#

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Threading.Tasks;
using Microsoft.PowerShell.EditorServices.Handlers;
using OmniSharp.Extensions.DebugAdapter.Protocol.Client;
using OmniSharp.Extensions.DebugAdapter.Protocol.Requests;
namespace PowerShellEditorServices.Test.E2E
{
public static class IDebugAdapterClientExtensions
{
public static async Task LaunchScript(this IDebugAdapterClient debugAdapterClient, string script, string executeMode = "DotSource")
{
_ = await debugAdapterClient.Launch(
new PsesLaunchRequestArguments
{
NoDebug = false,
Script = script,
Cwd = "",
CreateTemporaryIntegratedConsole = false,
ExecuteMode = executeMode,
}) ?? throw new Exception("Launch response was null.");
}
}
}