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

1.9.0 introduced bug: Could not find input with command {command} and taskId 'undefined'. #79

Closed
tmaslach opened this issue Feb 5, 2024 · 6 comments · Fixed by #80
Closed

Comments

@tmaslach
Copy link

tmaslach commented Feb 5, 2024

Hi!

First of all, thank-you for creating this product! It has been very helpful in enhancing the vscode experience.

It looks like the recent 1.9.0 release has broken our use case. I've created a simple case below that should outline the problem.

You will need to install another extension: rioj7.command-variable (Command Variable). Latest version (1.61.1) works fine.

  1. Create a new folder with the following tasks.json file placed in .vscode folder: tasks.json
  2. Open that folder in vscode.
  3. Go to command palette, Run Task -> Test Shell Command -> Select Target. Hit enter on Select Target
  4. A error box will pop up in vscode stating the following: Could not find input with command 'echo 'ItWorked'' and taskId 'undefined'.

It does work fine with 1.8.2, but not with 1.9.0.

I have not dug into the changes in the past 11 months. The fact that the taskid is undefined does seem wrong. Any ideas?

Thank-you!

@tmaslach
Copy link
Author

tmaslach commented Feb 6, 2024

Per the error message, it does look like it is throwing from shell command extension. But, if I factor out the command variable extension, it works fine. Maybe there is some interplay going on here between the two extensions?

@MarcelRobitaille
Copy link
Collaborator

I'm able to reproduce this. The bad commit is e564d56

MarcelRobitaille added a commit that referenced this issue Feb 6, 2024
@MarcelRobitaille
Copy link
Collaborator

Please check if this branch works for you: https://github.com/augustocdias/vscode-shell-command/tree/feature/nested_input

@tmaslach
Copy link
Author

tmaslach commented Feb 6, 2024

Perfect! It works!

Thank-you!

@tmaslach
Copy link
Author

tmaslach commented Feb 8, 2024

Hi - is there any chance of release a new update with the version soon? Thanks again..

@MarcelRobitaille
Copy link
Collaborator

Here is the tasks.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Test Shell Command",
            "detail": "Test of Shell Command",
            "type": "shell",
            "command": "echo ${input:testShellCommand}",
            "presentation": {
                "clear": true,
                "echo": true,
                "focus": true,
                "panel": "shared"
            },
            "group": "build",
        },
    ],
    "inputs" : [
        {
            // Prompts the user to select a target and stores the target name in the remember store as 'selectedBazelTarget'
            "id": "testShellCommand",
            "type": "command",
            "command": "extension.commandvariable.pickStringRemember",
            "args": {
                "description": "Choose a target",
                "key": "selectedBazelTarget",
                "rememberTransformed": true,
                "options": [
                    { "label": "Select Target", "value": "${command:bazelTargets}", "description": "NOTE: It may take some time for the selection list to be displayed" }
                ],
                "command": {
                    "bazelTargets": {
                        "command": "shellCommand.execute",
                        "args": {
                            "command": "echo 'ItWorked'",
                            "cwd": "${workspaceFolder}"
                        }
                    }
               }
            }
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants