Open MellowOrchid opened 1 month ago
Bug Summary:
tasks.json
launch.json
.vscode
hello_world.cpp
Run C/C++ File
inputs
"id": "ext"
${input:ext}
args
tasks.json:
{ "inputs": [ { "id": "ext", "type": "pickString", "description": "Choose the extension", "options": [ ".app", ".exe" ], "default": ".app" } ], "tasks": [ { "type": "cppbuild", "label": "C/C++: g++ build active file", "command": "g++", "args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${cwd}/bin/${fileBasenameNoExtension}${input:ext}" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "Generated task by Debugger." } ], "version": "2.0.0" }
launch.json: None
VS Code window: Variable 'ext' must be defined in an 'inputs' section of the debug or task configuration.
None, only C/C++ by Microsoft installed
C/C++
Microsoft
Actually, I want the tasks.json could use different extension name by judging the platform.
I want to compile C/C++ source code on Linux and Windows by using one 'tasks.json' and no need to install other extension.
Not resolved in VS Code v1.95.1 and C/C++ v1.22.11.
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
tasks.json
andlaunch.json
under.vscode
folder.hello_world.cpp
.tasks.json
by clickRun C/C++ File
. It should be able to run correctly.inputs
section that includes"id": "ext"
totasks.json
and append${input:ext}
to the last line inargs
.Debugger Configurations
tasks.json:
launch.json: None
Debugger Logs
VS Code window: Variable 'ext' must be defined in an 'inputs' section of the debug or task configuration.
Other Extensions
None, only
C/C++
byMicrosoft
installedAdditional Information
Actually, I want the
tasks.json
could use different extension name by judging the platform.I want to compile C/C++ source code on Linux and Windows by using one 'tasks.json' and no need to install other extension.