How to get 'project tasks' in new workspace

I’m using pio with Arduino projects on Linux with Visualcode as editor.

I want to work on some exiting code from Github as a new projetct. I download the code into a directory , the I open this directory with ‘open folder’. I can browse the files just fine, but I don’t have the Build/Upload etc. items to actually work on the files. How do I get those back ?

Like usual, after describing my problem I tried some more things. I found that if I copy the platformio.ini file from anothe project then my platformion stuff is back.

Yes, platformio.ini is required file for PlatformIO-based project.

I had the same problem, and adding / editing / comparing platformio.ini didn’t work for me.
I finally found that for projects that worked; there either was or wasn’t a tasks.json in the .vscode subfolder. In my “broken” project, there was a tasks.json, but it had references to some weird arm stuff. When I replaced it with the contents of the “good” file and restarted vscode, the task list came to life. Here are the contents of the “good” tasks.json:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "PlatformIO",
            "task": "Monitor",
            "problemMatcher": [
                "$platformio"
            ]
        }
    ]
}
1 Like

This work for me (thanks deluciap)

procedure to add a tasks.json:

  1. The menu item Terminal > Run Task... opens up a list of VSCode tasks for PlatformIO. In the line PlatformIO: Build , press the gear icon on the far right side of the list. This creates or opens the file .vscode/tasks.json with some template code.
  2. Replace the template in tasks.json with this code