Skip to content

Commit

Permalink
Ensure ${input:} placeholders with unknown types are left untouched
Browse files Browse the repository at this point in the history
To allow plugins to process them using a `dap.listeners.on_config` hook
  • Loading branch information
mfussenegger committed Jun 1, 2024
1 parent eebde2c commit fc1f795
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/ext_vscode_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit fc1f795

Please sign in to comment.