Another thing: I don’t know how the tasks from
"tasks/context.json" are supposed to work. They don’t appear under
"Run Task" (Ctrl-F12).
I made my own tasks.json (doesn’t work in ~/.vscode-oss or
~/.vscode, but only in <project>/.vscode), that works to
call context or mtxrun, but it won’t ever open an external PDF
viewer. I found a workaround via command substitution (backticks):
{
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "ConTeXt",
"type": "shell",
"command": "context --autopdf=auto '${file}' && `xdg-open '${fileBasenameNoExtension}.pdf'`",
"args": [],
"options": {
"cwd": "${fileDirname}"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "check file",
"type": "shell",
"command": "mtxrun --script check '${file}'",
"args": [],
"options": {
"cwd": "${fileDirname}"
},
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "open PDF in external viewer",
"type": "shell",
"command": "`xdg-open '${fileBasenameNoExtension}.pdf'`",
"args": [],
"options": {
"cwd": "${fileDirname}"
},
}
]
}