Skip to content

"preLaunchTask" in launch.json and "label" in task.json are different while generating them by default #5561

@timeneverdie

Description

@timeneverdie

The default generated launch.json and task.json files are below:

I don't know why there are some Chinese words. My VSCode is in English and doesn't install the language package. I think it's an another bug.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "gcc.exe - 生成和调试活动文件",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\ProgramData\\chocolatey\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "gcc.exe build active file"
        }
    ]
}
{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "shell",
			"label": "shell: gcc.exe build active file",
			"command": "C:\\ProgramData\\chocolatey\\bin\\gcc.exe",
			"args": [
				"-g",
				"${file}",
				"-o",
				"${fileDirname}\\${fileBasenameNoExtension}.exe"
			],
			"options": {
				"cwd": "C:\\ProgramData\\chocolatey\\bin"
			},
			"problemMatcher": [
				"$gcc"
			],
			"group": "build"
		}
	]
}

Notice the different:

"preLaunchTask": "gcc.exe build active file"    //from the launch.json
"label": "shell: gcc.exe build active file"    //from the task.json

They are not the same. It will cause an error when press F5 on the keyboard.

image

If correct them as the same, the bug gone.

"preLaunchTask": "gcc.exe build active file"    //from the launch.json
"label": "gcc.exe build active file"           //from the task.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicefixedCheck the Milestone for the release in which the fix is or will be available.quick fixtasks/build/debugAn issue relating to tasks.json (e.g. build issues)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions