Set Workspace folder

column
Posts: 3
Joined: Mon May 08, 2023 8:57 am

Set Workspace folder

Postby column » Tue May 21, 2024 9:25 am

0

I have created ESP project from sample template with ESP-IDF extension in Visual Studio code. As result I have project folder that contains besides source code and other configuration files folder .devcontainer with devcontainer.json and Dockerfile files. I suppose I need to create container and run project inside of it. I do View->Command Palette->Reopen in Container

I got error message:

Code: Select all

Visual Studio Code
Workspace folder in devcontainer.json must be an absolute path.
[Open devcontainer.json] [Cancel]
What is wrong with my project configuration? How to solve this problem?
Whole devcontainer.json

Code: Select all

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/ubuntu
{
    "name": "ESP-IDF QEMU",
    "build": {
        "dockerfile": "Dockerfile"
    },
    // Add the IDs of extensions you want installed when the container is created
    "workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
    /* the path of workspace folder to be opened after container is running
     */
    "workspaceFolder": "${localWorkspaceFolder}",
    "mounts": [
        "source=extensionCache,target=/root/.vscode-server/extensions,type=volume"
    ],
    "customizations": {
        "vscode": {
            "settings": {
                "terminal.integrated.defaultProfile.linux": "bash",
                "idf.espIdfPath": "/opt/esp/idf",
                "idf.customExtraPaths": "",
                "idf.pythonBinPath": "/opt/esp/python_env/idf5.3_py3.10_env/bin/python",
                "idf.toolsPath": "/opt/esp",
                "idf.gitPath": "/usr/bin/git"
            },
            "extensions": [
                "espressif.esp-idf-extension"
            ],
        },
        "codespaces": {
            "settings": {
                "terminal.integrated.defaultProfile.linux": "bash",
                "idf.espIdfPath": "/opt/esp/idf",
                "idf.customExtraPaths": "",
                "idf.pythonBinPath": "/opt/esp/python_env/idf5.3_py3.10_env/bin/python",
                "idf.toolsPath": "/opt/esp",
                "idf.gitPath": "/usr/bin/git"
            },
            "extensions": [
                "espressif.esp-idf-extension"
            ],
        }
    },
    "runArgs": ["--privileged"]
}

edwin.sun
Posts: 1
Joined: Thu Jun 20, 2024 7:58 pm

Re: Set Workspace folder

Postby edwin.sun » Thu Jun 20, 2024 8:11 pm

As mentioned in the error:
Workspace folder in devcontainer.json must be an absolute path

You need to fill in this field
"workspaceFolder": "${localWorkspaceFolder}"

specifically: "${localWorkspaceFolder}" with the path to the workspace.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Majestic-12 [Bot] and 86 guests