Ensure ${input:} placeholders with unknown types are left untouched

To allow plugins to process them using a `dap.listeners.on_config` hook
This commit is contained in:
Mathias Fussenegger 2024-06-01 12:39:10 +02:00 committed by Mathias Fußenegger
parent eebde2c241
commit fc1f7950c5

View file

@ -364,4 +364,36 @@ describe('dap.ext.vscode', function()
assert.are.same("Your input: ", prompt)
assert.are.same("", default)
end)
it('keeps unsupported input types as is', function()
local jsonstr = [[
{
"configurations": [
{
"type": "dummy",
"request": "launch",
"name": "Dummy",
"program": "${input:myCommand}"
}
],
"inputs": [
{
"id": "myCommand",
"type": "command",
"command": "shellCommand.execute"
}
]
}
]]
local configs = vscode._load_json(jsonstr)
local ok = false
local result
coroutine.wrap(function()
local conf = configs[1]()
result = conf.program
ok = true
end)()
vim.wait(1000, function() return ok end)
assert.are.same("${input:myCommand}", result)
end)
end)