Hi,
I try to start my first crystal project with VSCode running on a WindowsSubsystem for Linux (WSL2) with Ubuntu 20.04.
I created a simple taskfile like this: tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "crystal",
"command": "run",
"file": "src/main.cr",
"problemMatcher": [],
"label": "Crystal: run - src/main",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Problem A:
When I run this task [Terminal]>[Run Task…] the code works fine, but the comes the following task error in the output window:
The task provider for “crystal” tasks unexpectedly provided a task of type “shards”.
How can I solve this?
Problem B:
I also created a launch.json:
"configurations": [
{
"preLaunchTask": "Crystal: run - src/main.cr",
"type": "lldb",
"request": "launch",
"name": "Launch",
"program": "${workspaceFolder}/main",
"args": [],
"cwd": "${workspaceFolder}"
}
]
With a click on [Run]>[Run without debugging] there comes up this one:
“unable to find executable for ‘home/udach/projects/rftsim/main/main’”
And in fact, there is no file. I manually buildt the file and moved it to the expected loction and it works fine.
How can I modify the task (from Problem A) to build the file?
Whenever I add something like
“args”: ["-o main"]
or even
“args”: []
a new error comes up:
"There is no task provider registered for tasks of type “crystal”.
Any ideas?
Thanks
Bob