Closed mfussenegger closed 11 months ago
Nice! It also works for powershell! I think the powershell dap server has some weird way of interactive input; it wants to use the console as repl, but if I enable that setting it leads to errors. The regular repl does not return any output.
local PSES_BUNDLE_PATH = os.getenv("HOME") .. "/.local/share/nvim/mason/packages/powershell-editor-services"
local tmpdir = os.tmpname() .. 'd'
os.execute("mkdir " .. tmpdir)
dap.adapters.ps1 = {
type = "pipe",
pipe = "${pipe}",
executable = {
command = "pwsh",
args = {
"-NoLogo",
"-NoProfile",
"-File",
PSES_BUNDLE_PATH .. "/PowerShellEditorServices/Start-EditorServices.ps1",
"-BundledModulesPath",
PSES_BUNDLE_PATH,
"-LogPath",
tmpdir .. "/logs.log",
"-SessionDetailsPath",
tmpdir .. "/session.json",
"-FeatureFlags",
"@()",
"-AdditionalModules",
"@()",
"-HostName",
"My Client",
"-HostProfileId",
"myclient",
"-HostVersion",
"1.0.0",
"-LogLevel",
"Normal",
"-DebugServiceOnly",
"-DebugServicePipeName",
"${pipe}",
"-WaitForDebugger"
},
},
}
{
"name": "PowerShell: Current",
"type": "ps1",
"request": "launch",
"script": "${file}",
"cwd": "${file}"
},
For adapters like cmake which don't support stdin or TCP
Closes https://github.com/mfussenegger/nvim-dap/issues/924
For example: