Conversation
|
|
||
| import * as vscode from 'vscode'; | ||
|
|
||
| interface RTaskDefinition extends vscode.TaskDefinition { |
There was a problem hiding this comment.
More for my own knowledge sorry but what is vscode.TaskDefinition. I can't seem to find any details about what this interface actually is in the api documentation :(
There was a problem hiding this comment.
Just my personal opinion/experience: Last time I tried (~1 year ago), the task api was quite confusing to work with and not really flexible. I tried implementing the typical build/test tasks with the possibility to supply optional arguments to e.g. devtools::install(), but this was not supported by the task API. Instead, the extension had to explicitly register all possible combinations of arguments, which is not feasible. Apparently, the idea is to scan a list of tasks specified elsewhere, e.g. package.json, and parse them.
There was a problem hiding this comment.
TaskDefinition is basically the schema of tasks user could specify in tasks.json for that particular task type, in our case, R.
Previously, our resolveTask does not really resolve the task.
|
Currently, there is a problem that #964 uses will result in an invalid task definition: {
"type": "R",
"command": "Rscript",
"args": [
"-e",
{
"value": "devtools::install()",
"quoting": 2
}
],
"problemMatcher": [],
"label": "R: Install"
}I'm wondering if it is necessary to use |
|
I tested using {
"version": "2.0.0",
"tasks": [
{
"type": "R",
"command": "Rscript",
"args": [
"-e",
"readLines('${file}')",
],
"cwd": "${workspaceRoot}",
"env": {
"ZZZ_TEST": "test1"
},
"problemMatcher": [],
"label": "R: print file"
}
]
} |
|
However, in Windows, the file paths are supplied as is. Maybe we could use some form of notation in |
add in groups
|
Thanks @gowerc for the nice work done in renkun-ken#3. |
|
Windows user could use raw string (requires R 4.0+) in task code to make use of the path variables: {
"version": "2.0.0",
"tasks": [
{
"type": "R",
"code": [
"readLines(r'{${file}}')"
],
"group": "build",
"problemMatcher": [],
"label": "R test"
}
]
} |
|
I was wondering if we should document the use of tasks in the readme? Personally I never found the current way vscode exposes them to users to be that intuitive so was thinking we might get more adoption if we had some more docs on it? |
|
Makes sense to me, will try and add something |

What problem did you solve?
Closes #991