Allow coercing a type in vimspector config

Initially I considered using #i, #s, etc. to coerce to specific types,
but then it wasn't clear of the semantics (particularly for bool, where
JSON bool true/false, Python bool True/False).

But it turns out that we can just coerce any key from a JSON string.
Users can _probably_ type JSON strings for most things, or use variables
to run scripts to generate them, this allows essentially complete
flexibility to define the data types needed to populate the launch spec.

The purpose of this is to allow some level of automated setup by
requesting data from the user and then (subsequently) saving the
flattneed config to the vimspector config file.
This commit is contained in:
Ben Jackson 2020-08-05 22:19:38 +01:00
commit be44a22903
2 changed files with 26 additions and 4 deletions

View file

@ -57,8 +57,10 @@
"type": "python",
"cwd": "${workspaceRoot}",
"program": "${program:${file\\}}",
"stopOnEntry": false,
"console": "integratedTerminal"
"stopOnEntry#json": "${StopOnEntry:true}",
"console": "integratedTerminal",
"args#json": "${args:[]}",
"env#json": "${env:{\\}}"
},
"breakpoints": {
"exception": {