mirror of
https://github.com/mfussenegger/nvim-dap
synced 2024-09-08 02:25:46 +02:00
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:
parent
eebde2c241
commit
fc1f7950c5
1 changed files with 32 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue