Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use input variable in task command property #103018

Closed
alphagocc opened this issue Jul 21, 2020 · 2 comments
Closed

Cannot use input variable in task command property #103018

alphagocc opened this issue Jul 21, 2020 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues verified Verification succeeded
Milestone

Comments

@alphagocc
Copy link

Version: 1.47.2 (system setup)
Commit: 17299e4
Date: 2020-07-15T18:22:06.216Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19042

Does this issue occur when all extensions are disabled?: Yes

There's my part of my tasks.json

{
    "tasks": [
        {
            "label": "C++ Build",
            "type": "process",
            "windows": {
                "command": "${input:CppCompiler}",
                "args": [
                    "${relativeFile}",
                    "${input:CppStandard}",
                    "-o",
                    "${fileDirname}/${fileBasenameNoExtension}.exe"
                ]
            }
        }
    ],
    "inputs": [
        {
            "id": "CppStandard",
            "type": "pickString",
            "options": [
                "-std=c++17",
                "-std=c++03",
                "-std=c++11",
                "-std=c++14"
            ],
            "default": "-std=c++17",
            "description": "Which Cpp Standard do you want to use?"
        },
        {
            "id": "CppCompiler",
            "type": "pickString",
            "options": [
                "g++",
                "clang++"
            ],
            "default": "g++",
            "description": "Which Cpp Compiler do you want to use?"
        }
    ]
}

The variable "CppStandard" works well in args
but the variable "CppStandard" doesn't work in command
when i excute the task
it tells me:

Executing task: C:\Users\*\Documents\Programming\Coding\${input:CppCompiler} Archive\2020\07\20200717\Payment.cpp -std=c++17  -o c:\Users\*\Documents\Programming\Coding\Archive\2020\07\20200717/Payment.exec

Then the task failed

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tasks Task system issues labels Jul 21, 2020
@alexr00 alexr00 added this to the July 2020 milestone Jul 21, 2020
@alexr00
Copy link
Member

alexr00 commented Jul 21, 2020

Thanks for reporting the bug and for providing an easy way to repro! You should be able to work around it by changing your task to be a shell task instead of a process task.

@alphagocc
Copy link
Author

OK Thanks

@connor4312 connor4312 added the verified Verification succeeded label Aug 6, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants
@connor4312 @alphagocc @alexr00 and others