Skip to content

Commit fc1f795

Browse files
committed
Ensure ${input:} placeholders with unknown types are left untouched
To allow plugins to process them using a `dap.listeners.on_config` hook
1 parent eebde2c commit fc1f795

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

spec/ext_vscode_spec.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,36 @@ describe('dap.ext.vscode', function()
364364
assert.are.same("Your input: ", prompt)
365365
assert.are.same("", default)
366366
end)
367+
368+
it('keeps unsupported input types as is', function()
369+
local jsonstr = [[
370+
{
371+
"configurations": [
372+
{
373+
"type": "dummy",
374+
"request": "launch",
375+
"name": "Dummy",
376+
"program": "${input:myCommand}"
377+
}
378+
],
379+
"inputs": [
380+
{
381+
"id": "myCommand",
382+
"type": "command",
383+
"command": "shellCommand.execute"
384+
}
385+
]
386+
}
387+
]]
388+
local configs = vscode._load_json(jsonstr)
389+
local ok = false
390+
local result
391+
coroutine.wrap(function()
392+
local conf = configs[1]()
393+
result = conf.program
394+
ok = true
395+
end)()
396+
vim.wait(1000, function() return ok end)
397+
assert.are.same("${input:myCommand}", result)
398+
end)
367399
end)

0 commit comments

Comments
 (0)