You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"launch" configuration fails on multi-root workspace, when defined in .code-workspace file. #58818
bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesverifiedVerification succeeded
There seems to be a problem when defining the launch configurations inside the .code-worksapce file, when using a multi-root workspace. The exact same configuration in the launch.json file works correctly, but I would like to move it to the .code-workspace file to get rid of the launch.json file, and have everything on a single file.
VSCode Version: 1.27.2
OS Version: Ubuntu 16.04.5 LTS
Steps to Reproduce:
Create a multi-root workspace.
Create a launch configuration in the .code-workspace file under "launch".
Set the values of "cwd" or "program" of a launch configuration to be relative to one of the workspace folders: for instance "cwd": "${workspaceFolder:src1}/folder1/folder2".
When trying to launch this configuration, an error appears on the bottom right, that says: "Cannot read property 'name' of undefined". (It would also be nice if this error could give me more info, such as line number)
5: If I have the exact same configuration with the exact same "cwd" and "program" values in my launch.json file, this error doesn't happen: the configuration is launched correctly.
Does this issue occur when all extensions are disabled?: Doesn't work, as it needs cppdbg
Can you please paster the minimal launch.json for which you can reproduce this.
And I guess moving that launch.json to the code-workspace would reproduce the problem?
It is a simple C Hello world project with one include file. In tasks.json, I create an executable with GCC. And in launch.json I have a configuration to run the executable, which works fine. This configuration also references the gcc command in tasks.json as a prelaunch task. All of this is shown in the "master" branch.
Now, I created another branch, named "force_launch_fail", where I am commenting out the content of launch.json, and moving it to my .code-workspace file, under the key "launch". If you try to launch this configuration with F5, you will get the error I mentioned: "Cannot read property 'name' of undefined".
It would also be very nice if I could get at least a line number for this error.
Daniel Sanz Ausin (@dsanz006) the issue here is that you are referencing a task from a folder from a workspace launch. We currently do not support that, and in order to have something like that #36966 would be needed
To avoid the confusion I have improved the error message
bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesverifiedVerification succeeded
Activity
dsanz006 commentedon Sep 17, 2018
I have tried defining my workspace folders both as absolute path or relative to the .code-workspace file, and the error happens in both cases.
isidorn commentedon Sep 17, 2018
Can you please paster the minimal launch.json for which you can reproduce this.
And I guess moving that launch.json to the code-workspace would reproduce the problem?
dsanz006 commentedon Sep 18, 2018
Ok so to make things easy I just created a github repository where I show how this fails. It is @ https://github.com/dsanz006/launch_test.
It is a simple C Hello world project with one include file. In tasks.json, I create an executable with GCC. And in launch.json I have a configuration to run the executable, which works fine. This configuration also references the gcc command in tasks.json as a prelaunch task. All of this is shown in the "master" branch.
Now, I created another branch, named "force_launch_fail", where I am commenting out the content of launch.json, and moving it to my .code-workspace file, under the key "launch". If you try to launch this configuration with F5, you will get the error I mentioned: "Cannot read property 'name' of undefined".
It would also be very nice if I could get at least a line number for this error.
isidorn commentedon Sep 26, 2018
Daniel Sanz Ausin (@dsanz006) the issue here is that you are referencing a task from a folder from a workspace launch. We currently do not support that, and in order to have something like that #36966 would be needed
To avoid the confusion I have improved the error message
dsanz006 commentedon Sep 26, 2018
I understand, thank you Isidor Nikolic (@isidorn).