the prompt won't show anything. I think this is because the default value of getProperty(pattern, 'json') here is undefined, and that gets passed around through dataStructSubstitution and convertString until it eventually gets to running this in convertString:
"lmnop".replace(new RegExp("^(.+)$", undefined) // which returns string "undefined"
the condition is true, and so we try to JSON.parse("undefined") and get a parse error. I think maybe you'll want to catch JSON SyntaxErrors in some way or handle it gracefully? I'll leave that up to you.
Seems like this was a regression introduced in 2146b74e83267657ed56889ff8d0adf12f55f4a7
To replicate this bug:
Given
services.txt
in my launch.json
the prompt won't show anything. I think this is because the default value of
getProperty(pattern, 'json')
here isundefined
, and that gets passed around throughdataStructSubstitution
andconvertString
until it eventually gets to running this in convertString:classic javascript. And on line
963 -965
the condition is
true
, and so we try toJSON.parse("undefined")
and get a parse error. I think maybe you'll want to catch JSON SyntaxErrors in some way or handle it gracefully? I'll leave that up to you.Trying the same config with
works as expected.