Current Working Directory on vscode extensionHost launch

Viewed 144

I did some theme development in the past and wanted to update it. Unfortunately, I didn't save my previous launch.json and it's missing functionality to open files on f5.

Only option I find is cwd, but it isn't working.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Extension",
            "type": "extensionHost",
            "request": "launch",
            "runtimeExecutabl5e": "${execPath}",
            "args": [
                "--extensionDevelopmentPath=${workspaceFolder}"
            ], 
        },
    ]
}

I am sure, I did use to open files inside vscode opened by launch task while developing a new theme. That's how I did testing for syntax highlighting (by opening different files on launch inside of the vscode with developed extension )...

What's changed and how to make it work again?

1 Answers

So... to open file or folder in vscode you need to provide it as last argument for args. In my case, launch.json will looks like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Extension",
            "type": "extensionHost",
            "request": "launch",
            "args": [
                "--extensionDevelopmentPath=${workspaceFolder}",
                "--disable-extensions",
                "${workspaceFolder}/examples"
            ], 
        },
    ]
}
Related